ocr = new Ocr(); using (Bitmap bmp = new Bitmap(@"C:\OCR\IMG.jpg")) { tessnet2.Tesseract tessocr = new tessnet2.Tesseract(); tessocr.Init(null, "eng", false); //Application exit after this line. tessocr.GetThresholdedImage(bmp, Rectangle.Empty).Save("elo.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine("dsadasdasd"); ocr.DoOCRNormal(bmp, "eng"); } public class Ocr { public void DumpResult(List<tessnet2.Word> result) { foreach (tessnet2.Word word in result) { Console.WriteLine("{0} {1}", word.Confidence, word.Text); } } public List<tessnet2.Word> DoOCRNormal(Bitmap image, string lang) { tessnet2.Tesseract ocr = new tessnet2.Tesseract(); ocr.Init(null, lang, false); List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty); DumpResult(result); return result; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)