title: Tesseract detecting 1 and 0 as L and O
body: <p>In this image tesseract is detecting the text as <code>LOOOPCS</code>  but it is <code>1000PCS</code>. Command I am using is </p>
  
  <pre><code>tesseract "item_04.png" stdout --psm 6
  </code></pre>
  
  <p>I have tried all psm values 0 to 13   </p>
  
  <p><a href="https://i.stack.imgur.com/ZAML9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZAML9.png" alt="actual image"></a></p>
  
  <p>As per suggestions by other blogs and questions on SO and internet following clipping of image as well as thresholding is also tried.</p>
  
  <p><a href="https://i.stack.imgur.com/w3eYR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w3eYR.png" alt="after clipping and thresholding"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Fx0af.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fx0af.png" alt="after clipping only"></a>   </p>
  
  <p>Also tried <code>-c tessedit_char_whitelist=PCS0123456789</code>  but that gives <strong>00PCS</strong>.
  But I am not getting 1000PCS. Can someone try these and let me know what am I missing?</p>
  
  <p>Edit:<br>
  As per suggestion given by @nathancy, tried using - <code>cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU</code> which worked on this 1 and 0 but failed for below image. It is being detected as LL8gPcs:<br>
  <a href="https://i.stack.imgur.com/SIasK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SIasK.png" alt="another failing image"></a></p>