There are two ways for cameras to measure the distance to an object: they can fire a beam of infrared light at it and measure the time it takes to return, or they can look at contrast differences in a small area of the object and adjust the lens until you maximise the difference. The former system was common in early compact digital cameras and may still be found in many camera-phones. The latter has always been popular in DSLRs and is becoming increasingly common in digicams, particularly the more advanced models. Many modern cameras combine both systems.


Infrared AF systems only work when subjects are close enough to reflect enough of the beam for the camera to detect. For distant subjects, focus defaults to infinity. This is fine for small-sensor digicams, which have inherently wide depth of focus, but not for DSLRs. IR systems fail when shooting through glass, mesh, bars or any other objects that reflect the beam. However, they can be effective in dark situations where other focusing systems fail.

Contrast-based AF systems aren’t distance-limited and they can focus through window glass and other barriers. However, they have difficulty focusing on subjects with no contrast, such as a clear sky, large plain-coloured objects and misty scenes. For everything else they are both fast and reliable – provided the camera’s AF system is well-designed, correctly set up and used properly. We’ll address all three issues in this Insider.

AF System Design
Contrast-based AF systems rely on light sensitive sensors. In DSLRs they are usually located behind the reflex mirror in the base of a camera’s mirror box. A half-silvered section in the centre of the main mirror allows light to pass through to these sensors, enabling the lens to be focused while you’re viewing the subject.

The sensors are arrays of photosites that only detect contrast. Interestingly, they are only sensitive to contrast modulations in one direction. The reason is shown in the diagram below. The sensor labelled A is the only one capable of detecting contrast because it spans a contrast boundary. Sensor B would see all white; sensor C would see all black and sensor D would see all grey.


The sensor labelled A is the only one capable of detecting contrast because it spans a contrast boundary. Sensor B would see all white; sensor C would see all black and sensor D would see all grey.
When the sensors can’t detect contrast, the camera’s microprocessor will drive the focus on the lens backwards and forwards until the difference in intensity between adjacent pixels is at its greatest. This ‘hunting’ can significantly slow focusing times and may even force photographers to switch to manual focusing with some low-contrast subjects.

To improve focusing speeds and minimise ‘hunting’, AF sensors are arranged in two orientations: horizontal to the field of view and vertical. Some are coupled to produce cross-type sensors that respond to contrast in both vertical and horizontal directions. Most cameras include both types – although some have more linear sensors while others have more cross-type sensors. The latter provide greater accuracy.

Different camera brands and models have different numbers and arrangements of sensors. However, in most cases the sensors are arranged around the centre of the viewfinder field of view. Three typical patterns are shown below.


A typical AF sensor pattern in a point-and-shoot digicam. The two half-rectangles can detect horizontal and vertical contrast differences – but only in the centre of the field. When focus is achieved, the detectors may glow green.


A typical AF sensor pattern found in an entry-level DSLR. The sensor in the middle is a cross-type sensor while the others are linear, although vertical and horizontal directions are included. The rectangles mark the approximate positions of the sensors in the viewfinder. The sensors, which are invisible to the eye, are shown in red (which is often the colour used to indicate which sensors are active).


The AF sensor pattern from a professional DSLR camera. The cross-type sensor in the centre (coloured magenta and blue) is surrounded by two groups of similar sensors at different distances. The remaining sensors are linear and horizontal-line sensitive.

AF Errors
Autofocusing errors usually occur because photographers don’t understand how AF sensors work. Most photographers have taken shots like the one shown below where the lens has focused on the background instead of the subject of the picture. This usually results from shooting without checking what the camera is actually focusing on.


Shot taken with no control of the AF point selection.


The desired result, achieved by using focus point selection to focus on the flowers that aren’t in the centre of the frame.

In many cameras (particularly digicams), focus is normally prioritised on the central point of the AF system. More sophisticated digicams and most DSLRs can use all points in the array. Either way, when you set your camera to full auto or one of the Scene modes, the camera will always select the focus point (or points) and in many cases it will be the central point. If you want to control where the camera will focus, you must switch to the P, A, S and M shooting modes.

