Fix tarea type conversion
This commit is contained in:
+4
-4
@@ -255,10 +255,10 @@ class Lattice:
|
|||||||
areas = []
|
areas = []
|
||||||
for area in self.table_area:
|
for area in self.table_area:
|
||||||
x1, y1, x2, y2 = area.split(",")
|
x1, y1, x2, y2 = area.split(",")
|
||||||
x1 = int(x1)
|
x1 = float(x1)
|
||||||
y1 = int(y1)
|
y1 = float(y1)
|
||||||
x2 = int(x2)
|
x2 = float(x2)
|
||||||
y2 = int(y2)
|
y2 = float(y2)
|
||||||
x1, y1, x2, y2 = scale_to_image((x1, y1, x2, y2), factors_image)
|
x1, y1, x2, y2 = scale_to_image((x1, y1, x2, y2), factors_image)
|
||||||
areas.append((x1, y1, abs(x2 - x1), abs(y2 - y1)))
|
areas.append((x1, y1, abs(x2 - x1), abs(y2 - y1)))
|
||||||
table_bbox = find_table_joints(areas, vmask, hmask)
|
table_bbox = find_table_joints(areas, vmask, hmask)
|
||||||
|
|||||||
+4
-4
@@ -319,10 +319,10 @@ class Stream:
|
|||||||
table_bbox = {}
|
table_bbox = {}
|
||||||
for area in self.table_area:
|
for area in self.table_area:
|
||||||
x1, y1, x2, y2 = area.split(",")
|
x1, y1, x2, y2 = area.split(",")
|
||||||
x1 = int(x1)
|
x1 = float(x1)
|
||||||
y1 = int(y1)
|
y1 = float(y1)
|
||||||
x2 = int(x2)
|
x2 = float(x2)
|
||||||
y2 = int(y2)
|
y2 = float(y2)
|
||||||
table_bbox[(x1, y2, x2, y1)] = None
|
table_bbox[(x1, y2, x2, y1)] = None
|
||||||
else:
|
else:
|
||||||
table_bbox = {(0, 0, width, height): None}
|
table_bbox = {(0, 0, width, height): None}
|
||||||
|
|||||||
Reference in New Issue
Block a user