pull/284/merge
TA Duc-Tuyen 2022-02-23 12:52:51 +00:00 committed by GitHub
commit 3041138acf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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