前面的步骤都一样,从第4步开始 

4、使用tesseract生成.box文件:

tesseract eng.handwriting.exp0.tif eng.handwriting.exp0 -l eng -psm 7 batch.nochop makebox 

5、矫正一下识别有问题的字符

 

6、生成font_properties文件: 

只要字符部分,不要语言部分,也不要exp【数字】这里

echo handwriting 0 0 0 0 0 >font_properties

 

 

 7、使用tesseract生成.tr训练文件:

tesseract eng.handwriting.exp0.tif eng.handwriting.exp0 nobatch box.train

 

 

成功生成一个tr文件

8、生成字符集文件:

unicharset_extractor eng.handwriting.exp0.box

 

9、生成shape文件: 

shapeclustering -F font_properties -U unicharset -O eng.handwriting.exp0.unicharset eng.handwriting.exp0.tr

 

会生成 shapetable 和 zwp.unicharset 两个文件。

 

 

10、生成聚字符特征文件:

会生成 inttemp、pffmtable、shapetable和eng.handwriting.exp0.unicharset四个文件。

mftraining -F font_properties -U unicharset -O eng.handwriting.exp0.unicharset eng.handwriting.exp0.tr

 

 

 

11、生成字符正常化特征文件:会生成 normproto 文件。  

cntraining eng.handwriting.exp0.tr

 

 

 

12、文件重命名:

 

重新命名inttemp、pffmtable、shapetable和normproto这四个文件的名字为[lang].xxx。

这里修改为zwp.inttemp、zwp.pffmtable、zwp.shapetable和zwp.normproto

rename normproto eng.normproto
rename inttemp eng.inttemp 
rename pffmtable eng.pffmtable
rename shapetable eng.shapetable

 

 

13、合并训练文件:

执行下面命令,会生成handwritingEng.traineddata文件。

combine_tessdata eng.

 

 

 

转载于:https://www.cnblogs.com/jnhs/p/11320042.html

GitHub 加速计划 / te / tesseract
60.1 K
9.29 K
下载
tesseract-ocr/tesseract: 是一个开源的光学字符识别(OCR)引擎,适用于从图像中提取和识别文本。特点是可以识别多种语言,具有较高的识别准确率,并且支持命令行和API调用。
最近提交(Master分支:1 个月前 )
bc490ea7 Don't check for a directory, because a symbolic link is also allowed. Signed-off-by: Stefan Weil <sw@weilnetz.de> 3 个月前
2991d36a - 3 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