We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,987 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

image processing

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

4
Contributors
6
Replies
3 Days
Discussion Span
3 Months Ago
Last Updated
11
Views
maytham
Newbie Poster
9 posts since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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...?"

demon916
Newbie Poster
13 posts since Sep 2009
Reputation Points: 23
Solved Threads: 2
Skill Endorsements: 0

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

maytham
Newbie Poster
9 posts since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

AndreRet
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20

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

maytham
Newbie Poster
9 posts since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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.

AndreRet
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20

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

TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.3071 seconds using 2.68MB