Computer Vision in Autonomous Vehicles: How Cars See the Road
Computer vision helps self-driving cars see lanes, vehicles and pedestrians, working with radar and lidar. Here is how the perception stack works.
On this page
Short answer
Computer vision in autonomous vehicles uses cameras and software to help a self-driving car see and understand the road: detecting lanes, vehicles, pedestrians, signs and signals, and tracking how each of them moves over time.
What is computer vision in autonomous vehicles?
Computer vision in autonomous vehicles is the use of cameras and software to help a self-driving car see and understand the road: detecting lanes, vehicles, pedestrians, signs and signals, and tracking how each of them moves. It is one part of the perception system, working alongside radar and lidar.
The car does not simply record video. It turns each frame into a structured picture of the scene: where the lane markings are, which objects are nearby, how fast they are moving, and whether any of them is likely to cross the car's path. That picture is updated many times a second, and the driving system uses it to decide whether to keep going, slow down, change lane or stop.
Computer vision is central to this because cameras are cheap, small and rich in detail. They read signs, signals and road markings that radar and lidar cannot. The trade-off is that cameras struggle in rain, fog, glare and darkness, which is why no serious system relies on them alone. Computer vision in a car is one sensor among several, not the whole answer.
What does the perception stack do?
The perception stack turns raw sensor data into a picture of the world the car can act on. The table below shows its main jobs and what each one produces.
| Job | What it detects | What the car gets |
|---|---|---|
| Lane detection | Markings, edges, road shape | Where the car is in its lane |
| Object detection | Cars, trucks, cyclists, pedestrians | A list of nearby road users |
| Tracking | How each object moves over time | Speed and direction for each object |
| Sign and signal reading | Speed limits, stop signs, lights | The rules that apply right now |
| Free-space estimation | Where the road is clear | Where the car can safely drive |
| Depth estimation | Distance to each object | How much room there is to react |
These jobs run together, not one after another. A pedestrian is detected, tracked across frames, and its distance is estimated at the same time, so the car can judge whether the person is about to step into the road. If any one job fails, the others still give the car enough information to slow down rather than guess.
How do cameras, radar and lidar work together?
Cameras, radar and lidar work together because each sensor is strong where the others are weak. Cameras read detail such as signs, signals and lane markings. Radar measures speed and distance reliably in rain and fog. Lidar builds a precise three-dimensional map of shapes around the car.
The car combines the three streams into one picture of the scene, a process called sensor fusion. When the camera says there is a pedestrian and the radar says something is moving at walking speed in the same place, the car is confident. When the sensors disagree, the car is designed to act cautiously, usually by slowing down, until the picture is clear again.
Some teams build camera-only systems, arguing that lower cost matters more than the extra sensors. Most teams that carry passengers use the full set, because the cost of a missed detection is far higher than the cost of the hardware. The choice is a trade-off between cost and the margin for error, and it should be stated openly rather than hidden behind a brand name.
How does the car decide what to do next?
The car decides what to do next by combining the perception picture with a plan: where it needs to go, which rules apply, and what the other road users are likely to do. Planning turns the picture into a path, and control turns the path into steering, braking and acceleration.
Prediction is the hardest part. A pedestrian standing at a kerb may cross or may wait. A cyclist may hold a line or swerve. The system estimates what each nearby road user is likely to do next, based on their position, speed and past movement, and it leaves room for the estimate to be wrong.
Safety comes from margins, not from perfect prediction. The car keeps a gap it can stop within, slows near crossings and schools, and treats anything it cannot classify as an obstacle until proven otherwise. Vehicle detection on roads follows the same principle: when in doubt, the safe action is to slow down.
How do teams test and validate a self-driving system?
Teams test and validate a self-driving system in layers, starting with recorded data and ending with supervised driving on real roads, because no single test can cover the range of things that happen in traffic.
- Test on recorded data. Run the perception system on hours of labelled video and measure how often it detects, tracks and classifies correctly.
- Test in simulation. Replay tricky scenes, such as a child running between parked cars, thousands of times with small variations.
- Test on closed tracks. Drive the car on a private course with staged hazards, dummies and other vehicles.
- Test with a safety driver. Drive on public roads with a trained driver ready to take over, and log every takeover.
- Review every failure. Each takeover and each near miss becomes a new test case, so the same failure is not repeated.
The log of safety-driver takeovers is the most honest measure of progress. If takeovers per thousand kilometres are falling and the reasons are understood, the system is improving. If the number is flat, adding more driving will not help; the team needs to fix the specific situations that cause takeovers. A partner for computer vision development can help with the labelled data and the evaluation setup.
Example: a shuttle runs one fixed route
Example (hypothetical): a campus shuttle runs one fixed 4-kilometre loop at up to 30 kilometres per hour, carrying staff between buildings. The route has 6 crossings, 2 junctions and a bus stop where people gather.
In its first month the shuttle drives 2,400 kilometres and the safety driver takes over 48 times, or about once every 50 kilometres. The log shows 20 takeovers at one crossing where pedestrians step out from behind a parked van, 14 at a junction where the shuttle hesitates behind turning traffic, and 14 for other reasons.
The team fixes the crossing first, adding a slow-down zone 30 metres before it and retraining the pedestrian model on footage from that exact spot. In the next month the shuttle drives 2,600 kilometres with 26 takeovers, or about once every 100 kilometres, and the crossing takeovers fall from 20 to 6.
The arithmetic is simple: the same route, the same speed, and the takeover rate halved because the team fixed the worst location first instead of driving more kilometres.
What are the common mistakes?
The most common mistakes in autonomous-vehicle computer vision are trusting one sensor, testing only in good weather, and treating simulation as proof.
- One sensor only. A camera-only system has no answer when rain, fog or glare blinds it, and the car must then slow down or stop.
- Good-weather testing. A system that works on sunny days can fail at dusk, in rain or on wet roads that reflect headlights.
- Simulation as proof. Simulation finds bugs cheaply, but it cannot prove the car is safe on real roads with real people.
- Ignoring rare events. The long tail of unusual situations, such as a ladder falling off a truck, is where real systems fail.
- No takeover log. Without a record of every safety-driver takeover and its cause, the team cannot tell whether it is improving.
Key takeaways
- Cameras read signs, signals and lane markings that radar and lidar cannot, but struggle in rain, fog and glare
- The perception stack detects lanes and objects, tracks their movement, reads rules and estimates free space
- Sensor fusion combines camera, radar and lidar so the car acts on agreement and slows down on disagreement
- Safety comes from margins and cautious behaviour, not from perfect prediction of other road users
- Testing runs in layers, and the safety-driver takeover log is the most honest measure of progress
Frequently asked questions
What does computer vision do in a self-driving car?
It turns camera images into a structured picture of the road: lane markings, nearby vehicles and pedestrians, signs and signals, and how each object is moving. That picture is updated many times a second and drives every decision the car makes.
Do self-driving cars use only cameras?
Some do, but most systems that carry passengers combine cameras with radar and lidar. Cameras read detail, radar measures speed and distance in bad weather, and lidar builds a precise three-dimensional map. Each covers the others' weak points.
How does a self-driving car predict what pedestrians will do?
It estimates what each nearby road user is likely to do from their position, speed and past movement, then leaves room for the estimate to be wrong. The car keeps a stopping gap and slows near crossings, so a wrong guess still ends safely.
How are self-driving systems tested before public roads?
Testing runs in layers: recorded labelled data, simulation of tricky scenes, closed-track driving with staged hazards, then supervised driving on public roads with a safety driver. Every takeover becomes a new test case.
What is the hardest part of autonomous vehicle vision?
The long tail of rare events. Common scenes are well handled, but unusual situations, such as debris on the road or a person in an unexpected place, are where systems fail and where testing effort should concentrate.
Can computer vision work in rain and at night?
It works less well. Rain, fog, glare and darkness all reduce what a camera can see, which is why radar and lidar matter: they keep measuring distance and speed when the camera is struggling.