Subscribe to EDN

How Does a dSLR Camera’s Autofocus Work?

January 4, 2008

Well, I d hoped to have an answer to that question when I went to this really interesting Web page, which explains how autofocus works in Canon’s EOS cameras, but it’s still clear as mud. The sticking point for me is this sentence:

“When you half-press the shutter release (or the * button, if you’ve used the custom function to move focusing control there), the activated AF sensor "looks" at the image projected by the lens from two different directions (each line of pixels in the array looks from the opposite direction of the other) and identifies the phase difference of the light from each direction.”

No clue as to how a simple linear array of photosensors identifies a phase difference in the incident light. Any ideas?

Posted by Steve Leibson on January 4, 2008 | Comments (13)

June 25, 2009
In response to: How Does a dSLR Camera’s Autofocus Work?
Steve Leibson commented:

Kenn D, that is not correct; dSLRs generally do not emit infrared signals for focusing. Light travels much too fast to use as SONAR or RADAR in a consumer camera. Aircraft RADAR works because the objects (airplanes) are miles away so there are at least many nanoseconds of delay from transmit pulse to return echo. Light travels roughly one foot per nanosecond, so cameras would need sub-nanosecond resolution for accurate focusing down to the millimeter. dSLRs focus from incident light (with one or two exceptions, see below) and look for contrast edges and phase differences thrown onto special stereoscopic focusing sensors to determine distance. Some cameras analyze contrast differences from images directly on the camera's imaging sensor, although this approach is currently slower than the one that uses separate focusing sensors. There is one situation where the dSLR tosses out some infrared light as a focusing aid. For example, Canon's shoe-mount flashes and ST-E2 IR transmitter will emit infrared light as a focusing aid for dark scenes, but the reflected infrared light is merely a supplement for the missing visible light that would help the camera focus. In other words, the extra infrared is merely illuminating the scene so that the camera's focusing sensor can "see" better. Some dSLRs do the same thing with one or more "preflashes" from their internal, top-mounted, pop-up flash. You will sometimes see several short flashes followed by one long flash when a photographer takes a photo using this mode. One or more preflashes is for focus. One is often for setting exposure, and then comes the real "shoot-the-picture" flash.


June 25, 2009
In response to: How Does a dSLR Camera’s Autofocus Work?
kenn D. commented:

i'm not quite sure if this would help, i'm just a newbie in using a dslr camera, to my understanding auto focus sends out infrared signals to the subject then the camera will recive the same signals back (like sonar). in order for the camera to readjust the focus, i'm not quite sure if this is a helpful thing however this is just a simple theory broken down to newbies like me... i'm happy to recive any clarifications about my post.


February 8, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Per S. commented:

I should have added that I am a Nikon user. The Nikon D50 has a green focus light in the view finder, which I refer to as a "focus indicator" in the post above.


February 8, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Per S. commented:

Interesting discussion! The Split_Prism.pdf document helped me understand a lot, but not all. Anybode in here that understands how the half automatic focus works, when one turns the focus ring until a signal in the view finder indicates focus? Is this focus indicator connected with the "full" AF system at all, or is this just an indicator? Could we have a case where we have a faulty lens that when told to focus misses it such as the indicator won't lit up?


January 8, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Steve Leibson commented:

Brian, if you read the paper Dave J cites, I don't think you've got it yet. The two lines image 1D views (one pixel wide) of images delivered by small prisms. I still think the AF imagers are one pixel wide.


January 8, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Brian commented:

Steve, if you're right that the sensors ARE single pixel wide I'd have to agree; but that's not what I understood by "a pair of short lines" in the article. I am assuming the horizontal sensor (for vertical lines) consists of a pair of pixel rows, running left to right, one line immediately above the other. See if the explanation makes more sense now.


January 7, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Dave J commented:

The How Stuff Works explanation is for a contrast-based AF system, as found in point-and-shoot digicams and video cameras, not SLRs. It's just Not How, however, a Canon or Nikon SLR Works, at least not normally.


January 7, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Basic Guy on the Street commented:

