Exemple #1
0
 private static void RunGoogleOcrTests()
 {
     while (true)
     {
         OcrEngine abbyy = OcrEngine.Create(OcrEngineType.Google);//OcrEngineType.ABBYY);
         MessageBox.Show("Installed: " + abbyy.IsInstalled);
         Stopwatch sw1 = new Stopwatch();
         sw1.Start();
         if (abbyy.IsInstalled)
         {
             OcrResult result = abbyy.LoadFile("image1.png", "ko");
             if (result != null)
             {
                 sw1.Stop();
                 if (!string.IsNullOrEmpty(result.Text))
                 {
                     Clipboard.SetText(result.Text);
                 }
                 MessageBox.Show(result.ResultType + Environment.NewLine + result.Text + " " + sw1.Elapsed);
             }
         }
     }
 }
Exemple #2
0
 private static void RunNicomsoftOcrTests()
 {
     while (true)
     {
         OcrEngine engine = OcrEngine.Create(OcrEngineType.Nicomsoft);
         MessageBox.Show("Installed: " + engine.IsInstalled);
         Stopwatch sw1 = new Stopwatch();
         sw1.Start();
         if (engine.IsInstalled)
         {
             OcrResult result = engine.LoadFile("image1.png", "ko");
             if (result != null)
             {
                 sw1.Stop();
                 if (!string.IsNullOrEmpty(result.Text))
                 {
                     Clipboard.SetText(result.Text);
                 }
                 MessageBox.Show(result.ResultType + Environment.NewLine + result.Text + " " + result.Error + " " + sw1.Elapsed);
             }
         }
     }
 }
Exemple #3
0
        public static void LoadFileAsync(OcrEngineType type, string file, string language, Action <OcrResult> callback)
        {
            OcrEngine ocrEngine = Create(type);

            ocrEngine.LoadFile(file, language);
        }
Exemple #4
0
        public static OcrResult LoadFile(OcrEngineType type, string file, string language)
        {
            OcrEngine ocrEngine = Create(type);

            return(ocrEngine.LoadFile(file, language));
        }