NLP-image-to-text
NLP-image-to-text copied to clipboard
code to extract text from images
NLP-image-to-text
Code to extract text from images
pip install -r requirements.txt
If you encounter file not found error as below:
FileNotFoundError: [Errno 2] No such file or directory: 'tesseract'
Run the following command
brew install tesseract
Then run the image-to-text.py as below:
python image-to-text.py <relative filepaths separated by spaces>
We observe that for clean inputs the accuracy is high. See input 2. Noisy input may not have the same effect!
Some sample inputs and outputs:
Input:
Output:
DON’T
WATCH THE
CLOCK;
KEEP GOING.
SAM LEVENSON
/
/
7 J .- - flCESScom
Input:
Output:
How to recognize text from image with Python OpenCv OCR ?
Input:
Output:
A negative mind
will nevergive you
a positivevli‘fe.
Credit: Base code has been taken from Tram Vo Minh's blog. And modifications have been performed on that!