I was given a school project for recognizing various kinds of CAPTCHA, and I had some difficulties with its implementation. Images of this type will be fed into input ,,. I handle them with the following code: import cv2 import pytesseract # load image fname = 'picture.png' im = cv2.imread(fname,cv2.COLOR_RGB2GRAY) pytesseract.pytesseract.tesseract_cmd = r'C:\Tesseract-OCR\tesseract.exe' im = im[0:90, 35:150] im = cv2.blur(im,(3,3)) im = cv2.threshold(im, 223 , 250, cv2.THRESH_BINARY) im = im[1] cv2.imshow('',im) cv2.waitKey(0) After all processing, the image looks like this: And at this point, I have a problem, how can I modify the image to good readability by the computer, so that instead of the wrong TAREQ. he would display the 7TXB6Q I am trying to display text from an image with the pytesseract library as follows data = pytesseract.image_to_string(im, lang='eng', config='--psm 6 --oem 3 -c tessedit_char_whitelist= ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') print(data) I am writing here hoping to get valuable advice (perhaps you know the most suitable way to get text from a picture or process the image pinned above). ) More images Continue reading...