COMPUTER VISION

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.

01

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.

Annotation
Manually Annotated Label of the Car
02

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.
Resulting Plate
Resulting Plate after filtering
03

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.

Thresholded Plate
Thresholded Plate Example

CHARACTER PATCHES:

9 2 g s v h

Feature Extraction & Classification: SIFT descriptors are extracted from character patches and compared against a reference database using k-NN classification (k=3).

Visualization
Plate with Recognized Characters
04

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"]
                    
05

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.

GUI
Debug GUI showing all pipeline stages.
06

Evaluation

100%
Category 1 Accuracy
75.6%
Character Rec. Rate
90.3%
Localization (IoU > 0.5)

Future Directions

  • International Support: Expand database for diverse fonts and layouts.
  • Deep Learning: Supplement SIFT with CNNs for robustness against layout variations.
07

Team

  • Batu Eren
  • Kaan Altıntaş