天天看点

OCR 开源软件 Tesseract 的下载和入门使用

资源下载

tesseract-ocr-setup-3.05.01.exe

注: 安装的时候选好要识别的语言

tesseract-4.0-with-LSTM#400-alpha-for-windows

Windows中运行tesseract

1.

tesseract

是一个命令行OCR程序,打开一个终端(组合键Win +R),输入:

tesseract imagename outputbase [-l lang] [-psm pagesegmode] [configfile...]

imagename
The name of the input image. Most image file formats (anything readable by 
Leptonica) are supported.(输入图片的文件名,可以是Leptonica支持的各种图片格式)

outputbase
The basename of the output file (to which the appropriate extension will be 
appended). By default the output will be named outbase.txt.(输出文件的文件名,
默认输出文件是txt格式的,还可以指定Hocr和pdf格式)
           

2.举个栗子:识别

myscan.png

图像,将识别结果存入

out.txt

,命令行:

tesseract myscan.png out

3.指定特定语言,指定识别简体中文和英文

-l chi_sim+eng

,命令行:

tesseract myscan.png out -l chi_sim+eng

4.指定输出文件格式,在命令行最后加上文件格式即可,可以指定Hocr和pdf格式,hOCR是

是一种HTML文件,它对每个识别的字词会后一些参数的说明。tesseract 3.03及以上的版本才

支持pdf格式,命令行为:

hOCR:

tesseract myscan.png out hocr

pdf:

tesseract myscan.png out pdf

Github 参考文件

运行tesseract

参数说明

本文转自:https://blog.csdn.net/cylj102908/article/details/78760777

继续阅读