训练验证码识别程序-training tessertact

Simplest steps to train tesseract
参考

http://groups.google.com/group/tesseract-ocr/browse_thread/thread/983317066a5acbd1/58ccdd7c1da5884e?lnk=gst&q=train#58ccdd7c1da5884e

1.收集验证码,把所有验证码图片二值化,去噪点后,用PS合并在一张图片上如图,把图片转换成tif格式。如scan.tif

2.生成box文件

 运行"tesseract scan.tif scan batch.nochop makebox"; 会生成scan.txt文本文件,修正错误的字符。把scan.txt改名为scan.box(这一步可以用bbtesseract代替。bbtesseract下载地址http://code.google.com/p/bbtesseract/downloads/list)

3.开始训练tesseract

 运行"tesseract scan.tif junk nobatch box.train"; 生成文件scan.tr

4.Clustering

 运行"mftraining scan.tr"; 生成文件"inttemp", "pffmtable" and "Microfeat"(Not used)

 运行"cnTraining scan.tr";生成文件"normproto";

5.Compute the Character Set
 运行"unicharset_extractor scan.box"; 生成文件"unicharset"

6.Dictionary Data

这一步操作可以不用,直接复制其他的。

 Create two UTF-8 text file, "frequent_words_list" and "words_list",
the words in the files should not be duplicated;
 Run "wordlist2dawg frequent_words_list freq-dawg"
 Run "wordlist2dawg words_list word-dawg";
 This will generate two files, "freq-dawg" and "word-dawg";

7. Putting it all together
 All you need to do now is collect together all 8 files and rename
them with a lang. prefix;
 File "eng.DangAmbigs" and "eng.user-words" could be empty;
 If create "eng.DangAmbigs" file, the characters must be exist in the
"scan.box";

8. Try it
 Run "tesseract scan.tif output -l eng"
 The file "output.txt" is the result;

 

 

快速步骤

1.收集验证码,把所有验证码图片二值化,去噪点后,用PS合并在一张图片上如图,把图片转换成tif格式。如scan.tif

2.生成box文件

 运行"tesseract scan.tif scan batch.nochop makebox"; 会生成scan.txt文本文件,修正错误的字符。把scan.txt改名为scan.box(这一步可以用bbtesseract代替。bbtesseract下载地址http://code.google.com/p/bbtesseract/downloads/list)

3.把tesseract中training中的所有文件复制到tesseract.exe所在目录中,在tesseract.exe所在目录新建batch

tesseract scan.tif junk nobatch box.train
mftraining scan.tr
cnTraining scan.tr
unicharset_extractor scan.box

 

运行后,生成的inttemp,normproto,pffmtable,unicharset有用。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值