Vehicle Classification and Counting
Vehicle Classification and Counting
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
• 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
• 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.