tesseract image_to_data code example
Example 1: pytesseract
pip install pytesseract
Example 2: text recognition python library
import cv2
import pytesseract
img = cv2.imread('image.jpg')
# Adding custom options
custom_config = r'--oem 3 --psm 6'
pytesseract.image_to_string(img, config=custom_config)