# how to design 2D low pass filter that works with cycle per degree?

Discussion in 'Optometry Archives' started by kiki, Nov 16, 2004.

1. ### kikiGuest

Hi all,

I need to design a spatial 2D low pass filter, which cuts off high frequence
component beyond C cycle per degree...

Now I am given an image bitmap, which is MxN pixels...

How can I design such a filter, how do I relate pixels to cycle per degree?

I heard that cycle per degree is the unit of freuqency in spatial domain...

I guess I need to do 2D FFT first, then apply an ideal rectangular
shaped-low pass filter, or do I apply some fancy named filter such as raised
cosine, etc.?

Thanks a lot

kiki, Nov 16, 2004

2. ### kikiGuest

Hi Tim,

Thanks a lot for your help! Ok, from my side I can

1) Measure my viewing distance and the physical size of the image. And then
I can compute the visual angles in degree...

2) But how do I know how many cycles are there in these horizontal and
vertical visual angles(in degree)?

For sine/cosine grating image, I know how to count cycles... but for image,
how do I do that?

3) In fact, estimating the highest frequency(the highest cycles per degree)
is one of my goal... I hope by doing 2D FFT I can determine where is the
highest frequency...

4) But when talking about 2D FFT, problem comes again how are those MxN FFT
output matrix labeled, what is the unit of the FFT output? (cycle per
degree, or pixels per degree, or pixels per meter, cycles per meter, cycles
per pixel, etc.?)

I don't need real-time implementation, I just need Matlab to determine the
spectrum...

then I can cut off at certain cycle per degree -- Cutoff Frequency... do a
low pass filtering...

Why could not I find some information on the Internet? Neither did I find
any books talking about these things... Any more thoughts? Thank you so
much!

kiki, Nov 16, 2004

3. ### Gernot HoffmannGuest

Kiki,

it´s perhaps simpler to use MxM pixel images by adding empty rows or
empty columns. The FFT for non-square images is IMO wasted time.

An interpretation by 'cycles per second':
A pixel clock samples one pixel per second. This is a fictitious
sampling frequency of 1 Hz. The highest signal frequency is o.5 Hz
because of Nyquist.

In the frequency domain we'll find frequencies up to 0.5 Hz. The lowest
frequency is defined by the number of pixels in one row or column.

It´s hardly possible to explain this in a post. The mathematics and some
examples are e.g. here:
http://www.fho-emden.de/~hoffmann/fft31052003.pdf

Best regards --Gernot Hoffmann

Gernot Hoffmann, Nov 16, 2004
4. ### Olli NiemitaloGuest

Like Tim (I didn't see his post, but only your reply) suggested, it is
better to work in the spatial domain than the frequency domain, so no 2D
FFT...

Gaussian filters are something you might want to consider. They are the
only class of filters whose spread function (a.k.a. impulse response /
kernel) is center-symmetric when the processing is done in cascade on row
and column data. Cheap infinite impulse response (IIR) designs exist. See
van Vliet et al. (1998) Recursive Gaussian Derivative Filters:

http://www.ph.tn.tudelft.nl/People/lucas/publications/1998/ICPR98LVTYPV/ICPR98LVTYPV.pdf

-olli

Olli Niemitalo, Nov 19, 2004