Auto Focus

Auto Focus Systems

There are many auto focus systems built into cameras and camcorders.
Conceptually, they share the same fundamentals. The following is such a
scheme. The camera lens projects the image onto the image sensor, the
AF module retrieves a portion of the image for the CPU to process the contrast
information, and the CPU activates the auto focus motor to move the lens for
focusing based on the processing result. This process repeats until the subject
is accurately focused on.

There have been many auto focus methods proposed, developed, used, and
discarded in the past four decades. Currently, the two most popular ones
are the contrast detection method and the phase detection method. The former
has been superceded by the latter; however, it is being used in many
consumer level digital cameras.

What Is the Contrast Detection Method?

The contrast detection method is based on a fundamental principle:
the accurately focused image has the highest contrast among all images of the same
scene. Here, the term contrast is left undefined because it is very
difficult to be defined precisely using folklore terms. Therefore, in a
contrast detection method, the AF module (see the diagram above) extracts
a portion of the image from the image sensor, process its contrast information
with the help of the CPU, and moves the lens to focus. This process repeats
until the recorded contrast is the highest, and the lens is focused.
The extracted portion from the image sensor represents the auto focus area
being used. Suppose the accurately focused image in the extracted portion is
the following:

Suppose further the lens is out of focus initially. The extracted portion
may be very similar to (a) below. During the focusing process, the extracted
portion may go from (b) to (f), and eventually reaches a fully focused
image as shown above. From these images, initially we (and the AF module) only
see a very blurred image with very low contrast. As the lens moves to focus,
the contrast level of the image increases. In fact, we can see some barely
visible blurry lines in (d). The contrast between the dark color
lines and bright color space becomes clearer in (e) and even better in (f). When
the lens settles on the highest contrast image as shown above, auto focus
completes.

(a)

(b)

(c)

(d)

(e)

(f)

The Drawbacks of the Contrast Detection Method

Since this method requires contrast for focusing, the scene or the area used for
focusing must have a reasonable contrast. Since low light implies low contrast,
one major drawback of the contrast detection method is that AF may fail in a
poorly illuminated environment and one must fine a high contrast area
to focus. This is a major cause of the well-known focus failure problem of many
digital cameras. The contrast detection method may also be defeated by a range
of subjects with contrast gradients and/or repeated patterns.

Where Are the Bottlenecks?

If we look at the diagram in the beginning of this page, we will see at least the
following components that can slow down the auto focus speed:
(1), the time for the AF module to extract the portion in the image
for auto focus;
(2) the time for the CPU to process the contrast information;
(3) the time for the CPU to instruct the motor to move the lens
for focusing;
and
(4) the number of iterations the above steps must be repeated to get
a focus lock.

Item (1) would not be a major problem in general, because it only involves retrieving
a portion of the pixels from the image sensor. The retrieval speed is usually
dictated by the image sensor access speed.

Item (2) has three major factors. First, the CPU processing speed. A slow CPU
will process data slower. Second, although there are many contrast
detection based systems around, they may not use the same algorithm in
processing the contrast information. Efficient algorithms use less time.
Third, contrast processing algorithms would usually be slower when the focus
area has
lower contrast. This is mainly the reason that an AF system work slower in low
light and/or low contrast situation.

Items (3) may be crucial. Not all motors for driving lenses for focusing are
created equal. Some are faster than the others. Moreover, lens design also
plays an important role. Some lenses move a shorter distance than other lenses
for the same focus request. Therefore, given everything being equal, the lens that
moves a shorter distance focuses faster. This is the major driving
force for camera and lens makers to design internal focusing (IF) and rear
focusing (RF) systems and faster motors such as Nikon's AF-S silent wave motor.

In general, items (1) and (2) are electronic whose latency is generally shorter
than the mechanical latencies such as moving the camera lens. Note that the
situation may be worse if the lens is zoomed in because the maximum aperture
may be reduced by about 1 stop (lower light, and hence lower contrast), and the
focusing group of the lens may be forced to move a larger distance.

Other Factors That Can Make AF Slow

Based on the above discussion, let us see the other factors that can affect
AF speed. In fact, these factors can also be considered part of the four
items discussed earlier.

Product quality varies, and no two cameras will work exactly the same.
However, the variation in AF speed should be very minimal unless
you have a defective camera.

The AF speed at the tele end is likely to be slower than the AF speed
at the wide angle end. All zoom lenses zoom back to wide angle
(i.e., shorter lens barrel), and extend to reach telephoto
(i.e., longer lens barrel). Hence, the focus group of the
lens will travel a shorter distance at the wide angle end than that
at the telephoto end. Consequently, the AF speed at the wide angle
is definitely faster than the AF speed at the telephoto end.
The actual difference depends on the lens design. We also mention
about that Coolpix cameras are of the variable aperture type. Therefore,
the maximum aperture becomes a function of focal length. Since
the lens barrel extends at the telephoto end, aperture at the long end
of a lens is smaller, and, as a result, contrast may be reduced due to
light loss. In some cases, the light loss will also cause the AF
speed slower.

The lens on a Coolpix is a vari-focal one, which means the lens does
not maintain focus during zooming. In other words, if the lens is
focused at a distance and then is zoomed in or out, the lens is no more
focused. Thus, you need to lightly press the shutter release button
to refocus in the single mode. Or, the AF system works continuously
to refocus.

Camera shake could also make AF speed slower in low contrast
situations. Why? We mentioned earlier that the AF module extracts a
portion of the image for focusing. In a low light and/or low contrast
situation in which the AF speed is already slow, if camera shake
does happen, the AF module may retrieve a slightly different portion
for contrast processing. Consequently, the AF system will need more
time to determine the contrast of the "real" area you wish to focus
on, and, of course, focusing speed will be slower. In fact, if you
are shooting macro, the lens may just hunt for a while and stop.
So, in a low light and/or low contrast environment, using a tripod
will make AF speed a little bit faster.

As a consequence of the above item, a slower AF system may not be
above to shooting moving subjects. We have to be very careful in
saying "moving" subjects. The key is if the camera follows the
moving subject (i.e., panning). For example, one can prefocus
at certain point and take a shot when the moving subject passes
through it. In this case, the camera does not move and does not focus
on the moving subject. Instead, the camera focuses on somewhere we
anticipate the subject will pass through. Therefore, as long as the
prefocus step can be carried out before the moving subject
arrives at the anticipated point, one will have a focused image.
So, this prefocusing at an anticipated point is in general not an
AF speed issue. Some people choose to show off an image taken in this
way does not demonstrate if an AF system is fast or slow; it only
shows that the prefocus and prediction were successful. The real
challenging task is if the AF system can continually focus on,
or track, a moving subject. Some cameras such as the Coolpix 5700
provide a "continuous" mode for the camera to keep focusing even when
the camera is moving. However, the dynamic tracking AF capability
is different because the AF system can choose the appropriate AF focus
area in order to keep track the moving subject. The dynamic
tracing capability is available on many mid- to high- end SLR cameras.
As of this writing, the only consumer level digital camera that has
this capability is the Minolta A1.