AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

FrequencyFilter.FrequencyRange Property unit

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

FrequencyFilter.FrequencyRange Property unit

Postby karlonsio » Tue Mar 10, 2009 6:58 am

Hi everyone,

I am using the Frequency Filter in an Image, for example

FrequencyFilter filter = new FrequencyFilter( new IntRange( 20, 128 ) );

and I was wondering what are the units of the FrequencyRange property?? Is it cycles per pixel??
So the frequency Filter only shows from 20 cycles per pixel to 128 cycles per pixel in the line code I wrote before?

Thank you very much,

Carlos.
karlonsio
 
Posts: 3
Joined: Tue Mar 10, 2009 6:48 am

Re: FrequencyFilter.FrequencyRange Property unit

Postby andrew.kirillov » Tue Mar 10, 2009 7:20 am

Hello,

karlonsio wrote:and I was wondering what are the units of the FrequencyRange property??

The unit is cycles per image.

As an example, lets take a look at this image:
grid.png
Source image
grid.png (653 Bytes) Viewed 9123 times


Its Fourier transformation looks like this:
fourier.png
Fourier image
fourier.png (385 Bytes) Viewed 9123 times


As we can see, we have a component with 0 frequency, which sets image's "background". And we have component with 64 frequency - grid points, which also may be treated as high frequency noise. We have 64 cycles per the source images, which are made by 64 horizontal and vertical lines.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3453
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: FrequencyFilter.FrequencyRange Property unit

Postby karlonsio » Tue Mar 10, 2009 8:33 am

andrew.kirillov wrote:Hello,

karlonsio wrote:and I was wondering what are the units of the FrequencyRange property??

The unit is cycles per image.

As an example, lets take a look at this image:
grid.png


Its Fourier transformation looks like this:
fourier.png


As we can see, we have a component with 0 frequency, which sets image's "background". And we have component with 64 frequency - grid points, which also may be treated as high frequency noise. We have 64 cycles per the source images, which are made by 64 horizontal and vertical lines.


WOW!! I think I understand now.
Andrew, thank you very much for your clear reply.
So, if I want to change those units to cycles per pixel I just divide for the image size, for example 512*512?
so for 20 cycles per Image it would be: 20/(512*512) cycles per pixel?
or for example to convert to cycles per mm, if the displayed image width and height are 150mm, it would be 20/(150*150) cycles per mm?
Finally, if I know that my stimuli has a visual angle of 15 degrees.
then I can say that to convert to cycles per degree, it is just to divide by 15. In this case, It would be 20/15 cycles per degree?


Thank you in advance,
Carlos.
karlonsio
 
Posts: 3
Joined: Tue Mar 10, 2009 6:48 am

Re: FrequencyFilter.FrequencyRange Property unit

Postby andrew.kirillov » Tue Mar 10, 2009 10:25 am

<em>andrew.kirillov</em> wrote:So, if I want to change those units to cycles per pixel I just divide for the image size, for example 512*512?
so for 20 cycles per Image it would be: 20/(512*512) cycles per pixel?

Not sure. I would better say 20/512. 512*512 is already the area of your image, not width or height ... But, of course it depends on what you are trying to get.

The main point is to get the idea of Fourier, frequencies, etc. Then you may convert them to those units, which you need in your applications. But this is something, which is known to you only ;)
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3453
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: FrequencyFilter.FrequencyRange Property unit

Postby karlonsio » Wed Mar 11, 2009 12:19 am

andrew.kirillov wrote:
<em>andrew.kirillov</em> wrote:So, if I want to change those units to cycles per pixel I just divide for the image size, for example 512*512?
so for 20 cycles per Image it would be: 20/(512*512) cycles per pixel?

Not sure. I would better say 20/512. 512*512 is already the area of your image, not width or height ... But, of course it depends on what you are trying to get.

The main point is to get the idea of Fourier, frequencies, etc. Then you may convert them to those units, which you need in your applications. But this is something, which is known to you only ;)


Thank you again Andrew.
I think you are right and it is better to say 20/512 cycles per pixel.

Keep up with the good work.
Bests,
Carlos.
karlonsio
 
Posts: 3
Joined: Tue Mar 10, 2009 6:48 am




Return to AForge.NET Framework

cron