info@autonexit.com

Working Hours: 9:00 AM to 5:00 PM

Vehicle counting with image processing

Vehicle counting with image processing

In recent years, significant advancements have been made in the fields of computer vision and artificial intelligence. One of the key applications of these technologies is object detection and tracking in video, which is widely used in projects such as traffic management, urban surveillance, vehicle counting, and smart parking systems. This article introduces a practical system for vehicle detection and tracking using the YOLOv11 Large model and the SORT (Simple Online Realtime Tracking) algorithm.

Vehicle Detection with YOLOv11

YOLO (You Only Look Once) is one of the fastest and most accurate real-time object detection algorithms. The YOLOv11 Large version, due to its higher accuracy, is capable of detecting vehicles under various conditions such as lighting changes, high-speed motion, and crowded scenes. In this system, each video frame is processed by the YOLO model, and the output includes bounding box coordinates, object class (Car), and confidence score.

Multi-Vehicle Tracking with SORT

Object detection alone is not sufficient because objects are re-detected in every frame without maintaining a consistent identity. To solve this problem, the SORT algorithm is used, which consists of two main components:

The Kalman Filter, which predicts the vehicle’s position even if it is temporarily lost, and
The Hungarian Algorithm combined with IoU, which associates new detections with existing tracks to maintain a consistent unique ID.

System Workflow

The overall process of the system is as follows:

  • Capture frames from a video file or camera
  • Detect vehicles using YOLOv11
  • Send detection coordinates to the SORT tracker
  • Assign a unique ID to each vehicle
  • Display bounding boxes and IDs on the frame
  • Continue processing in real time

System Features

  • Accurate vehicle detection using YOLOv11 Large
  • Simultaneous tracking of multiple vehicles
  • Stable and consistent ID assignment
  • Real-time performance
  • Compatible with webcam, IP camera, or video files
  • Extendable for vehicle counting and traffic analysis

Applications

This system can be used in various applications, including:

  • Traffic monitoring and management
  • Vehicle counting at entry and exit points
  • Smart parking systems
  • Urban and security surveillance
  • Traffic behavior analysis
  • Computer vision research projects

Optimization Tips

If a vehicle is temporarily lost and receives a new ID, tracking stability can be improved by increasing max_age, adjusting iou_threshold, and tuning the YOLO confidence threshold.

Conclusion

Combining YOLOv11 for detection and SORT for tracking provides a fast, simple, and efficient solution for real-time vehicle tracking systems. This system serves as a strong foundation for further development, including vehicle counting, trajectory analysis, and intelligent surveillance applications.

Liam Siahtiri

Liam Siahtiri

I’m passionate about PLCs and industrial automation, with a focus on complex programming, communication protocols, and SCADA systems. My goal is to develop practical, project-based training to fill the gap in industry education and give back to the field that shaped my growth. I hold a Master’s degree in Electrical Power Engineering.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Recently comments
  • Raja : Good day EhsanThanks for uploading. May i have the password to the uploaded rar file. Regards Raja
  • Liam Siahtiri : Hi, It's: autonexit.com
  • MEETKUMAR Sandipbhai PATEL : Good day Ehsan . Thanks for uploading. I don't know why I am not able to install and extract a folder can you guide me plz?