|
| 1 | +# MRZ Scanner GUI |
| 2 | + |
| 3 | +A GUI application for MRZ (Machine Readable Zone) recognition and parsing with portrait detection and cropping, built with PySide6 and Dynamsoft Capture Vision SDK. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Multiple Input Sources** |
| 8 | + - Single image file |
| 9 | + - Batch processing of image folders |
| 10 | + - Real-time camera capture |
| 11 | + - Drag-and-drop support |
| 12 | + - Clipboard paste support |
| 13 | + |
| 14 | +- **MRZ Recognition & Parsing** |
| 15 | + - Reads MRZ from passports and ID cards (TD1, TD2, TD3 formats) |
| 16 | + - Parses document information: |
| 17 | + - Document type and ID |
| 18 | + - Surname and given name |
| 19 | + - Nationality and issuing country |
| 20 | + - Date of birth and expiry date |
| 21 | + - Gender |
| 22 | + - Displays raw MRZ text and parsed results |
| 23 | + |
| 24 | +- **Portrait Detection** |
| 25 | + - Automatically detects portrait/face region on passports |
| 26 | + - Visual overlay of portrait zone on the image |
| 27 | + - Export processed passport image with document normalization |
| 28 | + |
| 29 | +- **Visual Overlays** |
| 30 | + - Document boundary detection (blue) |
| 31 | + - MRZ location highlighting (green) |
| 32 | + - Portrait zone marking (orange) |
| 33 | + |
| 34 | +## Prerequisites |
| 35 | + |
| 36 | +- Python 3.9+ |
| 37 | +- Valid [Dynamsoft License](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform) |
| 38 | + |
| 39 | +## Installation |
| 40 | + |
| 41 | +1. Install dependencies: |
| 42 | + |
| 43 | + ```bash |
| 44 | + pip install -r requirements.txt |
| 45 | + ``` |
| 46 | + |
| 47 | +2. Replace the license key in the code with your own: |
| 48 | + |
| 49 | + ```python |
| 50 | + error_code, error_message = LicenseManager.init_license( |
| 51 | + "YOUR_LICENSE_KEY_HERE" |
| 52 | + ) |
| 53 | + ``` |
| 54 | + |
| 55 | +## Usage |
| 56 | + |
| 57 | +Run the application: |
| 58 | + |
| 59 | +```bash |
| 60 | +python mrz_scanner_gui.py |
| 61 | +``` |
| 62 | + |
| 63 | +### Input Methods |
| 64 | + |
| 65 | +1. **Load File/Folder**: Click "Load File/Folder" button to select an image or folder |
| 66 | +2. **Drag and Drop**: Drag image files directly onto the display area |
| 67 | +3. **Clipboard Paste**: Copy an image and click "Paste from Clipboard" |
| 68 | +4. **Camera**: Select "Camera" source and click "Start Camera" for real-time scanning |
| 69 | + |
| 70 | +### Exporting Passport Image |
| 71 | + |
| 72 | +After processing a passport image, click "Export Passport" to save the normalized document image (requires valid captured result). |
| 73 | + |
0 commit comments