title: Tesseract False Space Recognition
body: <p>I'm using tesseract to recognize a serial number. This works acceptable, common problem like false recognition of zero and "O", 6 and 5, or M and H exists. 
  Beside by this tesseract adds spaces to the recognized words, where no space is in the image. The following image is recognized as <strong>"HI 3H"</strong>. </p>
  
  <p><img src="https://i.stack.imgur.com/zGYdR.png" alt="Example Image 1"></p>
  
  <p>This image results in <strong>" FBKHJ 1R1"</strong> </p>
  
  <p><img src="https://i.stack.imgur.com/t5B6N.png" alt="Example image 2"></p>
  
  <p>So tesseract added a space, although there isn't really a space in the image. 
  Is there a possibility parametrize the spacing behavior of tesseract?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I'm sorry, have forgot to add, that I also have serial numbers which include spaces. So I cannot delete all spaces inside the recognized serial number. </p>
  
  <p>For example the following image containing a space in the serial number results after tesseract recognition into: <strong>J4 F1583BB</strong>. Beside that the recognition of the characters is false, the space is recognized correct with this image. </p>
  
  <p><img src="https://i.stack.imgur.com/xL0kA.png" alt="Example image 3"></p>
  
  <p>My actual parameters for tesseract are:</p>
  
  <pre><code>tesseract::TessBaseAPI tess;
  tess.Init(NULL, "eng", tesseract::OEM_TESSERACT_ONLY);
  tess.SetPageSegMode(tesseract::PSM_SINGLE_BLOCK);
  tess.SetVariable("tessedit_char_whitelist",
              "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345789");
  
  char* out = tess.GetUTF8Text();
  string text = string(out);
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>It is notices from already existing answers, that the space between the "J" and "I" for example seems to be little more, than between the other characters. The font-type I have chosen is a Monotype Font. Reason for this is that I thought, that this helps tesseract for character recognition. Drawback of such a Monospace font-type, where every character has the same  width, is that the kernel (the space between the characters) varies. 
  See example image of following source <a href="https://en.wikipedia.org/wiki/Typeface" rel="nofollow noreferrer">Source</a></p>
  
  <p><img src="https://i.stack.imgur.com/aWDeN.jpg" alt="Proportional vs. Monospace"></p>
  
  <p>Which font type do you think, will achieve better recognition results?</p>