Tesseract Training - new font with only digits
<p>Hello i try to train tesseract for a new font based on the following digits: <a href="https://i.stack.imgur.com/r57e5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r57e5.png" alt="digits with transparent background" /></a></p>
<p>all digits are provided in a png file with transparent background. If i create a box file from it, train it and so on - all works fine!</p>
<p>Now the problem, same situation but i want to train tesseract based on the following image: <a href="https://i.stack.imgur.com/FDG9u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FDG9u.png" alt="digits without transparent background" /></a></p>
<p>as you can see the digits are exactly the same as well as the positions and so on. The only difference from image 1 is that i used a yellow background and from now on nothing is working anymore. I create a box file i set the same positions as for the first image:</p>
<pre><code>0 5 4 20 22 0
1 27 4 38 21 0
2 48 4 60 22 0
3 71 3 83 22 0
4 94 5 109 22 0
5 119 5 131 22 0
6 143 5 157 22 0
7 172 5 184 22 0
8 197 5 211 23 0
9 224 5 238 22 0
</code></pre>
<p>well and then i trained the box, but the resulting .tr file is completely empty i didn't stop here and completed all other steps. The resulting font is not possible to use!</p>
<p>So my question is how to train tesseract to recognize this digits no matter which background is used for them?</p>
<h1>Edit 2016-04-16:</h1>
<p>I used <a href="https://mega.nz/#F!48oX2TgJ!Xq1T3FyWgFT2VRB6Al1mOw" rel="nofollow noreferrer">ImageMagick</a> to preprocess the images and i found a command which works very well for all kind of backgrounds. So i wanted to train tesseract for this created images, but it doesn't work as i thought it would... .
First of all i created box files, where most of them were empty. Well i used a website to organize the character positions and i spent a lot of time to make the cropping perfectly! Afterwards i created the resulting .tr files and did also the other stuff to train tesseract.</p>
<p>Finally i got the &quot;traineddata&quot;, i moved the file to the &quot;tessdata&quot; directory of tesseract and used it like it should be used:</p>
<pre><code>tesseract example.jpg output -l mg
</code></pre>
<p>(i called the new font &quot;mg&quot;)</p>
<p>Okay whatever it doesn't recognize all or most of them! I opened this thread to find help, till now nobody really has a clue how to do this, sadly... . Please help me out.</p>
<p>The whole tesseract training files, which i used and created, u can find here:</p>
<p><a href="https://mega.nz/#F!48oX2TgJ!Xq1T3FyWgFT2VRB6Al1mOw" rel="nofollow noreferrer">Tesseract training directory</a> (as no zip/not compressed -&gt; view of all files of the directory)</p>