To OCR (Optical Character Recognition) ROI (Region of Interest) of a scan in Python, you can follow the below steps:
Install required packages: pytesseract, opencv-python
main.py39 chars2 lines
Import the necessary modules:
main.py30 chars3 lines
Load the input image:
main.py30 chars2 lines
Extract the ROI from the image:
main.py60 chars6 lines
In the above code, x
, y
, w
, and h
are the position and size of the ROI.
Apply OCR on the ROI:
main.py52 chars3 lines
This will print the recognized text from the ROI.
gistlibby LogSnag