Research Article | Open Access | Download PDF
Volume 13 | Issue 7 | Year 2026 | Article Id. IJCE-V13I7P111 | DOI : https://doi.org/10.14445/23488352/IJCE-V13I7P111Automatic Vehicle Counting in Complex Traffic Zones Using Computer Vision: A Case Study in the City of Huancayo
Rosali Ramos Rojas, Giancarlo Fernando Meza Terbullino
| Received | Revised | Accepted | Published |
|---|---|---|---|
| 20 Apr 2026 | 10 Jun 2026 | 22 Jun 2026 | 29 Jul 2026 |
Citation :
Rosali Ramos Rojas, Giancarlo Fernando Meza Terbullino, "Automatic Vehicle Counting in Complex Traffic Zones Using Computer Vision: A Case Study in the City of Huancayo," International Journal of Civil Engineering, vol. 13, no. 7, pp. 176-194, 2026. Crossref, https://doi.org/10.14445/23488352/IJCE-V13I7P111
Abstract
The analysis of road traffic is fundamental for obtaining reliable information about itself. This paper presents Automatic Smart Vehicle Counting System – Intelligent System (CONTEV-SYS), a framework of a vehicle counting system developed in Python, employing YOLO v8n and the OpenCV library. A mixed method approach was adopted. Initially, a survey in the Likert scale was applied to 40 specialist identified the most extensive processing methods, errors in the data, and the impact in the weather as critical barriers of the traditional manual traffic counting system. Later on, a quantitative validation was carried out in nine vial scenarios, where different circulation patterns are presented in the city of Huancayo, comparing the system with a careful and accurate manual counting system. The results show that the CONTEX-SYS system has an average estimation efficiency of 89.40%, a Mean Absolute Percentage Error (MAPE) of 10.60%, reaching a maximum of 96% in scenario number 5, with a conservative behavior, that is, reducing the false positives in the severe occlusion case (R² = 0.921). The system attain a high precision in the vehicle classification, standing out the identification of heavy vehicles. In terms of operation, it saved 49.49% processing time, ensuring that the analysis was carried out in strict real-time. Finally, its implementation results to be highly promising in the field of civil engineering, particularly in the specialties of transportation and traffic.
Keywords
Vehicle detection, Vehicle counting, Road, Deep learning, Graphical user interface.
References
- Humberto Farias, Mauricio Solar, and Daniel Ortiz, “A Deep Learning Tool to Classify Vehicles in Real Time,” 2021 Eighth International Conference on eDemocracy & eGovernment (ICEDEG), Quito, Ecuador, pp. 215-218, 2021.
[CrossRef] [Google Scholar] [Publisher Link] - Hana Rabbouch, Foued Saâdaoui, and Rafaa Mraihi, “Unsupervised Video Summarization using Cluster Analysis for Automatic Vehicles Counting and Recognizing,” Neurocomputing, vol. 260, pp. 157-173, 2017.
[CrossRef] [Google Scholar] [Publisher Link] - Yingfeng Li, and Yong Bai, “Comparison of Characteristics between Fatal and Injury Accidents in the Highway Construction Zones,” Safety Science, vol. 46, no. 4, pp. 646-660, 2008.
[CrossRef] [Google Scholar] [Publisher Link] - Huansheng Song et al., “Vision-based Vehicle Detection and Counting System using Deep Learning in Highway Scenes,” European Transport Research Review, vol. 11, no. 1, pp. 1-16, 2019.
[CrossRef] [Google Scholar] [Publisher Link] - Ishank Mishra et al., “Methods for Vehicle Detection Using Roadside Sensors in Complex Environment,” Sustainable Infrastructure Development, pp. 117-124, 2022.
[CrossRef] [Google Scholar] [Publisher Link] - Kaijie Zhang et al., “Research on Mine Vehicle Tracking and Detection Technology based on YOLOv5,” Systems Science & Control Engineering, vol. 10, no. 1, pp. 347-366, 2022.
[CrossRef] [Google Scholar] [Publisher Link] - William Wai Leung Lam, Clement Chun-Cheong Pang, and Nelson Hon Ching Yung, “Highly Accurate Texture-Based Vehicle Segmentation Method,” Optical Engineering, vol. 43, no. 3, 2004.
[CrossRef] [Google Scholar] [Publisher Link] - Dilshad Islam, Tanjim Mahmud, and Tanjia Chowdhury, “An Efficient Automated Vehicle License Plate Recognition System Under Image Processing,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 29, no. 2, pp. 1055-1062, 2023.
[CrossRef] [Google Scholar] [Publisher Link] - Debojit Biswas et al., “An Automatic Car Counting System Using OverFeat Framework,” Sensors, vol. 17, no. 7, pp. 1-13, 2017.
[CrossRef] [Google Scholar] [Publisher Link] - Rui Zhao, and Xiaogang Wang, “Counting Vehicles from Semantic Regions,” IEEE Transactions on Intelligent Transportation Systems, vol. 14, no. 2, pp. 1016-1022, 2013.
[CrossRef] [Google Scholar] [Publisher Link] - Youssef Aitrais et al., “AI-Driven Traffic Flow Management System: Real-Time Blockage Detection, Emergency Prioritization, and Road Hazard Monitoring,” Proceedings of the International Conference on Advanced Communications with Modern Circuits and Systems Technologies, pp. 428-435, 2026.
[CrossRef] [Google Scholar] [Publisher Link] - Ahsen Battal, Yunus Emre Avcı, and Adem Tuncer, “Real-Time Detection of Vehicle Queue States in Urban Traffic Using Deep Learning,” El-Cezeri, vol. 12, no. 3, pp. 356-364, 2025.
[CrossRef] [Google Scholar] [Publisher Link] - Bl Shilpa, M. Mayank, and S Md Fakruddin, “Adaptive Urban Traffic Control Using Camera Vision and Emergency Vehicle Mobile Interface,” 2025 Second International Conference on Computing, Semiconductor, Mechatronics, Intelligent Systems and Communications (COSMIC), Mangalore, Karnataka, India, pp. 48-53, 2025.
[CrossRef] [Google Scholar] [Publisher Link] - C.R Rashmi, and C.P Shantala, “Vehicle Density Analysis and Classification using YOLOv3 for Smart Cities,” 2020 4th International Conference on Electronics, Communication and Aerospace Technology (ICECA), Coimbatore, India, pp. 980-986, 2020.
[CrossRef] [Google Scholar] [Publisher Link] - Zhe Dai et al., “Video-Based Vehicle Counting Framework,” IEEE Access, vol. 7, pp. 64460-64470, 2019.
[CrossRef] [Google Scholar] [Publisher Link] - Huy Van Pham, and Byung-Ryong Lee, “Front-View Car Detection and Counting with Occlusion in Dense Traffic Flow,” International Journal of Control, Automation and Systems, vol. 13, no. 5, pp. 1150-1160, 2015.
[CrossRef] [Google Scholar] [Publisher Link] - Gary Bradski, The OpenCV Library, United States Patent and Trademark Office, 2000. [Online]. Available: https://ptacts.uspto.gov/ptacts/public-informations/petitions/1558289/download-documents?artifactId=8E9mKCVRLTzAIHYKaMMeW0Y7vRNLW2jO3IgIxCIvFTojVG2bGeGwSDI
- Laurie Williams, Agile Software Development Methodologies and Practices, Advances in Computers, vol. 80, pp. 1-44, 2010.
[CrossRef] [Google Scholar] [Publisher Link] - Qizi Huangpeng et al., “Automatic Vehicle Detection and Counting Approach using Low-Rank Representation and Locality-Constrained Linear Coding,” Engineering Computations, vol. 35, no. 8, pp. 2825-2843, 2018.
[CrossRef] [Google Scholar] [Publisher Link] - Rui Wang et al., “AAC: Automatic Augmentation for Crowd Counting,” Neurocomputing, vol. 500, pp. 90-98, 2022.
[CrossRef] [Google Scholar] [Publisher Link] - Zhaojian Liu et al., “YOLO-DC for Vehicle Detection Using Deformable Convolutional Networks and Cross-Channel Coordinate Attention,” Scientific Reports, vol. 16, no. 1, pp. 1-16, 2026.
[CrossRef] [Google Scholar] [Publisher Link] - Miao He et al., “Real-Time Vehicle Detection Methods based on an Improved YOLO-Lite Approach in Edge Computing Scenarios,” Discover Artificial Intelligence, vol. 6, no. 1, pp. 1-20, 2026.
[CrossRef] [Google Scholar] [Publisher Link] - M. A. León-Tejeda et al., “Vehicle Traffic Analysis System Using Traffic Light Infrastructure,” International Journal of Research and Technological Innovation, vol. 9, no. 51, pp. 1-15, 2021.
[Google Scholar] [Publisher Link] - Miguel Angel Mendoza-Lugoa, and Oswaldo Morales-Nápoles, “Vehicular Loads Hazard Mapping through a Bayesian Network in the State of Mexico,” Proceedings of the 31st European Safety and Reliability Conference, pp. 2510-2517, 2021.
[CrossRef] [Google Scholar] [Publisher Link] - Eliseo Chávez-Alarcón, and Avid Roman-Gonzalez, “Analysis of Vehicle Flow Using Auto Vehicle Counting,” 2018 IEEE Third Ecuador Technical Chapters Meeting (ETCM), Cuenca, Ecuador, pp. 1-5, 2018.
[CrossRef] [Google Scholar] [Publisher Link] - Juan C. Perafan-Villota, Oscar H. Mondragon, and Walter M. Mayor-Toro, “Fast and Precise: Parallel Processing of Vehicle Traffic Videos Using Big Data Analytics,” IEEE Transactions on Intelligent Transportation Systems, vol. 23, no. 8, pp. 12064-12073, 2022.
[CrossRef] [Google Scholar] [Publisher Link] - Camilo Camacho, César Pedraza, and Carolina Higuera, “An Artificial Vision Based Method for Vehicle Detection and Classification in Urban Traffic,” Pattern Recognition and Image Analysis, pp. 394-403, 2019.
[CrossRef] [Google Scholar] [Publisher Link] - Xiuliang Jin et al., “Estimates of Plant Density of Wheat Crops at Emergence from Very Low Altitude UAV Imagery,” Remote Sensing of Environment, vol. 198, pp. 105-114, 2017.
[CrossRef] [Google Scholar] [Publisher Link] - Zhipeng Dong et al., “Object Detection Method for High Resolution Remote Sensing Imagery Based on Convolutional Neural Networks with Optimal Object Anchor Scales,” International Journal of Remote Sensing, vol. 43, no. 7, pp. 2698-2719, 2022.
[CrossRef] [Google Scholar] [Publisher Link] - Mofeng Yang et al., “Big-Data Driven Framework to Estimate Vehicle Volume Based on Mobile Device Location Data,” Transportation Research Record: Journal of the Transportation Research Board, vol. 2678, no. 2, pp. 352-365, 2024.
[CrossRef] [Google Scholar] [Publisher Link] - Ryan W. Klein, Christopher L. Dutton, and Andrew K. Koeser, “Development of a Low-Cost Traffic Counter for Assessing Likelihood of Impact for Tree Risk Assessment,” Arboricultural Journal, vol. 45, no. 1, pp. 49-71, 2023.
[CrossRef] [Google Scholar] [Publisher Link] - Konda Hari Krishna et al., “Vision-Driven Dynamic Traffic Light System for Smart Cities using Edge AI,” 2026 6th International Conference on Image Processing and Capsule Networks (ICIPCN), Dhulikhel, Nepal, pp. 1193-1199, 2026.
[CrossRef] [Google Scholar] [Publisher Link] - Shubham Sahu et al., “Edge-Enabled Smart Traffic Surveillance System with Federated Learning Approaches,” 2025 International Conference on Sensors and Related Networks (SENNET) Special Focus on Digital Healthcare(64220), Vellore, India, pp. 1-6, 2025.
[CrossRef] [Google Scholar] [Publisher Link] - R. Venkatesh, Harnessing Artificial Intelligence for Road Traffic Surveillance: A Comprehensive Overview of AIbased Statistical Models for Traffic Monitoring and Flow Prediction, AI-Based Statistical Modeling for Road Traffic Surveillance and Monitoring, pp. 233-253, 2025.
[CrossRef] [Google Scholar] [Publisher Link] - Khac-Hoai Nam Bui, Hongsuk Yi, and Jiho Cho, “A Multi-Class Multi-Movement Vehicle Counting Framework for Traffic Analysis in Complex Areas Using CCTV Systems,” Energies, vol. 13, no. 8, pp. 1-17, 2020.
[CrossRef] [Google Scholar] [Publisher Link] - Geometric Design of Highways DG-2018, Ministry of Transport and Communications (MTC), 2018. [Online]. Available: https://portal.mtc.gob.pe/transportes/caminos/normas_carreteras/documentos/manuales/Manual.de.Carreteras.DG-2018.pdf
- Mohanad Jabbar Abdali et al., “Employment of videogrammetric Techniques to Obtain Real-Time Traffic Survey Data,” AIP Conference Proceedings, vol. 3379, no. 1, 2026.
[CrossRef] [Google Scholar] [Publisher Link] - Kennedy Eloy Apolinario Tadeo, “Evaluation of Service Levels and their Effect on Traffic Flow at the Access Points to the Huallaga Bridge in the City of Huánuco, 2023,” Daniel Alcides Carrión National University, pp. 1-38, 2023.
[Google Scholar] [Publisher Link] - Mohana et al., “Artificial Intelligence (AI) Enabled Vehicle Detection and Counting Using Deep Learning,” 2022 International Conference on Computer Communication and Informatics (ICCCI), Coimbatore, India, pp. 1-5, 2022.
[CrossRef] [Google Scholar] [Publisher Link] - Sokèmi René Emmanuel Datondji et al., “A Survey of Vision-Based Traffic Monitoring of Road Intersections,” IEEE Transactions on Intelligent Transportation Systems, vol. 17, no. 10, pp. 2681-2698, 2016.
[CrossRef] [Google Scholar] [Publisher Link] - S. Gupte, O. Masoud, and P. Papanikolopoulos, “Vision-based Vehicle Classification,” IEEE Intelligent Transportation Systems, Proceedings (Cat. No.00TH8493), Dearborn, MI, pp. 46-51, 2000.
[CrossRef] [Google Scholar] [Publisher Link] - Nicolai Wojke, Alex Bewley, and Dietrich Paulus, “Simple Online and Realtime Tracking with a Deep Association Metric,” 2017 IEEE International Conference on Image Processing (ICIP), Beijing, China, pp. 3645-3649, 2017.
[CrossRef] [Google Scholar] [Publisher Link] - O. Sidla et al., “Vehicle Recognition for Highway Lane Survey,” Proceedings. The 7th International IEEE Conference on Intelligent Transportation Systems (IEEE Cat. No.04TH8749), Washington, WA, USA, pp. 531-536, 2024.
[CrossRef] [Google Scholar] [Publisher Link] - Prashan Premaratne et al., “Comprehensive Review on Vehicle Detection, Classification and Counting On Highways,” Neurocomputing, vol. 556, pp. 1-13, 2023.
[CrossRef] [Google Scholar] [Publisher Link] - Alexey Bochkovskiy, Chien-Yao Wang, and Hong-Yuan Mark Liao, “YOLOv4: Optimal Speed and Accuracy of Object Detection,” arXiv preprint, pp. 1-17, 2020.
[CrossRef] [Google Scholar] [Publisher Link] - Md Rezaul Karim Khan, and Naphtali Rishe, “A Unified Framework for Vehicle Detection, Tracking, and Counting across Ground and Aerial Views Using Knowledge Distillation with YOLOv10-S,” Remote Sensing, vol. 18, no. 5, pp. 1-27, 2026.
[CrossRef] [Google Scholar] [Publisher Link] - Solange Munoz et al., “Best Practices for the Application of Automated Traffic Counting Using Computer Vision in Chile,” 21st Chilean Congress on Transport Engineering, Valparaíso, pp. 1-18, 2023.
[Publisher Link] - Ahsen Battal, Yunus Emre Avcı , and Adem Tuncer, “Real-Time Detection of Vehicle Queue States in Urban Traffic Using Deep Learning,” El-Cezeri Journal of Science and Engineering, vol. 12, no. 3, pp. 356-364, 2025.
[CrossRef] [Google Scholar] [Publisher Link] - OPMI, UF and UEI, Ministry Of Economy and Finance, 2026. [Online]. Available: https://www.mef.gob.pe/es/?option=com_wrapper&language=es-ES&Itemid=100898&lang=es-ES&view=wrapper
- Gen Hayauchi et al., “From Sensing to Impact: LiDAR-Based Parking Guidance for Narrow Streets in a Coastal Tourist Village,” International Journal of Intelligent Transportation Systems Research, vol. 24, no. 1, pp. 64-73, 2026.
[CrossRef] [Google Scholar] [Publisher Link] - Grzegorz Wilczewski, Tomasz Czarnecki, and Krzysztof Perlicki, “Optoelectronic Systems for Automatic Vehicle Counting and Classification in Rest Areas,” Proceeding SPIE 10445, Photonics Applications in Astronomy, Communications, Industry, and High Energy Physics Experiments, 2017.
[CrossRef] [Google Scholar] [Publisher Link] - Nashwan Adnan Othman, Zahraa Zakariya Saleh, and Bishar Rasheed Ibrahim, “A Low-Cost Embedded Car Counter System by using Jetson Nano Based on Computer Vision and Internet of Things,” 2022 International Conference on Decision Aid Sciences and Applications (DASA), Chiangrai, Thailand, pp. 698-701, 2022.
[CrossRef] [Google Scholar] [Publisher Link] - Isaías Irigoín Barboza, “Evaluation of the Premature Deterioration of the Rigid Pavement of Av. Micaela Bastidas, Chota, 2019,” National Autonomous University of Chota, pp. 1-226, 2020.
[Google Scholar] [Publisher Link] - Fabian Montes, and Clever Wilbert, “Improvement of the Vehicular and Pedestrian Transit Service on Av. Salaverry, Section: Av. Mariscal Castilla – Jr. Callao in the AA.HH. La Victoria of the District of El Tambo - Huancayo – Junin,” Degree Tesis, Peruvian University of the Andes, 2021.
[Google Scholar] [Publisher Link] - Torres Cortez et al., “Diagnosis and Proposal to Reduce Queue Lengths in Public Transport at the Intersection of Av. Mariscal Castilla and Av. Evitamiento in the City of Huancayo, Using Traffic Microsimulation,” Tesis, Peruvian University of Applied Sciences, pp. 1-88, 2020.
[Google Scholar] [Publisher Link]