Explanation from How Stuff Works dot com "A typical autofocus sensor is a charge-coupled device (CCD) that provides input to algorithms that compute the contrast of the actual picture elements. The CCD is typically a single strip of 100 or 200 pixels. Light from the scene hits this strip and the microprocessor looks at the values from each pixel. The microprocessor in the camera looks at the strip of pixels and looks at the difference in intensity among the adjacent pixels. If the scene is out of focus, adjacent pixels have very similar intensities. The microprocessor moves the lens, looks at the CCD's pixels again and sees if the difference in intensity between adjacent pixels improved or got worse. The microprocessor then searches for the point where there is maximum intensity difference between adjacent pixels -- that's the point of best focus." I'd post a link up but the comment system won't let me. electronics dot howstuffworks dot com slash autofocus3 dot htm


January 7, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Dave J commented:

I agree that it seems like magic that the camera could determine, from the contrast method, exactly where to focus. It seems like it shouldn't even have enough information to know which direction! However, after reading the article in the link I thought it was pretty straightforward how the camera was able to determine immediately where to place the lens using the "phase" method. It seems that it is not much different than the split-prism method from the old days. We see two half-images, offset by some amount, but the way the AF system is designed, it pretty much sees two copies of a the same slice of the image, arrayed onto two separate strips of pixels. The strips of images are offset, and the camera measures how much. Then, knowing something about the lens, how many turns of the motor move the lens a certain amount etc, it can determine exactly where to put the focus. What confused me originally was all this talk of "phase." [ I was thinking the camera was working with constructive and destructive interference of two images superposed on each other, but offset by some amount as a function of focus. But that would imply offsets of nanometers and never made sense to me! Now I know it's because it doesn't make sense! ;) ] By the way, my fraction of correctly focused images is substantially lower with my XTi than it was with my old FD lenses and the split prism. This has been an ongoing disappointment for me. However, that fraction has been steadily increasing as I learn to predict what the camera will actually focus on in a given situation. Moral of the story, I guess is that even sophisticated AF has a learning curve. [ Another aside: I still may buy one of those Katz Eye replacement focusing screens, to kick it Old Skool. ]


January 7, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Steve Leibson commented:

Thanks for the link Dave. I suspect Canon is also using a contrast-focus technique, except Canon's cameras don't rack focus on the lens to hunt the point of highest contrast. Somehow, the defocused image hitting the linear focus sensors contains enough information for the camera processor to determine where to set the lens' focus in one step. Amazing. And I've no clue how this happens. Canon published data is pretty clear on this one step and using the cameras confirms that they don't rack, unless overall image contrast is extremely low.


January 6, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Dave J commented:

Steve, I saw the same article and was rather confused by it. Right around the point when it gets to all that talk of phase differences, the article becomes rather vague. However, I found this article, which may be more instructive: doug.kerr.home.att.net/pumpkin/Split_Prism.pdf non-SLRs with passive systems and some new SLRs that can focus in "live view" mode also use contrast based focusing. This to me is more intuitive: The lenses is back and forth racked until the point of highest contrast of adjacent pixels. Another way to think of this is to constantly compute an FFT along that strip of AF sensor pixels and stop the lens when the FFT has the most high-frequency energy. -- dave j


January 4, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Steve Leibson commented:

Brian, the autofocus sensors are single-pixel-wide linear sensors. I don't think there is a "left" or "right". A vertical array senses horizontal lines and a horizontal array senses vertical lines. There are a few such arrays arranged on a special auto-focus sensor that is not part of the actual picture imager.


January 4, 2008
In response to: How Does a dSLR Camera’s Autofocus Work?
Brian commented:

If you clock out the two lines (e.g. from left to right) and the image is to the right in one of them, that will appear as a phase advance in the output signal, which can be used as an error signal in the focusing system. The trick would be to get one pixel row looking left, the other looking right, which suggests microprisms (one per pixel). But if they can place R, G or B filters over each pixel, I expect microprisms are possible too.

POST A COMMENT
Display Name
captcha

Before submitting this form, please type the characters displayed above. Note the letters are case sensitive:

Advertisement
Advertisement
Advertisement
About EDN   |   Site Map   |   Contact Us   |   Subscription   |   RSS
© 2012 UBM Electronics. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other UBM Canon sites

UBM Canon | Design News | Test & Measurement World | Packaging Digest | EDN | Qmed | Pharmalive | Appliance Magazine | Plastics Today | Powder Bulk Solids | Canon Trade Shows