be642f44 by 周伟奇

fix dealername2

1 parent 3d68c2f1
...@@ -105,15 +105,20 @@ class Retriever: ...@@ -105,15 +105,20 @@ class Retriever:
105 y_min_find = None 105 y_min_find = None
106 value = None 106 value = None
107 coordinates = None 107 coordinates = None
108 for (x0, y0, _, _, x1, y1, _, _), text in go_res.values(): 108 for (x0, y0, x1, y1, x2, y2, x3, y3), text in go_res.values():
109 cent_x = x0 + ((x1 - x0)/2) 109 new_x0 = min(x0, x1, x2, x3)
110 cent_y = y0 + ((y1 - y0)/2) 110 new_y0 = min(y0, y1, y2, y3)
111 new_x1 = max(x0, x1, x2, x3)
112 new_y1 = max(y0, y1, y2, y3)
113
114 cent_x = new_x0 + ((new_x1 - new_x0)/2)
115 cent_y = new_y0 + ((new_y1 - new_y0)/2)
111 if x_min < cent_x < x_max and y_min < cent_y < y_max: 116 if x_min < cent_x < x_max and y_min < cent_y < y_max:
112 if y_min_find is None or y0 < y_min_find: 117 if y_min_find is None or new_y0 < y_min_find:
113 if len(text.strip()) > 0: 118 if len(text.strip()) > 0:
114 y_min_find = y0 119 y_min_find = new_y0
115 value = text 120 value = text
116 coordinates = (x0, y0, x1, y1) 121 coordinates = (new_x0, new_y0, new_x1, new_y1)
117 return value, coordinates 122 return value, coordinates
118 123
119 @staticmethod 124 @staticmethod
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!