This commit is contained in:
ItaloBorrelli 2025-05-21 16:55:23 -07:00
parent dd7f8f23ec
commit a2ee04bb90
5 changed files with 151 additions and 0 deletions

88
.gitignore vendored Normal file
View File

@ -0,0 +1,88 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# IDE-specific files
.idea/
.vscode/
*.swp
*.swo
# Personal settings
*.tmproj
*.sublime-project
*.sublime-workspace
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Logs and databases
*.log
*.sqlite
*.db
# Other
*.bak
*.orig
*.tar.gz
*.zip
*.tar.bz2
*.tar.xz
*.rar
*.7z
*.dmg
*.iso
*.lzma
*.whl

13
main.py Normal file
View File

@ -0,0 +1,13 @@
import pytesseract
from pytesseract import Output
import cv2
img = cv2.imread('image.jpg')
d = pytesseract.image_to_data(img, output_type=Output.DICT)
n_boxes = len(d['level'])
for i in range(n_boxes):
(x, y, w, h) = (d['left'][i], d['top'][i], d['width'][i], d['height'][i])
cv2.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2)
cv2.imshow('img', img)
cv2.waitKey(0)

7
requirements.in Normal file
View File

@ -0,0 +1,7 @@
pytesseract
opencv-python
numpy
pillow
flake8
black
isort

42
requirements.txt Normal file
View File

@ -0,0 +1,42 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile requirements.in
#
black==25.1.0
# via -r requirements.in
click==8.2.1
# via black
flake8==7.2.0
# via -r requirements.in
isort==6.0.1
# via -r requirements.in
mccabe==0.7.0
# via flake8
mypy-extensions==1.1.0
# via black
numpy==2.2.6
# via
# -r requirements.in
# opencv-python
opencv-python==4.11.0.86
# via -r requirements.in
packaging==25.0
# via
# black
# pytesseract
pathspec==0.12.1
# via black
pillow==11.2.1
# via
# -r requirements.in
# pytesseract
platformdirs==4.3.8
# via black
pycodestyle==2.13.0
# via flake8
pyflakes==3.3.2
# via flake8
pytesseract==0.3.13
# via -r requirements.in

1
runtime.txt Normal file
View File

@ -0,0 +1 @@
python-3.13.3