Extracting frequency components of line in a image

Hi.. I want to extract the only frequency components of discontinuous line in the image shown here http://tinypic.com/r/2va11fc/7 while removing all other frequencies Can i do like this
I = imread(image);
imshow(I);
FT = fft2(I);
FT(1,1) = 0;
I2 = ifft2(FT);
imshow(I2);

 Respuesta aceptada

Gova ReDDy
Gova ReDDy el 17 de Oct. de 2011

0 votos

Actually this discontinuous line is a edge in the original image. As EDGES are high frequency components so I thought to suppress DC components...... So how can I extract frequency components by shifting the discontinuous line.

5 comentarios

Image Analyst
Image Analyst el 17 de Oct. de 2011
You already have the line, so further Fourier analysis of it is pointless. And I don't see how you can get high frequency components by shifting that line. If you want to do a high pass filter on the original gray scale image you can use conv2() with a kernel of all -1/9 except for 8/9 at the center, or you can do it with multiplication in the Fourier domain.
Image Analyst
Image Analyst el 18 de Oct. de 2011
Just display it like this:
imshow(fil, []);
The [] is important because it's a floating point image. Once you are able to see it, it should be obvious. You might also use the 'same' option to conv2() so that the image is the same size.
Gova ReDDy
Gova ReDDy el 24 de Oct. de 2011
thankyou Image Analyst..
kamran
kamran el 26 de Mayo de 2019
Can any one guide me to find the high frequency image by descrete fourier transformation
kamran
kamran el 26 de Mayo de 2019
I want a an output image not a graph of an images

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 16 de Oct. de 2011

0 votos

Straight lines (or line segments) have frequency components at all frequencies. Zeroing the DC component would at best shift the line segments. Zeroing any other frequency component would result in a wiggly line after reverse transformation.

11 comentarios

Gova ReDDy
Gova ReDDy el 4 de Nov. de 2011
finally I was able to get the continous line like this
http://tinypic.com/view.php?pic=5x08io&s=5
Now can someone explain me how to get the frequecy values corresponding to this line only not for the entire image...
Image Analyst
Image Analyst el 4 de Nov. de 2011
What are you talking about? The spectrum of a line segment (like a rectangular pulse) is just a sinc function (Google it). I doubt that's what you want or need. Do you mean the spectrum of the IMAGE under the line? Why do you think you need frequency components, either of the line or the underlying image? What would you do if you had it?
Gova ReDDy
Gova ReDDy el 5 de Nov. de 2011
yes I remember that previously you explained me that the spectrum of a line segment or straight line will be a *sinc function* and it contains multiple frequencies.But I want to extract all the multiple frequencies corresponding to that line and to analyse the variations in them by applying standard deviation for multiple lines detected in multiple frames where each line(in a frame) contains multiple frequencies like you explained.
So could you please explain me how to get these multiple frequencies from the line.
Image Analyst
Image Analyst el 5 de Nov. de 2011
Sorry, but I don't want to send you on a wild goose chase. You'd have to explain to me how that would solve your problem (because I don't think it will).
Gova ReDDy
Gova ReDDy el 5 de Nov. de 2011
Yes..offcourse it wont solve my problem but I am trying to anlayze the results from different methods like I previously used *slope* method and now this *frequency* method.
Image Analyst
Image Analyst el 6 de Nov. de 2011
Then take the FFT of it, and you'll see sinc(x).
x = zeros(151,1);
midPoint = ceil(length(x)/2)
width = 40;
x(midPoint-width/2 : midPoint+width/2) = 1;
subplot(2,1,1);
plot(x, 'LineWidth', 3);
ylim([0 2]);
xlim([1 length(x)]);
grid on;
title('X, spatial domain', 'FontSize', 30);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
spectrumOfX = fft(x);
subplot(2,1,2);
plot(real(fftshift(spectrumOfX)), 'LineWidth', 3);
grid on;
title('FFT(X), frequency domain', 'FontSize', 30);
Image Analyst
Image Analyst el 6 de Nov. de 2011
Please let me know if this is helpful because I really feel you're wasting all of our time by continuing down this path. I just don't think you have the background concepts understood enough yet to realize what you're asking.
Gova ReDDy
Gova ReDDy el 6 de Nov. de 2011
I think here *spectrumOfX* contains all the frequencies of x(sinc function) and because the sinc function varies from -ve to +ve intervals it is containing both values.
Just a last doubt..is it possible to get only frequencies in x with a value of 1 from entire x?
What does it mean for a frequency to have a value of 1 ? Please keep in mind that the result of fft is generally a vector of complex values. The fft of a straight line (or approximation thereto) has phase components that you cannot neglect.
The magnitude of the coefficient of any frequency element does not often come out to be exactly 1.
If you are looking for relative peaks, then use a peak finder (once you work out the complex-number issues.)
Gova ReDDy
Gova ReDDy el 6 de Nov. de 2011
Here the value of 1 means the x has a values of 1 for a width of 40 as given in the above example of Image Analyst.
Doing fft for the entire image will result in the frequencies of entire image..right.
But Im asking this question for a long time*Extracting only the frequencies of line from the entire image*.How to do this..
Image Analyst
Image Analyst el 6 de Nov. de 2011
Sorry. I consider this a dead end. I'm done. I suggest you take a different approach.

Iniciar sesión para comentar.

Productos

Preguntada:

el 16 de Oct. de 2011

Comentada:

el 26 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by