pycognaize.common.utils.compute_intersection_area

compute_intersection_area(word, left, right, top, bottom)[source]

Given the word and coordinates of the area, computes area of intersection :type word: dict :param word: dictionary, containing coordinates,

ocr_text and word_id_number of the word

Parameters:
  • left ([<class ‘int’>, <class ‘float’>]) – left coordinate

  • right ([<class ‘int’>, <class ‘float’>]) – right coordinate

  • top ([<class ‘int’>, <class ‘float’>]) – top coordinate

  • bottom ([<class ‘int’>, <class ‘float’>]) – bottom coordinate

  • word (dict)

Return type:

[<class ‘int’>, <class ‘float’>]

Returns:

area of intersection