Vehicle Counting System


The client is a prominent construction and engineering contractor based in Hong Kong. They are reputed for delivering high-quality projects throughout China and Southeast Asia. The company focuses on civil, building, foundations, electrical and mechanical, facades, interiors works, and design. 


Traditionally, consignment tracking and logging are carried out by consignment tracking executives, who are responsible for tracking each consignment at regular intervals as it moves from origin to its destination along the suggested route. They coordinate with the truck driver, transport companies, and transport authorities to update real-time information on the system.

However, since all of this is done manually, mistakes are often made. This leads to erroneous information that affects the entire logistics chain. The client wanted to automate this process of consignment tracking and logging to prevent such mistakes from happening. The business requirements put forth by our client were,

  • Count the number of vehicles entering and exiting the premises
  • Detect the number plate and registration number of the vehicle
  • Log the traffic details and visualize them in an intuitive admin dashboard
  • Categorize the vehicles based on make, model, company of the vehicle
  • Raise red alerts for blacklisted vehicle


Based on the business requirements, we developed a system that uses computer vision technology to detect and track all of the vehicles that enter and leave the business facility. The solution was developed with machine learning algorithms that have been trained to recognize and identify the vehicles that move in the facility. The solution was also able to count these vehicles, categorize them based on the make, model, type of the vehicle, and then log them onto a structured database.

The first task undertaken is to calculate the number of vehicles crossing the intersection in each direction.  We built a robust segmentation algorithm that detects foreground pixels corresponding to moving vehicles. The system tracks the object of interest – the vehicles’ trajectories to identify its direction of movement. Based on the identified trajectories, vehicles are primarily counted based on their trajectory direction, which is either inward or outward.

The system can detect the vehicle’s license plate and recognizes the registration number. It can also recognize the type of vehicle and categorize it according to segments such as two-wheelers, dump trucks, cars, etc. The system was able to count and classify vehicles in real-time with a high level of accuracy (>98%) under different environmental situations such as the presence of shadows.