Reading License Plates with the Raspberry Pi

Robert Lucian Chiriac used a Raspberry Pi and machine learning to build a license plate reader that can be put in any car.

Reading license plates is one of the most common uses for machine learning. License plate readers are commonly for toll stations, speed cameras, and for police cruisers to automatically run the license plates of the cars driving nearby. At last year’s DEF CON, the “Surveillance Detection Scout” was unveiled. It’s a Tesla that was modified with just a bit of inexpensive hardware added to detect faces and license plates via the built-in cameras. Robert Lucian Chiriac didn’t want to spend the money on an actual Tesla, and so he used a Raspberry Pi to build a license plate reader that can be put in any car.

Chiriac doesn’t seem to have any actual need to read license plates on the road, but wanted to use it as a practice exercise in machine learning. While reading license plates is a well-documented use for machine learning, that doesn’t mean it’s easy to do. That’s because a license plate reader needs to do three distinct tasks: detect the presence of a license plate in a video feed, take a frame from that video and crop out just a rough box around the license plate, and finally read the actual numbers and letters on the license plate.

To accomplish that, Chiriac decided to run three separate machine learning models on his Raspberry Pi. The Raspberry Pi sits in a 3D-printed mount on the windshield, and captures video through a camera module. First, the popular YOLO (You Only Look Once) real-time object detection model is used to find license plates and then perform a rough crop around them. Then the CRAFT (Character Region Awareness for Text Detection) model is used to find the precise location of the letters and numbers within the cropped image. Finally, a CRNN (Convolutional Recurrent Neural Network) model is used to actually read those letters and numbers. The results are shown on a self-hosted website, which is able to update with a new license plate in less than a second.

Cameron Coward
Writer for Hackster News. Proud husband and dog dad. Maker and serial hobbyist. Check out my YouTube channel: Serial Hobbyism
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles