comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Convolution, IDL & Numerical Recipes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Convolution, IDL & Numerical Recipes [message #32676 is a reply to message #32675] Thu, 31 October 2002 14:29 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith (jdsmith@as.arizona.edu) writes:

> Because IDL's convol() really does a correlation, not a convolution at
> all! In a true convolution, the kernel is reversed (rotated by 180
> degrees). You could try z=convol(a,reverse(k)) to get a true
> convolution for comparison.

Oddly enough, I finally bought a copy of the acclaimed
Digital Image Processing, 2nd Ed., by Gonzalez and Woods,
and was reading it last night! On page 116 of this excellent
book in the section entitled Basics of Spatial Filtering it
has this:

"The mechanics of spacial filtering ... consists simply
of moving the filter mask from point to point in an image.
At each point (x,y), the response of the filter at that
point is calculated using a predefined relationship. For
linear spacial filtering, the response is given by a sum
of the products of the filter coefficients and the corresponding
image pixels in the area spanned by the filter mask."

A couple of paragraphs later, they say this:

"For this reason, linear spatial filtering often is referred to
as 'convolving a mask with an image.' Similarly, filter masks
are sometimes called *convolution masks*. The term 'convolution
kernel' also is in common use."

In this sense, IDL CONVOL seems to do exactly what it is
asked to do, I.e., convolve a kernel with an image. In any case,
IDL's CONVOL gave me what I expected it to give me after reading
this portion of the text.

Gonzales and Woods seem to suggest that "convolution" is a
frequency domain concept, and can only be loosely applied in
the linear spatial sense. Could this be part of the problem?

I'm curious about this because I have been trying to
duplicate some of the results in the book (they apparently
use MatLab) and I am having rather more trouble than
I had hoped to. :-(

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL --> C++ ?
Next Topic: About file length

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 03:00:56 PDT 2025

Total time taken to generate the page: 2.32029 seconds