|
@@ -18,6 +18,7 @@ from sx_utils.sx_log import *
|
|
import paddleclas
|
|
import paddleclas
|
|
|
|
|
|
from cores.post_hander import *
|
|
from cores.post_hander import *
|
|
|
|
+from cores.check_table import *
|
|
|
|
|
|
|
|
|
|
format_print()
|
|
format_print()
|
|
@@ -147,13 +148,12 @@ def get_zero_degree_image(img):
|
|
|
|
|
|
def table_res(im, ROTATE=-1):
|
|
def table_res(im, ROTATE=-1):
|
|
im = im.copy()
|
|
im = im.copy()
|
|
- cv2.imwrite('before-rotate.jpg', im)
|
|
|
|
|
|
+ # cv2.imwrite('before-rotate.jpg', im)
|
|
# 获取正向图片
|
|
# 获取正向图片
|
|
img = get_zero_degree_image(im)
|
|
img = get_zero_degree_image(im)
|
|
- cv2.imwrite('after-rotate.jpg', img)
|
|
|
|
|
|
+ # cv2.imwrite('after-rotate.jpg', img)
|
|
try:
|
|
try:
|
|
table_engine_lock.acquire()
|
|
table_engine_lock.acquire()
|
|
- # cv2.imwrite('3.jpg', img)
|
|
|
|
res = table_engine(img)
|
|
res = table_engine(img)
|
|
finally:
|
|
finally:
|
|
table_engine_lock.release()
|
|
table_engine_lock.release()
|
|
@@ -175,6 +175,13 @@ def ping():
|
|
def table(image: TableInfo):
|
|
def table(image: TableInfo):
|
|
img = base64_to_np(image.image)
|
|
img = base64_to_np(image.image)
|
|
res, html = table_res(img)
|
|
res, html = table_res(img)
|
|
|
|
+ # print(html)
|
|
|
|
+ table=Table(html,img)
|
|
|
|
+ if table.check_html():
|
|
|
|
+ res, html = table_res(table.img)
|
|
|
|
+ cv2.imwrite('table.jpg', table.img)
|
|
|
|
+ # print(table.total)
|
|
|
|
+ # print(table.empty)
|
|
|
|
|
|
if html:
|
|
if html:
|
|
post_hander = PostHandler(html)
|
|
post_hander = PostHandler(html)
|