How Computer Vision Detects and Tracks Pedestrians
Pedestrian detection finds people in camera video and follows each one across frames. Here is how the pipeline works and where it is used.
On this page
Short answer
Computer vision detects pedestrians by finding people in each video frame and then tracks them by linking those detections across frames, so each person keeps one identity as they move. The system reports counts, walking speed, direction and waiting time, which cities and retailers use to make crossings safer and spaces easier to move through.
What is pedestrian detection and tracking?
Pedestrian detection and tracking is the use of computer vision to find people in video and follow each person from frame to frame. Detection answers where people are in a single image, and tracking answers where each person goes over time, so the system knows both the crowd and the individual paths through it.
A single frame can hold dozens of people at different sizes and distances, partly hidden behind each other. The detector must find them all, from a child near the camera to a distant figure crossing the far side of a square, and the tracker must keep their identities straight when paths cross.
The output is a set of tracks, one per person, each with a position in every frame. From those tracks a system can count crossings, measure walking speed, spot crowding and tell how long people wait, which is the raw material for safer streets and better public spaces. The basics are the same as what computer vision is, pointed at people instead of vehicles.
How does a system spot a pedestrian?
Detection starts with a model trained on images of people in many poses, clothes and lighting conditions. The model scans each frame and draws a box around every person it finds, with a confidence score, and boxes below a threshold are dropped so the system does not chase shadows or street furniture.
Modern detectors such as YOLO or similar models run fast enough for live video, often 20 to 30 frames per second on a modest graphics card. Some systems add pose estimation, which finds joints such as shoulders, hips and knees inside each box, and that helps tell a walking person from a poster or a statue. The main detector families are described in computer vision techniques.
Detection is hardest where people overlap. In a crowd, one person can hide most of the person behind them, so detectors trained on crowded scenes matter, and a high camera angle that looks down on the crowd gives cleaner boxes than a camera at head height.
How does tracking follow one person across frames?
Tracking links detections across frames by predicting where each person will be next. A simple tracker uses position and speed: if a box moves a short distance in the expected direction, it is probably the same person. When two paths cross, the tracker uses appearance, such as clothing colour, to keep the identities apart.
People leave the frame and come back, step behind a pillar, or are hidden by a passing bus. A good tracker holds an identity for a short time after a person disappears, then matches the returning person to the held identity instead of starting a new track, which keeps counts from inflating.
Tracking quality is measured with standard scores, and the most useful check is a manual one: watch ten minutes of video, count the people by hand, and compare with the system. If the system counts the same people twice or swaps identities at crossings, the tracker needs tuning before the numbers can be trusted. The build steps are covered in how to implement computer vision.
What does a pedestrian system measure?
A pedestrian system reports a small set of numbers for each camera view, updated every few seconds or summarised per hour. Each number answers a different question about how people use a space.
| Measure | What it means | Why it matters |
|---|---|---|
| Count | People passing a line or entering a zone | Shows footfall and peak times |
| Walking speed | Average speed along a path | Slow speeds can mean crowding or confusion |
| Direction split | Share of people going each way | Shows the main flow through a space |
| Dwell time | How long people stay in a zone | Long dwell can mean interest or a bottleneck |
| Waiting time | How long people stand at a crossing or queue | Drives signal timing |
| Near-miss count | Close passes between people and vehicles | Flags a safety risk |
Counts and direction together show the real flow. A square can have high footfall in both directions, or a strong one-way flow at rush hour, and the two need different layouts, signs and signal timings.
How do teams build a pedestrian detection system?
Building a pedestrian system follows the same pattern as other vision projects, with a few steps that matter more for people than for vehicles. The usual sequence is:
- Choose the measurement points. Pick crossings, entrances and walkways where counts and waiting times will change a decision.
- Mount cameras high and wide. A high angle sees over heads and gives cleaner boxes than a camera at eye level.
- Pick a detector trained on crowds. Test it on local footage with prams, wheelchairs, umbrellas and rush-hour crowds.
- Add tracking and rules. Link detections across frames, then define counting lines, zones and dwell areas.
- Validate by hand. Count people manually for an hour and compare, and tune the tracker until the gap is small.
- Connect the output. Send counts and alerts to signal controllers, dashboards or safety teams on a fixed schedule.
Example (hypothetical): a crossing near a school
Example (hypothetical): a school crossing sees 320 pedestrians between 07:30 and 08:30 on a school morning. Cameras count 40 of them, or 1 in 8, crossing outside the marked crossing, mostly where the pavement narrows near a bus stop.
The team extends the green walking phase from 12 to 18 seconds and moves the bus stop 10 metres further from the crossing. A week later the cameras count 16 people crossing outside the marked area out of 320, or 1 in 20, down from 1 in 8. That is 24 fewer risky crossings each morning, a fall of 60%.
The team keeps the longer phase and reviews the counts each term. Waiting time at the crossing rises by a few seconds for drivers, but the school and the council agree the trade is worth it, since the risky crossings were the reason for the change.
What are the common mistakes?
The most common mistakes in pedestrian detection are counting the same person twice, testing only in daylight, and treating a count as a fact without checking it by hand.
- Letting tracks split. When a tracker loses a person and starts a new track, one person becomes two in the count.
- Testing on empty streets. A system tuned on quiet footage fails at rush hour, so test on the busiest hour, not the easiest.
- Counting reflections and posters. Shop windows and large adverts can look like people, so mask them out of the detection zone.
- Ignoring wheelchairs and prams. People move at different heights and speeds, so test on the full mix, not only walking adults.
- Storing faces by default. Detection needs boxes, not identities, so blur faces and keep only the numbers.
Where is pedestrian detection used, and what limits it?
The largest use is road safety. Cities measure waiting times at crossings, find where people cross outside marked areas, and retime signals so the busiest crossings get more green time. Retailers count footfall past a shop and inside it, and stations use counts to open extra gates before a crowd builds. The safety angle is covered in computer vision for safety.
Privacy is the main limit. A system that tracks individuals can be misused, so most pedestrian systems blur faces, delete video quickly, and store only counts and speeds. Some cities publish the rules for what is stored and for how long, and an independent review of those rules is becoming normal. A partner for computer vision development can help set the privacy rules and the pipeline up correctly.
Crowds and weather are the technical limits. Dense crowds hide people behind each other, and rain, fog and low light cut detection accuracy. High cameras, overlapping views and regular hand checks keep the numbers honest, but no system counts a packed crowd perfectly.
Key takeaways
- Detection finds people in each frame; tracking links those finds into one path per person
- High cameras and crowd-trained detectors give cleaner counts than eye-level views
- Counts, direction, dwell and waiting time together show how people really use a space
- Validate by hand: a manual count is the only check that catches split tracks
- Blur faces and store only numbers, since detection needs boxes, not identities
Frequently asked questions
How accurate is pedestrian detection?
A good system counts 90 to 97 percent of people in daylight with a clear camera view, and less in dense crowds or bad weather. Teams check accuracy by counting people by hand for an hour and comparing, then adjust camera position or detector settings until the gap is small.
Does pedestrian tracking identify people?
No, in most systems. Tracking gives each person a temporary number for a few seconds so the system can follow a path, and the number is not linked to a name, a face or a device. Faces are blurred and video is deleted quickly in systems built for counting.
What is the difference between detection and tracking?
Detection finds people in one frame, while tracking links those finds across frames so each person keeps one identity over time. Detection alone can count people in a snapshot, but only tracking can measure walking speed, waiting time or a full path through a space.
Can pedestrian detection work at night?
It can, but accuracy falls, since cameras see less detail and shadows grow. Teams use cameras with good low-light performance, add lighting at key crossings, or pair cameras with thermal sensors where night counts matter and the budget allows it.
How many cameras does a crossing need?
A small crossing usually needs one high camera with a clear view of the whole area, while a large junction needs two or more, one per approach. The rule is simple: if a person can be hidden from every camera at some point, add another view.
Is pedestrian data private?
Counts and speeds are anonymous, but raw video is not, so most systems blur faces, store video only briefly, and publish only aggregate numbers. Cities that run these systems usually publish a data policy saying what is kept, for how long, and who can see it.