However, even when the camera is set for central focusing, there are several ways to change the focused area. The quickest and simplest is to position the central AF point on the part of the subject you want sharp, half-press the shutter button (or press the AF lock) and quickly re-compose the shot.

In the P, A, S and M shooting modes a more accurate method (but slightly slower) is to use AF point selection. Different camera brands and models provide different options for selecting specific AF points. Some models allow you to use any one point in the array, while others limit selection to a reduced set of points.

Some models let you select clusters of AF points for focusing on off-centre subjects above, below or to either side of the frame. The selected AF point(s) are usually illuminated in the viewfinder – and on the LCD in Live View mode. Check your camera’s user manual for details of AF point selection.

AF Modes
Most DSLR cameras provide a range of AF modes that includes single AF and continuous AF plus variations like AI Servo AF, focus tracking AF and predictive AF. In single AF mode the camera focuses when the shutter release is half-pressed. Most cameras default to ‘focus priority’ mode with this setting, which means the shutter will not be released until the camera achieves focus on something. (It may not be the area you want to have sharp, however.)

With continuous AF (also known as ‘servo AF’) the camera focuses continuously UNTIL the shutter release is half-pressed. This reduces the focus lag time but uses more battery power. Continuous AF normally sets the camera to ‘release priority’ mode, which means shots are taken when the shutter is pressed, regardless of whether the subject is in focus. However, it provides more scope for photographers to decide exactly which part of the subject they want sharp.

With Canon’s AI Servo AF mode, the camera always focuses on the subject with the centre point. When the subject moves, focus is passed on to peripheral focus points when the subject moves away from the centre of the frame. This system is also known as ‘focus tracking’ and it’s common in DSLRs.

Predictive focus tracking is an evolution of focus tracking that uses phase detection to detect the direction and speed of motion of a moving subject. All AF sensors are involved and the resulting information determines how much the lens focus should be adjusted and in which direction. This should make focusing at least 25% faster than conventional AF systems, as shown in the diagram below.


The sequence of events in conventional and predictive tracking AF systems.

Some cameras let users switch off groups of peripheral focus points to improve focusing accuracy for sports photography, where quick responses are vital. Many sports photographers use only one focus point for optimal speed and precision.

Autofocusing Decisions
As well as deciding which AF mode to use, photographers should also consider just how much of a subject they wish to render in sharp focus; in other words the depth of field in the shot. This decision will influence the lens aperture that should be set.

Depth of field (DOF) is the range of distances in a scene that appear acceptably sharp in the image. By ‘acceptably sharp’ we mean the unsharpness is imperceptible under normal viewing conditions. DOF is influenced by several factors:
1. The subject distance – or distance to the point in the subject that is in perfect focus.

2. The subject magnification – which relates to the lens focal length.

3. The lens aperture (f-stop).

4. The imaging area (or sensor size).

5. The viewing distance.

Distant subjects photographed with wide-angle lenses at small apertures (f8 and smaller) using small-sensor digicams can appear to have everything in the shot pin-sharp. In contrast, close subjects photographed with DSLR cameras using telephoto lenses set at wide apertures (f4 or larger) will have shallow planes of focus. The closer you view an image, the easier it is to identify the regions where focus begins to fall off.

DOF is always greater behind the subject than in front of the subject and landscape photographers often use this factor to maximise the zone of sharp-looking focus in their shots. If you focus on a point in a scene roughly 1/3 of the distance to the main area in the subject where you want pin-sharpness and stop down the lens to f11 or smaller, it should be possible to render the entire scene with acceptable sharpness.


In order to obtain maximum depth of field in this shot, the lens was focused on the nearest green bush (closest to the centre of the image), which represents the hyperfocal distance. The lens aperture was stopped down to f13 to ensure both foreground and background details look sharp.

For subjects like landscape and close-up shots where sharpness throughout the image is required, the camera should be focused on the hyperfocal distance. At this point, DOF extends from half way back to the camera right out to infinity.

An easy way to find this point without making calculations is to focus on the zone in the subject where sharpness is desired and then – without changing other parameters – pull focus back to approximately 1/3 of the pre-focused distance. Setting the lens aperture to f11 or smaller on a DSLR or f5.6 or smaller on a digicam should achieve the result you require.

Also see Lens Advice