Motion Help

vba Jamaica
  • 14 years ago

    could some one tell me what this returns

    Counter = Counter + 1

    If Counter = AveragePixelLoop Then Counter = 1

    mdSample(PixX, PixY, 0) = 0
    mdSample(PixX, PixY, Counter) = 0

    For Repeat = 0 To 5
    mdSample(PixX, PixY, 0) = mdSample(PixX, PixY, 0) + AveragePixel(Repeat)
    mdSample(PixX, PixY, Counter) = mdSample(PixX, PixY, 0) + AveragePixel(Repeat)

    AverageSum = 0

    For Repeat = 1 To AveragePixelLoop
    AverageSum = AverageSum + mdSample(PixX, PixY, Repeat)

    AverageSum = AverageSum / AveragePixelLoop

    declaration s are as follows

    Dim ColorSumStr As String 'sum of pixel color
    Dim ColorRedStr As String 'red
    Dim ColorGreenStr As String 'green
    Dim ColorBlueStr As String 'blue
    Dim ColorRedDec As Single 'red
    Dim ColorGreenDec As Single 'green
    Dim ColorBlueDec As Single 'blue
    Dim PixX As Single 'curent pixel X
    Dim PixY As Single 'curent pixel Y
    Dim AveragePixel(5) As Single 'Average color from 6 pixels
    Static Counter As Single 'counter
    Dim AverageSum As Single 'Average sum of all colors

    Dim BoxesX As Single 'how many 'detection boxes - x axis
    Dim BoxesY As Single 'how many 'detection boxes - y axis
    Dim AveragePixelLoop As Single 'defines how many frames does this sub compare

    BoxesX = 16 'from 1 to 50
    BoxesY = 16 'from 1 to 50
    AveragePixelLoop = 30 'from 1 to 250

    Dim Repeat As Single
    Dim Px As Single, Py As Single


Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“I invented the term Object-Oriented, and I can tell you I did not have C++ in mind.” - Alan Kay