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

Home » Public Forums » archive » Re: CONVOL : no subscripting with POLYFILLV?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: CONVOL : no subscripting with POLYFILLV? [message #14106] Fri, 22 January 1999 00:00
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
Tom Wassenaar wrote:

> I'd like to use polygon vertices directly to determine the image subset
> to convolve, but is it right that CONVOL only operates on simple square
> subscripts ?

It operates on square ARRAYS.

> a simple example :
> ENVI> a = findgen(10, 20)
> ENVI> kernel = fltarr(3, 3) + 1
> ENVI> b = convol(a[2:8, 4:15], kernel, total(kernel))
> ; this works fine !
> ENVI> x = POLYFILLV([2,2,8,8], [4,15,15,4], 10, 20)
> ENVI> b = convol(a[x], kernel, total(kernel))
> % CONVOL: Kernel's dimensions are incompatible with operand's.
>
> WHY ?

Because a[2:8,4:15] is a 2d array, where a[x] gives you a 1d
array/vector.

What exactly do you expect CONVOL to do with the pixels at the border of
the polygon?

You can do it like that:

c = a * 0.0
c[x] = a[x]
b = convol( c, kernel, total( kernel ) )

This gives low values for the pixels near the edges, and even for pixels
outside the polygon. The latter can be correted by

d = a * 0.0
d[x] = 1.0 ; create a mask
b = b * d

Still, the pixels near the border are under-evaluated, so another
correction helps:

e = convol( d, kernel, total( kernel ) )
f = d
f[x] = b[x] / e[x]


More information on this topic can be found in this paper from Joe
Maisog:
An efficient method for correcting the edge artifact due to smoothing,
Human Brain Mapping, 6:128-136 (1998; co-author J. Chmielowska).


Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Processing Audio
Next Topic: Re: 8-bit vs. 24-bit color on Windows

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

Current Time: Wed Oct 08 15:12:54 PDT 2025

Total time taken to generate the page: 0.00574 seconds