zoukankan      html  css  js  c++  java
  • Tesseract-OCR的使用记录

    参考:

    http://www.cnblogs.com/cnlian/p/5765871.html

    http://www.cnblogs.com/wzben/p/5930538.html

    1、下载 Tesseract-OCR 及对应版本的 chi_sim.traindata 字库。

      一定要对应否则会报错。错误信息为:actual_tessdata_num_entries_ <= TESSDATA_NUM_ENTRIES:Error:Assert failed:in file tessdatamanager.cpp, line 53"

     

    2、打开cmd,打开图片所在文件夹,输入命令:tesseract in.png out -l chi_sim在图片所在文件夹下生成名字为out的txt文件。

      命令格式:  tesseract imagename outputbase [-l lang] [-psm pagesegmode] [configfile…]  

      imagename为目标图片文件名,需加格式后缀;outputbase是转换结果文件名;lang是语言名称(在Tesseract-OCR中tessdata文件夹可看到以eng开头的语言文件eng.traineddata),如不标-l eng则默认为eng。

    字库训练

    之前是打算字库训练,后来发现下载的字库还是比较完善的,就简单记录下。

    下面是训练所有的cmd命令。chi.newchi.exp0.tif为自己转换的图片名字

     

    tesseract chi.newchi.exp0.tif chi.newchi.exp0 -l chi_sim batch.nochop makebox

    tesseract  chi.newchi.exp0.png chi.newchi.exp0  nobatch box.train

    unicharset_extractor chi.newchi.exp0.box

    shapeclustering -F font_properties -U unicharset -O chi.unicharset chi.newchi.exp0.tr

    mftraining -F font_properties -U unicharset -O chi.unicharset chi.newchi.exp0.tr

    cntraining chi.newchi.exp0.tr   

    rename normproto newchi.normproto  
    rename inttemp newchi.inttemp      
    rename pffmtable newchi.pffmtable  
    rename unicharset newchi.unicharset
    rename shapetable newchi.shapetable

    combine_tessdata newchi.

    tesseract chi.newchi.exp0.png chi.newchi.exp0 -l newchi

  • 相关阅读:
    uva 11294 Wedding
    uvalive 4452 The Ministers’ Major Mess
    uvalive 3211 Now Or Later
    uvalive 3713 Astronauts
    uvalive 4288 Cat Vs. Dog
    uvalive 3276 The Great Wall Game
    uva 1411 Ants
    uva 11383 Golden Tiger Claw
    uva 11419 SAM I AM
    uvalive 3415 Guardian Of Decency
  • 原文地址:https://www.cnblogs.com/congyinew/p/7694204.html
Copyright © 2011-2022 走看看