Hi,
I would like to recognize only digits with the code sample below:
try
{
System.Drawing.Bitmap imagee=new Bitmap(pictureBox1.Image);
System.Drawing.Bitmap
imagee2=AForge.Imaging.Image.Clone(imagee,System.Drawing.Imaging.PixelFormat.Format24bppRgb);
//GET IMAGE FROM FILE
//CONVERT IMAGE TO TEXT
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
ocr.SetVariable("tessedit_char_whitelist", "0123456789");
ocr.Init(@"C:\Users\197199\Documents\Visual Studio
2013\Projects\OCR\OCR\bin\Debug\tessdata", "eng", true);
List<tessnet2.Word> res=ocr.DoOCR(imagee2,Rectangle.Empty);
foreach(tessnet2.Word word in res)
{
textBox1.Text=textBox1.Text+word.Text+Environment.NewLine;
}
//CONVERT IMAGE TO TEXT
}
catch( Exception ex)
{
textBox1.Text = ex.Message;
}
Here is the image that I would like to recognize:
<https://lh3.googleusercontent.com/-2s9jnjIoWjA/VZGaIGBoF9I/AAAAAAAAC6s/1tz4TUuq6WY/s1600/Ekran%2BAl%25C4%25B1nt%25C4%25B1s%25C4%25B12.JPG>
And the outcome is:
*88*
*12*
*18*
*28*
*41*
*48*
How can I fix this? Any help please.
Thanks in advance & Best Regards.
--
You received this message because you are subscribed to the Google Groups
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tesseract-ocr/2e7c2183-63e9-49da-ac7e-c1079273199e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.