Python program to extract text from images (OCR - Optical Character Recognition), using opencv and pytesseract. Images can be jgp or png, from various sources: print screen, scanned, handwritten/drawn, typed, etc.
PT-BR: programa em python para obter textos de imagens (OCR - Optical Character Recognition), usando opencv e pytessetact. As imagens podem ser jgp ou png, oriundas de várias fontes: print screen, digitalizadas, escritas / desenhadas à mão, datilografadas, etc.
-
Python Opencv: pip install opencv-python More: https://pypi.org/project/opencv-python/
-
Pytesseract: pip install pytesseract Info: Python-tesseract requires python 2.6+ or python 3.x More: https://github.com/h/pytesseract
git clone https://github.com/mendes79-my-projects/extract-text-from-images
-
Open the OCR_example.py file in the python editor of your choice, for example VS Code;
-
Place the image with the text to be extracted in the same folder as OCR_example.py;
-
Enter the image file name in the location indicated in the code;
-
Run the program. The text extracted from the image will appear in the command prompt.
-
Abra o arquivo OCR_exemplo.py no editor python de sua preferência, por exemplo VS Code;
-
Coloque a imagem com o texto a ser extraído na mesma pasta do OCR_exemplo.py;
-
Digite o nome do arquivo da imagem no local indicado no código;
-
Execute o programa. O texto extraído da imagem aparecerá no prompt de comando.
Example image / imagem de exemplo
Result / Resultado
New projects coming soon!