#GRIPJAN21
import cv2 import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
image = cv2.imread("Distorted.PNG")
def get_grayscale(image): return cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
def thresholding(image): return cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 31, 11)
gray = get_grayscale(image) thresh = thresholding(gray)
text = pytesseract.image_to_string(gray) print(text) cv2.imshow("image", gray) cv2.waitKey(0)