Exemple #1
1
 private static void Tesseract64()
 {
     Ocr64 ocr = new Ocr64();
     Assert.NotNull(ocr);
     using(Bitmap bmp = new Bitmap(pTestImagePath))
     {
         Assert.NotNull(bmp);
         tessnet2_64::tessnet2.Tesseract tessocr = new tessnet2_64::tessnet2.Tesseract();
         Assert.NotNull(tessocr);
         tessocr.Init(null, "eng", false);
         tessocr.GetThresholdedImage(bmp, Rectangle.Empty).Save(FileUtils.CombineWinPath(pTempDirectory, Guid.NewGuid().ToString()) + ".bmp");
         ocr.DoOcrMultiThread(bmp, "eng");
         List<tessnet2_64::tessnet2.Word> words = Ocr64.DoOcrNormal(bmp, "eng");
         Assert.NotNull(words);
     }
 }
Exemple #2
0
		static void Main64()
		{
			// Code usage sample
			Ocr64 ocr = new Ocr64();
			using(Bitmap bmp = new Bitmap(@"D:\temp\ocr\b1.bmp"))
			{
				tessnet2_64::tessnet2.Tesseract tessocr = new tessnet2_64::tessnet2.Tesseract();
				tessocr.Init(null, "eng", false);
				tessocr.GetThresholdedImage(bmp, Rectangle.Empty).Save("c:\\temp\\" + Guid.NewGuid() + ".bmp");
				// Tessdata directory must be in the directory than this exe
				Console.WriteLine("Multithread version");
				ocr.DoOcrMultiThread(bmp, "eng");
				Console.WriteLine("Normal version");
				Ocr64.DoOcrNormal(bmp, "eng");
			}
		}