|
@@ -960,7 +960,7 @@ class LineTable():
|
|
|
for table_line in _table:
|
|
|
for _cell in table_line:
|
|
|
if self.inbox(textbox.bbox,_cell["bbox"]):
|
|
|
- _cell["text"]+= _text
|
|
|
+ _cell["text"] += _text
|
|
|
in_objs.add(textbox)
|
|
|
_find = True
|
|
|
break
|
|
@@ -1012,8 +1012,12 @@ class LineTable():
|
|
|
def getIOU(self, bbox0, bbox1):
|
|
|
width = max(bbox0[2],bbox1[2])-min(bbox0[0],bbox1[0])-(bbox0[2]-bbox0[0]+bbox1[2]-bbox1[0])
|
|
|
height = max(bbox0[3],bbox1[3])-min(bbox0[1],bbox1[1])-(bbox0[3]-bbox0[1]+bbox1[3]-bbox1[1])
|
|
|
- if width<0 and height<0:
|
|
|
- return abs(width*height/min(abs((bbox0[2]-bbox0[0])*(bbox0[3]-bbox0[1])),abs((bbox1[2]-bbox1[0])*(bbox1[3]-bbox1[1]))))
|
|
|
+ print("getIOU", width, height)
|
|
|
+ if width < 0 and height < 0:
|
|
|
+ iou = abs(width*height/min(abs((bbox0[2]-bbox0[0])*(bbox0[3]-bbox0[1])),
|
|
|
+ abs((bbox1[2]-bbox1[0])*(bbox1[3]-bbox1[1]))))
|
|
|
+ print("getIOU", iou)
|
|
|
+ return iou
|
|
|
return 0
|
|
|
|
|
|
def getspan(self, _list, x0, x1, margin):
|
|
@@ -1037,7 +1041,7 @@ class LineTable():
|
|
|
# plt.scatter(point.get("point")[0],point.get("point")[1])
|
|
|
for textbox in list_textbox:
|
|
|
x0, y0, x1, y1 = textbox.bbox
|
|
|
- plt.Rectangle(([x0, x1], [y0, y1]))
|
|
|
+ plt.plot([x0, x1], [y0, y1])
|
|
|
plt.show()
|
|
|
|
|
|
|