Tech Insights: Panasonic's DFD autofocus technology

by Dave Etchells

With the GH4, Panasonic has introduced an all-new autofocus algorithm that eliminates many of the drawbacks of contrast-detect autofocus, and delivers AF speeds approaching those of traditional SLRs. DFD stands for "Depth From Defocus," and to understand what this is all about and why it's such an impressive innovation, let's first take a quick look at how camera AF systems work.

In traditional SLRs, the mirror system diverts a small portion of the incoming light to a separate autofocus sensor, typically located in the bottom of the mirror box. A prism there splits the light coming from opposite sides of the lens and directs it to paired groups of sensor pixels, forming each AF point. Depending on the focus of the lens, the light falling on the paired groups of pixels will either line up (focused) or be shifted one way or the other relative to each other (front-focused or back-focused). Phase-detect AF thus not only knows whether the subject is in focus or not, but if out of focus, it knows in what direction and how much out of focus the image is. This means the camera can command the lens to move directly to the correct focus setting, without having to "hunt" along the way.

This illustration shows how the split image seen by the two halves of a conventional phase-detect AF point explicitly show the amount of defocus in an image. (Illustration courtesy of and copyright 2013 by Rob Taylor - Source )

The other way of determining focus is called "Contrast-Detect", and involves measuring how abruptly objects in the image change from light to dark or back again. When an object is in sharp focus, the tonal values will change fairly rapidly as you move from pixel to pixel. When it's out of focus, these transitions happen much more gradually. With contrast-detect AF, the camera measures how rapidly brightness levels change from pixel to pixel, shifts the lens' focal distance slightly, and measures the brightness changes again. If there were more differences between pixels after the focus change, that means the subject is closer to being in focus, so the camera will shift the focus again, take another look, and keep going until it finds that the pixel to pixel contrast dropped slightly. That means it just passed the point of best focus, so it'll drop back one increment and snap the picture.

This figure shows an example of contrast-detect AF at work, including "hunting" for the point of sharpest focus. (Illustration courtesy of and copyright 2013 by Rob Taylor - Source )

Because it's an iterative process, contrast-detect AF can be rather slow, compared to conventional phase-detect AF, as found in SLRs. Also, since the only way the camera can tell whether the subject is focused or not is by tweaking the focus and seeing if the contrast signal gets better or worse, this is why you'll often see contrast-detect AF systems "hunting" for the best focus, constantly moving in and out of focus during a video recording.

Panasonic has been very successful in making their contrast-detect AF systems very fast, to the point that they're in many cases as fast or faster than the phase-detect systems on low-end SLR cameras. Still, they're not up to the speed levels of the best phase-detect systems, and they're still prone to hunting during video recording, even if to a lesser degree than many competing systems.

Recently, a number of manufacturers have managed to integrate phase-detect pixels onto the main image sensor, but on large-sensor cameras, AF speeds are still rather slow, because it takes too long to clock the PDAF data off the larger imaging chips.

With all that as background we can now talk about Panasonic's latest AF innovation, Depth From Defocus, or DFD technology. Panasonic's engineers realized that they had more information to work with than just whether incremental changes in focus resulted in better or worse contrast measurements; they could also tell how much the contrast signal improved or worsened. By knowing how much the focus improved or worsened after a small focus change, they had an opportunity to tell how far out of focus the lens was. They had the opportunity to tell that, but actually knowing how far the lens needed to travel required that the camera know a great deal about the lens. Basically, the camera has to have a detailed understanding of the lens' bokeh, across the full range of out of focus conditions, at all focal lengths (in the case of a zoom lens), and all apertures.

That's a pretty tall order, but since Panasonic manufactures their own lenses, they could in fact characterize each of them fully in this regard. So of course, that's what they did, and they loaded a full database of the bokeh behavior of all their current lenses into the GH4's memory. As a result, no matter the focal length, aperture, or subject distance, the GH4 can very quickly determine now much out of focus each lens is, and in what direction, just by comparing two images, acquired in rapid succession, with a small lens movement in between. By interpreting the change in bokeh from one "look" to the next, the GH4 can calculate how far it needs to move the lens, to get very close to the final focus setting. After this rapid movement, it does one or two normal contrast-AF cycles to fine-tune the focus, before snapping the shot.

Conventional contrast-detect autofocus involves a progressive "hunting' process to find the point of best focus. Panasonic's new Distance From Defocus method can quickly calculate the amount and direction of misfocus and move the lens close to the final focus setting very quickly.

When shooting with our production review unit, the DFD technology worked well, with very quick focus acquisition times. For video recording, the focus transitions between focus distances was precise and smooth with little to not hunting.

49-area AF.

This deep understanding of lens bokeh by the GH4 apparently also helps minimize focus hunting, since the camera can detect and quantify changes in subject focus without having to move the lens. You should thus only see the lens shift focus when the subject actually moves, and the process of re-acquiring focus should be noticeably faster than in the past. (You can bet we'll put all this to the test, as soon as we can get our hands on a production sample of the GH4!)

Of course, given that the camera needs to understand each lens' bokeh characteristics in great detail, the first question we asked was what will happen as Panasonic develops and releases new lenses: Will the GH4's firmware have to be updated every time a new lens comes out? The answer was that, while the GH4 will contain a database of all the current Lumix lenses, new models will have their bokeh profiles stored on internal memory in the lens itself. So, no camera firmware updates needed, each new lens will carry with it the information needed to make DFD work.

Focus peaking.

This naturally leads to the next question: What about third-party lenses? As you might expect, the GH4 doesn't contain a bokeh database for every non-Lumix lens out there, so third-party lenses will revert to Panasonic's (already very fast) conventional contrast-detect AF algorithms.

The Panasonic GH4's AF features aren't only about improved speed, though; the camera now sports 49 contrast-detect AF areas up from 23 in the GH3, and has both face and eye-detection AF, a flexible 1-area AF option, and a flexible "pinpoint" AF display, for setting focus very precisely on small elements within the scene. In 1-area AF mode, you can change the size of the AF frame, and there's also focus peaking, a much-requested feature.

Face and eye detection.

You can also select the AF area via the rear-panel touch screen, optionally enable Eye Sensor AF, which starts the AF running when you bring the camera to your eye, and select a one-shot AF mode that lets you use AF for initial rough focusing, then switch to manual focus for fine-tuning. Finally, the GH4 is capable of focusing at light levels down to -4EV, a challenge even for many phase-detect systems. All in all, the Panasonic GH4 sports an unusually capable and flexible AF system.

As always with new technologies, we'll withhold judgment on Panasonic's new DFD approach until we have a chance to try it out in practice. The performance of the early prototype and the demo videos Panasonic showed us were very encouraging indeed, though. Panasonic has always been a leader in advancing the speed and accuracy of contrast-detect autofocus, and this latest innovation of theirs promises to kick it up another substantial notch. Kudos to Panasonic for their continuing innovation in this area.

Ready to Order? Support this site by purchasing through a trusted Imaging Resource affiliate now:
(No added cost to you, a big help to us)

Panasonic GH4 body-only: ADORAMA | AMAZON | B&H
Panasonic GH4 + DMW-YAGH Interface Unit Kit: ADORAMA | B&H
Panasonic DMW-YAGH Interface Unit: ADORAMA | B&H
Panasonic DMW-FL580L Wireless Flash: ADORAMA | B&H



Editor's Picks