Automatic License/Number Plate Recognition

Automatic License/Number Plate Recognition (ANPR/ALPR) is a process involving the following steps: Step #1: Detect and localize a license plate in an input image/frame Step #2: Extract the characters from the license plate Step #3: Apply some form of Optical Character Recognition (OCR) to recognize the extracted characters Click here to download the source code to this post In this tutorial, you will build a basic Automatic License/Number Plate Recognition (ANPR) system using OpenCV and Python. ANPR is one of the most requested topics here on the PyImageSearch blog. I’ve covered it in detail inside the PyImageSearch Gurus course, and this blog post also appears as a chapter in my upcoming Optical Character Recognition book. If you enjoy the tutorial, you should definitely take a look at the book for more OCR educational content and case studies! Automatic License/Number Plate Recognition systems come in all shapes and sizes: ANPR performed in controlled lighting conditions with predictable license plate types can use basic image processing techniques. More advanced ANPR systems utilize dedicated object detectors, such as HOG + Linear SVM, Faster R-CNN, SSDs, and YOLO, to localize license plates in images. State-of-the-art ANPR software utilizes Recurrent Neural Networks (RNNs) and Long Short-Term Memory networks (LSTMs) to aid in better OCR’ing of the text from the license plates themselves. And even more advanced ANPR systems use specialized neural network architectures to pre-process and clean images before they are OCR’d, thereby improving ANPR accuracy. Automatic License/Number Plate Recognition is further complicated by the fact that it may need to operate in real time. For example, suppose an ANPR system is mounted on a toll road. It needs to be able to detect the license plate of each car passing by, OCR the characters on the plate, and then store this information in a database so the owner of the vehicle can be billed for the toll. Several compounding factors make ANPR incredibly challenging, including finding a dataset you can use to train a custom ANPR model! Large, robust ANPR datasets that are used to train state-of-the-art models are closely guarded and rarely (if ever) released publicly: These datasets contain sensitive identifying information related to the vehicle, driver, and location. ANPR datasets are tedious to curate, requiring an incredible investment of time and staff hours to annotate. ANPR contracts with local and federal governments tend to be highly competitive. Because of that, it’s often not the trained model that is valuable, but instead the dataset that a given company has curated. For that reason, you’ll see ANPR companies acquired not for their ANPR system but for the data itself! In this tutorial we’ll be building a basic Automatic License/Number Plate Recognition system. By the end of this guide, you’ll have a template/starting point to use when building your own ANPR projects. To learn how to build a basic Automatic License Plate Recognition system with OpenCV and Python, just keep reading. Looking for the source code to this post? JUMP RIGHT TO THE DOWNLOADS SECTION OpenCV: Automatic License/Number Plate Recognition (ANPR) with Python My first run-in with ANPR was about six years ago. After a grueling three-day marathon consulting project in Maryland, where it did nothing but rain the entire time, I hopped on I-95 to drive back to Connecticut to visit friends for the weekend. It was a beautiful summer day. Sun shining. Not a cloud in the sky. A soft breeze blowing. Perfect. Of course, I had my windows down, my music turned up, and I had totally zoned out — not a care in the world. I didn’t even notice when I drove past a small gray box discreetly positioned along the side of the highway. Two weeks later … I got the speeding ticket in the mail. Sure enough, I had unknowingly driven past a speed-trap camera doing 78 MPH in a 65 MPH zone.

That speeding camera caught me with my foot on the pedal, quite literally, and it had the pictures to prove it too. There is was, clear as day! You could see the license plate number on my old Honda Civic (before it got burnt to a crisp in an electrical fire.) Now, here’s the ironic part. I knew exactly how their Automatic License/Number Plate Recognition system worked. I knew which image processing techniques the developers used to automatically localize my license plate in the image and extract the plate number via OCR. In this tutorial, my goal is to teach you one of the quickest ways to build such an Automatic License/Number Plate Recognition system. Using a bit of OpenCV, Python, and Tesseract OCR knowledge, you could help your homeowners’ association monitor cars that come and go from your neighborhood. Or maybe you want to build a camera-based (radar-less) system that determines the speed of cars that drive by your house using a Raspberry Pi. If the car exceeds the speed limit, you can analyze the license plate, apply OCR to it, and log the license plate number to a database. Such a system could help reduce speeding violations and create better neighborhood safety. In the first part of this tutorial, you’ll learn and define what Automatic License/Number Plate Recognition is. From there, we’ll review our project structure. I’ll then show you how to implement a basic Python class (aptly named PyImageSearchANPR) that will localize license plates in images and then OCR the characters. We’ll wrap up the tutorial by examining the results of our ANPR system. What is Automatic License/Number Plate Recognition (ANPR/ALPR)? Figure 1: An example of a real-time Automatic License/Number Plate Recognition system (image source: Chem on Pinterest). Automatic License/Number Plate Recognition (ANPR/ALPR) is a process involving the following steps: Step #1: Detect and localize a license plate in an input image/frame Step #2: Extract the characters from the license plate Step #3: Apply some form of Optical Character Recognition (OCR) to recognize the extracted characters ANPR tends to be an extremely challenging subfield of computer vision, due to the vast diversity and assortment of license plate types across states and countries. License plate recognition systems are further complicated by: Dynamic lighting conditions including reflections, shadows, and blurring Fast-moving vehicles Obstructions

 

Description

Automatic License/Number Plate Recognition

Reviews

There are no reviews yet.

Be the first to review “Automatic License/Number Plate Recognition”

Your email address will not be published. Required fields are marked *

Title

Go to Top