WTF is Phase Detection Autofocus?

What Is Phase Detection Autofocus?

As you've probably figured out by now, I find the science behind photography quite interesting. And the reason for this is that I think (and other opinions are available) that knowing how something works helps me better understand what I can do with it. At the end of the day a camera is just a tool to get a job done, but it's a complex tool, and to get the best from it, I like to know what's going on inside. This gives me some insight into what it can do and what it can't do and I believe this helps me take better photographs. I perfectly understand that not everyone thinks like this and not everyone cares. This article, for example, explains how DSLR cameras achieve autofocus and if this isn't something that interests you, best give this article a miss. For everyone else, let's move on. In a future article I will look at how all this is done in a Mirrorless camera, but this is not that article.

Before we get into the science stuff, the first thing we need to understand is that DSLR cameras usually have two ways of getting stuff in focus:

1. Phase Detection
2. Contrast Detection

Depending on how you are using your camera, one of these methods will kick in. Both methods rely on the light coming through your camera lens so before we do anything else, let's look at one of my world famous and very simple diagrams of what happens to the light when it enters your camera:

Showing the light path through a DSLR

(1) Camera Lens
(2) Camera Body
(3) Pentaprism
(4) Viewfinder
(5) Reflex Mirror
(6) Sub Mirror
(7) AF Sensor
(8) Light Path

From this you can see that light (8) entering the camera passes through the Lens (1), enters the camera body (2) and hits the Reflex Mirror (5). This mirror is actually semi-transparent so not all the light hitting it is reflected.

Traditionally, the light that is reflected off the Reflex Mirror bounces into a 5 sided prism (3) (called a Pentaprism) which bounces the light around some more so that it comes out of the Viewfinder  (4) allowing you to see the image the correct way up and right way round. In many modern DSLRs this Pentaprism has been replaced with an arrangement of mirrors (called a Pentamirror) which do exactly the same job. Either way, this is what allows you to see exactly what is coming through the lens in the viewfinder.

You can also see from the above diagram that some of the light coming into the camera passes through the Reflex Mirror and hits another mirror, called the Sub Mirror (6). This light bounces off the Sub Mirror towards the bottom of the camera into the AF Sensor (7) and it's this sensor (it's actually a collection of sensors) which allows your DSLR to use Phase Detect Autofocus.

Ok, so now we know that something called the AF Sensor inside your camera is doing the Phase Detect Autofocus, but we're no closer to knowing how this works. That's what we're going to look at now.

When the light enters the AF Sensor, yet more prisms and lenses (really, really small ones!) split the light into two separate images and then bring the images back together again. If the two images don't align, then the camera knows the image is out of focus. The AF sensor will then tell the camera to adjust the focus on the lens, all the while comparing the two images. And it will continue to do this until the images are perfectly aligned. And when the two images in the AF Sensor are perfectly aligned, that's when the camera will indicate that it has achieved autofocus.

1. Focus is too far. 2. Focus is correct. 3. Focus is too close

Now obviously, this is a much simplified explanation, but the theory is perfectly sound. However, this only works when we are using the mirrors in our camera. If our DSLR camera has something called "Live View" where you can view the image in the screen on the back of the camera, then the reflex mirror and the sub mirror are lifted out of the way exposing the sensor directly to the light coming in from the lens. In this instance we can't use Phase Detect Autofocus and so the camera uses its second autofocus method, Contrast Detection, which is controlled by the image sensor.

The word "contrast" means two or more things being very different when compared to each other. In photography it means the difference between light parts of the image, and dark parts. Contrast Detection works on the theory that an object will be in focus when its contrast is at its highest. Again, let's look at a simple example:

The edges in this image are badly defined. This demonstrates low contrast.
This illustration is clearly out of focus. The edges are blurry and badly defined - in other words there is poor contrast between the subject and the surroundings. However, the camera doesn't know this is out of focus until it adjusts the focus of the lens to compare it with another image.

The edges are now defined. This demonstrates high contrast.
In this next image, the edges of the object have much improved definition and as a consequence, there is much sharper contrast between the object and its surroundings, however, the camera is still likely to check out a few other focus points before deciding on the best one. This is called "hunting" and is simply the sensor talking to the lens and trying to find the focus point which has the best contrast. As a consequence, Contrast Detection is often a slower method of finding focus than Phase Detection. Contrast Detection can often fail to find focus when there is no obvious difference between the subject and its background. In the two illustrations here, I've shown an image with very high contrast - a black object on a white background - but what if the background had been very dark grey? In cases like that, the camera can "hunt" for a long time before finding focus, or perhaps even fail to find focus at all. In these circumstances, it's often a case of trying out the different focus methods (this is why it's important to know how your camera's AF system works so that you can try them as circumstance dictates) or resort to manual focus.

As I said at the start of this article, the Phase Detect AF method described here only applies to DSLR cameras. At the moment, normal digital compact cameras, bridge cameras and mobile phones are liable to use Contrast Detect autofocus. As the world of cameras changes though, and the move towards all cameras being mirrorless becomes an inevitability (and it is, it may take many years but the time will come) new auto-focus methods are being applied and these will form the subject of a later article.


Popular Posts