change logic and to or to discard area

pull/284/head
Duc Tuyen Ta 2022-02-23 13:52:33 +01:00
parent ad4ffec629
commit bbff5d8130
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_area(ba)>0) and ((bbox_intersection_area(ba, bb) / bbox_area(ba)) > 0.8):
if (bbox_area(ba)==0) or ((bbox_intersection_area(ba, bb) / bbox_area(ba)) > 0.8):
if bbox_longer(bb, ba):
rest.discard(ba)
unique_boxes = list(rest)