I’ve noticed that in some devices without true optical focus control, (Blackberries, Android phones, etc), there’s a built-in digital auto-focus mechanism.
I suppouse that this mechanism is fully implemented in software, applying an image “sharping” algorithm to the images feed by the camera)*.
Is there an algorithm (or even an open source library in Java or C) so that I can apply it to an image after it has been captured?
Thanks in advance.
*UPDATE: Seems that what I’m looking for is not actually auto-focus, since it involves detecting the best focus level and a mean to change it via API. What I need is an algorithm that given a blurred input image, produces an output image with better definition.
It seems you’re about deconvolution. Say, we have convolution g(x)a = h where g is an original image, a – camera aperture and h – sensed (‘blurred’) image, (x) – convolution operation.
Deconvolution is computing G with known A and H, and can be done in many ways.
One is based on fact that Fg(i) * Fa(i) = Fh(i), where F is fourier transform. Obviously Fg(i) = Fh(i) / Fa(i).
In practice, deconvolution greatly increases noise so there’s need in noise suppressing algorithm to use with.