License Plate Recognition
An automatic license plate recognition system built in Python. The pipeline handles localization, segmentation, and character recognition using SIFT descriptors and k-NN classification.
Dataset
Ground truth data is generated by manually annotating data. The dataset is split with 60% for training and 40% for evaluation. The allocation is random to preserve diversity.
Localization
The localization pipeline isolates the plate based on color characteristics.
- Color Segmentation: Hue, saturation, and value parameters were tweaked to mask the plate color correctly.
- Morphology: Opening and closing operations with specific kernels to reduce noise and fill holes.
- Contour Fitting: Fitting the shape based on aspect ratio and filtering to find the correct bounding box.
Recognition Pipeline
After localization, the image is resized, and an Adaptive Threshold is applied to binarize it based on lighting conditions.
Contours are then detected and filtered by aspect ratio and solidity. Characters are extracted as 32x32 patches.
CHARACTER PATCHES:
Feature Extraction & Classification: SIFT descriptors are extracted from character patches and compared against a reference database using k-NN classification (k=3).
System Flowchart
The system defines scenes using Levenshtein distance to detect plate changes and applies majority voting across frames.
flowchart LR
A["Start"] --> B["Annotate"]
B --> C["Localization"]
C --> D["White Plate Algo"]
C --> E["Yellow Plate Algo"]
D --> F["Evaluate"]
E --> F
F --> G["Edge Detection"]
G --> H["Crop Plate"]
H --> I["Pre-Process"]
I --> J{"Quality OK?"}
J -- "Yes" --> K["Default Enhance"]
J -- "No" --> L["Low-Qual Enhance"]
K --> M["Contours"]
L --> M
M --> N["Color Mask"]
N --> O["Ref Matching"]
O --> P{"Valid Length?"}
P -- "No" --> Q["Ignore"]
P -- "Yes" --> R["Result"]
User Interface
A custom GUI was built to visualize the pipeline in real-time, showing the localized bounding box, the thresholded segmentation view, and the final recognized string.
Evaluation
Future Directions
- International Support: Expand database for diverse fonts and layouts.
- Deep Learning: Supplement SIFT with CNNs for robustness against layout variations.
Team
- Batu Eren
- Kaan Altıntaş