How does a camera know where to focus?

507 views

I can understand why a camera needs to focus, beams hit from different distances so you direct them to hit the sensor optimally. But how does a camera’s autofocus decide where that is ? Is there some artificial intelligence behind the cameras I’ve owned ? And how can a phone with no moving parts even focus at all ?

In: Technology

2 Answers

Anonymous 0 Comments

A picture which is focussed resolves a lot of very small details, while a slightly defocussed picture is blurred.

One can transform such a picture into frequencies using the Fourier-transform, and exploit that focussed pictures contain the most high-frequency / short wavelength components, since these are required to create smaller details in the picture.

So, it is no real AI required, just take a series of images, Fourier-transform them, pick the one with the highest amount of high frequencies and you are in-focus.

Anonymous 0 Comments

A digital image is made up of pixels that correspond to photosites on the camera’s image sensor. If the image is in focus, the pixels will be clear and well-defined. In other words, an image that is in sharp focus will have high contrast pixels.

If a digital photo is out of focus, then it will appear blurry. This is because the pixels on the image are not in sharp focus, therefore they have low pixel contrast.

Contrast-detection autofocus uses this information to figure out the correct point of focus. This light-dependent method achieves focus by means of trial and error.

The camera doesn’t know when it has reached its maximum contrast, so it moves the focus motor back and forth, even past the focal point, in search of the highest contrast between the pixels.