Process MRZ
Extracts and recognizes Machine Readable Zone (MRZ) from passport and ID document images using ABBYY FineReader Engine.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
Inputs
- Path - Path to the image file containing the MRZ (passport or ID document).
- Out Path - Path where the extracted MRZ data will be exported.
Options
- Export Format - Export format for MRZ data (default: XML). Options:
- XML - Structured XML format
- CSV - Comma-separated values
- JSON - JSON format
- Other formats depending on ABBYY Engine version
Outputs
This node produces an output file at the specified Out Path location containing structured MRZ data.
How It Works
The Process MRZ node extracts structured personal information from MRZ areas. When executed, the node:
- Validates the input file exists
- Validates export format is selected
- Creates an ABBYY FRDocument and adds the input image
- Extracts the MRZ data from the first page
- Validates MRZ was found in the image
- Exports the parsed MRZ data in the selected format
- Saves the output to the specified path
Requirements
- Valid ABBYY FineReader Engine installation with MRZ support
- Valid ABBYY license
- Input image containing a visible, complete MRZ area
- Standard passport (TD-3), ID card (TD-1), or visa (TD-2) format
- Output directory must exist and be writable
Error Handling
The node will return specific errors in the following cases:
ErrNotFound- Input image file not found, or MRZ not detected in the image. Error message indicates which case occurred.ErrInvalidArg- Export format is empty or invalid.
Usage Example
Scenario: Extract passport data to XML
Process MRZ node:
- Path: "C:/passports/passport_scan.jpg"
- Out Path: "C:/data/passport_data.xml"
- Export Format: XML
Scenario: Process ID card to JSON
Process MRZ node:
- Path: "C:/ids/drivers_license.png"
- Out Path: "C:/data/id_data.json"
- Export Format: JSON
Scenario: Batch passport processing
Loop through passport images:
1. Process MRZ node:
- Path: {{ $.passport_image }}
- Out Path: {{ $.output_folder }}/{{ $.passport_id }}.xml
- Export Format: XML
2. Parse XML to extract fields
3. Store in database
Common Use Cases
- Airport Check-in - Extract passenger information from passports
- Hotel Registration - Capture guest details from ID documents
- KYC Verification - Identity verification for banking and financial services
- Border Control - Process travel documents at immigration
- Visa Applications - Extract applicant data from passport MRZ
- Document Verification - Validate passport and ID card authenticity
- Customer Onboarding - Quick registration using ID documents
- Access Control - Identity verification for secure facilities
MRZ Document Types
Passport (TD-3)
- Two lines of 44 characters each
- Most common international travel document
- Contains full personal and document information
ID Card (TD-1)
- Three lines of 30 characters each
- Used for national ID cards and driver's licenses
- Compact format with essential information
Visa (TD-2)
- Two lines of 36 characters each
- Machine readable visa stickers in passports
- Travel authorization information
Extracted Information
The MRZ data typically includes:
Document Information
- Document type (P=Passport, I=ID Card, V=Visa)
- Issuing country code (3-letter ISO code)
- Document number
- Personal number / Optional data
Personal Information
- Surname (family name)
- Given names (first and middle names)
- Date of birth (YYMMDD format)
- Sex/Gender (M/F)
- Nationality (3-letter code)
Validity Information
- Date of expiry (YYMMDD format)
- Check digits for data validation
Tips and Best Practices
- Image Capture:
- Ensure entire MRZ is visible in the image
- Capture straight-on (avoid angled shots)
- Use good lighting without glare or shadows
- Keep MRZ horizontal and readable
- Include some margin above and below MRZ
- Use at least 300 DPI resolution
- Document Handling:
- Keep document flat during capture
- Clean any dirt or marks from MRZ area
- Avoid worn or damaged documents
- Ensure adequate contrast
- MRZ should be unobscured
- Image Quality:
- MRZ uses specialized OCR-B font
- High contrast is critical for accuracy
- Focus should be sharp on MRZ text
- Avoid curved or folded documents
- No fingers or objects blocking MRZ
- MRZ Location:
- Passports: Bottom of photo page
- ID Cards: Usually on back side
- Visas: Bottom of visa sticker
- Include MRZ plus some surrounding area
- Export Format:
- XML provides complete structured data
- JSON is easier for web applications
- CSV for spreadsheet imports
- Choose based on downstream processing needs
- Data Validation:
- MRZ includes check digits for validation
- Cross-reference extracted data with visual zone
- Verify date formats and ranges
- Check country codes against valid list
- Validate document number format
- Error Handling:
- Enable Continue On Error for batch processing
- Retry with better image if MRZ not found
- Verify document has MRZ (some old docs don't)
- Check for complete MRZ visibility
- Log failures for manual review
- Security & Privacy:
- Handle passport/ID data securely
- Encrypt stored images and extracted data
- Follow data protection regulations (GDPR, etc.)
- Implement access controls
- Secure deletion of temporary files
- Comply with data retention policies
- Integration:
- Parse exported file to extract individual fields
- Validate against government databases if available
- Auto-fill registration forms
- Flag suspicious or invalid documents
- Link to image for audit trail
- Performance:
- MRZ extraction is fast (typically 1-3 seconds)
- No language selection needed (MRZ is standardized)
- Can process batches sequentially
- Consider parallel processing for large volumes
- Common Issues:
- Worn MRZ may not read correctly
- Poor lighting causes recognition errors
- Curved documents (open passport) reduce accuracy
- Dirt, stamps, or stickers on MRZ interfere
- Very old documents may have faded text
- Troubleshooting:
- If MRZ not found, check image includes entire MRZ
- Improve lighting and contrast
- Flatten document completely
- Clean MRZ area
- Increase image resolution
- Try different angle or lighting