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

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

首先需要两个东西

1.tesseractengine3.dll 此处 下载

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

 using tesseract;
TesseractProcessor m_tesseract = new TesseractProcessor();
string m_path = Application.StartupPath + @"\tessdata\";
string m_lang = "eng";
//初始化
bool isSucceed = m_tesseract.Init(m_path, m_lang, (int)TesseractEngineMode.TESSERACT_ONLY);
m_tesseract.SetVariable("tessedit_char_whitelist", "");
//m_tesseract.SetVariable("tessedit_pageseg_mode", TesseractPageSegMode.PSM_AUTO.ToString());
//m_tesseract.SetVariable("tessedit_char_whitelist", "0123456789ABCDEFGHIJKLMNOPQLSTUVWXYZ"); m_tesseract.Clear();
m_tesseract.ClearAdaptiveClassifier(); string result = m_tesseract.Apply("ValidateCode.bmp");
05-03 23:55