Autofocus is a feedback system that moves a camera lens until the image lands sharply on the sensor. The camera measures focus, decides which direction the lens must move, commands a tiny motor inside the lens or camera body, checks the result, and repeats as needed.
Modern cameras make that process feel almost invisible. Tap a face on a phone, half-press a shutter button, or point a mirrorless camera at a running athlete and a green box appears as if the camera simply “knows” what should be sharp. Underneath that box is a mix of optics, semiconductor sensors, control algorithms and motorized mechanics working in a fraction of a second.
Focus is really about where light converges
A camera lens bends incoming light so rays from a subject converge onto the image sensor. If the sensor sits at the correct image plane for that subject distance, fine details appear sharp. If the lens is focused too near or too far away, the light reaches the sensor as a blur rather than a tight point.
Manual focusing solves this by letting the photographer rotate a focus ring until the image looks sharp. Autofocus replaces the human judgment-and-hand loop with sensors, calculations and a motor. The goal is the same; only the control system changes.

Contrast detection asks: is the image getting sharper?
One autofocus method is contrast detection. A sharply focused edge has a strong difference between light and dark neighboring pixels. A blurred edge spreads that transition across more pixels and reduces local contrast.
The camera can therefore move the lens, measure contrast, move again and look for the position where contrast reaches its maximum. This method can be very accurate because it evaluates the image formed on the actual imaging sensor.
The limitation is direction. A contrast measurement can tell the camera that the image is blurry, but the first measurement alone does not necessarily reveal whether the lens should move closer or farther. Older systems often had to “hunt” past the correct point and reverse direction before settling.
Phase detection asks: which way, and by how much?
Phase-detection autofocus compares light arriving through different portions of the lens. If the subject is properly focused, the paired image information lines up. If it is out of focus, the two samples are displaced relative to one another.
That displacement contains more useful information than a simple “sharp or blurry” score. It can tell the camera the direction of the error and estimate how far the lens needs to move. That lets the system drive toward the correct focus position directly instead of searching blindly.
Canon’s technical explanation of Dual Pixel CMOS AF describes this advantage directly: phase detection can determine both which direction the lens must move and approximately how far it must travel.
CanonUSA’s technical movie shows how Dual Pixel CMOS AF uses phase information from paired photodiodes to determine focus quickly and continue tracking moving subjects.
Modern mirrorless cameras put autofocus onto the image sensor
Traditional DSLRs often used a separate autofocus sensor when shooting through the optical viewfinder. A partially transparent mirror redirected some incoming light toward dedicated phase-detection hardware. When the mirror flipped up for the exposure, the image sensor recorded the photograph.
Mirrorless cameras removed that moving reflex mirror and increasingly placed phase-detection capability directly on the main image sensor. Canon’s Dual Pixel design, for example, divides the light-sensitive area of a pixel into paired photodiodes that can be read separately for focus detection and then combined for the final image.
The underlying photodiodes are semiconductor devices, making autofocus another everyday application of the same physics discussed in BitcoinVersus.Tech’s semiconductor-device overview.
The lens still has to physically move
Detecting the error is only half the problem. The camera must also change the optical system. A focus motor moves one or more lens groups forward or backward by extremely small amounts until the desired subject falls onto the focal plane.
Different lenses use different motor technologies—stepping motors, ultrasonic motors, linear motors and other designs—but the control idea is similar. The camera estimates the needed correction, sends a command, receives new focus information and adjusts again.
This makes autofocus a classic closed-loop control problem. Sensors measure the result, a controller calculates an error, an actuator moves the mechanism, and the system measures again.
Single autofocus versus continuous autofocus
For a stationary subject, a camera can focus once and lock. Camera makers use names such as AF-S or One-Shot AF for this general behavior. The subject is measured, the lens moves into position, and focus remains fixed until the photographer asks again.
Moving subjects require continuous focus. In AF-C, Servo AF or similarly named modes, the camera repeatedly measures subject distance and updates the lens position while the subject moves.
Good tracking systems also predict motion. If a cyclist is approaching quickly, the camera cannot merely react to where the cyclist was a moment ago. It estimates where focus will need to be when the shutter actually opens.
Face, eye and subject detection sit above the basic focus system
Phase detection answers an optical question: where should the lens focus? Modern subject-recognition systems answer a different question: what part of the scene deserves focus?
Image-processing software can identify faces, eyes, animals, vehicles and other subjects, then hand the chosen region to the autofocus system. The focusing hardware still has to move the lens, but software decides what target should receive priority.
This is one reason autofocus increasingly overlaps with computer vision. The same broad idea—extract useful structure from camera images—appears at a much larger scale in autonomous-driving systems such as Waymo’s robotaxi perception stack, although vehicle perception involves far more than focus alone.
Phones use the same basic ideas
Smartphones have tiny lenses and short focusing travel compared with interchangeable-lens cameras, but many use phase-detection pixels, contrast information or combinations of the two. Software then adds face detection, subject segmentation, multi-frame processing and computational photography.
A phone camera that scans a QR code still benefits from reliable focus: the software cannot decode the pattern well if the camera never resolves the edges clearly enough.
Smartphones also use phase-detection autofocus. This Infinix launch post is tied to a phone whose main camera used PDAF, showing how the same focusing principle moved from dedicated cameras into pocket devices.
Why autofocus still fails sometimes
Autofocus needs usable visual information. Very dark scenes reduce signal. Flat surfaces such as a blank wall may contain too little contrast. Repeating patterns can confuse correspondence. Reflections, glass, smoke and foreground objects can cause the system to lock onto the wrong distance.
Fast lenses and larger effective apertures can help some phase-detection systems because they provide a wider optical baseline and more light. But focus performance is always a combination of lens mechanics, sensor design, processing speed, subject recognition and the scene itself.
Autofocus is not the same thing as image stabilization
These features are easy to confuse because both can affect apparent sharpness. Autofocus moves optical elements so the intended subject lands at the correct focal plane. Image stabilization compensates for unwanted camera motion by moving lens elements, the image sensor or both.
A perfectly focused subject can still blur if the camera shakes during a long exposure. A perfectly stabilized camera can still produce a blurry subject if the lens is focused at the wrong distance. They solve different problems.
The practical takeaway
The easiest way to understand autofocus is as a loop: measure, decide, move, measure again.
- Contrast detection searches for the lens position that produces maximum image contrast.
- Phase detection can estimate the direction and amount of focus error from paired image information.
- Subject recognition decides what the camera should prioritize—such as an eye or moving animal.
- The focus motor physically moves lens elements to correct the optical focus.
- Continuous AF repeats this process while predicting a moving subject’s next position.
Autofocus feels instantaneous because modern cameras compress that entire sensing-and-control process into tiny fractions of a second. What looks like a simple green box is really an optical measurement system, a motor controller and increasingly a computer-vision system all cooperating to put the right part of the world into sharp focus.

Leave a Reply