首页 > 解决方案 > 改进表格中的 Pytesseract 结果(表格 OCR)

问题描述

我目前正在处理这个韩国数据集,并且在正确获取值方面遇到了一些问题。一些问题是图片有点不稳定,语言是韩国,还有垂直桌子的存在。

我正在使用的表的图像

我把它剪成了灰度,所以我总是可以把它剪掉。

目前的问题是性能不是很好。默认设置让我很混乱。虽然我发现 psm 4 是最好的,但它看起来仍然不是很好,似乎 tesseract 刚刚突破了一半。

电流输出图像

我想知道是否有人对如何改进 ocr 有任何建议。我正在考虑使用 table-ocr 之类的东西来拆分列和行,但我不确定,因为它是垂直的。到目前为止,我尝试更改 psm 配置值,尝试各种编辑,扩大规模,但它们似乎都比我现在的结果更糟糕。

img = Image.open(f"{link}---{page}") #opening image based on classification system
area = (300, 235, 750, 335) #cropping it to just be that sliver of data
cropped_img = img.crop(area).convert("LA") #convert to greyscale
text = (pytesseract.image_to_string(cropped_img, lang='kor', config='--psm 4')) #pytesseract using korean trained data
print(text) #seeing output

谢谢!

标签: pythonocrtesseractimage-recognitioncjk

解决方案


推荐阅读