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

Home » Public Forums » archive » Re: using convol with 2D image and 1D kernel
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: using convol with 2D image and 1D kernel [message #37199 is a reply to message #37198] Sat, 29 November 2003 11:17 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bruce writes:

> Hello, I was wondering what the convol(array,kernel) function does
> when it is given a 2D array and a 1D kernel ?
>
> I have run through "Example 2" for the digital_filter() function,
> in which the 2D array "mandril" is convolved with the 1D array
> "filter" (in Reference Volume 1):
>
> mandril = bytarr(512,512)
> ...
> mandril = float(mandril)
> filter = digital_filter(0.0,0.1,50,10)
> filt_image = convol(mandril,filter)
>
> I can see that the image is smoothed, but did convol()
> 1) take the 1D kernel of size 1x21 and run it over the image, where
> the result at each point is only influenced by points in the
> horizontal direction,
> OR
> 2) take the 1D kernel and transform it into some 2D kernel of
> dimension 21x21, and run that over the image, where the result is
> now influenced by points in both the horizontal and vertical
> directions ?

If you do a "Help, filter" after the DIGITAL_FILTER step,
you see that the filter is a 21-element 1D array. So
the convolution is performed as in 1 above.

You can also see this because there will be black
bands on the left and right edge of the image, since
the example did not use the EDGE_TRUNCATE keyword.
Had the filter been applied two-dimensionally, you
would have seen a band around the entire image.

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
Previous Topic: using convol with 2D image and 1D kernel
Next Topic: Re: geld nodig?

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

Current Time: Wed Oct 08 20:14:49 PDT 2025

Total time taken to generate the page: 0.04494 seconds