Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically find shaky OR out-of-focus Images

Most modern mobile cameras has a family of techniques called Image Stabilization to reduce shaky effects in photographs due the motion of the camera lens or associated hardware. But still quite a number of mobile cameras produce shaky photographs. Is there a reliable algorithm or method that can be implemented on mobile devices, specifically on Android for finding whether a given input image is shaky or not? I do not expect the algorithm to stabilize the input image, but the algorithm/method should reliably return a definitive boolean whether the image is shaky or not. It doesn't have to be Java, but can also be C/C++ so that one can build it through the native kit and expose the APIs to the top layer. The following illustration describes the expected result. Also, this question deals with single image problems, thus multiple frames based solutions won't work in this case. It is specifically about images, not videos.

enter image description here

like image 511
C-- Avatar asked Aug 22 '14 10:08

C--


People also ask

Is there a way to detect if an image is blurry?

The easiest way to detect if an image is blurry or not is to look at the strength of the high frequency content. This can be done with a simple gradient of gaussian filter or a laplacian filter.

What is a blurred image?

Blurring is to make something less clear or distinct. This could be interpreted quite broadly in the context of image analysis - anything that reduces or distorts the detail of an image might apply.

How do you know if an image is blurry in Python?

This method is fast, simple, and easy to apply — we simply convolve our input image with the Laplacian operator and compute the variance. If the variance falls below a predefined threshold, we mark the image as “blurry”.

How do you find the focus of an image?

The aperture of your lens will determine how much light is let in and as a consequence, how well you'll be able to focus. Photo by: 'Unsplash'. Practically speaking, you can check whether a picture is in focus or not by its sharpness. The sharper that it looks, the more it will be in focus.


1 Answers

Wouldn't out of focus images imply that

a) Edges are blurred, so any gradient based operator will have a low values compared to the luminance in the image

b) edges are blurred, so any curvature based operator will have low values

c) for shaky pictures, the pixels will be correlated with other pixels in the direction of the shake (a translation or a rotation)

I took your picture in gimp, applied Sobel for a) and Laplacian for b) (available in openCV), and got images that are a lot darker in the above portion.

Calibrating thresholds for general images would be quite difficult I guess.

like image 50
user3970006 Avatar answered Nov 07 '22 18:11

user3970006