10

Is there some robust metric of image sharpness or bluriness? I have various set of images with different parameters of saturation and captured from different optical systems, and i heed to show user something like "quality" of focusing. For getting most focused image i use metric getted with Sobel-Tenengrad operator(summ of high-contrast pixels), but the problem is that for different objects are quite different range of metric(depends on unknown parameters of image intensity, optical system ) - needed some metric where possible to say that image has bad focus whithout comparing with reference image, like this is "bad" or "good" focused image.

asaenko
  • 215
  • 1
  • 2
  • 11
  • This question appears to be off-topic because it is about a mathematical/numerical analysis/computer graphics topic. Don't get me wrong, it's interesting, but the underlying problem is actually really hard and still being researched. – Zeta Jul 26 '13 at 17:58
  • 5
    @Zeta - Since when is computer graphics off-topic for SO? The [help page](http://stackoverflow.com/help/on-topic) specifically says that questions about software algorithms are on-topic. I don't believe OP is asking for a theoretical answer, but rather for an algorithm to compute a metric. – Ted Hopp Jul 26 '13 at 18:14
  • possible duplicate of [Calculating image acutance](http://stackoverflow.com/questions/6123443/calculating-image-acutance) – Nakilon Jul 11 '15 at 00:38

4 Answers4

3

You can calculate the accutance of the image by calculating the mean of the Gradient Filter.

Reference this StackOverflow answer to a similar question.

Community
  • 1
  • 1
Andrew Ng
  • 300
  • 2
  • 11
  • I have to implement this same way before asking, and this is looks like algorithm “mean of Gaussian filteter”: * Calculate gradient Sobel x,y derivative * Get the magnitude image * Get the average(mean) value of magnitude. Result seems to be acceptable, but it vary his value range from image to image. – asaenko Jul 27 '13 at 15:35
3

You need a no-reference sharpness metric, such as:

Thiago Falcao
  • 3,235
  • 31
  • 30
0

Autofocus is an interesting problem on its own, and so evaluating sharpness across arbitrary images is another level of complexity.

On sharpness evaluation, I suggest this paper from Cornell. Their conclusion was that the variance metric provided the best evaluation of a given image. And it doesn't hurt that it's really easy to calculate!

For creating a consistent metric across different images, you'll need a way to normalize. The metric might be in units of variance per pixel. You could take advantage of the fact that lack of focus provides an upper bound on variance, and so look for clustering at a maximal rate of local variance.

Eliot Gillum
  • 683
  • 7
  • 17
0

Here's a short paper describing a method for detecting blurredness using a Haar Wavelet Transform

The other answers to this PAQ may also be helpful.

Community
  • 1
  • 1
gordy
  • 8,350
  • 1
  • 27
  • 40