Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Private Sub Form_Load()

Picture1.Width = 320 * Screen.TwipsPerPixelX
Picture1.Height = 240 * Screen.TwipsPerPixelY
Picture2.Width = 320 * Screen.TwipsPerPixelX
Picture2.Height = 240 * Screen.TwipsPerPixelY

Picture1.Picture = LoadPicture("nosignal.bmp")
Picture2.Picture = LoadPicture("nosignal.bmp")
End Sub

Private Function Different(ByVal a As Long, ByVal b As Long) As Boolean
'Checks different of two colors
ar = a Mod 256: a = a \ 256
ag = a Mod 256: a = a \ 256
ab = a Mod 256: a = a \ 256

br = b Mod 256: b = b \ 256
bg = b Mod 256: b = b \ 256
bb = b Mod 256: b = b \ 256
sense = 255 - Slider1.Value * 5

Different = (Sqr((ar - br) * (ar - br) + (ag - bg) * (ag - bg) + (ab - bb) * (ab - bb)) > sense) 'formula for counting different
End Function

That's coding really work for motion detection, but for my final project must have identification on "SWITCH LAMP"..
Does anybody have code for read "hand motion detection" actually on VB6?

For example simulation, I would like to switch on my lamp with WEBCAM and detected my hand then calculation the parameter of hand's, finally lamp can ON.

Sorry if I wrote in bad English.
Thanks so much.

Gani Hartato (Postgraduate Student)
Surabaya Shipbuilding State of Polytechnic.
East Java - Indonesia.
Posted
Updated 21-Dec-13 22:31pm
v2
Comments
Richard MacCutchan 22-Dec-13 10:13am    
Try Google for "motion detection".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900