Tesseract: Recognition simple numbers in C#
<p>I used Tesseract library (3.2.0-alpha2) from nuget. I playing also with older versions and with tessnet2 library and didn`t get any positive results for me.
For sample I have 2 images:
<a href="https://i.stack.imgur.com/mgckH.png" rel="nofollow noreferrer">multiple numbers</a>
<a href="https://i.stack.imgur.com/q7QDB.png" rel="nofollow noreferrer">single number</a></p>

<p>When I tried recognize multiple numbers I only received number '541' and did not see numbers with <strong>single char</strong> '0'. When I tried to recognize <strong>single</strong> number I also did not have any result.</p>

<p>My code sample below:</p>

<pre><code>        using (var engine = new TesseractEngine(@"tessdata/", "eng"))
        {
            engine.SetVariable("tessedit_char_whitelist", "0123456789");

            using (var img = Pix.LoadFromFile(@"multiple_numbers.bmp"))
            using (var page = engine.Process(img))
            using (var iterator = page.GetIterator())
            {
                Console.WriteLine(page.GetText()); 
                iterator.Begin();

                do
                {
                    var text = iterator.GetText(PageIteratorLevel.Word);
                    Console.WriteLine(int.Parse(text));
                }
                while (iterator.Next(PageIteratorLevel.Word));
            }
        }
</code></pre>

<p>I played with PageIteratorLevel for iterator, EngineMode for engine and PageSegMode for processing - without any success. Please help me to fix my problem. Main goal to receive all numbers from image. I can change recognition library if I will find simplest way.</p>