检测哪个图像更清晰 [英] Detect which image is sharper

查看:133
本文介绍了检测哪个图像更清晰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来检测两个(相似)图像中的哪一个更清晰。

I'm looking for a way to detect which of two (similar) images is sharper.

我认为这可能会使用一些整体锐度的度量并产生一个分数(假设的例子:image1的清晰度得分为9,image2的清晰度得分为7;因此image1更清晰)

I'm thinking this could be using some measure of overall sharpness and generating a score (hypothetical example: image1 has sharpness score of 9, image2 has sharpness score of 7; so image1 is sharper)

我做了一些锐度搜索检测/评分算法,但只会遇到提高图像清晰度的算法。

I've done some searches for sharpness detection/scoring algorithms, but have only come across ones that will enhance image sharpness.

有没有人做过这样的事情,或者有任何有用的资源/潜在客户?

Has anyone done something like this, or have any useful resources/leads?

我会在webapp的上下文中使用此功能,因此首选PHP或C / C ++。

I would be using this functionality in the context of a webapp, so PHP or C/C++ is preferred.

推荐答案

简单的方法是测量对比度 - 像素值之间差异最大的图像是最清晰的。例如,您可以计算像素值的方差(或标准偏差),以及产生较大数量的胜利。这会寻找最大的整体对比度,这可能不是你想要的 - 特别是它会倾向于支持具有最大景深的图片。

The simple method is to measure contrast -- the image with the largest differences between pixel values is the sharpest. You can, for example, compute the variance (or standard deviation) of the pixel values, and whichever produces the larger number wins. That looks for maximum overall contrast, which may not be what you want though -- in particular, it will tend to favor pictures with maximum depth of field.

取决于具体的你想要的,你可能更喜欢使用类似FFT的东西来查看哪个显示频率最高的内容。这使得你可以偏爱某些部分非常锐利的图像(但在其他部分则更少)而不是具有更多景深的图像,因此更多的图像相当清晰,但最大锐度更低(这是常见的,由于用较小的孔径衍射。)

Depending on what you want, you may prefer to use something like an FFT, to see which displays the highest frequency content. This allows you to favor a picture that's extremely sharp in some parts (but less so in others) over one that has more depth of field, so more of the image is reasonably sharp, but the maximum sharpness is lower (which is common, due to diffraction with smaller apertures).

这篇关于检测哪个图像更清晰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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