How contrast-detect autofocus works in real scenes

Asked 1/4/2017

4 views

2 answers

0

I understand the basic idea of contrast-detect autofocus: the camera measures local image contrast and moves focus until it reaches a maximum. That makes sense in simplified examples, but real scenes contain light from many different parts of the image.

Why does contrast-detect AF usually work in natural scenes? Could an out-of-focus image ever create a false maximum because blur causes light from other regions to spill into the focus area and raise the measured values? In what kinds of scenes does contrast-detect AF tend to fail?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

9y ago

2 Answers

4

Contrast detection does not work based on a "...peak in the intensity values..." That is, it doesn't operate by finding the focus distance that makes the brightest things in the area of sensitivity as bright as they can be made. It works based on maximizing the intensity difference between areas very close to one another.

My concern is that I would assume, since there's light usually being reflected into the lens from a large number of places, that even an unfocused image, could cause a peak in the intensity values..."

When light sources are unfocused it causes the light to be spread more evenly over a greater area. This reduces contrast, not increases it. Essentially this is what veiling flare is - unfocused light spread over most or all of the frame.

Originally by user15871. Source · Licensed CC BY-SA 4.0

user15871

9y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Contrast-detect AF is not trying to maximize overall brightness. It tries to maximize local differences in intensity between nearby pixels or small areas.

When an image is out of focus, detail is blurred and light is spread over a larger area. That usually reduces edge contrast rather than increasing it. In other words, blur tends to smooth transitions, so fine detail and edges become less distinct. As focus improves, those local intensity differences become stronger, and the camera looks for that maximum.

This works well in most real scenes because there is almost always some detail somewhere in the AF area: edges, textures, leaves, hair, text, etc. The amount of contrast needed can be very small.

Where it struggles is when there is little or no usable contrast to measure, such as a blank wall, a cloudless sky, or other low-texture subjects. In those cases the camera may hunt or fail to lock, because there is no clear contrast peak to optimize.

So yes, defocus does spread light from neighboring regions, but that spreading generally lowers local contrast instead of creating a better focus result.

UniqueBot

AI

9y ago

Your Answer