问题标签 [ocr]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
4 回答
1523 浏览

testing - 如何为 OCR 软件提供最大的成功机会?

我正在使用Tesseract OCR(通过pytesser)和 PIL(Python 图像库)对应用程序进行自动化测试。

我正在通过截屏并通过 tesseract 获取文本来检查显示的文本是否正常。

一开始我遇到了一些问题,但由于 PIL 的双三次插值,我增加了屏幕截图的大小,所以效果似乎更好。

不幸的是,我仍然有一些错误,例如混淆“0”和“O”。我可以想象我以后还会遇到其他类似的问题。

我想知道是否有一些技术可以准备图像以帮助 OCR。欢迎任何想法。

提前致谢

0 投票
4 回答
4804 浏览

asp.net - 如何在 ASP.Net Web 应用程序中使用 MODI?

我已经围绕 Microsoft Office Document Imaging COM API 编写了一个 OCR 包装库,并且在本地运行的控制台应用程序中,它在每次测试中都能完美运行。

可悲的是,当我们尝试将它与作为 IIS6 下的 ASP.Net Web 应用程序运行的 WCF 服务集成时,事情开始变得糟糕。我们在尝试释放 MODI COM 对象时遇到了问题,网上有很多例子对我们有帮助。

然而,问题仍然存在。如果我重新启动 IIS,并重新部署 Web 应用程序,前几次 OCR 尝试效果很好。如果我将其放置 30 分钟左右,然后再执行另一个请求,则会收到如下服务器故障错误:

服务器抛出异常。(来自 HRESULT 的异常:0x80010105 (RPC_E_SERVERFAULT)):在 MODI.DocumentClass.Create(String FileOpen)

从这一点开始,每个请求都将无法执行 OCR,直到我重置 IIS,然后循环再次开始。

我们在它自己的应用程序池中运行这个应用程序,它以具有本地管理员权限的身份运行。

更新:这个问题可以通过在进程外执行 OCR 来解决。似乎 MODI 库不能很好地处理托管代码,当涉及到自身清理时,因此在我的情况下为每个 OCR 请求生成新进程效果很好。

这是执行 OCR 的函数:

然后我在 using 块中实例化 ImageReader 的一个实例(它将在退出时调用 IDisposable.Dispose)

调用 Marshal.FinalReleaseComObject 应该指示 CLR 释放 COM 对象,所以我不知道是什么导致了我们的症状。

对于它的价值,在 IIS 之外运行此代码,例如控制台应用程序,一切似乎都是防弹的。它每次都有效。

任何可以帮助我诊断和解决此问题的提示都将是巨大的帮助,我会疯狂地投票!;-)

谢谢!

0 投票
2 回答
1550 浏览

image-processing - OCR - 大多数“不同”或“可识别”的 ASCII 字符?

我正在寻找一种方法来确定最“不同”或“可识别”的 N 个 ASCII 字符...例如,如果 N = 10,从 0x21 到 0x7E 的 ASCII 集中最不同的 N 个字符是什么?显然,字符“X”与“O”(字母)非常不同,但“O”(字母)与“0”(零)非常相似。假设一个受限制的 OCR 字符子集,这样零和字母 O 将被检测为一个或另一个,并且不必担心它是零还是字母 O,那么最不同的 N 是什么典型的 OCR 引擎(例如 Tesseract)容易从质量差的输入图像中识别出的字符?假设。例如“+”和“t”可能会被广泛地误认为是彼此。可以制作,

谢谢,本

0 投票
1 回答
32356 浏览

java - 用Java从图像文件中读取文本

我可以用来从图像(JPEG、PNG)文件中提取文本的最佳开源 Java 库是什么?

0 投票
2 回答
757 浏览

text - 从绘图中提取文本的最佳 OCR?

替代文字
(来源:goldprice.org

有谁知道能够将此图像转换为文本的好 ocr 吗?我尝试了tesseract,但没有达到我的预期。

0 投票
2 回答
2486 浏览

xml - How to embed external OCR into existing PDF?

I have a set of images over which I run an OCR application. This process results in a XML file with character offsets. Then I convert the images to PDF using Acrobat 9. Now, I would like to add the XML file information as an invisible text layer into the PDF in order to achieve a searchable PDF. Is there an easy and free way?

Some details:

  • I don't want to use Acrobat's OCR functionality;

  • The OCR process results in a XML file which contains elements like:

    <line baseline="1049" l="158" t="1012" r="1196" b="1060">This is a sample line of text from an image</line>

Update: it may be possible doing what I want in a different way. Supposing there is already a PDF file generated from a set of images, and which already contains OCRed text. Would it be possible to (maybe programmatically) access just the image of each page, process it (e.g., converting it to monochrome), and save it back to the PDF file? If yes, then the OCRed text would not be lost.

[Should I put this update into a separate question?]

0 投票
7 回答
46886 浏览

search - How to know if a PDF contains only images or has been OCR scanned for searching?

I have a bunch of PDF files that came from scanned documents. The files contain a mix of images and text. Some were scanned as images with no OCR, so each PDF page is one large image, even where the whole page is entirely text. Others were scanned with OCR and contain images and searchable text where text is present. In many cases even words in the images were made searchable.

I want to make an automated process to recognize the text in all of the scanned documents using OCR, with Acrobat 8 Pro, but I don't want to re-OCR the files that have already been through the OCR process in the past. Does anyone know if there is a way to tell which ones contain only images, and which ones already contain searchable text?

I'm planning on doing this in C# or VB.NET but I don't think being able to tell the two kinds of files apart is language dependent.

0 投票
2 回答
9952 浏览

vb.net - 使用 VB.net 将 PDF 转换为文本文件

我有一个扫描的 PDF 文件,我需要一个 VB.net 源代码,它将扫描的 PDF 转换为文本格式。

0 投票
2 回答
1933 浏览

c# - Screen scraper application (not HTML)

I need screen scraper application which will recognize text from the screen (and not use winapi to do this so source could be in image file). I found a lot of commercial solutions, but I need something open source or free. I plan to include it in my C# project, so there should be some SDK available.

Thanks.

0 投票
4 回答
3270 浏览

pdf - 批量 OCRing 尚未进行 OCR 处理的 PDF

如果我有 10,000 个 PDF,其中一些已被 OCRed,其中一些有 1 页已被 OCRed,但其余页面没有,我如何才能浏览所有 PDF,而仅 OCR 尚未完成的页面完成了吗?