如何在matlab/octave中实现图像的韦伯对比度?
我想获得图像的每像素局部对比度,我猜韦伯对比度 是一个合理的公式。问题是,假设我们只使用相邻像素(例如,5x5)作为 Ib,如何在 matlab 中得到它?
I would like to get per-pixel local contrast of an image, and I guess Weber contrast is a plausible formula for that. Question is, how to get it in matlab assuming we just use neighboring pixels (ex, 5x5) for Ib?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了计算局部对比度,我们需要亮度图像和局部背景亮度。
假设我们已经有一个亮度图像,可以通过取局部区域中所有像素的平均值来计算特定像素的局部背景亮度。
我们可以通过在水平和垂直方向上重复将图像移动 0:(n-1) 个像素来收集一组此类局部背景区域(原始图像中的每个像素一个)。
以下演示函数说明了基本思想:
对于真正的心理物理学实验,我们希望将参数从弧度或球面度转换为像素,并且需要校准显示器或图像捕获设备,以便亮度测量准确。
To calculate local contrast we need a luminance image, and local background luminance.
Assuming we already have a luminance image, the local background luminance for a particular pixel can be calculated by taking the average over all pixels in the local region.
We can collect a set of such local background regions (one per pixel in the original image) by repeatedly shifting the image by 0:(n-1) pixelsin both horizontal and vertical directions.
The following demo function illustrates the basic idea:
For a real psychophysical experiment we would want to convert parameters from radians or steradians to pixels, and would need to calibrate the display or image capture device so the luminance measure is accurate.