be642f44 by 周伟奇

fix dealername2

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