Vehicle Detection and Classification Using Computer Vision Techniques

In the past decade, vehicular traffic in Pakistan has increased tremendously and continues to do so. Unfortunately, due to the lack of proper planification in regards to traffic management and infrastructure to support the increasing traffic, this has started to become a major bottleneck. To

2025-06-28 16:29:55 - Adil Khan

Project Title

Vehicle Detection and Classification Using Computer Vision Techniques

Project Area of Specialization Internet of ThingsProject Summary

In the past decade, vehicular traffic in Pakistan has increased tremendously and continues to do so. Unfortunately, due to the lack of proper planification in regards to traffic management and infrastructure to support the increasing traffic, this has started to become a major bottleneck.

To better manage the vehicular traffic and minimize road congestions, proper acquisition and analysis of road traffic data is necessary. Traffic surveys can capture the data that reflects the traffic conditions in a specific area. Traffic surveys can be conducted using simple technology like a pneumatic tube, which counts the number of vehicles passing through a point, or by using employing more advanced technologies incorporating state-of-the-art computer vision techniques.

Counting vehicles through traditional pneumatic tubes, which is commonly used for road traffic surveys in Pakistan, can provide some data. However, such pneumatic tubes do not provide precise vehicular count and are more prone to errors. Moreover, the data obtained from pneumatic tubes do not specify the type of traffic that most frequents on a certain road. To overcome these limitations, data collection using computer vision techniques can be utilized. Computer vision techniques provide data with high level of accuracy and also it can also easily characterize the type of traffic in certain area.

Traffic volume data, which is the number of traffic attendants passing through a road in a certain period of time, is a crucial information which indicates the utilization of the road at a given time. The traffic data and also the transport behavior are continuously collected at regular intervals. This data is essential in order to fulfill the demand of the transport models, i.e.,

In this project, we are going to create a cost-effective real time road traffic survey device using raspberry Pi. The device will incorporate computer vision technique to detect the vehicles and then classify those vehicles into different classes.

Project Objectives

The aim of the project is to design a system utilizing both raspberry pi and computer vision technique to capture and analyze real time traffic of the road.

Following are the major objectives for this project

Project Implementation Method

The implementation plan for this project consists of two phases

  1. Implementation and evaluation of computer vision algorithms
  2. Real-time data collection
  1. Implementation and evaluation of computer vision algorithms:

In the first phase of our project, we will literature review and select current state-of-the-art computer vision algorithms (OpenCV, YOLO etc.) for object detection and tracking. The algorithms will then be implemented on a personal computer and their performance will be evaluated on sample video recordings of road traffic data. The outcome of this phase is to select the best method for vehicular traffic detection and classification, which has good accuracy in detecting the vehicles and properly classifying them according to classes (light vehicle, heavy vehicle).

  1. Real-time Data Collection:

In the second phase of our project, we will implement the selected computer vision algorithm on a Raspberry PI micro-computer. The computer vision algorithm will perform vehicular detection and classification on traffic data coming from a live video stream obtained from a PI-cam connected to Raspberry Pi.

The Raspberry Pi will store the processed video as well as the vehicle data in an external storage device connected to Raspberry Pi. This data can then be downloaded to other systems for post processing for further analysis if required.

Benefits of the Project

The project can help transportation engineers, traffic authorities in:

  1. Understanding the traffic flow evolution. The data being derived from our project can help in forecasting traffic flow.
  2. Road traffic management to avoid traffic congestions during peak times.
  3. Proper road infrastructure planning.
Technical Details of Final Deliverable

Following are the final deliverables of the project

In the end of this project, we will have the final simulation model of object detection and classification usable for object detection, tracking and counting of vehicles.

This module will be able to capture the traffic flow in real-time.

Upon completion of the project, we will have a fully programmed Raspberry Pi microcontroller which can perform the above simulated tasks in real-time.

We will use a 128 GB micro-SD card to store the processed data. Upon post-processing, our device will be able to store the video feed and also the vehicle count file.

Final Deliverable of the Project HW/SW integrated systemCore Industry TransportationOther Industries IT , Telecommunication Core Technology Internet of Things (IoT)Other Technologies Artificial Intelligence(AI), Big DataSustainable Development Goals Industry, Innovation and Infrastructure, Sustainable Cities and CommunitiesRequired Resources
Item Name Type No. of Units Per Unit Cost (in Rs) Total (in Rs)
Total in (Rs) 79860
Raspberry Pi 4 Model B 8GB Equipment14500045000
FTDI Cable 5V Equipment126002600
Raspberry Pi 4 Case with Cooling Fan and Heatsink Equipment116001600
Raspberry Pi 4 Micro HDMI Cable Equipment1800800
Raspberry Pi 4 Power Supply Equipment110001000
Raspberry Pi LCD Screen Equipment180008000
Raspberry Pi Camera Module Equipment11000010000
Raspberry Pi GPIO Breakout Expansion Board Equipment110001000
Male to Female Jumper Wires Miscellaneous 404160
SanDisk 128GB Extreme Pro V30 Micro SD Card (SDXC) A2 UHS-I U3 - 170MB Miscellaneous 157005700
Delivery Charges Miscellaneous 140004000

More Posts