Answer the question
In order to leave comments, you need to log in
How to do digit recognition in python?
Hello who is watching this thread.
I want to recognize numbers from captcha in python, advise me how to do it correctly, there are always 2 digits in the captcha, always blue, I used the code below, that's all I came to, I don't know what to do next (the second photo is what it turns out):
from PIL import Image
im = Image.open("1.jfif")
im = im.convert("P")
im2 = Image.new("P",im.size,255)
im = im.convert("P")
temp = {}
for x in range(im.size[1]):
for y in range(im.size[0]):
pix = im.getpixel((y,x))
temp[pix] = pix
if pix == 174 or pix == 224: # Это код синего цвета и другого оттенка синего
im2.putpixel((y,x),0)
im2.save("output.gif")
Answer the question
In order to leave comments, you need to log in
from PIL import Image
from pytesseract import image_to_string
myText = image_to_string(Image.open("tmp/test.jpg"))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question