Skip to main content
Log in

Automatic traffic data extraction tool for mixed traffic conditions using image processing techniques

  • Technical Paper
  • Published:
Innovative Infrastructure Solutions Aims and scope Submit manuscript

Abstract

This study addresses challenges related to extracting detailed data about vehicle movements in diverse traffic situations, such as those in India. Manual data extraction with the desired precision requires considerable human resources and time, posing a significant obstacle to obtaining the vast amounts of data needed for analysis. To overcome this issue, the study introduces a computer-based offline tool that utilizes advanced technologies, including YOLOv4 deep learning and the SORT algorithm, to analyse recorded traffic videos. This tool can identify vehicle types, track their paths, and calculate speed. The final output of the tool is presented in the form of a spreadsheet. The tool’s accuracy was confirmed by comparing its outputs with manually collected data, demonstrating its reliability in various traffic situations. It is anticipated to be effective in similar traffic conditions in other Asian countries.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

Data availability

Data will be provided on genuine request as data are still being used in further research.

References

  1. Mallikarjuna C, Phanindra A, Rao KR (2009) Traffic data collection under mixed traffic conditions using video image processing. J Transp Eng 135(4):174–182

    Article  Google Scholar 

  2. Munigety CR, Vicraman V, Mathew TV (2014) Semiautomated tool for extraction of microlevel traffic data from videographic survey. Transp Res Rec 2443(1):88–95

    Article  Google Scholar 

  3. Khan SI, Maini P (1999) Modeling heterogeneous traffic flow. Transp Res Rec 1678(1):234–241

    Article  Google Scholar 

  4. Dhatbale R, Chilukuri BR (2021) Deep learning techniques for vehicle trajectory extraction in mixed traffic. J Big Data Anal Transp 3:141–157

    Article  Google Scholar 

  5. Inigo RM (1989) Application of machine vision to traffic monitoring and control. IEEE Trans Veh Technol 38(3):112–122

    Article  Google Scholar 

  6. Keith R, Tindall J, Yan S (1964) The performance and characteristics of a magnetic loop vehicle detector. In: Australian road research board (ARRB) conference, 2nd, 1964, Melbourne.

  7. MacCarley CA et al (1992) Evaluation of video image processing systems for traffic detection (Abridgment). Transp Res Record (1360). https://onlinepubs.trb.org/Onlinepubs/trr/1992/1360/1360-008.pdf

  8. Wang L, Yung NHC (2012) Three-dimensional model-based human detection in crowded scenes. IEEE Trans Intell Transp Syst 13(2):691–703

    Article  Google Scholar 

  9. Leibe B, Seemann E, Schiele B (2005) Pedestrian detection in crowded scenes. In: 2005 IEEE computer society conference on computer vision and pattern recognition (CVPR’05). IEEE

  10. Wang L, Yung NHC, Xu L (2014) Multiple-human tracking by iterative data association and detection update. IEEE Trans Intell Transp Syst 15(5):1886–1899

    Article  Google Scholar 

  11. Milan A, Roth S, Schindler K (2013) Continuous energy minimization for multitarget tracking. IEEE Trans Pattern Anal Mach Intell 36(1):58–72

    Article  Google Scholar 

  12. Cheng H-Y, Yu C-C (2012) Detecting and tracking vehicles in airborne videos. Int J Comput Inf Eng 6(5):665–668

    Google Scholar 

  13. Choi JH, Lee D, Bang H (2011) Tracking an unknown moving target from uav: Extracting and localizing an moving target with vision sensor based on optical flow. In: The 5th international conference on automation, robotics and applications. IEEE

  14. Miao Q et al (2011) A new framework for on-line object tracking based on SURF. Pattern Recogn Lett 32(13):1564–1571

    Article  Google Scholar 

  15. Chen X et al (2020) High-resolution vehicle trajectory extraction and denoising from aerial videos. IEEE Trans Intell Transp Syst 22(5):3190–3202

    Article  Google Scholar 

  16. Haghighat AK et al (2020) Applications of deep learning in intelligent transportation systems. J Big Data Anal Transp 2:115–145

    Article  Google Scholar 

  17. Koller D, Weber J, Malik J (1994) Robust multiple car tracking with occlusion reasoning. In: Computer vision—ECCV’94: third European conference on computer vision Stockholm, Sweden, May 2–6, 1994 proceedings, Vol I3. Springer

  18. Rothrock RL, Drummond OE (2000) Performance metrics for multiple-sensor multiple-target tracking. In: Signal and data processing of small targets 2000. SPIE

  19. Danescu R, et al. (2009) Tracking multiple objects using particle filters and digital elevation maps. In: 2009 IEEE intelligent vehicles symposium. IEEE

  20. Hue C, Le Cadre J-P, Pérez P (2002) Sequential Monte Carlo methods for multiple target tracking and data fusion. IEEE Trans Signal Process 50(2):309–325

    Article  Google Scholar 

  21. Rodríguez-Canosa GR et al (2012) A real-time method to detect and track moving objects (DATMO) from unmanned aerial vehicles (UAVs) using a single camera. Remote Sens 4(4):1090–1111

    Article  Google Scholar 

  22. Kim Z, et al. (2005) A machine vision system for generating vehicle trajectories over extended freeway segments. In: 12th World congress on intelligent transportation systems.

  23. Xu Y et al (2017) Car detection from low-altitude UAV imagery with the faster R-CNN. J Adv Transp. https://doi.org/10.1155/2017/2823617

    Article  Google Scholar 

  24. Oh J et al (2009) Development of an automatic traffic conflict detection system based on image tracking technology. Transp Res Rec 2129(1):45–54

    Article  Google Scholar 

  25. St-Aubin P et al (2013) Use of computer vision data for detailed driver behavior analysis and trajectory interpretation at roundabouts. Transp Res Rec 2389(1):65–77

    Article  Google Scholar 

  26. Li J et al (2014) Computer vision techniques to collect helmet-wearing data on cyclists. Transp Res Rec 2468(1):1–10

    Article  Google Scholar 

  27. Aubry A et al (2020) Optimal opponent stealth trajectory planning based on an efficient optimization technique. IEEE Trans Signal Process 69:270–283

    Article  Google Scholar 

  28. Gao H et al (2014) Automatic extraction of multi-vehicle trajectory based on traffic videotaping from quadcopter model. Appl Mech Mater. https://doi.org/10.4028/www.scientific.net/AMM.552.232

    Article  Google Scholar 

  29. He K, et al. (2017) Mask R-CNN. In: Proceedings of the IEEE international conference on computer vision.

  30. Apeltauer J et al (2015) Automatic vehicle trajectory extraction for traffic analysis from aerial video data. Int Arch Photogramm Remote Sens Spat Inf Sci 40(3):9

    Article  Google Scholar 

  31. Raveendran B, Arkatkar SS, Vanajakshi LD (2019) Development of a video image processing-based micro-level data extractor for non-lane-based heterogeneous traffic conditions. Transp Dev Econ 5:1–10

    Article  Google Scholar 

  32. Bharadwaj N et al (2016) Traffic data analysis using image processing technique on Delhi–Gurgaon expressway. Curr Sci 110:808–822

    Google Scholar 

  33. Fung GS, Yung NH, Pang GK (2003) Camera calibration from road lane markings. Opt Eng 42(10):2967–2977

    Article  Google Scholar 

  34. Schoepflin TN, Dailey DJ (2003) Dynamic camera calibration of roadside traffic management cameras for vehicle speed estimation. IEEE Trans Intell Transp Syst 4(2):90–98

    Article  Google Scholar 

  35. Wang L-L, Tsai W-H (1991) Camera calibration by vanishing lines for 3-D computer vision. IEEE Trans Pattern Anal Mach Intell 13(4):370–376

    Article  Google Scholar 

  36. Wicaksono DW, Setiyono B (2017) Speed estimation on moving vehicle based on digital image processing. Int J Comput Sci Appl Math 3(1):21–26

    Article  Google Scholar 

  37. Bochkovskiy A, Wang C-Y, Liao H-YM. YOLOv4: optimal speed and accuracy of object detection. Available from https://arxiv.org/abs/2004.10934

  38. Solawetz J (2020) YOLOv4 explained. Available from https://blog.roboflow.com/a-thorough-breakdown-of-yolov4/

  39. Maiya SR (2019) Deepsort: deep learning to track custom objects in a video. Available at https://nanonets.com/blog/object-tracking-deepsort

  40. Lewis C (1982) International and business forecasting methods. Butterworths, London

    Google Scholar 

  41. Puig-Diví A, et al. (2017) Validity and reliability of the kinovea program in obtaining angular and distance dimensions. Preprints

