Search code examples
pythonimagetexttesseractpython-tesseract

Why tesseract is not recognising text from this image?


I am trying to get the text from these images. When I run the code is below, in the first picture recognize "Legendary x" but the second picture doesnt recognize anything. I dont undertand what is wrong

def get_text(image, coord):
   im = Image.open(image)
   image_cropped = crop_text(im, coord)
   text = pytesseract.image_to_string(image_cropped, config='--psm 6')
   return text.replace('\n', '').replace('\f', '')

First picture Second picture


Solution

  • Please read the tesseract docs: https://github.com/tesseract-ocr/tessdoc/blob/main/ImproveQuality.md