- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我开始编写一个简单的脚本来从图像中读取数据。这是我使用 RTesseract 读取它的 Ruby 代码:
require 'rtesseract'
require 'mini_magick'
RTesseract.configure do |config|
config.processor = "mini_magick"
end
image = RTesseract.new("myImage.jpg")
puts image.to_s
我从这张图片开始:
返回的结果是:132B 4
。
我知道 0 作为 B 返回(我可以解决)。但是后面的3
、0
、8
根本没有返回。现在我知道它已经知道如何读取 3 和 0,因为它在第一个数字中就这样做了。我认为它在渲染以下数字时存在一些问题,所以我将其设为黑白。
这是我尝试的第二张图片:
但是返回的结果仍然是:132B 4
。
最后我剪切了图像并尝试了最后 3 个数字。
这是图片:
但是当我运行脚本时,它没有返回任何结果。关于为什么我无法读取最终数字有什么想法吗?
我正在使用 Ruby 2.2.2、rTesseract 2.1.0 和 MiniMagick 4.5.1。
我正在使用 Tesseract 3.04.01
最佳答案
我在我的 Linux Mint 17 机器上用 tesseract 3.03 测试了你的脚本, Ruby 2.1.5 和 MiniMagick 4.5.1
它还返回 132B 4
。
如果您确定数字已编码,您可以尝试:
image = RTesseract.new("myImage.jpg", options: :digits)
它返回 13223 4
。
在没有参数的情况下启动 tesseract 会给你一个可能的选项列表。 “pagesegmode 7”看起来很有趣:7 = 将图像视为单个文本行。
所以:
image = RTesseract.new("myImage.jpg", options: :digits, psm: 7)
它返回 13223 4 3 21 8
。
对于您的第二张图片,它返回 3 21 8
。
我认为现在最大的问题是 JPG 伪影非常严重,数字和背景之间的对比度相对较低。 PNG 图像可能会产生更好的结果。
使用 gimp,我将图像调整为 200px 高度,裁剪接近数字以去除一些伪影,使用 150 的颜色/阈值,反转图像并保存为 png :
Rtesseract 返回:
1320 4 3 0 8
使用 Image Magick,此命令可获得相同的结果:
convert myImage.jpg -geometry x200 -threshold 13% -negate myImage.png
关于ruby - Tesseract 不读取某些数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40245844/
我正在尝试使用 tesseract 来识别图像中的字符。这个图像是通过从另一个图像中抓取字符并将它们放在新图像中的一行来创建的。问题是,当我将这张图片提供给 tesseract 时,它在输出中没有显示
使用创建聚类数据时 mftraining -F font_properties -U unicharset -O lan.unicharset *.tr 我收到以下消息 C:\Users\ \AppD
我是 tesseract 的新手,对 github 页面中的不同目录有点困惑。 tesserac-ocr 代码库是我安装的。在/usr/local/share/tessdata/中安装了一个 tess
我找不到详细的文档,也没有浏览源代码的感觉。例如,如果 Tesseract 引擎已经完成,我不想重做精明的边缘检测。 最佳答案 本文档提供了引擎的概述:https://github.com/tesse
我对 Tesseract OCR 完全陌生。这个问题可能很简单,但我似乎无法使用 Google 找到答案。 基本上,我有一个包含两部分的图像:第一部分位于图像的顶部,黑色背景和白色文本;第二部分位于图
我浏览了整个 Google 代码网站,但没有找到任何从 API 角度解释如何使用 Tesseract 的内容。有人知道在哪里可以找到这个吗? 最佳答案 最新文档现已发布 here 和 here 。 关
我可以通过命令行使用 tesseract 4.0 获得单词级别的置信度分数。有兴趣知道是否也有办法让角色自信。 对于单词级别的置信度,使用以下命令: tesseract [Image name] ou
TL;DR It appears that tesseract cannot recognize images consisting of a single digit. Is there a wor
所以我已经研究这个问题一段时间了,虽然其他人也有类似的问题,但对我来说没有任何作用: 我正在尝试将 pytesseract 用于项目,并将其安装在 User/Environments/testEnv/
我正在考虑使用 Tesseract 来处理 PDF 文件,因此我想使用该库而不是外部可执行文件。 我首先下载完整的 Tesseract 源代码并考虑构建它。遗憾的是,标准源没有任何方法可以在非 Lin
是否可以使用 Tesseract-OCR 获取已识别字符的字体,即它们是 Arial 还是 Times New Roman,无论是从命令行还是使用 API。 我正在扫描可能具有不同字体的不同部分的文档
我试图让 Tesseract(使用 Tess4J 包装器)仅匹配特定模式。该模式是连续四位数字,我认为是\d\d\d\d。这是我正在提供 tesseract 的图像的一个非常小子集(平面图受到限制
我不是 100% 确定 Java api 包 Tess4J 中 Tesseract 和 Tesseract1 对象的区别,任何人都可以解释一下吗? 我知道 Tesseract 使用接口(interfa
我正在测试 Hololens 中的一些功能。想知道是否可以在 Hololens 中使用任何对象检测/文本识别功能? 最佳答案 Hololens 1 本身不支持对象检测,您需要使用第三方代码。 Open
我正在尝试为 Tesseract 4.0 创建训练数据来识别屏幕截图中的图标(例如,评论,分享,保存)。这是示例屏幕截图: 我想微调 Tesseract 以实现如下输出: 喜欢147 评论 29 已保
我想知道Tesseract OCR使用的配置文件接受哪些参数,如何编写配置文件等 我在 their site 上找不到任何有关此内容的文档。如何确定支持哪些参数及其含义? 最佳答案 Tesseract
我正在尝试为 Tesseract 4.0 创建训练数据来识别屏幕截图中的图标(例如,评论,分享,保存)。这是示例屏幕截图: 我想微调 Tesseract 以实现如下输出: 喜欢147 评论 29 已保
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 6 年前。 此帖于11个月前编辑提交审核,
我正在尝试设置 tessedit_write_images但似乎做不到,我在任何地方都看不到 tessinput.tif 我正在做: import tesseract api = tesseract.
使用tesseract-ocr#3.02.02。 tesseract的基本用法是 tesseract sourc.png result 生成 和result.txt。要获取结果文本,我必须 cat 这
我是一名优秀的程序员,十分优秀!