Tesseract-OCR 字符训练操作 精简版

Tesseract-OCR 字符训练操作 精简版

安装好tesseract 和jTessBoxEditor-2.2.0
在jTessBoxEditor-2.2.0中合成tif图片
设置tif图片命名格式

lang.sign.img.tif

[lang].[fontname].exp[num].tif
lang为语言名称,fontname为字体名称,num为序号

生成box文件:

tesseract mytest.tif mytest -l chi_sim+eng batch.nochop makebox

多个box文件

tesseract lang.sign.img.tif lang.sign.img -l chi_sim+eng batch.nochop makebox

训练生成tf文件:

tesseract 200test.tif 200test nobatch box.train

产生计算字符集(unicharset):

unicharset_extractor 200test.box

如果有多个,就在后面依次添加

unicharset_extractor lang.sign.img.box lang.sign.img1.box lang.sign.img2.box

新建文件“font_properties” 内容输入:

200test 0 0 0 0 0

可使用命令行:echo 200test 0 0 0 0 0 >font_properties
生成shape文件

shapeclustering -F font_properties -U unicharset lang.sign.img.tr

多个shape文件

shapeclustering -F font_properties -U unicharset lang.sign.img.tr lang.sign.img1.tr lang.sign.img2.tr

接着执行命令:

mftraining -F font_properties -U unicharset 200test.tr

多个文件:

  mftraining -F font_properties -U unicharset -O lang.unicharset lang.sign.img.tr

输入命令:

cntraining 200test.tr
cntraining lang.sign.img.tr

更名:

rename/mv normproto lang.normproto 

合并训练文件

combine_tessdata test200.
combine_tessdata lang.

最后生成*.traineddata

参考文档:http://www.suohi.cc/posts/5810974b731d7c006f9daf77

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值