Free C# OCR library
Free C# OCR library
Does anyone know a good free C# OCR library ?
Re: Free C# OCR library
Hi,
I don't have a use for OCR library, but a quick google search returned this:
http://www.pixel-technology.com/freeware/tessnet2/
I don't have a use for OCR library, but a quick google search returned this:
http://www.pixel-technology.com/freeware/tessnet2/
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Free C# OCR library
Hi!
I have the Tesseract OCR Library running with Ranorex.
I ended up using the Package below:
Make sure to have the libs in the Ranorex Project. My code looks like that:
And an example call:
Make sure you have the Trainingsdata File available in the tessdata folder. If I remember right, the tessdata folder was mandatory.
I downloaded the files eng.traineddata and deu.traineddata from https://github.com/tesseract-ocr/tessdata. Make sure you use the correct version (3.0.4 in my case)
As for the accuracy of the text detection I do have to say that it works best with large texts. Small texts may be challenging and some characters and spaces are not always detected perfectly. Even if I filter all colors to have only white text on black background. But that may be different from case to case. And there should be the possibility to train it yourself - but I haven't looked into that yet.
Hope that helps!
I have the Tesseract OCR Library running with Ranorex.
I ended up using the Package below:
Make sure to have the libs in the Ranorex Project. My code looks like that:
Code: Select all
//---------------------------------------------------------------------
/// <summary>
/// Read graphical Text with the Tesseract OCR module
/// </summary>
[UserCodeMethod]
public static string OCRRead(Bitmap bmp, string whitelist,string enginePath)
{
try{
Tesseract.Pix px = PixConverter.ToPix(bmp);
TesseractEngine engine = new TesseractEngine(enginePath, "eng", Tesseract.EngineMode.Default);
engine.DefaultPageSegMode=Tesseract.PageSegMode.Auto;
//engine.SetVariable("classify_bln_numeric_mode",0);
if (whitelist!="")
{
engine.SetVariable("tessedit_char_whitelist",whitelist);
}
Tesseract.Page pg = engine.Process(px);
string text = pg.GetText();
return text;
} catch(Exception ex) {
Debug.WriteLine("EnginePath: "+enginePath);
Debug.WriteLine("Whitelist: "+whitelist);
throw new ExceptionOcrImage(ex.ToString(),bmp);
}
}
Code: Select all
Bitmap bmp ; // bitmap, e.g. from screenshot
string whitelist = "0123456789:._-/| ";
string [email protected]"D:\tesseract\DataFiles\tessdata";
string ocrDatetime = OCRRead(bmp, whitelist, tesseractFile);
I downloaded the files eng.traineddata and deu.traineddata from https://github.com/tesseract-ocr/tessdata. Make sure you use the correct version (3.0.4 in my case)
As for the accuracy of the text detection I do have to say that it works best with large texts. Small texts may be challenging and some characters and spaces are not always detected perfectly. Even if I filter all colors to have only white text on black background. But that may be different from case to case. And there should be the possibility to train it yourself - but I haven't looked into that yet.
Hope that helps!
You do not have the required permissions to view the files attached to this post.
Re: Free C# OCR library
It messed up the pictures in my earlier post.
Libs picture should be:
Libs picture should be:
You do not have the required permissions to view the files attached to this post.