If I understand correctly the difference between CDAF and PDAF, CDAF basically does not have knowledge of distance while PDAF does. CDAF simply maximizes contrast. So if that is the case how does it choose which object in the scene to focus on? Is it completely independent of distance and it tries to guess by isolating objects?

And how does this compare to PDAF? Does PDAF literally calculate all the distances of all objects in shot and choose the closest object?


2 Answers 2


Let's start with phase-detect autofocus. Here, there are a limited number of focus points to choose from. You may choose manually, in which case it doesn't pick anything -- it just tries to focus at that point.

If you chose a mode where the focus point is selected automatically, the camera will decide. Usually, this is initially based on a simple measurement, usually picking the point which has the closest focus initially as a preference. It doesn't really calculate this; each sensor gives a reading of the direction in which the focus is off and by how much, and the camera simply has to prefer the one which would give a closer focus. (In continuous or "servo" modes, the camera may attempt to track motion from one point to the next. And some advanced cameras have fancier options to tweak whether closer distances are preferred.)

With contrast detect, a similar principle applies. Here, the lens has to be moved between measurements as part of the calculation, and inherently (if you are letting the camera make the decision) the focus point choice must come after the AF movement starts. In theory, the entire sensor could be read and any area focused, but the focus algorithms tend to divide this into virtual focus point areas and then compare, narrowing down to a single rectangle to focus on. (Or, in some cases, weighing multiple areas.) On many cameras, you'll notice that CDAF is much faster if you pre-select a spot. Face detection is nice here, because if it is a face you want to focus on, the autofocus area can be narrowed down quickly without as much hunting.

  • \$\begingroup\$ So CDAF has virtual focus points, but how does it determine which point to use? And how will it know which point has the closest object? \$\endgroup\$
    – erotsppa
    May 9, 2013 at 15:35
  • \$\begingroup\$ Generally, start the lens at close focus and move out; when one of the AF points passes a peak contrast, select that AF point and then hunt back and forth around it for maximum contrast. \$\endgroup\$
    – mattdm
    May 9, 2013 at 16:03
  • \$\begingroup\$ I see, so basically it's a first come first serve kind of situation. \$\endgroup\$
    – erotsppa
    May 9, 2013 at 19:30

In short, it looks for high contrast areas.

It usually restricts itself to either a pre-set area or a pre-set array of areas though, and it may also have a slight bias towards the centre of the picture, or at least away from the far edges.

In a shot like this it'll pick the dog, because the other areas are too low-contrast. This is a win, because it's what you would have wanted it to focus on. In a portrait, it will hopefully select one of the eyes, but it may fail if there is something high-contrast in the person's hair on on the person's clothes. In a busier scene there may be higher-contrast areas that you don't want to focus on.

It may also try to have a bit of bias toward closer objects. If anyone tells you that CDAF cannot tell relative distance they're wrong - while a single CDAF sample cannot tell distance, the autofocus system infers distance by taking multiple CDAF samples while the focus mechanism moves in or out - something that becomes sharper when moving the focus in is a closer object (in short, CDAF needs to take readings while moving the lens, then move the lens further).

Cameras with CDAF often have face detection these days which can be switched on or off - if on, it will prefer things that look like a face. If a face is not found, it'll just act like a multi-area autofocus, so there is no harm in leaving it on when not taking a face, except on the off-chance that it mistakenly detects something that isn't a face.

The way it selects focus areas is largely the same as for PDAF, by the way, except that PDAF can't do facial recognition, it is resticted to certain zones, and PDAF usually heavily favours the sensor in the middle of the screen especially in low-light, because that sensor is a more sensitive one.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.