Naked Science Forum

Non Life Sciences => Technology => Topic started by: DoctorBeaver on 21/02/2007 13:24:50

Title: How does the auto-focus on a camera work?
Post by: DoctorBeaver on 21/02/2007 13:24:50
How do they work? Is there an invisible imp inside who runs out very fast with a tape measure, or is it something a bit more scientific?
Title: Re: How does the auto-focus on a camera work?
Post by: eric l on 21/02/2007 14:10:35
In some cases there is indeed a little imp leaving the camera and comming back with the measurement.  That imp is either an ultrasonic wave, in which case the time delay between emission of the pulse and reception of the reflection is the tape measure.  If your imp is an infra red light beam, it works more along the line of the split image (or double image) rangefinders (Leica, early Contax models...), that is by triangulation.  In those cases, focussing is independent of the camera lens.
In other cases, the little imp looks at the image in the camera, and searches for maximum contrast or maximum "neatness" of the image.
I know there is also a system called "phase detection" but I have to leave it to others for explaining that.
Title: Re: How does the auto-focus on a camera work?
Post by: DoctorBeaver on 21/02/2007 21:55:44
I was wondering about IR or ultrasound but I didn't see how that could work in a really jumbled environment. I suppose if the beam is narrow enough it would be OK though.

I still prefer the imp theory though  [;D]
Title: Re: How does the auto-focus on a camera work?
Post by: eric l on 22/02/2007 15:29:03
In most cases it focusses on a circle or oval in the centre of the image (very much like the microprism ring in "analog" SLR cameras).  If you want to focus on something that is not in the centre, point first with the object in the centre and fix the focussing while you compose your image as you want to have it.
In a jumbled environment, focussing is done on the object closest to the camera (and within that foussing centre of the image).
Most problems occur when you want to take a picture through a window, e.g. from the inside of a touring car. 
Title: Re: How does the auto-focus on a camera work?
Post by: another_someone on 22/02/2007 16:02:45
In most cases it focusses on a circle or oval in the centre of the image (very much like the microprism ring in "analog" SLR cameras).  If you want to focus on something that is not in the centre, point first with the object in the centre and fix the focussing while you compose your image as you want to have it.
In a jumbled environment, focussing is done on the object closest to the camera (and within that foussing centre of the image).
Most problems occur when you want to take a picture through a window, e.g. from the inside of a touring car. 

A car window is relatively a simpler problem (many autofocus cameras will still allow you to force the camera to focus to infinity), but focusing through a shop window can be far more problematic (especially because the low lighting often creates difficulties cameras that use TTL focusing (contrast detection, etc.).

Some modern digital cameras will actually allow you to select focus areas away from the centre of the screen (not tried using one, so I cannot say if it actually is any simpler to use than simply pointing the camera at what you want to focus on, locking the focus, and the recomposing the image), and one of the latest cameras actually has a mode that tries to identify any human faces in the image and choose that as the focus point (what it does when it detects multiple faces, I don't know - then again, it may, if there is enough light, simply try and expend the depth of field).
Title: Re: How does the auto-focus on a camera work?
Post by: DoctorBeaver on 23/02/2007 13:52:18
Thank you all for your erudite replies. I am enlightened.  [:)]
Title: How does the auto-focus on a camera work?
Post by: Pumblechook on 27/10/2008 13:39:23
Guessing here but maybe one system just looks at the file size of the image.  When in focus there will be more detail and the number of bytes will peak.
Title: How does the auto-focus on a camera work?
Post by: Don_1 on 27/10/2008 14:07:27
This is usually a phase detection system in SLR cameras and contrast detection in non SLRs.

In the old film SLRs' the focus was centre weighted but in modern digital SLRs' (DSLR) there will usually be nine or more centre of focus points to choose from. My Nikon D300 has 51 points of focus to choose from, so you do not have to have the main subject in focus in the middle of your frame.

This will roughly explain how it works: http://www.luminescentphoto.com/articles/CAM2000/cam2000.html (http://www.luminescentphoto.com/articles/CAM2000/cam2000.html)
Title: How does the auto-focus on a camera work?
Post by: DoctorBeaver on 27/10/2008 17:01:15
My Canon EOS has lots of points of focus too. That's 1 of the things that prompted this question.
Title: How does the auto-focus on a camera work?
Post by: lyner on 27/10/2008 21:49:49
Guessing here but maybe one system just looks at the file size of the image.  When in focus there will be more detail and the number of bytes will peak.
That is effectively what they do in most systems,nowadays. But you don't need to JPEG code the image to tell when it's in focus.. You just need to look for the focus setting which gives you maximum detail - highest spatial frequency content - which would give the biggest file
There are small areas of striped sensor at different (selectable) places in the focal plane of the lens. The autofocus system waggles the focus motor until it gets the maximum signal, which is the sharpest picture. This system works through glass or anything. It does, however, tend to need a fair amount of light and can fail in dim scenes. It also tends to maximise vertical edges and can miss out with diagonal details.