给定代码
function [nImg,mask] = myFunc(img,rl,rh)
[n m] = size(img);
mask = ones(n, m);
% do some stuff
% more
% and more
%
fourierImg = fft2(img); % take the fourier transform 2d for the given image
fourierImg = fftshift(fourierImg); % shift the fourier transform
output = mask.*fourierImg; % calc with the mask % THAT LINE CAUSES
% Warning: Displaying real part of complex input ?
ishifting = ifftshift(output); % grab the DC element
nImg = ifft2(ishifting); % inverse back to the image dimension
end
我不断得到: Warning: Displaying real part of complex input
当我执行该行时output = mask.*fourierImg; % calc with the mask
。
我该如何解决?
问候