In many cities around the world, traffic issues are an important concern. The traffic problem has many big causes. Due to better health care, better education, better job opportunities, and well-built houses people migrate from rural to urban areas. And the number of residents moving to urban areas has increased dramatically, resulting in a drastic rise in the number of vehicles. Due to increasing the number of residents, the capacity of the roadway has become inadequate and has grown relatively slow. In large cities, this causes roads and the number of vehicles to be imbalanced which results in road congestion. Similarly, public transportation causes the same problem. Another factor, due to the lack of real-time traffic information causes inadequate traffic management. So, in an intelligent transportation system, especially for traffic management, vehicle detection and counting system plays an important role.
Note: In the future, the traffic problem causes a serious problem if not addressed appropriately.
This tutorial proposes a video-based approach based on computer vision technologies for vehicle detection and counting. To find foreground objects in a sequence of video, the suggested method uses a technique called background subtraction technique. Several computer vision techniques, including thresholding, hole filling, and adaptive morphology operations, are then applied in order to track moving vehicles more accurately and precisely. Finally, with the use of a virtual(simulated) detection zone, vehicle counting and tracking is conducted.
A digital camera on a house was set up to collect the dataset of road videos which is recorded during the afternoon(from 12 P.M. to 2.30 P.M.). Six input videos of the road around four to seven minutes were taken. The resolution of the video was 1280×720 pixels with a time resolution of 30 frames per second.
- Python 3.7
- OvenCV
- Intel(R) Core i5 (1.7-2.4 GHz) CPU or above
- 4 GB RAM or Above
- Camera
- Just download the repository and unzip the file
- Run the python program named
main.py
- Enjoy the vechile Count Program
- Localize the number plates
- Segment the character
- Store character in database
Vehicle counting and detecting system can be used to trace vehicles, traffic monitoring and controlling, payment on highway troll. We can also detect the speed of the vehicle on the lane. People will get knowledge about the types of vehicles entering and exiting and also will be able to get accurate information on the flow of traffic.