# Detect blur, sharpness of the single image

I am trying to create validation of the image into my mobile application for different platforms(iOS, Android, etc.) Googled a lot I found some solutions and snippets but unfortunately they are not opaque for me. The idea is take a picture and validate it. For example attached image is not valid.

Is it possible to make this kind of validation using OpenCV? I want to have functions like isBlurry(image), isSharped(image)

edit retag close merge delete

maybe you will support the idea of adding calcBlurriness function to imgproc

( 2016-02-21 07:52:09 -0600 )edit

With one image I don't know if an image is blur or not. With two images you can compare values of bluriness but you need to define a region of interest. It's like when you take a picture do you want to see a blur backgound or a blur foreground?

( 2016-02-21 09:07:58 -0600 )edit

Sort by ยป oldest newest most voted

Take a look at this SO answer. http://stackoverflow.com/a/7768918/56...

These aren't absolute measures, but they are relative. So you can use these to tell if one image is blurrier than another.

more

Thank you. But the question is what to do when you have only one image without comparing.

( 2016-02-21 23:26:42 -0600 )edit

If you find an answer after you can post an answer to this comment "What if you take a perfectly on-focus picture of a blurred image?" When you measure something all is relative

( 2016-02-22 03:30:47 -0600 )edit

It can actually be done if you have a perfectly sharp edge aligned with either the horizontal or vertical line of pixels. But other than a very few lab condition papers I've never seen it used.

Basically, take a perfect picture, measure the metric immediately surrounding the knife edge, set that to 1.0, and find the knife edge in subsequent images and compare.

( 2016-02-22 07:06:37 -0600 )edit

check this link. This uses variance of laplacian.

more

Hi,

this paper is also interesting, where they use a Harr Wavlet transform to determine bluriness and sharpness:

Blur Detection for Digital Images Using Wavelet Transform

more

Official site

GitHub

Wiki

Documentation