Number Plate Detection using ML
ARTH — TASK 40
Task Description 📄
📌 In this task :
👉Create a model that will detect a car in a live stream or video and recognize characters on number plate of the car .
We need to build a system that is capable of-
- Looking for a license plate in the image:
To detect an object(license plate) from an image we need another tool that can recognize an Indian license plate so for that I’ve used Haar cascade, pre-trained on Indian license plates (will be updating soon to YOLO v3).
- OpenCV: OpenCV is a library of programming functions mainly aimed at real-time computer vision plus its open-source, fun to work with and my personal favorite. I have used version 4.1.0 for this project.
- Python: aka swiss army knife of coding. I have used version 3.6.7 here.
- IDE: I’ll be using Jupyter here.
- Haar cascade: It is a machine learning object detection algorithm used to identify objects in an image or video and based on the concept of features proposed by Paul Viola and Michael Jones in their paper “Rapid Object Detection using a Boosted Cascade of Simple Features” in 2001. More info
- Keras: Easy to use and widely supported, Keras makes deep learning about as simple as deep learning can be.
- Scikit-Learn: It is a free software machine learning library for the Python programming language.
STEP 1 : Environment
Setup the Environment
- Install the dependencies
- import the necessary modules
STEP 2 : Plate Detection
- Preprocess the image
- Extract the plate ( using indian_plate.xml haarcascade)
- Save it in an image
STEP 3 : Data Preprocessing/Cleaning
- Collect the images of characters from (0–9, A-Z), dimensions: 28x28
- Save each character images in their own folders
- Create Train and Eval Sets using ImageDataGenerator
STEP 4 : Build and Train the Machine Learning Model
- Using Convolution technique
- Create layers as mentioned in the program(github link: https://github.com/Charan2k/Vehicle-Registration-Details)
- Finally, Compile the model using Adam as Optimizer and Categorical Cross Entropy as Loss function
- Train the model by feeding the Image Data that we Generated in STEP 3
STEP 5 : Now Predict the Things
- Take an Image and Go through the step 2, and get the number plate
- Call API of RTO to get the details of the Vehicle Registration
Link for the Code: https://github.com/Charan2k/Vehicle-Registration-Details
That’s all for today :-)