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

Home » Public Forums » archive » gauss_smooth with integers
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
gauss_smooth with integers [message #88878] Tue, 01 July 2014 01:10 Go to next message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
The GAUSS_SMOOTH (introduced 8.1) documentation appears to suggest it should work on integer arrays, but I can't get anything useful without converting to float. I can do this but, since I'm constrained by memory usage, I'd be glad to know if there is a way (although maybe it has to be converted to float internally anyway?)

a=intarr(800,800)
a[*,400]=1000
a[400,*]=1000
tvscl,a
tvscl,gauss_smooth(a,20,kernel=k)
tvscl,k

...there's no smoothing because the kernel is zeros with a single 1 at the centre.

cheers,
Greg
Re: gauss_smooth with integers [message #88881 is a reply to message #88878] Tue, 01 July 2014 03:04 Go to previous messageGo to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi,

if you check the code from gauss_smooth you can see where the problem
occurs. Gauss_smooth generates internally a normalized kernel and then
fixes it to integer.

Based on this code you can do your own cuisine using convol:

a=intarr(800,800)
a[*,400]=1000 & a[400,*]=1000

; this call is necessary to compile "create_gaussian"
tvscl, gauss_smooth(a, 20)

; parameters are arbitrary, be careful
k = FIX(create_gaussian(20, 100, 2) * 100)
tvscl, convol(a, k, total(k))

Cheers,

Fabien
Re: gauss_smooth with integers [message #88883 is a reply to message #88881] Tue, 01 July 2014 04:18 Go to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
that works - thanks very much
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: trying to pass parameter
Next Topic: CPU usage

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

Current Time: Wed Oct 08 15:08:06 PDT 2025

Total time taken to generate the page: 0.00390 seconds