예제 #1
0
파일: Form1.cs 프로젝트: chuixue/Gamer
 /*
 private string GetNumber(Bitmap image)
 {
     UnCodebase ud = new UnCodebase(image);
     ud.DealMap2();
     image = ud.bmpobj;
     pictureBox1.Image = image;
     if (!bInitT)
     {
         ocrNumber = new TesseractProcessor();
         bool inited = ocrNumber.Init(@".\", "chi_sim", 3);
         if (!inited) { MessageBox.Show("智能识别引擎初始化失败!"); return ""; }
         ocrNumber.SetVariable("tessedit_char_whitelist", ".,3214567890 ");
     }
     ocrNumber.Clear();
     ocrNumber.ClearAdaptiveClassifier();
     string result = ocrNumber.Recognize(image);
     return result;
 }
  * */
 private string GetChiSim(Bitmap image)
 {
     UnCodebase ud = new UnCodebase(image); 
     ud.DealText();
     image = ud.image;
     //pictureBox1.Image = image; textBox3.Text = ud.txt;
     if (!bInitT)
     {
         ocrText = new TesseractProcessor();
         bInitT = ocrText.Init(@".\", "chi_sim", 3);
         if (!bInitT) { MessageBox.Show("智能识别引擎初始化失败!"); return ""; }
         ocrText.SetVariable("tessedit_char_blacklist", "1234567890μqwertyuiopasdfghjklzxcvbnm'I flU]M.H flO");
     }
     ocrText.Clear();
     ocrText.ClearAdaptiveClassifier();
     string result = ocrText.Recognize(image);
     return result;
 }
예제 #2
0
파일: Form1.cs 프로젝트: chuixue/Gamer
 private string getNumber(Bitmap image)
 {
     UnCodebase ud = new UnCodebase(image);
     ud.DealMap2();
     image = ud.bmpobj;
     pictureBox1.Image = image;
     return ocrNumber.Recognize(image);
 }