简体   繁体   中英

How to identify/check blur image?

How can we identify that a given image is blur or how much percent is it blur in C#? Is there any API available for that? Or any algorithm that can be helpful in that?

Thanks!

You could perform a 2D-FFT and search the frequency coefficients for a value over a certain threshold (to elimate false-positives from rounding/edge errors). A blurred image will never have high frequency coefficients (large X/Y values in frequency-space).

If you want to compare with a certain blurring algorithm, run a single pixel through a 2D-FFT and check further images to see if they have frequency components outside the range of the reference FFT. This means you can use the same algorithm regardless of what type of blurring algorithm is used (box blur, gaussian, etc)

For a very specific problem (finding blurred photos shot to an ancient book), I set up this script, based on ImageMagick:

https://gist.github.com/888239

Given a blurred bitmap alone, you probably can't.

Given the original bitmap and the blurred bitmap you could compare the two pixel by pixel and use a simple difference to tell you how much it is blurred.

Given that I'm guessing you don't have the original image, it might be worthing looking at performing some kind of edge detection on the blurred image.

This Paper suggests a method using Harr Wavelet Transform, but as other posters have said, this is a fairly complex subject.

Although, I am posting this answer after 8-9 years after asking the question. At that time, I resolved this problem by applying blur on image and then comparing with the original one.

The idea is, when we apply blur on a non-blurry image and then compare them, the difference in images is very high. But when we apply blur on a blurry image, the difference in images is almost 10%. In this way, we resolved our problem of identifying blur images and the results were quite good.

Results were published in following conference paper: Creating digital life stories through activity recognition with image filtering (2010)

Err ... do you have the original image? What you ask is not a simple thing to do, though ... if its even possible

This is just a bit of a random though but you might be able to do it by fourier transforming the "blurred" and the original image and seeing if you can get something that has a very similar frequency profiles by progressively low pass filtering the original image in the frequency domain. Testing for "similarity" would be fairly complex in itself though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM