训练验证码识别程序-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有用。

  • 训练验证码识别程序-training tessertact_第1张图片
  • 大小: 5.7 KB
  • 查看图片附件

你可能感兴趣的:(Google,thread)