如何让 Tesseract 将 o 识别为 o 而不是零?
How to make Tesseract recognize o as o and not as zero?
我有以下图片:
img01.png
img02.png
当我 运行 tesseract img01.png img01.txt -l eng --psm 7
我收到短信
7.819 0
第一张图片
10.024
第二个
第二个结果正确。但是,在第一张图片中,它是 o
而不是零。
如何让 Tesseract 将 o 识别为 o?
更新 1: 我尝试使用 this answer (tesseract --oem 1 img01.png img01-ocred -l eng --psm 7
) 中建议的 --oem 1
选项,但它没有帮助。
更新 2: 使用 magick img01.png +dither -colors 3 -colors 2 -colorspace gray -normalize img01-binarized.png
对图像进行二值化也没有帮助。二值化图像如下所示:
你只需要将图片放大两倍然后使用tesseract。
wget https://i.stack.imgur.com/bSO87.png
identify -format "%wx%h" bSO87.png
40x20
tesseract -l eng --oem 3 --psm 6 bSO87.png stdout
7.819 0
convert bSO87.png -resize 80x40 bSO87.png
identify -format "%wx%h" bSO87.png
80x40
tesseract -l eng --oem 3 --psm 6 bSO87.png stdout
7.819 o
我有以下图片:
img01.png
img02.png
当我 运行 tesseract img01.png img01.txt -l eng --psm 7
我收到短信
7.819 0
第一张图片10.024
第二个
第二个结果正确。但是,在第一张图片中,它是 o
而不是零。
如何让 Tesseract 将 o 识别为 o?
更新 1: 我尝试使用 this answer (tesseract --oem 1 img01.png img01-ocred -l eng --psm 7
) 中建议的 --oem 1
选项,但它没有帮助。
更新 2: 使用 magick img01.png +dither -colors 3 -colors 2 -colorspace gray -normalize img01-binarized.png
对图像进行二值化也没有帮助。二值化图像如下所示:
你只需要将图片放大两倍然后使用tesseract。
wget https://i.stack.imgur.com/bSO87.png
identify -format "%wx%h" bSO87.png
40x20
tesseract -l eng --oem 3 --psm 6 bSO87.png stdout
7.819 0
convert bSO87.png -resize 80x40 bSO87.png
identify -format "%wx%h" bSO87.png
80x40
tesseract -l eng --oem 3 --psm 6 bSO87.png stdout
7.819 o