0

I am working on this project where I have to automate the sharpness calculation of an camera taken image without actually looking a the image. I have tried many detection methods, but finally I am going further with Laplacian operator using openCV.

Now, the laplacian operator in the openCV returns the image matrix. But, I have to get boolean output whether the image is blurry or not depending upon my threshold.

Any link, algorithm or IEEE paper for the same would be helpful. Thanks!

Web_Designer
  • 72,308
  • 93
  • 206
  • 262
Ankit
  • 11
  • 1
  • 3
  • Following might be helpful http://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/ – Ari Hietanen Mar 03 '16 at 09:57
  • so you can/will capture multiple images and choose the setting where the sharpest image was captured? – Micka Mar 03 '16 at 10:26
  • Lets take Galaxy S6. Now, I have to check how much the focusing performance of S6 has degraded over a period of time. For that, I'll have to take several photos of same image but not manually through my eyes, rather using my program. – Ankit Mar 03 '16 at 10:36
  • Look for "perceptual sharpness metric" (PSM) for example from yang et al 2006 – Micka Mar 03 '16 at 10:49

2 Answers2

3

You will find a lot of infos here.

Also the paper cited in one of the answers if quite interesting: Analysis of focus measure operators for shape from focus

Community
  • 1
  • 1
MarcoM
  • 1,093
  • 9
  • 25
1

Refer this https://stackoverflow.com/a/44579247/6302996

Laplacian(gray, laplacianImage, CV_64F);
Scalar mean, stddev; // 0:1st channel, 1:2nd channel and 2:3rd channel
meanStdDev(laplacianImage, mean, stddev, Mat());
double variance = stddev.val[0] * stddev.val[0];

double threshold = 2900;

if (variance <= threshold) {
    // Blurry
} else {
    // Not blurry
}
Delgan
  • 18,571
  • 11
  • 90
  • 141
Nikhil Kulkarni
  • 644
  • 1
  • 6
  • 23