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

Home » Public Forums » archive » Re: Gaussian Convolution
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: Gaussian Convolution [message #3190] Fri, 18 November 1994 14:08
velt is currently offline  velt
Messages: 19
Registered: June 1994
Junior Member
In reply to: Thomas Edgar Nichols <tn0o+@andrew.cmu.edu>
Date: Mon, 14 Nov 1994 00:24:11 -0500
>
> I have checked the FAQ and poked around the suggested FTP sites and have
> not come up with a
> Gaussian Blur function (in 3D)
> along the lines of smooth() which uses a uniform kernal instead of a
> Gaussian one.
>

I wrote a Gaussian smoothing a while ago for a image processing class.
It's two-D, but can easily be extende to 3D. It is a very small piece
of code, and is not exactly fast, but it does the job.

Robert Velthuizen, velt@rad.usf.edu
Digital Medical Imaging Program of the
H. Lee Moffitt Cancer Center and Research Institute at the
University of South Florida.

============================================================ =====

;+
; Name: gsmooth
; Purpose: smooth an image with a gaussian template
; Calling-seq: result=gsmooth(image,sigma)
; Inputs: image: a 2d array
; sigma: standard deviation of the smoothing function
; Author: Robert Velthuizen 020492
;-
Function gsmooth, image, sigma
if sigma lt 0.25 then return,image
TemplateWidth=fix(2*sigma +0.5)
Template=exp(-0.5*(indgen(TemplateWidth + 1)/sigma)^2)
Template=Template/(template(0)+2*total(template(1,*)))

Temp=Template(0)*image
for i=1,TemplateWidth do $
Temp=Temp + Template(i)*(1.0 * shift(image,i,0) + shift(image,-i,0))

Temp2=Template(0)*Temp
for i=1,TemplateWidth do $
Temp2=Temp2 + Template(i)*(1.0 * shift(Temp,0,i) + shift(Temp,0,-i))

return,Temp2
end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: how to wrap text in WIDGET_TEXT()
Next Topic: Can you do 'unions' with pv-wave?

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

Current Time: Fri Oct 10 18:16:15 PDT 2025

Total time taken to generate the page: 1.28436 seconds