top of page

How Does a Camera Keep a Moving Person Sharp? Autofocus and the Lens Equation

7 hours ago
4 min read
How Does a Camera Keep a Moving Person Sharp? Autofocus and the Lens Equation
How Does a Camera Keep a Moving Person Sharp? Autofocus and the Lens Equation

A person walks toward you and your camera keeps them sharp without any effort. Behind that is a small motor that moves the lens by a fraction of a millimetre to a few millimetres, again and again, guided by a simple rule of optics.

The animation below follows a person walking toward a camera. You can change the focal length and the closest distance, and watch the subject distance, the image distance, the lens extension, the magnification and the blur on the sensor.

The short answer

A lens bends the light from each point of the subject so it meets again at one point behind the lens. The thin-lens equation says where:

1/f = 1/u + 1/v

where f is the focal length, u is the distance to the subject and v is the distance from the lens to the sharp image. The sensor cannot move, so the lens does. As the subject comes closer, u falls, v grows, and the lens has to move forward, away from the sensor. Autofocus checks the contrast of the image and keeps nudging the lens until the edges are as crisp as possible.

With a 50 mm lens, a subject walking from 3 m to 0.42 m makes v grow from about 50.85 mm to about 56.76 mm, so the lens travels about 5.9 mm in the animation.

What the animation shows

The person walks toward the camera, the subject distance falls, and a small motor turns a lead screw that moves the lens forward. A 0.5 mm pitch lead screw turns 360° for every 0.5 mm of lens travel. The panels show the blur circle on the sensor while the lens catches up, and how it drops to zero when focus is locked.

The physics: image distance and extension

Solving the lens equation for the image distance gives v = f·u / (u − f). The lens extension is v − f, the distance it has moved beyond its infinity-focus position. The magnification is v / u.

When the subject is very far away, v is almost f and the extension is close to zero. As the subject comes closer, the extension rises sharply, especially near the minimum focus distance.

What the numbers say

For the subject walking from 3 m to the closest distance, the model gives:

Focal length

Lens extension at 3 m

Lens extension at 0.42 m

35 mm

0.41 mm

3.18 mm

50 mm

0.85 mm

6.76 mm

100 mm

3.45 mm

31.25 mm

The extension grows with the square of the focal length, so a long lens must travel much farther. At 50 mm, the magnification goes from about 0.017 at 3 m to about 0.135 at 0.42 m, and the lead screw turns from about 1.7 to 13.5 turns.

The closest distance matters too. With a 50 mm lens and a closest distance of 1.5 m, the lens travels only to about 1.72 mm, while at 0.3 m it must travel to about 10 mm.

In the animation the blur circle on the sensor of the f/2 lens peaks at about 148 µm while the lens is catching up with the moving subject, and falls to zero once focus is locked.

Honest limits of the model

This is a thin-lens model. Real camera lenses are made of many elements, and most focus by moving an internal group rather than the whole lens, so the real motion differs. Real cameras also use phase detection as well as contrast, which finds the focus direction faster. The animation shows only the contrast approach to keep the idea clear.

Frequently asked questions

Why does the lens move when the subject moves? The position where the image is sharp depends on the subject distance. The sensor is fixed, so the lens moves to put the sharp image on it.

Does the lens move forward or back for a nearer subject? Forward, away from the sensor.

What is contrast-detection autofocus? The camera adjusts the focus until the image edges have the highest contrast, which means the image is sharpest.

Why does a longer lens need more focus travel? The extension grows roughly with the square of the focal length for the same subject distance.

What does the thin-lens equation assume? A single idealised thin lens. Real multi-element lenses are more complex, but the equation shows the main trend.

What is magnification? The size of the image divided by the size of the subject, which here equals v divided by u.

Related

Figures in this article come from the animation's thin-lens model: focal length 35 to 100 mm (50 mm default), subject distance from 3 m to the closest distance (0.42 m default), a 0.5 mm pitch lead screw and an f/2 aperture. They illustrate the principle and are not data for a real lens.

Comments


bottom of page