OCR Tesseract,空白页错误?


5

我使用的源代码对其进行了编译leptonica。这是具有透明背景的png图像,我对其进行了编辑,添加了蓝色,但仍然出现此错误:

Tesseract Open Source OCR Engine v3.02.02 with Leptonica
Empty page!!
Empty page!!

这是图像输入:

在此处输入链接说明

Answers:


5

尝试psm选项。

-psm N
    Set Tesseract to only run a subset of layout analysis and assume a certain form of image. The options for N are:

    0 = Orientation and script detection (OSD) only.
    1 = Automatic page segmentation with OSD.
    2 = Automatic page segmentation, but no OSD, or OCR.
    3 = Fully automatic page segmentation, but no OSD. (Default)
    4 = Assume a single column of text of variable sizes.
    5 = Assume a single uniform block of vertically aligned text.
    6 = Assume a single uniform block of text.
    7 = Treat the image as a single text line.
    8 = Treat the image as a single word.
    9 = Treat the image as a single word in a circle.
    10 = Treat the image as a single character.

参考:http : //hilojack.sinaapp.com/?p=866


4

将图像处理为阈值背景色。将文本颜色更改为黑色(为了更好地识别。将背景阈值设置为阈值后,更改颜色值应该非常简单。)将图像转换为灰度。然后转换为.tif格式。

现在您可能有机会处理该图像(超级用户不允许我发布图像,因此我将它们链接起来):

处理的图像

现在运行以下命令:

tesseract test.tif test_output -psm 7

结果是:

Tist

考虑到除了标准eng之外,我没有使用任何其他培训数据,因此这非常好。

结果截图


2

Tesseract未接受过手写识别训练。也不知道这些颜色有什么作用。

您可以尝试使用该笔迹来训练tesseract ...

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.