Raja Sharma
4 min readAug 19, 2021

--

Task Description 📄

📌 In this task :

👉Creating a model that will detect a car in a live stream or video and recognize characters on number plate of the car .
👉Secondly , it will use the characters and fetch the owners information using RTO API’s .
👉Creating a Web portal where all this information will be displayed (using html, CSS, and JavaScript)

STEP — 1: Training Model and Car Detection

For the First step we will use LBPH to detect the car.

WHAT IS LBPH?

Local Binary Pattern (LBP) is a simple yet very efficient texture operator which labels the pixels of an image by thresholding the neighborhood of each pixel and considers the result as a binary number.

It was first described in 1994 (LBP) and has since been found to be a powerful feature for texture classification. It has further been determined that when LBP is combined with histograms of oriented gradients (HOG) descriptor, it improves the detection performance considerably on some datasets.

Using the LBP combined with histograms we can represent the face images with a simple data vector.

As LBP is a visual descriptor it can also be used for face recognition tasks, as can be seen in the following step-by-step explanation.

The LBP procedure was expanded to use a different number of radius and neighbors, it is called Circular LBP.

The first computational step of the LBPH is to create an intermediate image that describes the original image in a better way, by highlighting the facial characteristics. To do so, the algorithm uses a concept of a sliding window, based on the parameters radius and neighbors.

The LBPH uses 4 parameters:

→ Radius: the radius is used to build the circular local binary pattern and represents the radius around the central pixel. It is usually set to 1.

→ Neighbors: the number of sample points to build the circular local binary pattern. Keep in mind: the more sample points you include, the higher the computational cost. It is usually set to 8.

→ Grid X: the number of cells in the horizontal direction. The more cells, the finer the grid, the higher the dimensionality of the resulting feature vector. It is usually set to 8.

→ Grid Y: the number of cells in the vertical direction. The more cells, the finer the grid, the higher the dimensionality of the resulting feature vector. It is usually set to 8.

🔹 The feature vector be processed using the Support vector machine, extreme learning machines, or some other machine learning algorithm to classify images.

LBPH is widely used in facial recognition and texture analysis for fast prediction but it can also be used for image classifiers such as an image of a car.

So now we will get the data set of various cars and train our data via LBPH.

After providing the data we will train the model using LBPH

import following libraries:

import numpy as np
import cv2
from google.colab.patches import cv2_imshow
import imutils
import easyocr

Convert into grey scale

Perform edge detection

Approximate the contour

So now here is our web page where we have to enter the Number plate initials to get the Vehicle Information

So now when you will click on display , the detailed Vehicle information will be displayed

Hence now we have got the detailed vehicle information and our task-8 is successfully completed..

THANKS FOR READING!!

--

--