user10005853
user10005853

Reputation:

pytesseract not working on digits image

I would like to use pytesseract to classify the following image:

image of number 5

but it classifies it as "T".

here's the code:

txt = pytesseract.image_to_string(image, config='-psm 10')

Upvotes: 0

Views: 144

Answers (1)

zindarod
zindarod

Reputation: 6468

image = cv2.imread('image.jpg', cv2.IMREAD_UNCHANGED);
image = cv2.bitwise_not(image)
text = pytesseract.image_to_string(image, lang='eng',config='--tessdata-dir "/tessdata/data/" --oem 2 --psm 6')
print(text)

Upvotes: 1

Related Questions