Sine wave representation of a peak in FFT image

3 views (last 30 days)
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.

Answers (2)

Walter Roberson
Walter Roberson on 9 Aug 2015

Image Analyst
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
Anupa  Shyamlal
Anupa Shyamlal on 10 Aug 2015
Sorry if I am making lame questions. I am new to matlab and image processing.
I need to represent these lines of the image in sine waves. Fourier transformation can be converted into sine wave representation. The peaks we get from the fft shifted images represent those lines. I need to extract those peaks and get their sine representations. Any idea? BTW why haven't you used findpeaks() function in your example?
Image Analyst
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.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!