1,105,232 Community Members

image processing

Member Avatar
maytham
Newbie Poster
9 posts since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
demon916
Newbie Poster
13 posts since Sep 2009
Reputation Points: 13 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
0
 

Not sure what your asking help on, but I believe, based on your code structure, that this may need to be posted in the VB.Net forum.
"Moderator...?"

Member Avatar
maytham
Newbie Poster
9 posts since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

thanks Moderator
am askin about gaussian filter do u have an idea about it ..i mean the code
how to make it

Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

This is C code. I have asked that it be moved to C...

Member Avatar
maytham
Newbie Poster
9 posts since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

ok just forget it sir ...
i need gaussian filter in vb code
do u have it ?

Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

Try this link. We are STILL not sure what you need. What do you want to do. Do you have current VB6... code? The code above looks like C code, if you are trying to use that in vb it will not work.

Member Avatar
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418 [?]
Q&As Helped to Solve: 152 [?]
Skill Endorsements: 16 [?]
 
2
 

Another give me code request from another I'm too lazy to search myself poster.

http://letmebingthatforyou.com/?q=gaussian%20filter%20vb6

hint it's on planetsource code

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: