ASF_edge=[-46,18,4,0,0,0,-4,-18,46
-110,44,11,0,0,0,-11,-44,110
-205,82,20,0,0,0,-20,-82,205
-298,120,29,0,0,0,-29,-120,298
-332,136,33,0,0,0,-33,-136,332
-298,120,29,0,0,0,-29,-120,298
-205,82,20,0,0,0,-20,-82,205
-110,44,11,0,0,0,-11,-44,110
-46,18,4,0,0,0,-4,-18,46]; % 我用上面这个掩膜的话,处理出来的主背景为何是灰色的?
x1=imread('d:/img/bluesky.jpg');
x1=rgb2gray(x1);
x2=fft2(x1);
[height,width]=size(x2);
H=fspecial('sobel');
H=freqz2(H,width,height);
% H=freqz2(ASF_edge,width,height);
H=fftshift(H); %不做移位处理的话,会少很多边缘信息?
H=abs(H); % 加了abs处理后,边缘会更加清晰一些?
% H=255*H/max(H(:)); % 做归一化处理,处理后的图像主背景就变成灰色的了?
figure,imshow(H);
G=H.*x2;
G=real(ifft2(G));
G=uint8(G);
figure,imshow(G);
谁可以帮我看看,非常感谢 |