How does the autofocus work?

here is a brief explanation of how the two common passive autofocus systems work. Passive means the camera does not send out a signal to measure the distance (ultrasound, infrared light). Instead, it adjusts the distance based on a phase comparison or contrast measurement.

phase comparison

At phase comparison (phase detection, phase shift, phase contrast, phase difference) parts of the subject are projected from the lens onto autofocus CCD image sensor pairs, a couple for each autofocus metering field. With the help of the signals of the partial image pairs, the camera calculates to which distance the lens should be set.

In a reflex camera, the mirror that reflects the image produced by the lens onto a matte screen lets some of the light through. Another mirror behind it (auxiliary mirror) redirects the transmitted light to the autofocus sensors in the camera bottom. On each autofocus sensor pair projects a small lens (microlens) the light from the same partial image coming from opposite sides of the lens.

Some mirrorless cameras also have a phase comparison autofocus. There, the autofocus sensors sit directly on the image sensor.

Based on the light intensity patterns of a pair of autofocus sensors, the camera processor / autofocus processor can calculate, how far and in which direction the autofocus motor must adjust the lens so that the image is sharp. Because (theoretically) the distance setting does not have to be determined by trial and error, but can fit at the first attempt, the phase comparison autofocus is quickly.

How does the autofocus work?
How does the autofocus work?

Figure: principle of the phase comparison autofocus for SLR cameras. The drawings are not precise in terms of distances, sizes and angles, they only illustrate the principle. we are looking at light beams that all pass from the same motif point through the lens via the auxiliary mirror through microlenses onto an autofocus sensor pair. each sensor of the pair receives light coming from opposite outer areas of the lens. Below is the intensity of the light ( y-axis, perpendicular) and its location ("x-axis", horizontal) of both sensors is sketched, the intensity increases upwards. In (1) the lens is correctly adjusted. The object point is a pixel on the sensor and the light is at the same location on both sensors. In (2) a too close distance is set. The light from the left sensor is on the left and the light from the right sensor is on the right: the "phases" (light signals) are shifted. The same is true for (3), only the lens is set to a too far distance. Now the light of the left sensor is on the right, that of the right sensor on the left. If the phases are out of phase, the autofocus processor knows that the lens is not properly focused. Based on the distance and direction of the shift, it can calculate to which distance exactly the lens should be set.

Figure: phase comparison-autofocus and partial images. Here a partial image a triangle viewed falling on a pair of autofocus sensors. On the left, the distance is set correctly. the triangle is projected on the same place on both sensors. If both sensors were superimposed, the images of the triangle would be congruent. This corresponds to (1) in the previous figure. In the center, the distance is set too close, which corresponds to (2) in the previous figure. The triangle is not in the same place on both sensors, it is shifted. Right corresponds to (3) in the figure above, the distance is set too wide. Again the triangles are not congruent.

Minimum aperture size

Phase comparison autofocus only works with lenses that do not fall below a certain light level. Usually this is 5.6, with some cameras also 8. If the lens has a lower light intensity, for example 8 or 11, the camera switches the autofocus off. This limiting light intensity is undershot if a low-light lens is combined with a teleconverter. A lens with a speed of 5.6 and a 2x teleconverter becomes one with a speed of 11.

Front focus, back focus (front focus, back focus)

phase comparison metering in SLR cameras is prone to errors: the autofocus sensors and the image sensor are not in the same plane, after the metering is done, time elapses until the mirror is tilted up, during which time the subject can move, and the lens may not correctly set the distance transmitted by the metering: a too close (front focus, front focus) or one too large (backfocus, back focus). This is most noticeable at short distances (large image scales) and large apertures, for example 2 or 1.4.

front- and backfocus can be determined with test charts like lensalign. With some cameras, front- and backfocus can be corrected by yourself with the help of a test chart, with most of them, only the camera service will be able to do this. With my nikon D300, I can set the distance via the camera menu under AF fine tuning set individual corrections for each lens. The camera recognizes which lens is attached to it and automatically adjusts the corrections made. I would make use of this, if i notice in a lens front- or backfocus in practice. I do not specifically test my lenses for front or back focus. For a professional photographer this could be useful.

