0% found this document useful (0 votes)
83 views22 pages

Vehicle Classification and Counting

The document discusses vehicle counting and classification using video surveillance. It aims to enable effective traffic management solutions for smart cities. The objectives are to generate heat maps of vehicle types, manage traffic flow, enable diversion planning, and avoid accidents. The methodology uses HOG-SVM to extract features from vehicle images for classification training. Virtual lines are used to count vehicles by type based on detecting when vehicles cross the line.

Uploaded by

Abdul Moaiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views22 pages

Vehicle Classification and Counting

The document discusses vehicle counting and classification using video surveillance. It aims to enable effective traffic management solutions for smart cities. The objectives are to generate heat maps of vehicle types, manage traffic flow, enable diversion planning, and avoid accidents. The methodology uses HOG-SVM to extract features from vehicle images for classification training. Virtual lines are used to count vehicles by type based on detecting when vehicles cross the line.

Uploaded by

Abdul Moaiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Vehicle Counting And Classification

Group Members:
Muhammad Ahmed (BCS07173143)
Muhammad Hamza Khan (BCS07173145)
Abdul Moiz (BCS07173041)
Introduction:
● Increased demand for smart cities necessitates the deployment of digital
techniques to analyze the road traffic density, especially in mega cities, for
effective traffic management.
● Video surveillance is one of the most widely adopted technologies by the city
authorities for traffic monitoring.
● Video management and analytics are set to be in a sweet spot for enabling
effective traffic management solutions in smart city projects.
Objective
● Heat map per vehicle type can help understand the distribution of the types of vehicles and
their density on particular roads, which further helps in planning road network.

● Vehicle flow management and congestion avoidance on the road can be done by applying
fluid mechanics principles using the flow volume and flow velocity for a different class of
vehicles.

● Diversion planning can be done at peak hours on a daily, monthly or yearly event basis.

● Accidents can be avoided and a systematic, safer, and smarter transit can be achieved by
monitoring the driving behavior through video surveillance.
Vehicle Classification and Counting Working

● In the vehicle classification and counting solution, the vehicle is first classified,
then counting is done according to the vehicle type.

● Typically, object detection and tracking for vehicle classification are done using
two methodologies
Methodology for classification of vehicles

HOG-SVM based Vehicle Classification


Support Vector Machine (SVM)

● Support Vector Machine is a supervised machine learning algorithm, which


is used for image classification and pattern recognition.
● SVM model can be considered as a point space wherein multiple classes are
isolated using hyperplanes.
● It is widely used for object-based classification.
Histogram of Oriented Gradients (HOG) Working

• Divide the image into sub-images called “Cells”


• Compute the gradients in the cells to be described
• Accumulate a histogram within that each cell
• Group the cells into large blocks
• Normalize each block
• Train classifier to detect objects
HOG SVM based vehicle classification

It consists of three phases:


• Dataset collection
• Feature extraction and
• Training
Dataset Collection

• The data set is a collection of sample images of vehicles in different


positions, illumination conditions, and scales.
• For car vehicle type, we have collected Front, Rare, and Side view images.
Feature extraction
• It will be used for vehicle detection and recognition.
• HOG feature extraction techniques will be used for vehicle classification and
counting.
• HOG relies on the property of objects within an image to process the distribution
of intensity gradients or edge directions.
• A block is considered as a pixel grid in which gradients are constituted from the
magnitude and direction of change in the intensities of the pixel within the block.
Parameters

• win_size – Size (128, 128). Detection window size. Align the block size and
block stride.
• block_size – Size (16, 16). Block size in pixels. Align the cell size. Only (16,16)
is supported for now.
• block_stride – Size (8, 8). Block stride. It must be a multiple of cell size.
• cell_size – Size (8, 8). Cell size. Only (8, 8) is supported for now.
• Nbins – 9. Number of bins.
Feature Extraction

• We have used multiclass SVM having three different vehicle models that are Car,
HMV (Heavy Moving Vehicles), and two-wheelers.
• We will train a classifier with the set of positive-vehicle and negative non-vehicle
images for each type.
• All the sample images of a vehicle are fed to the feature descriptor extraction
algorithm i.e. HOG.
Gradient Formulae

• The gradient for each pixel consists of magnitude and direction, calculated
using the following formulae:
Fig [1]: HOG Feature Extraction Sample
Training

• Vehicle classification is based on the training of the collected data set.


• A training set of feature vectors is exported from the HOG algorithm and then
used for training the SVM model.
• In this Vehicle Classification, for three different vehicle types, we have three
different Binary Linear SVM models .
• 1. For car vehicle type, there is a Car SVM model, 2. For HMV (truck, bus) type,
there is an HMV SVM model, 3. For two-wheelers, there is a two-wheeler SVM
model.
Block Diagram For Vehicle Training
Vehicle Classification

• Vector of HOG features of the vehicle is extracted.


• Vector is then used in the SVM model to determine a matching score for the input
vector with each of the labels.
• SVM returns the label with the maximum score, which represents the confidence
to the closest match within the trained vehicle data.
Fig [3]: Block Diagram Of The Vehicle Classification
Process
Vehicle Counting

• Virtual line method will be used as a counter from which the count is updated.
• Vehicles are close to each other, there is a risk to count two adjacent vehicles
being counted as one, which reduces the accuracy .
• object segmentation algorithm will be used to overcome this
Vehicle counting and classification when
integrated into an application
• Draw a line on the input image. (Virtual line)
• Calculate the inner product of vector for checking vehicle object is in the range of
line or not.
• Find the current and previous position value of an object with respect to the line.
Map the status of each object.
• If the current and previous position value of vehicle object is not the same, then
increment respective vehicle class counter. Otherwise, capture the next frame and
go to step 2.

You might also like