Skip to content
VideoPhoto

Phase Detection vs Contrast Detection Autofocus

Phase detection autofocus measures how far and in which direction focus is off, while contrast detection hunts for the sharpest image; this lesson compares them.

By Jennifer K. Telfer · 6 Min Read

Jump To
DSLR phase-detection autofocus diagram showing the mirror light path, AF sensor and focus positions
Diagram reproduced in Ari Hazeghi Photography article

Phase detection autofocus compares two views of the scene from different sides of the lens to tell how far out of focus the image is and in which direction, so the lens can move straight to the right place. Contrast detection autofocus instead moves the lens back and forth until the image looks sharpest. Phase detection is faster; contrast detection is simpler and often very accurate.

Why It Matters

These two methods decide how fast the camera focuses, how well it follows a moving subject, and how it behaves in dim light. Knowing which is at work explains why a camera hunts back and forth in one situation and snaps into focus in another.

It also explains why video autofocus, live view focus and viewfinder focus can behave differently on the same camera, especially on older bodies.

Beginner How The Two Main Autofocus Types Find Sharp Focus

Both systems solve the same problem: moving the lens to the distance where the subject forms a sharp image on the sensor. They solve it in different ways.

Contrast Detection

A sharp image has strong edges, where light and dark areas meet with a clean step. A blurred image has soft edges. Contrast detection measures that edge contrast in the focus area. The camera moves the lens a little, measures the contrast, moves again, and checks whether the contrast went up or down. It continues until it passes the peak, then steps back to it. This is why focus seems to pulse in and out when it is working, a behavior called hunting.

Phase Detection Autofocus

Phase detection splits the light coming through the lens into two paths that come from opposite sides of the lens opening. If the subject is in focus, the two images line up. If not, they are offset, and the size and direction of the offset tell the camera how far and which way to move the lens. One reading gives a direction and a distance, so the lens moves once, and then the camera checks. That is why phase detection is quick and does not hunt as much.

Side By Side

Feature Phase Detection Contrast Detection
Speed Fast Slower
Tells direction of error Yes No, it must test
Moving subjects Good, supports prediction Weak
Needs extra hardware Dedicated sensor or sensor pixels None, uses the image sensor
Low light Good with a wide aperture Struggles, needs contrast
Accuracy on still subjects Very good, may need calibration Excellent, measures the actual image

Where You Meet Them

  • A DSLR uses a separate phase detection sensor when you look through the viewfinder, and contrast detection in live view on older models.
  • Most mirrorless cameras and recent DSLRs use phase detection pixels on the main sensor, sometimes combined with contrast checks. See on-sensor autofocus.
  • Some compact cameras and older mirrorless cameras use only contrast detection.
  • Smartphones use a mix of on-sensor phase detection, depth sensors and contrast.

What To Do With This

  1. In dim light, use a lens with a wide maximum aperture. Both methods work better with more light.
  2. Aim at a contrasty edge when the camera hunts. A flat blue wall or a plain shirt gives little to measure.
  3. Switch to manual focus with focus peaking when autofocus fails entirely, see focus peaking and magnification.

Common Mistakes

  • Blaming the lens for hunting when the target has no edges.
  • Expecting a contrast detection camera to track fast subjects.
  • Pointing the focus point at an area with a repeating pattern, which can confuse both methods.

Handy for this: Speedlight Flash — add light anywhere. (affiliate link)

Advanced Defocus Direction, AF Microlenses, Hunting Behavior, And Low-Light Limits

How Phase Detection Measures Defocus

In a DSLR, light from the lens passes through a partly transparent mirror to a secondary mirror, then to an autofocus module. Small lenses in the module, called separator lenses, form two images from light that crossed opposite edges of the lens. The module compares the spacing of the two images on a line sensor. When the lens is in focus, the spacing equals a calibrated value. Too close or too far gives a sign and a magnitude, so the camera knows both the direction and the amount of correction. The geometry works best with a wide aperture, which makes the two light paths further apart and the spacing easier to measure. Many modules need at least f/5.6 for the standard points, and a few work at f/8.

On-Sensor Phase Detection

Mirrorless cameras place phase detection pixels on the image sensor. Some pixels are partly masked, so each sees light from one side of the lens, and the camera pairs left-looking and right-looking pixels to find the offset. Other designs split every pixel into two photodiodes that see opposite sides of the lens. Microlenses over the pixels guide the light so that each half receives only light from one side. The idea is the same as in a DSLR, but the points can cover most of the frame. See on-sensor autofocus.

Cross-Type Points And Subject Patterns

A line sensor measures offset along one direction. A point that measures only horizontal detail may miss a plain horizontal edge, such as a table, and work well on vertical edges. Cross-type points use two sensors at right angles and work with both. This is why a point may focus well on a tree trunk and fail on a horizon.

Why Contrast Detection Hunts

Contrast detection has no way to know which direction to move at the start. It tries a direction, checks, and reverses if the contrast falls. It must pass the peak to know it was there. This overshoot is the visible hunt. Some cameras reduce it by using depth from defocus, which compares the blur level of two frames to estimate distance. Panasonic and a few others use it. It gives a direction after two images without hardware, at some loss of speed compared with phase detection.

Hybrid Systems

Most modern cameras combine the two. Phase detection moves the lens near focus quickly, then contrast detection fine-tunes the last step using the actual image. This gives speed and accuracy together. It is also why a hybrid camera may show a small pulse at the end of a focus move.

Low-Light Limits

Phase detection needs enough signal to compare the two images, and at very low light the noise drowns the offset. Camera specifications list a low-light limit in exposure value, for example minus 6 EV with a particular lens aperture. Contrast detection fails earlier, since it needs enough contrast to measure the change. An assist beam, a bright lens or a flashlight on the subject helps. Read AF microadjustment if a DSLR focuses consistently in front of or behind a subject, because phase detection depends on calibration of its own path.

Try It

  1. In live view on a DSLR or an older compact, aim at a clear edge and watch the lens hunt as contrast autofocus works.
  2. Aim at a plain wall and compare the behavior. Note what happens when nothing has contrast.
  3. On a mirrorless camera, use autofocus on a moving person and then switch to a manual focus mode with peaking to see the difference.
  4. In dim light, try focusing on a high-contrast edge instead of a flat area and notice the speed.

Common Questions

Which is better, phase detection or contrast detection?

Phase detection is better for speed and for following moving subjects because it measures both direction and distance. Contrast detection is better at checking final sharpness on the actual image. Most modern cameras use both in a hybrid system.

Why does my camera hunt for focus?

It is usually using contrast detection, or the subject has little contrast, or the light is low. Aim at an edge, add light, use a faster lens, or move closer to the subject.

Do mirrorless cameras use phase detection?

Most current mirrorless cameras do, using phase detection pixels built into the image sensor, often combined with contrast detection. Some older and entry-level models use contrast detection only.

Does phase detection need calibration?

DSLRs with a separate autofocus module can show front or back focus because the module is a different path from the sensor. Many can be calibrated. On-sensor systems measure at the sensor itself, so they rarely need it.

Related Lessons

Gear That Helps With This

Hand-picked kit that makes this lesson easier to put into practice.

Some links are affiliate links: if you buy through them we may earn a small commission at no extra cost to you. How this works.