Even though various methods have been presented for moving vehicles detection, it is still a difficult and challenging task to segment moving vehicles in the dynamic scenes. To discriminate the moving vehicles from the dynamic background, the key point is to find the distinct properties of moving ve
Estimating Traffic Flow Using Supervised ML and Image Processing Techniques
Even though various methods have been presented for moving vehicles detection, it is still a difficult and challenging task to segment moving vehicles in the dynamic scenes. To discriminate the moving vehicles from the dynamic background, the key point is to find the distinct properties of moving vehicles and background. Considering the vehicles move evenly and straightly while background moves randomly, motion information potentially can be employed for moving vehicle detection. The computationally efficient algorithm has been developed for real-time vehicle detection in video streams. Experimental results show that the approach effectively deals with various illumination conditions and robustly detects moving vehicles even in grayscale video. Moving object detection in video sequences is fundamental in application areas such as visual surveillance, traffic monitoring, human-computer interaction, and video compression. Especially, vehicle detection with a stationary camera is an important problem for video-based traffic monitoring, which is essential for the measurement of traffic parameters such as vehicle count, speed, and flow. However, accurate detection could be difficult due to the potential variability including shadows or lights cast by moving objects, dynamic background processes, and camouflage. We aim to develop such an algorithm for area and occupancy rate calculation that gives better accuracy. If we encounter hindrances in developing efficient logics then we may make use of contour functions of the OpenCV library. For video-based traffic monitoring, each pixel in the scene is to be classified as moving vehicle, cast shadow (or light), or background (roadway).
The main objective of our system is to identify the flow of traffic by using different techniques to achieve maximum accuracy and efficiency. The data will be drone videos (overhead view).
• The first method will be initiated by using the OpenCV library where we aim to develop a 4 tier architecture to obtain occupancy percent, traffic density, and flow.
• The second approach will be implemented by using Supervised Machine Learning where we will test the performance by developing our own model on which we train and test our own data.
• A comparative analysis will be made on both techniques based on accuracy and computational efficiency.
Approach#1:
For Image processing, the camera continuously monitors the traffic by capturing videos. These videos are then used by our system to extract frames at particular time intervals. Following steps are taken to remove noise from the frames:
It is used as a pre-processing step in applications that includes computer vision. A mixture of Gaussian (MoG) background subtractor is used. This subtractor helps in separating the foreground from the background. The road is considered the background because it is static and the foreground is the moving vehicles.
After applying “background subtraction”, we perform grey-scaling and pass the grey-scaled frames into the system for thresholding. Binary threshold is applied with the threshold value of 250, so only pixel values that are white or are very close to white are assigned the value of 255. In this way, all shadows and grey regions in the image are removed.
To get rid of any remaining noise in the system we further applied erosion followed by dilation to retain the original image.
After performing all the necessary steps required, obtaining a black background and white objects with as minimal noise as possible, we apply Contour Detection. Contours are the curve points on the boundary of the objects having the same color intensity. Therefore, the points are created along the boundary of each white vehicle and these vectors are later used by the draw-contour function to draw a rectangular box on each object.
The axis of these boxes will later be used to calculate the occupancy of the vehicles.
Approach#2:
Supervised Machine Learning Model The goal of this model was to detect different types of vehicles such as cars, motorbikes, rickshaws, buses, and trucks present in a particular frame. The challenging part of this project was classifying different types of vehicles in heterogeneous traffic.
Steps:
The data that was provided to us was a 15-minute long video from which we extracted useful frames. On processing the video through a python code, we collected about 300 frames. Each frame was extracted at an interval of 0.5 seconds.
One of the commonly used free tools is LabelImg. We used LabelImg for object annotation among five classes that are as bus, car, motorbike, rickshaw, and truck.
Once all the annotations for the images were done, a folder for our dataset, vehicles_fyp, was created and in this parent folder, two-child folders train and validation were created.
The images were fed to the model.
Our model made use of pre-trained weights of YOLOv3 hence supporting the concept of transfer learning.
Robust and reliable vehicle detection is a critical step. The most common approach to vehicle detection is using active sensors. However, active sensors have several drawbacks, such as low spatial resolution, slow scanning speed, and high cost. A software solution making use of visual information can be very important in a number of related applications, such as lane detection, traffic or object identification (e.g., pedestrians, obstacle) and they provide an upgrade without modifying the current system.
| Item Name | Type | No. of Units | Per Unit Cost (in Rs) | Total (in Rs) |
|---|---|---|---|---|
| Brochures | Miscellaneous | 100 | 50 | 5000 |
| Drone | Equipment | 1 | 60000 | 60000 |
| Banner | Miscellaneous | 0 | 5000 | 0 |
| Total in (Rs) | 65000 |
Food Waste is a massive problem. One third of all food produced in the world goes to waste...
Our application "Find The Lost" will provide you the ease of finding items that have been...
Many people dump their plastic waste in the lakes and dams. As plastic choking our planet....
Augmented reality a technology ,which is new in IT world that combines real and comp...
Humidity, Temperature,Wind speed and Pressure are four basic parameters to build any Weath...