Replies: 1 comment 1 reply
-
根据你的描述,表格识别的文字内容是正确的,但位置错位,导致两行合并成一行。这种情况可能是由以下几个因素导致的: 可能的原因
解决方案1. 调整表格检测模型
2. 进一步优化图片
3. 使用 PP-OCRv3 重新检测
4. 训练自定义数据如果问题仍未解决,可以考虑:
总结
如果你能提供具体的代码和更多测试案例,可能会更容易找到具体原因并优化解决方案。 Response generated by feifei-bot | chatgpt-4o-latest |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
图片转表格识别文字准确但是位置错位两行合并成一行,试过各种质量的图片都会出现以上问题
paddle版本如下:
paddleclas 2.6.0
paddleocr 2.9.1
paddlepaddle 2.6.2
代码如下
`import os
import cv2
from paddleocr import PPStructure,draw_structure_result,save_structure_res
table_engine = PPStructure(
show_log=True, # 关闭日志输出
lang='ch', # 设置语言为中文
table=True, # 启用表格识别
ocr=True, # 启用文字识别
layout=True, # 启用版面分析
recovery=True, # 启用版面恢复, # 不启用版面恢复(如果不需要)
structure_version='PP-StructureV2', # 表格结构化模型版本
)
input_path = r"photo/test.png"
output_folder = r"output"
if not os.path.exists(output_folder):
os.makedirs(output_folder)
img = cv2.imread(input_path)
result = table_engine(img)
save_structure_res(result, output_folder, os.path.basename(input_path).split('.')[0])
from PIL import Image
font_path = '../doc/fonts/simfang.ttf' # PaddleOCR下提供字体包
image = Image.open(input_path).convert('RGB')
im_show = draw_structure_result(image, result, font_path=font_path)
im_show = Image.fromarray(im_show)
im_show.save(os.path.join(output_folder, 'result.jpg'))`
Beta Was this translation helpful? Give feedback.
All reactions