【问题标题】:How can I achieve a difference of gaussian high pass filter?如何实现高斯高通滤波器的差异?
【发布时间】:2017-05-09 22:27:38
【问题描述】:

看到this的回答,这已经是高通滤波器了吗?

【问题讨论】:

  • docH = fspecial('gaussian',HSIZE,SIGMA) returns a rotationally symmetric Gaussian LOWPASS filter of size HSIZE with standard deviation SIGMA (positive).
  • 那么,我可以得到一个高通高斯滤波器吗?
  • 您可以减去输入减去低通滤波器的输出(或构建一个脉冲响应)

标签: matlab image-processing gaussian


【解决方案1】:

您需要使用傅里叶变换并将低频归零。像这样的:

I = imread('cameraman.tif');

%fourier transform
If = fftshift(fft2(I));

%create the filter as a mask with circle of radius 50
rx = (1:size(I,1)) - size(I,1)/2;
ry = (1:size(I,2)) - size(I,2)/2;

[X,Y] = meshgrid(rx,ry);
R = sqrt(X.^2 + Y.^2);
Ifhw = If;
Ifhw(R < 25) = 0;  % we kill the low frequencies

%get the inversed fourier transform
Ihw = abs(ifft2(Iflw));


%use the abs log for visualization purposes
abslog = @(X)(log(abs(X)+1));

figure
subplot(2,2,3)
imshow(abslog(If), [])
title('fft in the original image')
subplot(2,2,4)
imshow(abslog(Iflw), [])
title('fft low pass filter image')

subplot(2,2,1)
imshow(I, [])
title('original image')
subplot(2,2,2)
imshow(Ilw, [])
title('low pass filter image')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-26
    • 2013-03-29
    • 1970-01-01
    • 1970-01-01
    • 2018-10-03
    • 1970-01-01
    • 1970-01-01
    • 2017-12-22
    相关资源
    最近更新 更多