我使用 clown.jpg 图像来消除其明显的图案/噪音。
在对图像进行 FFT 之前所做的第一步是将其重新调整为 2 次幂的方形图像(即 256 x 256)。在 matlab 中使用 FFT 和 fftshift 可以实现快速傅里叶变换,其强度集中在图像中。下图是使用前面提到的函数的结果。
我通过手动将 FFT 图像上的“星星”归零,成功去除了图案/噪声,如下所示:
通过 IFFT,我得到了更好的图像质量(未显示)。
我的问题是是否有一种自动方法将“星星”归零?我创建了一个将图像归零的间隔,因为我们不想删除最亮的“星星”、DC 分量或低值。下面给出这样的阈值:
filter = (fLog > .7*max(fLog(:)) ) | (fLog < .25*max(fLog(:)) )
where fLog is the log(1+abs(Fourier image)) and .7 and .25 are the corresponding
interval percentages.
输出掩模(我将其乘以傅立叶图像)如下所示。黑色对应于值 0,白色对应于 1。请注意,此掩模的过滤会去除一些“星星”并保留一些 DC 分量。显然这个方法并不是最好的。
我正在阅读有关进行高通滤波器的内容,但这似乎消除了傅立叶图像中的所有外部值。这是基于我之前的测试(我没有包含这些图像)。
您是否建议使用某些东西来突出显示除直流分量之外的高强度值。理想情况下,我想让面具看起来像:
source: http://users.accesscomm.ca/bostrum/Imaging/tips/tip1.html http://users.accesscomm.ca/bostrum/Imaging/tips/tip1.html
在另一个网站中,提到使用“高通和电平校正 FFT 数据以仅保留代表光栅图案的杂散点”。我不清楚具体如何做到这一点。
source: http://www.robotplanet.dk/graphics/raster_removal/ http://www.robotplanet.dk/graphics/raster_removal/
对你的帮助表示感谢。
这是我的源代码以提供帮助:
I = imread('clown.jpg'); % Read Image
% convert to grayscale
I = rgb2gray(I);
% normalize the image and conver to doubleI
I = double(mat2gray(I));
% Resize the image
I = imresize(I, [256 256]);
% get the size of the image
[rows,cols] = size(I);
% apply FFT
f = fftshift(fft2(I));
% used to plot the image
fLog = log(1 + abs(f));
% filter by a range based on fLog
filter = (fLog > .7*max(fLog(:)) ) | (fLog < .25*max(fLog(:)) );
B = abs(ifft2(f.*filter));
colormap(gray)
subplot(2,2,1),imagesc(I); title('Original Image')
subplot(2,2,2),imagesc(fLog); title('Fourier Image')
subplot(2,2,3),imagesc(filter); title('Zeroed Fourier Image')
subplot(2,2,4),imagesc(B); title('Cleaned Image')
annotation('textbox', [0 0.9 1 0.1], ...
'String', 'Fourier Analysis on Clown Image', ...
'EdgeColor', 'none', ...
'HorizontalAlignment', 'center', ...
'FontSize', 15, ...
'FontWeight', 'bold')