Sine wave representation of a peak in FFT image
3 views (last 30 days)
Show older comments
I wonder what is the best way to identify the peaks in fourier transformed image and how to represent that peak as a sine wave.
0 Comments
Answers (2)
Walter Roberson
on 9 Aug 2015
The "best" way is not invented yet. You can find a bunch of different methods listed in http://www.researchgate.net/publication/233735046_An_Efficient_Algorithm_for_Automatic_Peak_Detection_in_Noisy_Periodic_and_Quasi-Periodic_Signals
0 Comments
Image Analyst
on 9 Aug 2015
It depends on what the spectrum looks like. For many real world images, you have a spectrum that looks like an exponential decay. If there is a periodic pattern in the spatial domain picture, then this exponential decay might have some spikes superimposed on it. One thing I've done to get just the spikes is to use a bottom hat filter. Here's a snippet. Feel free to modify it (it won't run as-is since it's just a snippet pulled out of a larger program):
% Compute the 2D fft.
frequencyImage = fftshift(fft2(grayImage));
% Take log magnitude so we can see it better in the display.
amplitudeImage = log(abs(frequencyImage));
minValue = min(min(amplitudeImage))
maxValue = max(max(amplitudeImage))
subplot(2, 3, 2);
imshow(amplitudeImage, []);
caption = sprintf('Notice the two spikes\nperpendicular to the periodic frequency');
title(caption, 'FontSize', fontSize);
axis on;
% zoom(10)
amplitudeImage = medfilt2(amplitudeImage, [3,3]);
se = strel('disk', 23, 0);
mf = imtophat(amplitudeImage, se);
subplot(2, 3, 3);
imshow(mf, []);
axis on;
title('Filtered image', 'FontSize', fontSize);
lowThreshold = 1.45;
% [lowThreshold, highThreshold, lastThresholdedBand] = threshold(1.4, 10, mf);
binaryImage = mf > lowThreshold;
3 Comments
Image Analyst
on 10 Aug 2015
findpeaks() works on 1D signals, not 2D images. The most similar 2D function is imregionalmax() but it doesn't have options for eliminating noisy small peaks.
For your image, you can take the FFT and look for spikes. Then erase everything but the spikes and inverse FFT. Study up on the Fourier Transform and you'll know why you don't model the FT image or the spikes in it as sine waves. Essentially the image can be made up as a weighted sum of sine waves and the FT represents the weights of each sine wave. So it makes no sense at all to model the FT image or spikes in it as sines.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!