Download references

Acknowledgements

The authors thank the Ministry of Education, Government of India for the financial support in the form of stipend given to the research scholars through centrally funded institutes in India.

Author information

Authors and Affiliations

Authors

Contributions

Conceptualization was done by Priyanka Diwakar and Dr Udit Jain; methodology was done by Priyanka Diwakar and Pranav Kulkarni.; investigation was done by Priyanka Diwakar and Pranav Kulkarni.; resources were done by Dr. V.S.Landge; writing—original draft preparation were done by Priyanka Diwakar.; supervision was done by Dr. V S Landge and Dr Udit Jain. All authors have read and agreed to the published version of the manuscript.

Corresponding author

Correspondence to Priyanka Diwakar.

Ethics declarations

Conflict of interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Ethical approval

The submission has not been previously published. The authors mutually agree with the contents of the article and with the stated authorship.

Informed consent

All participants provided informed consent prior to participation in paper “Automatic traffic data extraction tool for mixed traffic conditions using image processing techniques”.

Appendix: procedure to use tool

Appendix: procedure to use tool

  1. 1.

    Install anaconda

  2. 2.

    Install python 3x

  3. 3.

    Open Anaconda Prompt by typing it in the search bar, open it and go to the work directory with the “cd”command.

Type the below commands in the work directoryFor CPU

  1. (a)

    conda env create -f conda-cpu.yml

  2. (b)

    conda activate yolov4-CPU