Mirrorless cameras with phase-locked autofocus do not have these problems because the autofocus sensors are directly on the image plane.

extension of the structures

In SLR cameras there are sensors that can only focus on horizontal structures, sensors that can only focus on vertical structures and sensors that can focus on both structures, so-called cross sensors. Today’s cameras are likely to use all three types mixed together.

Contrast measurement

With the contrast measurement the camera measures the contrast, the brightness difference, of neighboring pixels on the image sensor. The image is focused at maximum contrast. When measuring contrast for the first time, the camera does not know in which direction to adjust the distance on the lens, it tries one out. If the contrast gets stronger, it can keep the direction, if it gets weaker, it uses the opposite direction. The contrast then becomes stronger and decreases again after a certain distance setting. If this is the case, the distance must again be adjusted slightly in the opposite direction, up to maximum contrast. The lens adjusts the distance in one direction and then in the other direction until the contrast deteriorates in both directions then the correct distance is set. Under certain circumstances (low light, low subject contrast, noisy autofocus motor), you can see on the display and hear on the lens how the distance is adjusted back and forth until the focus is "leveled" is.

The contrast measurement is therefore not (yet) as fast as the phase comparison. On the other hand, it is free of front and back focus errors and I am not aware of any limiting light intensity (nevertheless, fast lenses are an advantage). Since the measurement is made directly in the sensor plane, the contrast autofocus can also be more accurate than the phase comparison autofocus in SLR cameras.

The position and number of the "autofocus sensors" is not limited in principle as with phase comparison measurement and the size of a (virtual) autofocus sensor can be adjusted more or less continuously.

Size and number of the autofocus measuring fields and coverage of the image area

Modern cameras have 30 and more autofocus measuring fields. If the camera has many metering fields, it is more likely to find a field that captures the desired subject location without having to tilt the camera for metering and reposition it for shooting. This saves time and is more precise.

If a measuring field is small, small objects can be captured more precisely and not accidentally objects in front of it. A larger metering field can be advantageous for fast moving subjects, as it takes longer for the subject to be out of the metering field area. The maximum size of the measuring fields is indirectly related to the number of measuring fields: the more measuring fields there are, the smaller they become. In phase comparison metering, the size of the fields is fixed; in contrast metering, it can be changed.

The ideal situation is when the measuring fields cover the entire image area. With contrast metering this is possible (although not necessarily realized). Phase comparison measurement usually covers less image area than contrast measurement.

If the sum of the measuring field areas is smaller than the covered image area, there are gaps between the measuring fields, there the autofocus does not capture the motive.

Several adjacent measuring fields can be combined to form a group. Each measuring field of the group is active. This means that small objects can no longer be captured precisely, but fast-moving subjects can be captured more reliably: if the subject leaves one measuring field, another one in the group can still cover it.

A camera should have many small measuring fields that cover as much of the image as possible. It should be possible to control (activate) the measuring fields individually and combine them into groups.

How does the autofocus work?
How does the autofocus work?

Figure: autofocus points of the nikon D300 (1. image) and olympus OM-D E-M5 (2. Image). The nikon D300 has 51 measuring fields, whose size and spacing are fixed. Less image area is covered upwards and downwards than to the left and right. the olympus OM-D E-M5 has 35 measuring fields, which cover more image area than the nikon . The size of the measuring field is variable: the measuring fields can be enlarged to such an extent that there is no longer a gap between them.

Autofocus in principle

Contrast is required in the motif (differences in brightness) for the autofocus to work. A completely blue sky or a smooth white surface will not be able to be focused by the autofocus as a rule.

Which autofocus to use?

As a rule, all SLR cameras have a phase comparison autofocus and mirrorless cameras have contrast metering. There are mirrorless cameras with both autofocus metering systems, where the phase comparison metering is done on the image sensor.

If the mirror is tilted up and the SLR camera shows the image in the live view on the display, it also uses the contrast metering for the autofocus, because then the phase comparison metering no longer works.

For fast-moving subjects that are constantly moving toward and away from the camera, such as athletes and animals, it is (still) best to use SLR cameras with phase comparison autofocus. Otherwise nothing speaks against the contrast measurement.

Leave a Reply

Your email address will not be published. Required fields are marked *