python - 改进表格中的 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
谢谢!
解决方案
推荐阅读
- c++ - 使用 getline() 时编译错误:“类型不匹配”
- javascript - 使用相同组件编辑和添加数据的最佳方法。将组件状态与 redux 存储混合
- reactjs - Create-React-App:.env 文件无法正确解析
- python - PySide:QAbstractItemModel - 访问项目的 QLineEdit
- c++ - 将向量映射到特定范围
- python - FancyArrowPatch 不绘制标签
- c++ - 刽子手游戏的验证问题
- powershell - TPM 和私钥保护
- javascript - Vue无效的主机头
- node.js - Firebase 身份验证与云 sql 混合