Note: type the above (b) command every time you open the anaconda prompt in your work directoryFor GPU

  1. (a)

    conda env create -f conda-gpu.yml

  2. (b)

    conda activate yolov4-gpu

Note: type the above (b) command whenever you open the anaconda prompt in your work directory

figure a

For CPU

pip install -r requirements.txt.

For GPU

pip install -r requirements-gpu.txt.

  1. 4.

    Convert darknet weights to TensorFlow model python save_model.py –model yolov4

Note: Steps 1 to 5 should be executed initially only to create an environment and install dependencies on a workstation.

  1. 5.

    Place video to be processed at “\data\video” location.

  2. 6.

    Open GUI by below command

python OSDetect.py

figure b
  1. 7.

    Write the name of the input video file near the “Process Video” button (any format) and the “Save As” filename with the.avi extension in the GUI window.

  1. 8.

    Add the field of view of the camera, the angle of the camera and the height of the camera in the inputfile.

  2. 9.

    Click the “Process Video” button and wait for some time.

  3. 10.

    Observe the anaconda prompt to check for successful detection or any errors.

  4. 11.

    If you want to stop processing, click the “Stop” button.

  5. 12.

    After completion of processing/stop, to view the output file, go to the “output” folder and findthedesired file with the.avi extension.

  6. 13.

    All vehicle detection information is stored in the “record.csv” file after every processing.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Diwakar, P., Landge, V.S., Jain, U. et al. Automatic traffic data extraction tool for mixed traffic conditions using image processing techniques. Innov. Infrastruct. Solut. 9, 167 (2024). https://doi.org/10.1007/s41062-024-01465-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s41062-024-01465-x

Keywords

Navigation