Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
HELP!How can I konw a fft2 processed image's frequency value

Subject: HELP!How can I konw a fft2 processed image's frequency value

From: liu

Date: 24 Nov, 2008 11:31:56

Message: 1 of 6

I want to use band-pass filter to wipe off some regular background pettern from a image after FFT and fftshift processing.My problem is how can I know the frequency value of th regular pattern or other frequency of the image in Matlab.

Subject: HELP!How can I konw a fft2 processed image's frequency value

From: Gavrilo Bozovic

Date: 24 Nov, 2008 11:43:02

Message: 2 of 6

"liu " <yacheeliu@yahoo.com.cn> wrote in message <gge3bc$sbm$1@fred.mathworks.com>...
> I want to use band-pass filter to wipe off some regular background pettern from a image after FFT and fftshift processing.My problem is how can I know the frequency value of th regular pattern or other frequency of the image in Matlab.

make an image of the pattern alone, and do its FFT.

However, removing a pattern from an image is not so easy: the frequencies that constitute your pattern will probably overlap with the frequencies of the image itself. Therefore, if you simply remove all the frequencies constituting the pattern, you'll also alter the image.

Secondarily, if your pattern is not a sine, it will have more than one frequency, and most likely an infinite number of frequencies.

Subject: HELP!How can I konw a fft2 processed image's frequency value

From: liu

Date: 24 Nov, 2008 12:18:02

Message: 3 of 6

"Gavrilo Bozovic" <gavrilo.bozovic@helbling.ch> wrote in message <gge406$646$1@fred.mathworks.com>...
> make an image of the pattern alone, and do its FFT.
>
> However, removing a pattern from an image is not so easy: the frequencies that constitute your pattern will probably overlap with the frequencies of the image itself. Therefore, if you simply remove all the frequencies constituting the pattern, you'll also alter the image.
>
> Secondarily, if your pattern is not a sine, it will have more than one frequency, and most likely an infinite number of frequencies.

If it is regular it will have many sub-frequencis ,can I wipe off these sub-frequencis?

Subject: HELP!How can I konw a fft2 processed image's frequency value

From: Gavrilo Bozovic

Date: 24 Nov, 2008 13:32:01

Message: 4 of 6

"liu " <yacheeliu@yahoo.com.cn> wrote in message <gge61q$s1o$1@fred.mathworks.com>...
> "Gavrilo Bozovic" <gavrilo.bozovic@helbling.ch> wrote in message <gge406$646$1@fred.mathworks.com>...
> > make an image of the pattern alone, and do its FFT.
> >
> > However, removing a pattern from an image is not so easy: the frequencies that constitute your pattern will probably overlap with the frequencies of the image itself. Therefore, if you simply remove all the frequencies constituting the pattern, you'll also alter the image.
> >
> > Secondarily, if your pattern is not a sine, it will have more than one frequency, and most likely an infinite number of frequencies.
>
> If it is regular it will have many sub-frequencis ,can I wipe off these sub-frequencis?

It depends. If it's a sine, it will have one frequency. You can then proceed to delete completely this frequency from your global image, but this is likely to alter your image. It's as if you hade a blue stain on a picture, and decided to remove it by removing all the blue: you'd alter the picture.

Then, if it is not a sine, if it is a grid, for instance, the pattern will have infinite frequency components. At this point, you can also try to remove all these components, but you'll also alter your image.

Basically, it's more complicated than this....

what kind of pattern do you have? is it simply a grid?

Subject: HELP!How can I konw a fft2 processed image's frequency value

From: liu

Date: 25 Nov, 2008 08:44:02

Message: 5 of 6

