Skip to content

Instantly share code, notes, and snippets.

@suryak-cs
Last active March 18, 2021 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suryak-cs/71c79b0c96b7222cc6df3297cb8bc806 to your computer and use it in GitHub Desktop.
Save suryak-cs/71c79b0c96b7222cc6df3297cb8bc806 to your computer and use it in GitHub Desktop.
try:
from PIL import Image
except ImportError:
import Image
import pytesseract
def ocr_extraction(filename):
"""
This function will handle the core OCR processing of images.
"""
text = pytesseract.image_to_string(Image.open(filename))
return text
@suryak-cs
Copy link
Author

OCR Extraction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment