Skip to content

Instantly share code, notes, and snippets.

@voratham
Last active August 31, 2022 16:31
Show Gist options
  • Save voratham/bf3a720c878c9ad03db6d05f1c6d6792 to your computer and use it in GitHub Desktop.
Save voratham/bf3a720c878c9ad03db6d05f1c6d6792 to your computer and use it in GitHub Desktop.
Easy ocr read captcha simple

How to install

pipenv install opencv-python
pipenv install tesseract-ocr
pipenv install tesseract
# for mac
brew install tesseract
brew install tesseract-lang
import cv2
import pytesseract
def ocr_core(img):
text = pytesseract.image_to_string(img)
return text
img = cv2.imread('captcha.png')
print(ocr_core(img).strip())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment