Click here to Skip to main content
15,889,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.





XML
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;
Posted
Updated 3-Feb-15 1:07am
v2

1 solution

You should talk to the people who produce this package[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900