2013-08-07 48 views
0

我已經改變了與方法的幫助下fft2現在我想找到嘈雜的峯值和清除它們作爲顯示在下面的圖片鏈接的圖像:Matlab的:刪除嘈雜峯

Image with Noisy Peaks

請提示功能的MATLAB實現這一

這是我做的,到目前爲止

F = fft2(myImage); 

    F = fftshift(F); % Center FFT 

    F = abs(F); % Get the magnitude 
    F = log(F+1); % Use log, for perceptual scaling, and +1 since log(0) is undefined 
    F = mat2gray(F); % Use mat2gray to scale the image between 0 and 1 

    imshow(F,[]); % Display the result 
+0

我已經得到圖像的傅里葉變換,現在我想找到除原點以外的嘈雜峯值並將它們去除 –

+0

該圖像看起來像一個標誌,而不是一堆噪音。這真的是你想要消除噪音嗎? – horchler

+0

沒有人編輯它請按照鏈接「圖像與嘈雜的山峯」,我想所有嘈雜peeks被刪除在運行時 –

回答

0

您可以嘗試創建一個顯示/表示超過特定閾值和位置的點的遮罩。我們來創建位置數組。

[x y] = meshgrid(1:size(a, 2), 1:size(a, 1)); % x-y coordinate of the data 
ft = 0.5;          % Try different values for your case. 
mask = F > ft && y < 0.4*size(a, 1) && y > 0.6*size(a, 1); 
F(mask) = 0; 

你應該能夠檢查mask看到,如果你已經找到了合適的崗位。 imagesc(mask)在您的反覆試驗步驟中會非常有幫助。請注意,在示例中我沒有x規則,但如果可以幫助縮小搜索空間,則可以添加它們。