识别结果保存到对应目录下
This commit is contained in:
14
core/ocr.py
14
core/ocr.py
@ -167,7 +167,19 @@ def detect(frame):
|
||||
items_to_process = [line]
|
||||
|
||||
for item in items_to_process:
|
||||
# 跳过纯数字列表(可能是坐标信息)
|
||||
# 精确识别并忽略图片坐标位置信息 [[x1,y1], [x2,y2], [x3,y3], [x4,y4]]
|
||||
if isinstance(item, list) and len(item) == 4: # 四边形有4个顶点
|
||||
is_coordinate = True
|
||||
for point in item:
|
||||
# 每个顶点应该是包含2个数字的列表
|
||||
if not (isinstance(point, list) and len(point) == 2 and
|
||||
all(isinstance(coord, (int, float)) for coord in point)):
|
||||
is_coordinate = False
|
||||
break
|
||||
if is_coordinate:
|
||||
continue # 是坐标信息,直接忽略
|
||||
|
||||
# 跳过纯数字列表(其他可能的坐标形式)
|
||||
if isinstance(item, list) and all(isinstance(x, (int, float)) for x in item):
|
||||
continue
|
||||
|
||||
|
Reference in New Issue
Block a user