License Plate OCR Investigation System
A comprehensive license plate detection and OCR system for law enforcement investigations. Organized by projects, with multi-image cross-validation for improved accuracy.
Project Structure
Each investigation follows this structure:
projects/
├── 001/ # Investigation 001
│ ├── raw/ # Source images of the vehicle
│ │ ├── image1.jpg # Multiple angles/lighting
│ │ ├── image2.jpg # of the same vehicle
│ │ └── image3.jpg
│ ├── annotations/ # Human annotations (JSON)
│ │ ├── image1.json # License plate locations
│ │ └── image2.json
│ ├── debug/ # Debug images and parameters
│ │ ├── detection_parameters.json
│ │ └── [debug images]
│ ├── output/ # Analysis results
│ │ ├── investigation_report.json
│ │ ├── investigation_summary.txt
│ │ └── top_candidates.txt
│ └── project.json # Project metadata
└── 002/ # Investigation 002
└── ...
Quick Start
1. Create a New Investigation
python project_manager.py create "Maryland license plate investigation - Case #2024-001"
This automatically creates the next project ID and folder structure.
2. Add Your Images
Copy your multiple images of the same vehicle to the projects/001/raw/ folder.
3. Annotate License Plates
python project_manager.py annotate 1
Draw bounding boxes around license plates in each image.
4. Run Comprehensive Analysis
python project_manager.py analyze 1
This runs the complete analysis pipeline:
- Automatic annotation analysis (generates detection parameters)
- Multi-image cross-validation
- Super resolution enhancement
- Character frequency analysis
- Combined ranking and reporting
Tools
Project Manager (project_manager.py)
create "description": Create new project (auto-increments ID)annotate <id>: Run annotation tool (skips already annotated images)annotate <id> --reannotate: Reannotate all images (shows existing annotations)analyze <id>: Run comprehensive analysis (includes automatic annotation analysis)list: List all projectsinfo <id>: Show project details
Annotation Tool (annotate_project.py)
- Interactive tool to mark license plate regions
- Generates detection parameters from annotations
- Use
--analyzeflag to process annotations
Detection System (detect_project.py)
- Comprehensive detection using multiple methods
- Saves debug images and results
- Generates ranked candidate list
Multi-Image Analysis (multi_image_analysis.py)
- Cross-validates candidates across multiple images
- Character pattern analysis for higher accuracy
- Specialized for multiple images of same vehicle
Super Resolution Analysis (super_resolution_analysis.py)
- Extracts annotated license plate regions
- Normalizes dimensions and applies super resolution
- Advanced enhancement techniques (EDSR, frequency domain, etc.)
- Enhanced OCR on super-resolved regions
Output Files
output/analysis_results.txt
Technical results summary with ranked candidates and frequency analysis.
output/comprehensive_analysis.json
Detailed JSON with all analysis results, including:
- Ranked candidates with scores
- Individual image results
- Cross-image analysis
output/super_resolution_report.json
Super resolution analysis results (if annotations available):
- Enhanced candidates from normalized regions
- Method breakdown and confidence scores
- Super resolution technique comparison
debug/detection_parameters.json
Optimized detection parameters (if annotations were provided).
Example Investigation Workflow
# Create investigation (auto-increments to next available project ID)
python project_manager.py create "Vehicle pursuit - Case #2024-001"
# Copy your images to the raw folder
# cp front_view.jpg rear_view.jpg side_view.jpg projects/001/raw/
# Annotate license plates
python project_manager.py annotate 1
# Run comprehensive analysis
python project_manager.py analyze 1
# Check final results
cat projects/001/output/analysis_results.txt
Requirements
- Python 3.7+
- OpenCV
- NumPy
- Pytesseract
- PIL (Pillow)
Notes
- The system uses aggressive detection by default
- Annotations improve detection accuracy significantly
- Debug images are saved for troubleshooting
- Results are automatically ranked by Maryland license plate likelihood
Description
Languages
Python
100%