-1

I want to solve automatically captchas like this one. I have been trying processing image to make Pytesseract be able to read it, but no success.

Can you help me?

image

I try this:

import cv2
from pytesseract import image_to_string
import pytesseract




img = cv2.imread("screenshot.png")
img = cv2.resize(img, (0, 0), fx=16, fy=16)
gry = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
(h, w) = gry.shape[:2]
gry = cv2.resize(gry, (w*2, h*2))
cls = cv2.morphologyEx(gry, cv2.MORPH_CLOSE, None)
#thr = cv2.threshold(cls, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
thr = cv2.threshold(gry, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]
txt = image_to_string(,lang='eng', config='--psm 11')
cv2.imwrite('prv.png', thr)
print(txt)
gino5432
  • 1
  • 1

1 Answers1

0

It would be really hard for AI/ML to solve a captcha. They are, at their core, designed to stop OCR.

Consider reading this: https://www.cloudflare.com/learning/bots/how-captchas-work/

Orijhins
  • 142
  • 5