hi guys ..
i have problem in this code . it dose not work
am trying to make gaussian filter in spatial domain.
is this possible ???????
pls, any help
#Const gauss_width = True
sumr=0
sumg=0
sumb=0
Dim gauss_fact() As Integer = {1,6,15,20,15,6,1}
Dim gauss_sum As Integer = 64
For i = 1 To temp.w-2
For j = 1 To temp.h-2
sumr=0
sumg=0
sumb=0
For k = 0 To DefineConstants.gauss_width - 1
color=getpixel(temp,i-((DefineConstants.gauss_width-1)>>1)+k,j)
r=getr32(color)
g=getg32(color)
b=getb32(color)
sumr+=r *gauss_fact(k)
sumg+=g *gauss_fact(k)
sumb+=b *gauss_fact(k)
Next k
putpixel(temp1,i,j,makecol(sumr/gauss_sum,sumg/gauss_sum, sumb/gauss_sum))
Next j
Next i
For i = 1 To temp.w-2
For j = 1 To temp.h-2
sumr=0
sumg=0
sumb=0
For k = 0 To DefineConstants.gauss_width - 1
color=getpixel(temp1,i,j-((DefineConstants.gauss_width-1)>>1)+k)
r=getr32(color)
g=getg32(color)
b=getb32(color)
umr+=r *gauss_fact(k)
sumg+=g *gauss_fact(k)
sumb+=b *gauss_fact(k)
Next k
sumr/=gauss_sum
sumg/=gauss_sum
sumb/=gauss_sum
putpixel(temp2,i,j,makecol(sumr,sumg,sumb))
Next j
Next i
Partial Friend NotInheritable Class DefineConstants
Public Const gauss_width As Integer = 7
End Class
Next j
Next i