Being a hobbyist photographer I, of course, watch a lot of photography gear related videos. At some point, I reached a pretty weird place: being familiar will all the tech jargon, but having no idea how certain parts of a camera actually work.
I know how, in digital cameras, the sensor is read if you press the shutter button. I have quite a good understanding of the IBIS and that it uses accelerometers, gyroscopes or other sensors to recognize if there is some movement and how to adjust the sensor for this.
But what I do lack is the knowledge about autofocus. This integral part for any photographers, that I rely on pretty heavily, and I don’t know much about it. It’s time for a rabbit hole.
I will only talk about passive
autofocus here, active
autofocus systems
that use infrared light also exist but I won’t mention them.
Types of autofocus
When talking about autofocus, it’s necessary to differentiate between DLSRs and mirrorless cameras. If you use a DSLR, the sensor is not exposed to anything when you’re not pressing the shutter button - so the camera can’t use the sensor to do any measurements.
Phase Detection Autofocus (PDAF)
This is why DSLRs often use phase detection autofocus, which involves a dedicated sensor that is exposed to some light if the shutter button (or the dedicated AF button) is half pressed. The light is then split into two seperate paths using a beam splitter (a semi-transparent area in the reflex mirror) or a micro-lens array
The two paths can then be compared - more precisely the phase difference between the two light rays. If the image is out of focus, the phase difference will be significant. If the image is in focus, the phase difference will be minimal.
Contrast Detection Autofocus (CDAF)
Mirrorless cameras don’t have to use phase detection since the sensor is never blocked by a reflex mirror and can therefore use contrast detection autofocus. It analyzes the current image on the sensor and compares adjacent pixels.
An image that is out of focus will have a lower contrast between neighboring pixels because light/shadow will “spill over” from one object to another (or foreground to background). An image that is in focus however will have a high contrast between the adjacent pixels.
This apporach is also used in DSLRs in live view mode.
Hybrid AF Systems
Most modern mirrorless cameras actually use a hybrid AF system (so does my Fuji XT-5) - a combination of PDAF and CDAF, often with fancy predictive algorithms to calculate where the camera might pan (very helpful for tracking moving objects).
Common end path
Independent of the type of autofocus a camera uses, the end path is pretty much the same: the camera sends the information, whether the image is in focus or not, to the lens where different types of motors move the lens elements to achieve the correct focus. This goes back and forth until the image is finally in focus.
Here’s a quick overview of the different types of motors that are built into the lenses (with the abbreviations that are most often found in the product name of the lenses):
- Ultrasonic Motor (USM)
- Stepping Motor(STM)
- Linear Motor
- Ring USM
- Piezoelectric Motor
- and many more…
But where to check the focus?
If you use single-spot AF, it’s pretty easy for the camera: you want a specific section of the sensor to be in focus, so the camera knows where to check.
So what if you don’t define the area that should be in focus? In this case, the camera would typically look at the central focus point or focus on the nearest subject and make its best guess from there.
But, let’s be honest, if you read until here and do some photography most likely you either manual focus or you use single-spot AF.
Understanding how the camera achieves autofocus is much simpler than I expected, although I’m pretty sure that it’s hard to implement.