有没有办法检测图像是否模糊? [英] Is there a way to detect if an image is blurry?

查看:199
本文介绍了有没有办法检测图像是否模糊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法通过分析图像数据来确定图像是否模糊。

I was wondering if there is a way to determine if an image is blurry or not by analyzing the image data.

推荐答案

是的。计算fft并分析结果。傅里叶变换可以告诉您图像中存在哪些频率。如果高频率较低,则图像模糊。

yes it is. compute the fft and analyse the result. The Fourier transform tells you which frequencies are present in the image. If there is a low amount of high frequencies, then the image is blurry.

定义术语低和高取决于您。

Defining the terms 'low' and 'high' is up to you.

编辑
,如评论中所述,如果您想要一个浮点代表给定图片的模糊 ,你必须制定一个合适的指标。

edit: as stated in the comments, if you want a single float representing the blurryness of a given image, you have to work out a suitable metric.

nikie的回答提供了这样的指标。使用拉普拉斯内核卷积图像:

nikie's answer provide such a metric. Convolve the image with a Laplacian kernel:

   1
1 -4  1
   1

并在输出上使用强大的最大指标来获取可用于阈值处理的数字。在计算拉普拉斯算子之前尽量避免过多地平滑图像,因为你只会发现平滑的图像确实模糊: - )。

And use a robust maximum metric on the output to get a number which you can use for thresholding. Try to avoid smoothing too much the images before computing the Laplacian, because you will only find out that a smoothed image is indeed blurry :-).

这篇关于有没有办法检测图像是否模糊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