You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ocr-tesseract-wrapper

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ocr-tesseract-wrapper

Tiny wrapper around pytesseract with image preprocessing and OCR configurations

0.0.8
pipPyPI
Maintainers
1

ocr-tesseract-wrapper

Tiny wrapper around pytesseract with image preprocessing and OCR configurations

Requirements

  • tesseract installed (https://github.com/tesseract-ocr/tesseract/wiki#installation)

Basic usage

from ocr_tesseract_wrapper import OCR
ocr_tool = OCR()
results = ocr_tool.ocr([image])  # where image is Pillow image or string image path

Advanced usage

from ocr_tesseract_wrapper import OCR
ocr_tool = OCR()
results = ocr_tool.ocr([image1, image2], config=[])
"""
where config parameter is list of additional configs and restrictions for each of the 
images given to the OCR. for instance: [None, 'tessedit_char_whitelist=0123456789'] will 
apply no restriction to the first but will only return numeric characters from the second image.
""" 

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts