opencv - 如何通过在python中使用pytesseract和opencv-python来识别其他更大对象下的变形文本?
问题描述
我正在使用 pytesseract 来识别如下文本
td = pytesseract.image_to_data(img, output_type=Output.DICT)
tn_boxes = len(td['level'])
for o in range(0, tn_boxes):
text = td['text'][o]
print(text)
我只是Examples
通过使用一个简单的逻辑来制作索引detect keyword 'Example no.' find it's end point keyword 'Sol.' and put a piece of image from keyword 'Example no.' to keyword 'Sol.' into index and then find next example and so on
但是当我尝试跟随图像
然后它显示输出
SET THEORY ae . . 5 (6) Let A = {x: x isa negative odd integer} = {-1,-3,-5,-7,
......等等
看看它是如何不识别第一行......等等Sol. (a) Let A={x:x is a natural number
。
当我尝试使用以下没有水平线的图像时,
它就可以正常工作。
有没有办法配置 pytesseract 来识别上面有一行的文本?
编辑:
有时,当我们将一些图像放在文本上方或其他一些尺寸较大的文本上时,pytesseract 无法检测到该较大对象下方的文本。
这种问题有什么解决方案吗?可能有一种方法可以配置检测最小尺寸或配置检测所有可能大小的文本,即使在一些更大的物体下?
例如它显示输出usually denoted by o(G). ors a a {= 7 Wave =e () oe that the set of ae | group usual ition of integers.
看看它是如何没有检测到Example 1.
以下图像的
关键字
但是当我尝试下图时它显示输出usually denoted by o(G). Example 1. (2) Prove that th . group under usual addition of integers,
现在它正在检测关键字Example 1.
解决方案
阅读例如图像处理以提高 tesseract OCR 准确性并阅读文档。
推荐阅读
- javascript - .then() 链中的变量类型
- arrays - 使用 C 查找最长公共前缀的累积方法不起作用
- typescript - Svelte 在汇总中看到一个令人困惑的错误
- javascript - 联系表格 7 复选框 勾选
- javascript - 通过 nodejs 最小化应用程序 || 纯js
- common-lisp - 我将如何打印出元素之间有空格的列表
- python - 如何查看 Gensim 生成的字典的内容?
- javascript - 在使用 javascript 的 HTA 应用程序中显示 html iframe 对象
- amazon - 如果我要获取 Jungle Scout 之类的数据,我应该从哪里开始?
- python - 查找每个类别的最大值的名称