title: OCR small image with python
body: <p>i need to ocr small images with python 2.7, contains a price. </p>
  
  <p><a href="https://i.stack.imgur.com/rvepr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rvepr.png" alt="enter image description here"></a></p>
  
  <p>as you can see the image is very small , and contains some values.</p>
  
  <p>my goal is to decode to : 654.10</p>
  
  <p>i try with tesseract but i had no luck.</p>
  
  <pre><code>import pytesseract
  print(pytesseract.image_to_string(Image.open('example.png') , lang='eng', boxes=False,config='--psm 10 --eom 3 -c tessedit_char_whitelist=€0123456789'))
  </code></pre>
  
  <p>i get :</p>
  
  <pre><code>€553 1
  </code></pre>
  
  <p>i try with an online converter and work like a charm (<a href="https://convertio.co/it/ocr/" rel="nofollow noreferrer">https://convertio.co/it/ocr/</a>) so i think it will be possibile.</p>
  
  <p>someone have a better idea ?</p>
  
  <p>Thanks</p>
  
  <p>(sorry for my bad english)</p>
  
  <p>UPDATE :</p>
  
  <p>i try to threshold the image without any luck ... again ...</p>
  
  <pre><code>import cv2
  img = cv2.imread('cropped.png')
  grayscaled = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  retval, threshold2 = cv2.threshold(grayscaled,125,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
  cv2.imwrite('threshold.jpeg',threshold2)
  print(pytesseract.image_to_string(Image.open('threshold.jpeg') , lang='eng', boxes=False,config='--psm 10 --eom 3 -c tessedit_char_whitelist=0123456789'))
  </code></pre>
  
  <p>output : 553 0
  image output : <a href="https://i.stack.imgur.com/R04PA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R04PA.jpg" alt="enter image description here"></a></p>
  
  <p>ps. i cropped the original image deleting the € sign ... but still got the error.</p>
  
  <p>Thanks</p>