fix float division by zero

pull/284/head
Duc Tuyen Ta 2022-02-23 11:20:17 +01:00
parent 644bbe7c6d
commit ad4ffec629
1 changed files with 1 additions and 1 deletions

View File

@ -373,7 +373,7 @@ def text_in_bbox(bbox, text):
continue
if bbox_intersect(ba, bb):
# if the intersection is larger than 80% of ba's size, we keep the longest
if (bbox_intersection_area(ba, bb) / bbox_area(ba)) > 0.8:
if (bbox_area(ba)>0) and ((bbox_intersection_area(ba, bb) / bbox_area(ba)) > 0.8):
if bbox_longer(bb, ba):
rest.discard(ba)
unique_boxes = list(rest)