0

I am applying pytesseract to my project and I did not get the desired results, so I started to optimize a bit ...

  • I trained the font from the website
  • I made the image binary (Black and white)
  • I put only the characters that will have the images (A to Z in uppercase)
  • Since they are single character, I put in config "--psm 10"
  • In a desperate measure, with Photoshop I raised the DPI from 72 to 600

But even with all this and having a clear isolated and visible letter, instead of the "A" I get a "T" ... Is there something where I am failing? I would really appreciate your help :)

import pytesseract
import pyautogui
import cv2
pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'



celda1 = cv2.imread('imagen.jpg')



sret=pytesseract.image_to_string(celda1, config="-c tessedit"
                                         "_char_whitelist=ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                         " --psm 10"
                                         " -l osd"
                                         " ")



print(sret)

Image

furas
  • 134,197
  • 12
  • 106
  • 148

0 Answers0