在提供的图像示例中,文本在视觉上具有相当好的质量,因此问题是OCR如何提供不准确的结果?
为了说明这个答案的进一步文本中给出的结论,让我们运行给定的图像
通过Tesseract.低于Tesseract OCR的结果:
"fhpgearedmomrs©gmachom"
现在让我们调整图像大小四次并对其应用阈值.我已经在Gimp中手动完成了大小调整和阈值处理,但是使用适当的调整大小方法和PIL的阈值可以确保自动化,这样在增强后你会得到一个类似于我所获得的增强图像的图像:
通过Tesseract OCR运行的改进图像提供以下文本:
“fhpgearedmotors©gmail.com”
这表明放大图像有助于在所提供的文本图像示例上实现100%的准确性.
放大图像有助于实现更好的OCR精度可能看起来很奇怪,但是… OCR被开发用于将打印介质的扫描转换为文本并且期望通过设计预期300dpi的文本图像.这就解释了为什么有些OCR程序没有自己调整文本大小以改善其结果,并且对预期可以通过放大实现的图像的更高dpi分辨率的小字体做坏事.
[There is a minimum text size for reasonable accuracy. You have to consider resolution as well as point size. Accuracy drops off below 10pt x 300dpi, rapidly below 8pt x 300dpi. A quick check is to count the pixels of the x-height of your characters. (X-height is the height of the lower case x.) At 10pt x 300dpi x-heights are typically about 20 pixels, although this can vary dramatically from font to font. Below an x-height of 10 pixels, you have very little chance of accurate results, and below about 8 pixels, most of the text will be “noise removed”.]