Phase Detect Versus Contrast Detect Focus Accuracy
Here I go again. I intend to question authority. This time, I’m going to perform some tests to see just how superior contrast-detect autofocus is at nailing focus, compared to phase-detect. We all know how slow contrast-detect focus is, but the results are totally worth it, right?
I have been picking on my nifty-fifty (Nikkor 50mm f/1.8 AF-D) lens lately, and this round of testing maintains that same theme. I did all of these tests using my Nikon D850. Everybody claims that the AF-S focus technology is faster and more accurate than AF-D focus (AF-D requires an in-camera focus motor). If my 50mm AF-D lens can perform okay, then the AF-S lenses (with in-lens focus motors) should perform even better.
Cameras designs are always getting better over time, and it may be that “rules” of the past aren’t necessarily true today. Modern sensors that contain “phase-detect” pixels muddy the water even more, since they can eliminate the slowpoke on-sensor focus issue.
For each of the following tests, I shot at least 10 pictures at each aperture and focus mode. I am interested in maximums, averages, and ranges of results here. Resolution results are the best indicator of successful focus, so I’m doing an MTF50 resolution analysis as an equivalent to focus analysis.
First, calibrate your lens properly
It bears mentioning that it’s crucial that you accurately focus-calibrate your lenses; if you don’t, then you might just as well stick with contrast-based focus. Or buy a mirrorless camera (except they don’t work with AF-D lenses!).
Get over the idea that lenses are calibrated well enough at the factory. They're not. Out of all of my cameras and lenses, I have only ever had two lens/camera combinations that were factory-calibrated properly.
Focus-calibrate with a proper target
The picture above shows the kind of target I use to calibrate (phase detect) autofocus. I got this target image from the same site that has the program MTFMapper. The target image tapers from left-to-right, such that perspective distortion makes the image look like both ends of the “trapezoids” appear as perfect rectangles when you rotate the target 45 degrees about the vertical. The web site has a few different images with different amounts of perspective in them.
I print and mount different size images, depending upon the lens focal length and the distance to the target that will let me come close to filling the camera’s field of view. The picture shown has its left-hand side further from the camera than its right-hand side. This perspective effect isn’t perfect, and depends upon what lens focal length you’re testing.
What is important is that you focus on the vertical edge depicted by the red rectangle as shown. This way, there is no confusion about what edge is used for focus. I always calibrate using these targets to get the best focus accuracy that I can. My MTFMapper program can show me the resolution of each edge in my test photos, so it's easy to see where the sharpest focus lands, versus where the camera tried to focus. Cameras and lenses have some degree of focus variation, which is why I performed multiple tests to get my data.
If you have a lens that exhibits spherical aberration, then it will shift focus as you stop it down. This kind of lens problem can potentially defeat you with phase-detect focus (you can only have optimal focus calibration at one aperture). My nifty-fifty has “slight” spherical aberration, so it will be interesting to see if it affects the test results.
Contrast-Detect Testing
Contrast detect f/1.8 MTF50 resolution
The f/1.8 results showed an average MTF50 resolution of 32.7, with a peak of 34 and a range of 2 lp/mm.
Contrast detect f/2.0 MTF50 resolution
The f/2.0 results showed an average MTF50 resolution of 34.7, with a peak of 35 and a range of 2 lp/mm.
Contrast detect f/2.8 MTF50 resolution
The f/2.8 results showed an average MTF50 resolution of 47.9, with a peak of 48 and a range of 1 lp/mm.
Contrast detect f/4.0 MTF50 resolution
The f/4.0 results showed an average MTF50 resolution of 58.9, with a peak of 60 and a range of 2 lp/mm.
Contrast detect f/5.6 MTF50 resolution
The f/5.6 results showed an average MTF50 resolution of 62.4, with a peak of 64 and a range of 6 lp/mm.
Contrast detect f/8.0 MTF50 resolution
The f/8.0 results showed an average MTF50 resolution of 59.1, with a peak of 60 and a range of 2 lp/mm.
Phase-Detect Testing
Phase detect f/1.8 MTF50 resolution
The f/1.8 results showed an average MTF50 resolution of 33.5, with a peak of 34 and a range of 3 lp/mm.
Phase detect f/2.0 MTF50 resolution
The f/2.0 results showed an average MTF50 resolution of 34.7, with a peak of 35 and a range of 1 lp/mm.
Phase detect f/2.8 MTF50 resolution
The f/2.8 results showed an average MTF50 resolution of 51.1, with a peak of 52 and a range of 1 lp/mm.
Phase detect f/4.0 MTF50 resolution
The f/4.0 results showed an average MTF50 resolution of 55.3, with a peak of 56 and a range of 1 lp/mm.
Phase detect f/5.6 MTF50 resolution
The f/5.6 results showed an average MTF50 resolution of 62.3, with a peak of 63 and a range of 1 lp/mm.
Phase detect f/8.0 MTF50 resolution
The f/8.0 results showed an average MTF50 resolution of 59.0, with a peak of 59 and a range of 0 lp/mm.
Summary of Results
At the wide apertures, phase detect results are actually superior to contrast detect results. The lens was calibrated at f/1.8, and the lens exhibits a small amount of spherical aberration. It is expected that phase detect will work better at this calibrated aperture, and in fact it does. The repeatability of both focus systems (contrast and phase-detect) seems equivalent.
At narrow apertures, the contrast-detect system gives slightly better results. I attribute the better results to the phase-detect system not being able to compensate for the focus shift from spherical aberration. If the lens were calibrated at a narrower aperture, phase-detect results would be better here (at the expense of wide apertures).
What I’m not seeing is any overall superiority of contrast-detect focus. I’m not seeing any significant resolution bump and I’m not seeing any tighter focus range, either. As a matter of fact, the largest focus variation (large range value) was found with contrast-detect and not phase-detect!
It would be wise to perform an analysis such as this on a lens-by-lens and camera-by-camera basis, but what I’ve seen so far has given me a dose of encouragement. Maybe phase-detect focus has been given a bad rap.
Am I going to get a bunch of flak for daring to say out loud that phase-detect can work just as well as contrast-detect?
Comments