change logic and to or to discard area
parent
ad4ffec629
commit
bbff5d8130
|
|
@ -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_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):
|
if bbox_longer(bb, ba):
|
||||||
rest.discard(ba)
|
rest.discard(ba)
|
||||||
unique_boxes = list(rest)
|
unique_boxes = list(rest)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue