Gate Automation — License Plate Detection
An edge AI system for real-time license plate detection and optical character recognition (ANPR), engineered for automated barrier control, high security, and automated parking management.
The Problem & Context
Manual gate security relies heavily on physical passes, paper entry logs, and human vigilance, leading to security bottlenecks during peak hours, human clerical errors, and unauthorized access vulnerabilities.
This project automated the complete access loop: from camera vehicle detection to real-time optical plate parsing, whitelist database matching, and servo barrier activation—all running on affordable, localized compute hardware.
Key Capabilities
Real-Time 30 FPS Stream
Continuous video pipeline that extracts vehicle frames, detects bounding regions of interest, and isolates plate contours on the fly.
Multi-Format OCR
Trained neural network models to recognize both standard international Latin characters and embossed regional plate formats.
Microcontroller Barrier Relay
Serial communication with Arduino actuators to trigger physical barrier gates upon verified cryptographic whitelist matching.
Audit Logging & Timestamps
Structured SQLite storage capturing timestamped vehicle logs, entry/exit durations, and captured plate image snapshots.
Hardware-Software Pipeline
Frame Acquisition
Video frames are ingested, resized, and passed through grayscale, bilateral filter smoothing, and adaptive edge thresholding.
Plate Localization
Contour approximation filters rectangular license plate regions, validating aspect ratios before feeding into the OCR model.
Verification & Trigger
The parsed string is sanitized, verified against the database whitelist, and a serial signal triggers the Arduino servo barrier.
Engineering Challenges & Solutions
Challenge 1: Variable Outdoor Lighting & Glare
Direct sunlight, shadows, and night-time headlight glare distorted character recognition. An adaptive thresholding pipeline using CLAHE (Contrast Limited Adaptive Histogram Equalization) was implemented, normalizing image contrast before segmentation.
Challenge 2: Low-Latency Inference on Constrained Hardware
Heavy deep learning models caused frame drops on mini-PCs. We optimized the model architecture to a lightweight quantized CNN (MobileNet backbone), shrinking inference time to under 80ms while maintaining 98%+ detection precision.