我试图通过设计高斯高通滤波器来锐化图像。我想利用高通滤波器相当于单位矩阵减去低通滤波器的事实来做到这一点,所以我执行了以下操作:
image= imread('Question3_Data-Cats.jpg'); % read image
H = 1 - fspecial('gaussian' ,[5 5],2); % create unsharp mask
sharpened = imfilter(image,H); % create a sharpened version of the image using that mask
imshow([image sharpened]); %showing input & output images
我没有得到锐化的图像。相反,我得到了一张白色图像,图像的一小部分区域上有一些颜色。有人可以帮忙吗?谢谢。
Let g
be the gaussian
内核和f
成为形象。然后f * g
(卷积)给出图像的模糊版本。这意味着low-passed
图像的版本。
Then consider . It means image - lowpass image
. That gives the high-passed
version of the image. It contains only image details. The details are in white on the black background. I think that is the image you are getting right now.
从图像中提取图像细节后,必须将它们添加回图像以获得锐化图像。
这意味着你可以通过卷积得到锐化图像2e - g
与您的图像(这是不清晰的蒙版)。
你可以得到2e
从 matlab 使用padarray(2,[2 2])
and g
using fspecial('gaussian' ,[5 5],2)
.
H = padarray(2,[2 2]) - fspecial('gaussian' ,[5 5],2); %create unsharp mask
有时,您需要控制图像细节的亮度。你可以这样做
锐化图像 = 图像 + alpha(图像细节)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)