Fadly31337

Bypass Captcha using 10 lines of code with Python

Oct 22nd, 2020 (edited)
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import cv2.cv as cv
  2. import tesseract
  3. gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
  4. cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
  5. api = tesseract.TessBaseAPI()
  6. api.Init(".","eng",tesseract.OEM_DEFAULT)
  7. api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
  8. api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
  9. tesseract.SetCvImage(gray,api)
  10. print api.GetUTF8Text()
Add Comment
Please, Sign In to add comment