"Gavrilo Bozovic" <gavrilo.bozovic@helbling.ch> wrote in message <ggeach$ocv$1@fred.mathworks.com>...
> "liu " <yacheeliu@yahoo.com.cn> wrote in message <gge61q$s1o$1@fred.mathworks.com>...
> > "Gavrilo Bozovic" <gavrilo.bozovic@helbling.ch> wrote in message <gge406$646$1@fred.mathworks.com>...
> > > make an image of the pattern alone, and do its FFT.
> > >
> > > However, removing a pattern from an image is not so easy: the frequencies that constitute your pattern will probably overlap with the frequencies of the image itself. Therefore, if you simply remove all the frequencies constituting the pattern, you'll also alter the image.
> > >
> > > Secondarily, if your pattern is not a sine, it will have more than one frequency, and most likely an infinite number of frequencies.
> >
> > If it is regular it will have many sub-frequencis ,can I wipe off these sub-frequencis?
>
> It depends. If it's a sine, it will have one frequency. You can then proceed to delete completely this frequency from your global image, but this is likely to alter your image. It's as if you hade a blue stain on a picture, and decided to remove it by removing all the blue: you'd alter the picture.
>
> Then, if it is not a sine, if it is a grid, for instance, the pattern will have infinite frequency components. At this point, you can also try to remove all these components, but you'll also alter your image.
>
> Basically, it's more complicated than this....
>
> what kind of pattern do you have? is it simply a grid?

I can't upload pic here,it's grid,like redular line,dot,crosing line etc in the back ground ,I just want to wipe off these line,dot.I don't mind if the image would be damaged in some degree.Thank you~

I=imread('path');
A=rgb2gray(I);
W=fft2(A);
imshow(W);
J=fftshift(W);
figure,imshow(log(abs(J)),[])

Subject: HELP!How can I konw a fft2 processed image's frequency value

From: Gavrilo Bozovic

Date: 26 Nov, 2008 12:18:01

Message: 6 of 6

"liu " <yacheeliu@yahoo.com.cn> wrote in message <gggdsi$b0o$1@fred.mathworks.com>...
> "Gavrilo Bozovic" <gavrilo.bozovic@helbling.ch> wrote in message <ggeach$ocv$1@fred.mathworks.com>...
> > "liu " <yacheeliu@yahoo.com.cn> wrote in message <gge61q$s1o$1@fred.mathworks.com>...
> > > "Gavrilo Bozovic" <gavrilo.bozovic@helbling.ch> wrote in message <gge406$646$1@fred.mathworks.com>...
> > > > make an image of the pattern alone, and do its FFT.
> > > >
> > > > However, removing a pattern from an image is not so easy: the frequencies that constitute your pattern will probably overlap with the frequencies of the image itself. Therefore, if you simply remove all the frequencies constituting the pattern, you'll also alter the image.
> > > >
> > > > Secondarily, if your pattern is not a sine, it will have more than one frequency, and most likely an infinite number of frequencies.
> > >
> > > If it is regular it will have many sub-frequencis ,can I wipe off these sub-frequencis?
> >
> > It depends. If it's a sine, it will have one frequency. You can then proceed to delete completely this frequency from your global image, but this is likely to alter your image. It's as if you hade a blue stain on a picture, and decided to remove it by removing all the blue: you'd alter the picture.
> >
> > Then, if it is not a sine, if it is a grid, for instance, the pattern will have infinite frequency components. At this point, you can also try to remove all these components, but you'll also alter your image.
> >
> > Basically, it's more complicated than this....
> >
> > what kind of pattern do you have? is it simply a grid?
>
> I can't upload pic here,it's grid,like redular line,dot,crosing line etc in the back ground ,I just want to wipe off these line,dot.I don't mind if the image would be damaged in some degree.Thank you~
>
> I=imread('path');
> A=rgb2gray(I);
> W=fft2(A);
> imshow(W);
> J=fftshift(W);
> figure,imshow(log(abs(J)),[])

okay. then what you want to erase are high frequencies only, you need a low-pass filter.

to do this, you can either calculate the FFT2 of your image and then remove the high frequencies (the exact cut-off frequency will have to be fine-tuned according to your image and noise), or simply apply a moving average filter to your image (or gaussian blurring, or whatever of the kind, it's all basically low-pass).

sorry for the late answer, I hope it helps!

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us