Commit 1d59509d authored by liukaiwen's avatar liukaiwen

Merge branch 'master' of github.com:myhloli/Magic-PDF

parents 047a8df2 9cc53a5e
...@@ -210,10 +210,11 @@ def get_minbox_if_overlap_by_ratio(bbox1, bbox2, ratio): ...@@ -210,10 +210,11 @@ def get_minbox_if_overlap_by_ratio(bbox1, bbox2, ratio):
area1 = (x1_max - x1_min) * (y1_max - y1_min) area1 = (x1_max - x1_min) * (y1_max - y1_min)
area2 = (x2_max - x2_min) * (y2_max - y2_min) area2 = (x2_max - x2_min) * (y2_max - y2_min)
overlap_ratio = calculate_overlap_area_2_minbox_area_ratio(bbox1, bbox2) overlap_ratio = calculate_overlap_area_2_minbox_area_ratio(bbox1, bbox2)
if overlap_ratio > ratio and area1 < area2: if overlap_ratio > ratio:
return bbox1 if area1 <= area2:
elif overlap_ratio > ratio and area2 < area1: return bbox1
return bbox2 else:
return bbox2
else: else:
return None return None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment