Tesseract, while being "good" is not the best. For critical applications I tend to use EasyOCR so maybe give that a shot.
It's free and opensource as well.
Here's an example:
import easyocr
reader = easyocr.Reader(['en']) # this needs to run only once to load the model into memory
result = reader.readtext('chinese.jpg')
print(result)
Answer from divine architect on Stack Overflowpython - Extract text from image using tessaract - Stack Overflow
python - Extracting text out of images - Stack Overflow
Just a quick question. Any idea on how to extract text from an image file?
Is It Possible To Extract Text From An Image Without Machine Learning?
How do I use pytesseract to extract text from an image?
Install the pytesseract and Pillow libraries, open the image using PIL.Image.open(), and pass it to pytesseract.image_to_string() to extract text.
What is pytesseract in Python?
pytesseract is a Python wrapper for the open source Tesseract OCR engine. It enables developers to extract text from images using a simple Python API.
How do I install Tesseract OCR in Python?
To install Tesseract OCR, download the installer from GitHub for Windows(opens in a new tab), use brew install tesseract on macOS, or run sudo apt install tesseract-ocr on Debian/Ubuntu.
Tesseract, while being "good" is not the best. For critical applications I tend to use EasyOCR so maybe give that a shot.
It's free and opensource as well.
Here's an example:
import easyocr
reader = easyocr.Reader(['en']) # this needs to run only once to load the model into memory
result = reader.readtext('chinese.jpg')
print(result)
- Read the docs: https://github.com/tesseract-ocr/tessdoc/blob/main/ImproveQuality.md
- Adjust image according docs:
- Resize image to meet optimal letter size
- Invert image (dark letters on bright background
- (optional) convert to grayscale (or binarize)

tesseract modified_image_based_on_docs.png - --psm 6
CW9-1Y
from PIL import Image
import pytesseract
import argparse
import cv2
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="Path to the image")
args = vars(ap.parse_args())
# load the image and convert it to grayscale
image = cv2.imread(args["image"])
cv2.imshow("Original", image)
# Apply an "average" blur to the image
blurred = cv2.blur(image, (3,3))
cv2.imshow("Blurred_image", blurred)
img = Image.fromarray(blurred)
text = pytesseract.image_to_string(img, lang='eng')
print (text)
cv2.waitKey(0)
As as result i get = "Stay: in an Overwoter Bungalow $3»"
What about using Contour and taking unnecessary blobs from it ? might work
Try this one -
import os
from PIL import Image
import cv2
import pytesseract
import ftfy
import uuid
filename = 'uTGi5.png'
image = cv2.imread(os.path.join(filename))
gray = cv2.threshold(image, 200, 255, cv2.THRESH_BINARY)[1]
gray = cv2.resize(gray, (0, 0), fx=3, fy=3)
gray = cv2.medianBlur(gray, 9)
filename = str(uuid.uuid4())+".jpg"
cv2.imwrite(os.path.join(
filename), gray)
config = ("-l eng --oem 3 --psm 11")
text = pytesseract.image_to_string(Image.open(os.path.join(
filename)), config=config)
text = ftfy.fix_text(text)
text = ftfy.fix_encoding(text)
text = text.replace('-\n', '')
print(text)