我正在尝试使用Tesseract从下图中提取
text = pytesseract.image_to_string(image, config='-c preserve_interword_spaces=1 --psm 1 --oem 1')
这是tesseract 4 ocr的结果
print(text)
Wrote Datastream application
e Used Kafka to get the accounts
如果您看到图像中的项目符号被转换为e
,我在文档中发现了几个这样的点,它们被转换为ascii中的单个字符
如果有人熟悉此类问题并有解决方案,请告诉我
我有一个建议,也许最好去掉要点
删除项目符号的一个解决方案是应用
adaptive-threshold
如果我们将
adaptive-threshold
应用于当前图像:现在如果我们读到它:
代码:
请允许我告诉您,我的示例代码可能不适用于所有图像。因为图像可能有不同的伪影或需要额外的处理。您可能需要更改
adaptive-threshold
的block-size
和C
参数。因此,请先阅读adaptive-threshold相关问题 更多 >
编程相关推荐