本文介绍了Tesseract 错误:警告.无效的分辨率 0 dpi.改用 70的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在图像(附图片)上运行 tesseract 时报告错误
Error was reported when running tesseract on a image (image attached)
tesseract rsa-out.jpg stdout
Warning. Invalid resolution 0 dpi. Using 70 instead.
Empty page!!
Empty page!!
推荐答案
图像的元数据可能不包括图像分辨率.如果您知道,您可以使用 --dpi
命令选项来指定输入图像的 DPI.运行 tesseract --help-extra
以获取更多信息.
The image's metadata probably does not include image resolution. You can use --dpi
command option to specify DPI for input image, if you know it. Run tesseract --help-extra
to get more info.
更新了版本信息和 cmd 的输出:
>tesseract -v
tesseract 4.1.1
leptonica-1.79.0 (Jan 2 2020, 22:29:02) [MSC v.1924 DLL Release x64]
libgif 5.1.4 : libjpeg 9c : libpng 1.6.37 : libtiff 4.0.10 : zlib 1.2.11 : libwebp 1.0.3 : libopenjp2 2.3.1
>tesseract --help-extra
Usage:
tesseract --help | --help-extra | --help-psm | --help-oem | --version
tesseract --list-langs [--tessdata-dir PATH]
tesseract --print-parameters [options...] [configfile...]
tesseract imagename|imagelist|stdin outputbase|stdout [options...] [configfile...]
OCR options:
--tessdata-dir PATH Specify the location of tessdata path.
--user-words PATH Specify the location of user words file.
--user-patterns PATH Specify the location of user patterns file.
--dpi VALUE Specify DPI for input image.
-l LANG[+LANG] Specify language(s) used for OCR.
-c VAR=VALUE Set value for config variables.
Multiple -c arguments are allowed.
--psm NUM Specify page segmentation mode.
--oem NUM Specify OCR Engine mode.
NOTE: These options must occur before any configfile.
Page segmentation modes:
0 Orientation and script detection (OSD) only.
1 Automatic page segmentation with OSD.
2 Automatic page segmentation, but no OSD, or OCR. (not implemented)
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.
11 Sparse text. Find as much text as possible in no particular order.
12 Sparse text with OSD.
13 Raw line. Treat the image as a single text line,
bypassing hacks that are Tesseract-specific.
OCR Engine modes:
0 Legacy engine only.
1 Neural nets LSTM engine only.
2 Legacy + LSTM engines.
3 Default, based on what is available.
Single options:
-h, --help Show minimal help message.
--help-extra Show extra help for advanced users.
--help-psm Show page segmentation modes.
--help-oem Show OCR Engine modes.
-v, --version Show version information.
--list-langs List available languages for tesseract engine.
--print-parameters Print tesseract parameters.
这篇关于Tesseract 错误:警告.无效的分辨率 0 dpi.改用 70的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!