Real-Time License Plate Recognition on Android
My senior design project implements a mobile system capable of detecting and reading license plates in real time using a smartphone camera. It combines classical image processing with machine learning tools(MLKIT) to create a on-device solution.
Main app screen showing detected plate and OCR result.
Project Overview
The goal of this senior design project is to create an application capable of detecting a car's license plate and reading it in real time directly from the device locally without using third parties. This type of system can be used in places where a comparison with a database is required to check whether that vehicle belongs there or is allowed to be there.
The app captures frames from the camera, locates the license plate region using image processing and object detection techniques, performs preprocessing (deskewing, denoising, thresholding), and finally extracts the plate text using optical character recognition (OCR).
Technology Stack
Android & Kotlin
The application is built natively in Kotlin using Android Studio. Jetpack Compose is used to create a modern UI for live camera previews, detection overlays, and OCR results.
OpenCV & Image Processing
OpenCV is used for operations such as noise reduction, edge detection, contour extraction, and perspective transforms to isolate and deskew the plate.
ML Kit OCR
Google ML Kit's on-device text recognition is used to read characters from the cropped license plate image, returning the final alphanumeric plate text to the user.
Milestones & Screenshots
Below are the key milestones completed during the project, with screenshots from the app.
Static Image Plate Detection
Implemented image loading from drawable and used OpenCV preprocessing plus contour filtering to detect the plate region on still images.
Deskewing & Plate Cropping
Added rotation correction and perspective transform to deskew the plate before OCR, improving readability and recognition accuracy.
OCR Integration
Integrated ML Kit text recognition to extract alphanumeric characters from the plate crop and display the cleaned result in the UI.
Real-Time Camera
Switched from static images to camera frames, running the detection and OCR in real time while maintaining interactive performance.
Challenges & Solutions
Variation in Lighting & Angles
- The other parts of the car with strong edges and intense reflections caused false contours.
- Plates captured at angles reduced OCR accuracy.
Solution: Applied adaptive thresholding, morphological operations, and perspective correction to obtain a cleaner, front-facing plate image.
Performance on Mobile
- Running detection and OCR at the same time in the program causes a lot of stress on each frame, in addition to drawing boxes on the screen every second.
Solution: reduced image resolution for detection, and limiting how often OCR runs per second.
Chose the wrong box
- Having so many box shapes on the screen caused confusion in the program.
Solution: I set a condition so that it would only take boxes within a certain range.
Future Work & Extensions
How would I make this project better:
- Support multiple license plate formats and countries.
- Improve license plate recognition.
- Add a history view to save plate reads.
- Use artificial intelligence to achieve more efficient and accurate detection
Source code and additional documentation can be provided on request or hosted on GitHub.
Extra
How I had to change my project at the last minute:
At the beginning of the semester, I wanted to use a pre-trained model to do the license plate detection part to increase the accuracy of the OCR, but I had a lot of problems when converting and implementing the model in my project. I had a lot of problems with output mismatches, which meant that with a month to go before handing in my project, I had to switch to OpenCV to do the license plate detection.
Functionality
Below are some screenshots about the functionality within the program.
Plate Cropping
Detector