Hi,
Please find the below code is used in my programme where i have configure the tessnet2 tesseract for the reading the images. Presently the code is reading the images but the problem is that in a sentence it will read only one word means while it detect the space it is getting stop and it will return only one word. Kindly help.
Ex : If my image having the following sentences:
scenario 1: ABCDEFGHIJKLM (there is no space in the text of image)
Result : ABCDEFGHIJKLM (Reads the complete image)
scenario 2: ABCDE FGHJKLM (space after the ABCDE)
Result : ABCDE (Reads upto only ABCDE )
Kindly guide how to solve this issue.
Bitmap image = new Bitmap(path+"abcdef.jpg");
Response.Write("<script>alert('converted');</script>");
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
ocr.SetVariable("tessedit_char_whitelist", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 0123456789"); // If digit only
ocr.Init(@"E:\Dotnet\NPR\tessdata", "eng",false); // To use correct tessdata
//List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
foreach (tessnet2.Word word in result)
Console.WriteLine("{0} : {1}", word.Confidence, word.Text);
Console.ReadLine();
Response.Write("<script>alert('compltd');</script>");
Label1.Text= result[0].Text;
// Image1.ImageUrl = path;