Overview

Autofocus is an automated method for positioning a camera's focusing element so that a subject appears sharp in the resulting image. A complete autofocus system normally combines a movable optical element (the lens or group of lens elements), a sensing device such as an image sensor, a drive mechanism, and processing logic that evaluates image quality and commands motion. The objective is to move the optics to the position that produces the best perceived image quality for a chosen scene or subject.

Core components and measurements

Typical autofocus systems operate by measuring some metric of focus quality at different lens positions. Common focus metrics include contrast or gradient measures computed across the sensor image, phase differences detected in dedicated photodiodes, or frequency-domain estimators. The processing unit compares measurements across positions and selects the one with the highest score. Motion is provided by small motors in the lens or camera body; some systems also use voice-coil actuators or piezoelectric elements for fast, precise adjustments.

Methods and algorithms

  • Contrast-detection (CDAF): evaluates image sharpness directly from the sensor by maximizing local contrast. It is accurate but can be slower because it often requires iterative searching.
  • Phase-detection (PDAF): uses pairs of sensors or split photodiodes to detect whether the image is front- or back-focused and in which direction to move; this allows single-step correction and faster response.
  • Hybrid approaches: combine PDAF for coarse positioning and CDAF for fine tuning to balance speed and precision.
  • Predictive and tracking algorithms: use motion models and continuous measurements to follow moving subjects in video or sports photography.

Speed and practical strategies

To make autofocus faster and more reliable, systems often adopt staged searches: a coarse sweep across the full focus range with large steps provides an approximate best region, followed by a fine search with smaller steps to refine the focus. Interpolation among the top-scoring positions can improve accuracy without requiring more physical steps. Manufacturers also tune motor control, use depth sensors, or apply machine-learning-based subject detection to speed up acquisition. Continuous autofocus modes keep adjusting focus during recording so moving subjects remain sharp.

History and development

Autofocus evolved from early mechanical and electronic aids in film cameras to today's mostly electronic systems in digital cameras and smartphones. Phase-detection modules became common in single-lens reflex (SLR) cameras, while compact cameras and early live-view systems relied on contrast-detection. Modern mirrorless cameras and many phones use on-sensor phase detection or computational imaging techniques to achieve fast, accurate focusing even in low light.

Applications, limitations and notable distinctions

Autofocus is central to many image-making and imaging fields: still photography, cinematography, microscopy, machine vision and mobile imaging. Strengths include faster operation and higher keeper rates for action shots; limitations appear in low-contrast scenes, through obscured or low-light targets, and with subjects lacking detail. Distinguishing methods is useful when choosing equipment: PDAF tends to be faster for initial acquisition, CDAF can be more precise for fine focus, and hybrid implementations aim to deliver both advantages.

Further notes

Practical users can improve autofocus performance by selecting appropriate autofocus modes (single, continuous, or manual override), using smaller apertures for greater depth of field when acceptable, and ensuring adequate illumination and subject contrast. For technical details on implementation, consult manufacturer's materials or optics texts for descriptions of sensor architectures and control algorithms. For introductory resources, see manufacturer guides and technical summaries represented by lens, scene and image sensor documentation.

Note: This article summarizes common principles and distinctions in autofocus technology without covering every specialized design or proprietary algorithm.