|
@@ -74,6 +74,8 @@ def get_table_by_rule(img, text_list, bbox_list, table_location, show=0):
|
|
# 根据bbox_list,计算与table_location左上角坐标距离,锁定第一个bbox
|
|
# 根据bbox_list,计算与table_location左上角坐标距离,锁定第一个bbox
|
|
table_left_up_point = [table_location[0], table_location[1]]
|
|
table_left_up_point = [table_location[0], table_location[1]]
|
|
min_distance = 100000000000
|
|
min_distance = 100000000000
|
|
|
|
+ if not bbox_list:
|
|
|
|
+ return [], [], [], {}
|
|
first_bbox = bbox_list[0]
|
|
first_bbox = bbox_list[0]
|
|
for bbox in bbox_list:
|
|
for bbox in bbox_list:
|
|
distance = abs(bbox[0][0] - table_left_up_point[0]) + abs(bbox[0][1] - table_left_up_point[1])
|
|
distance = abs(bbox[0][0] - table_left_up_point[0]) + abs(bbox[0][1] - table_left_up_point[1])
|