Re: 2dFFT & image processing

• To: mathgroup at smc.vnet.net
• Subject: [mg101607] Re: [mg101500] 2dFFT & image processing
• From: Sseziwa Mukasa <mukasa at jeol.com>
• Date: Fri, 10 Jul 2009 23:24:33 -0400 (EDT)

```On Jul 10, 2009, at 8:32 AM, Alessandro Magni wrote:

> thank you everybody,
> I corrected my mistake - I didnt realize that the FFT output wasnt
> centered, and YES I looked at the FFT image, wandering how beautiful
> it was, and not understanding the rings at the 4 corners... how dumb
> can I be???

You're not dumb, the position of the zero frequency is a side effect
of the convention for writing the discrete Fourier sum, summing over
[-n/2,n/2] would put the zero frequency in the expected region.
Unless you work with Fourier transforms regularly and are aware of
the convention it's easy not to realize how the frequencies map to
the transformed data, although this is mentioned in the help
information on Fourier, which also lists information on other
conventions with respect to the transform.

> If I may add a further question -
> I always knew that as an alternative to this kind of filtering it also
> exists the possibility to do a convolution with a high-pass kernel.
> Everywhere in literature and on the net you find exemples for this
> kind of kernel, say something proportional to
> ((0,-1,0)(-1,5,-1)(0,-1,0))
> but...
>
> 1) how can I create a high pass kernel that corresponds to a filter
> below a given cutoff frequency fc? Which numbers go into the matrix if
> I only know fc?

You need to study digital filtering, I don't know any succinct way of
answering your question, but if you look up windowed filters (many of
which have closed form expressions) and how to transform low pass
filters to high pass filters you can put together a filter which lets
you control the cutoff frequency.

> 2) the 3x3 size is related to the cutoff frequency?
> Under which rules
> I can define larger kernels?

The size of the kernel is related to the impulse response of the
filter, in this case the impulse response is assumed to last for only
3 sample in each direction.

>
> I really looked everywhere for a couple of days but couldnt find an
> answer to those questions, so if you can spare more time with my
> problems, I'll thank you a lot!!!

Without a better description of what you are trying to achieve it's
have to know how much distortion in magnitude you're willing to
tolerate, how much suppression you need in the stopband etc.  That
said there are plenty of image processing packages that let you
manipulate images without worrying about such details, are you sure
you really need to know these details?  For example the Sharpen
function in Mathematica (I assume your using version 7) applies a
high pass filter, the r parameter essentially controls the size of
the kernel but the actual filter used is unspecified.  You can
experiment with your own filter kernels using the ImageConvolve
function, but as I said earlier to understand how a kernel is defined
requires knowledge of digital filtering.

Best Regards,

Sseziwa Mukasa

```

• Prev by Date: Re: Calculate n in binomial distribution
• Next by Date: Re: 2dFFT & image processing
• Previous by thread: Re: 2dFFT & image processing
• Next by thread: Re: 2dFFT & image processing