I am trying to read the following image(without the black bar that is from 
VS):


[image: image] 
<https://user-images.githubusercontent.com/30272427/28338164-0f345f00-6bd6-11e7-9d14-02a1a0679ca8.png>


I have tried it several time and each time it returns nothing. I am using 
the code(below).


Am I just running into a limitation of the OCR or is there something else I 
could do to try and get it to work?


Thanks,

Nathan


I am using a .NET wrapper for tesseract-ocr 3.04 found here: "
https://github.com/charlesw/tesseract";

Code I am running

`namespace` ORC
{
    class OCRFun
    {
        public void readData(Bitmap img)
        {
            try
            {
                using (var engine = new TesseractEngine(@"./tessdata", "eng", 
EngineMode.Default))
                {
                    using (img)
                    {
                        using (var page = engine.Process(img))
                        {
                            var text = page.GetText();
                            Console.WriteLine("Mean confidence: {0}", 
page.GetMeanConfidence());

                            Console.WriteLine("Text (GetText): \r\n{0}", text);
                            Console.WriteLine("Text (iterator):");
                            using (var iter = page.GetIterator())
                            {
                                iter.Begin();

                                do
                                {
                                    do
                                    {
                                        do
                                        {
                                            do
                                            {
                                                if 
(iter.IsAtBeginningOf(PageIteratorLevel.Block))
                                                {
                                                    
Console.WriteLine("<BLOCK>");
                                                }

                                                
Console.Write(iter.GetText(PageIteratorLevel.Word));
                                                Console.Write(" ");

                                                if 
(iter.IsAtFinalOf(PageIteratorLevel.TextLine, PageIteratorLevel.Word))
                                                {
                                                    Console.WriteLine();
                                                }
                                            } while 
(iter.Next(PageIteratorLevel.TextLine, PageIteratorLevel.Word));

                                            if 
(iter.IsAtFinalOf(PageIteratorLevel.Para, PageIteratorLevel.TextLine))
                                            {
                                                Console.WriteLine();
                                            }
                                        } while 
(iter.Next(PageIteratorLevel.Para, PageIteratorLevel.TextLine));
                                    } while (iter.Next(PageIteratorLevel.Block, 
PageIteratorLevel.Para));
                                } while (iter.Next(PageIteratorLevel.Block));
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Trace.TraceError(e.ToString());
                Console.WriteLine("Unexpected Error: " + e.Message);
                Console.WriteLine("Details: ");
                Console.WriteLine(e.ToString());
            }
            //Console.Write("Press any key to continue . . . ");
            //Console.ReadKey(true);

        }

    }
}

-- 
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 https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/dcfa7e61-20a4-41f3-bea0-ddeae6f61962%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to