Tesseract就不多介绍勒,能找到的人都知道是干嘛的

下面记录一下C# vs2010下的使用方法(借鉴http://blog.csdn.net/bobo1013767522/article/details/17894997)

首先需要两个东西

1.tesseractengine3.dll 此处 下载

2.语言包(字典) 此处 为英文语言库

 

 1 using tesseract;
 2 TesseractProcessor m_tesseract = new TesseractProcessor();
 3 string m_path = Application.StartupPath + @"\tessdata\";
 4 string m_lang = "eng";
 5 //初始化
 6 bool isSucceed = m_tesseract.Init(m_path, m_lang, (int)TesseractEngineMode.TESSERACT_ONLY);
 7 m_tesseract.SetVariable("tessedit_char_whitelist", "0123456789"); 
 8 //m_tesseract.SetVariable("tessedit_pageseg_mode", TesseractPageSegMode.PSM_AUTO.ToString());
 9 //m_tesseract.SetVariable("tessedit_char_whitelist", "0123456789ABCDEFGHIJKLMNOPQLSTUVWXYZ");  
10 
11 m_tesseract.Clear();
12 m_tesseract.ClearAdaptiveClassifier();
13 
14 string result = m_tesseract.Apply("ValidateCode.bmp");

 

posted on 2014-05-13 03:51  love7hp  阅读(854)  评论(0编辑  收藏