Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
AI & Machine Learning

Counting and Tracking Objects With Your Existing Cameras

Last updated:

You probably own more sensors than you think

A builders' merchant has 14 cameras covering the yard, the gate and the trade counter. They exist for insurance. Nobody watches them unless something goes missing.

Those same cameras could count vehicles entering the yard per hour, measure queue length at the counter, and tally pallets leaving loading bay two. Modern object detection models run comfortably on recorded or live footage and turn pixels into numbers a manager can use.

The catch is that security cameras were positioned to identify faces and number plates after an incident, which is not the same as the angle that makes counting reliable.

What can be counted and tracked

  • People crossing a line, entering a zone, or waiting in a queue
  • Vehicles by broad type at gates, car parks and loading bays
  • Pallets and cages moving through doors or staged in a marshalling area
  • Products on a conveyor, where the camera is close and the background plain
  • Occupancy of desks, tables or parking bays over the day
  • Dwell time in a zone, such as how long lorries wait before unloading

Counting relies on two steps. Detection finds each object in a frame. Tracking links the same object across frames so a person standing in a doorway for a minute is counted once, not 1,800 times. Tracking is usually where accuracy is won or lost.

Camera angle decides almost everything

Camera positionCounting qualityWhy
Overhead, looking straight down at a doorwayExcellentPeople and objects rarely hide behind each other
High corner, angled at 45 degreesGood in light trafficOcclusion rises quickly in crowds
Eye level, facing a queuePoor for countsPeople block each other; great for faces, bad for numbers
Wide yard view from a poleGood for vehicles, weak for peopleSmall objects at distance lose detail

Resolution matters less than people expect for large objects and more for small ones. A car at 60 metres on a 1080p camera is fine. A box on a shelf at the same distance is a few pixels.

Night footage, rain on the lens and infrared switching all deserve testing. Many systems that score well on a sunny test clip lose a noticeable share of accuracy at 6pm in November.

Running it on footage versus live

Batch processing recorded footage overnight is the simplest start. It gives daily and hourly numbers, costs little, and needs no always-on infrastructure. Live counting is needed when someone will act within minutes, such as opening another till when the queue passes six people.

Live processing can run on a small box on site or in the cloud. Where each camera stream is processed has real consequences for bandwidth, privacy and cost, which we cover in our post on edge cameras versus cloud vision.

Privacy is not optional

Counting people from CCTV is processing personal data, even if you only ever keep the numbers. Under UK and EU data protection law you need a lawful basis, a data protection impact assessment for most workplace or public-facing uses, and signage that reflects what is actually happening.

  • Process frames and discard them, keeping only counts where you can
  • Avoid face recognition entirely unless you have a very specific, lawful reason
  • Tell staff before you start, and do not quietly repurpose counts for performance monitoring
  • Check how the EU AI Act treats your use if you operate in the EU; biometric identification carries far heavier obligations than counting

When cameras are the wrong way to count

If a door beam or a floor mat counter would give the number you need, buy one. They are cheap, simple and do not raise the same privacy questions. Barcode or RFID scans at a dock beat vision for pallet counts where scanning already happens.

Vision earns its place when the thing you want to count has no scan, no beam and no form attached to it.

Cameras make sense where you need several measurements from one device, where installing sensors is impractical, or where the footage already exists and you want history from last month too.

How we test feasibility

  1. Pull one week of footage from the candidate camera, including nights and a busy day
  2. Count by hand for several sample hours to create a ground truth
  3. Run detection and tracking and compare the totals and the hour-by-hour pattern
  4. Report accuracy by condition: daylight, dark, crowded, quiet

At SpiderHunts that test usually takes days rather than weeks, and it settles the argument about whether the camera is good enough. When it is, the build that follows is part of our machine learning work connected to whatever dashboard or rota tool the numbers need to reach.

Plan for the numbers to be wrong in a predictable way, and say so on the dashboard. A count that runs 5% low in the dark is still perfectly useful for spotting that Tuesday afternoons are quiet, as long as nobody is using it to reconcile tills. Once counts are flowing, pairing them with sales or dispatch data is where the insight tends to appear, and our post on anomaly detection for operations covers flagging the days that look unusual.

Frequently asked questions

Can AI count people accurately from CCTV?

Yes, in the right conditions. Overhead cameras at entrances can be very accurate; angled cameras in crowded areas less so because people block each other. Test on your own footage rather than relying on a vendor's headline figure.

Do we need new cameras for object counting?

Often not. Most IP cameras from the last several years provide enough resolution for counting people and vehicles. You may need to reposition one or add a single overhead camera at a key doorway.

Is people counting with CCTV legal in the UK?

It can be, with a lawful basis, a data protection impact assessment and clear signage. Keeping only aggregate counts and avoiding identification of individuals reduces the risk considerably. Take advice specific to your site.

Can it tell the difference between staff and customers?

Partly, using uniforms or zones that only staff enter, but it is error-prone. Excluding staff-only areas and subtracting a known staff count is usually more reliable than asking the model to guess.

How does object tracking avoid double counting?

The tracker gives each detected object an identity and follows it across frames. A count is only recorded when that identity crosses a defined line or enters a zone, so lingering does not add to the total.

Keep reading

Already recording footage nobody watches?

Send us a short clip from the camera you have in mind and tell us what you want counted. We will tell you honestly whether that angle can do it.

Book a free 30-minute call Get a project estimate WhatsApp us

Related services

What we build for problems like this one

AI AgentsMachine LearningAI Integration