How konstantint/passporteye works
PassportEye recognizes and parses machine-readable zones (MRZs) from document images and supported PDFs. A caller or CLI submits an image; the image pipeline loads it, detects candidate regions, extracts each ROI, sends it to Tesseract, and parses OCR text into validated MRZ fields. The pipeline also supports ROI output and intermediate results; the CLI offers tabular or JSON output and a separate ROI-extraction command. PDF support is limited to finding an embedded JPEG. Relationships below follow the shown imports/calls and README; unsampled implementation details are not expanded.
Main entry points: image.py MRZ pipeline · scripts.py MRZ CLI · __init__.py Python API · ocr.py Tesseract adapter
Components 17
Interfaces
- MRZ CLI
passporteye/mrz/scripts.py - ROI CLI
passporteye/mrz/scripts.py - Python API
passporteye/__init__.py
Image analysis
- MRZ pipeline
passporteye/mrz/image.py - Image loader
passporteye/mrz/image.py - PDF JPEG extraction
passporteye/util/pdf.py - Image scaling
passporteye/mrz/image.py - Image binarization
passporteye/mrz/image.py - MRZ box locator
passporteye/mrz/image.py - ROI extraction
passporteye/mrz/image.py
Recognition
- Tesseract adapter
passporteye/util/ocr.py - Candidate evaluation
passporteye/mrz/image.py - MRZ parser
passporteye/mrz/text.py
Shared utilities
- Rotated geometry
passporteye/util/geometry.py - Lazy pipeline engine
passporteye/util/pipeline.py
Other components
- Python caller
- Tesseract
Connections 20
- Python caller → Python API: calls read_mrz
README.rst - Python caller → MRZ CLI: runs
README.rst - MRZ CLI → MRZ pipeline: processes image
passporteye/mrz/scripts.py - ROI CLI → MRZ pipeline: requests ROIs
passporteye/mrz/scripts.py - Python API → MRZ pipeline: creates
passporteye/__init__.py - MRZ pipeline → Lazy pipeline engine: extends
passporteye/mrz/image.py - MRZ pipeline → Image loader: registers
passporteye/mrz/image.py - MRZ pipeline → Image scaling: registers
passporteye/mrz/image.py - MRZ pipeline → Image binarization: registers
passporteye/mrz/image.py - MRZ pipeline → MRZ box locator: registers
passporteye/mrz/image.py - MRZ pipeline → Candidate evaluation: registers
passporteye/mrz/image.py - MRZ pipeline → ROI extraction: registers
passporteye/mrz/image.py - Image loader → PDF JPEG extraction: extracts PDF JPEG
passporteye/mrz/image.py - MRZ box locator → Rotated geometry: builds rotated boxes
passporteye/mrz/image.py - ROI extraction → Rotated geometry: extracts box region
passporteye/util/geometry.py - Candidate evaluation → ROI extraction: evaluates candidates
passporteye/mrz/image.py - ROI extraction → Tesseract adapter: recognizes ROI
passporteye/mrz/image.py - Tesseract adapter → Tesseract: runs OCR
passporteye/util/ocr.py - Candidate evaluation → MRZ parser: parses OCR text
passporteye/mrz/image.py - MRZ CLI → MRZ parser: formats parsed fields