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!
In images, high frequency is edges and texture. In a blurry image, the energy in this high frequency content is weak. 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.
Thus, given an image, we can determine whether it is blurred by motion, by detecting areas where there is smoothness in one main direction and more significant difference of values in the vertical direction. If we found that motion blur, we can compute its direction of motion relatively to the camera.
You can easily fix blurry text in an image with Fotor's online image deblurrer. Using artificial intelligence (AI), it automatically detects and fixes blurry text pictures and jagged edges in your photos. You can also use its image sharpening tool to sharpen text in your image to make them more readable.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With