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

Home » Public Forums » archive » Re: Kuwahara Filter
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: Kuwahara Filter [message #29419 is a reply to message #29412] Thu, 14 February 2002 15:15 Go to previous message
Joshua Nipper is currently offline  Joshua Nipper
Messages: 8
Registered: February 2002
Junior Member
That was an old version of the code, this is what I'm currently using....
Josh


function kuwahara,input,kernelsize
T=systime(1)
s=size(input,/dimensions)
temp=bytarr(s)
identity=intarr(kernelsize)+1
M=indgen(kernelsize)-(kernelsize/2)
mX=M#identity
my=-identity#M
for i=0,s[0]-1 do begin
for j=0,s[1]-1 do begin
xpoint=j
ypoint=i
region1=input[(xpoint-1)+mX,(ypoint+1)+mY]
region2=input[(xpoint+1)+mX,(ypoint+1)+mY]
region3=input[(xpoint-1)+mX,(ypoint-1)+mY]
region4=input[(xpoint+1)+mX,(ypoint-1)+mY]

var=[variance(region1),variance(region2),variance(region3),v ariance(region4)
]
avg=fix([mean(region1),mean(region2),mean(region3),mean(regi on4)])
location=where(var EQ min(var))
temp[xpoint,ypoint]=avg[location[0]]
endfor
endfor
PRINT, SYSTIME(1) - T, 'Seconds'
return,temp

end
[Message index]
 
Read Message
Read Message
Previous Topic: solution of linear equations
Next Topic: Re: 5.5 bug or a local problem?

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

Current Time: Fri Oct 10 14:00:42 PDT 2025

Total time taken to generate the page: 0.08099 seconds