|
-
Jul 26th, 2000, 12:53 PM
#1
Thread Starter
Hyperactive Member
Is this possible??....
Ok, I have an had an idear. What I want to do is buy a web cam, now here is the kicker, do some web cams come with motion activatiation? (i.e.) When the camera senses motion it starts recording, when it stops senses motion it stops recording. Does anyone know if they do that?
If not, is it possible to write a vb program to do so, I guess the prog could take a picture every second and compare with the one before, if it is different then have the cam start recording, and record for a specified amount of time and/or the pictures start being the same. Anyone think this is feasible to do?
-
Jul 26th, 2000, 01:10 PM
#2
Fanatic Member
I'm not sure about 'activation' webcams, but I would guess they do exist somewhere.
But on the programming side, it is (I think) possible:
This is a sample of v slow (and untested) code:
Code:
'Picture1.Picture is the picture with the Cam image:
'ScaleMode = 3 - Pixels
Private Const SIMIL = 0.9 'Required Maximum difference to start recording (account for quality of webcam)
Private PicPix(1000, 1000) As Long
Private Sub Form_Load()
Dim i as Integer, j as Integer
For i = 0 to Picture1.ScaleHeight
For j = 0 to Picture1.ScaleWidth
PicPix(i, j) = GetPixel(i, j)
Next:
Next:
End Sub
Private Sub Timer1_Timer()
Static Counter As Long
Dim i as Integer, j as Integer
If Counter Mod 2 <> 0 Then 'Compare
For i = 0 to Picture1.ScaleHeight
For j = 0 to Picture1.ScaleWidth
If GetPixel(i, j) = PicPix(i, j) then 'it could be j, i (I don't remember)
SameCount = SameCount + 1
End If
Next:
Next:
If (Picture1.ScaleHeight * Picture1.ScaleWidth * SIMIL) > SameCount Then
StartRecording 'I don't know how this would be done
End If
Else: 'Take Picture
Dim i as Integer, j as Integer
For i = 0 to Picture1.ScaleHeight
For j = 0 to Picture1.ScaleWidth
PicPix(i, j) = GetPixel(i, j)
Next:
Next:
End Sub
Dunno how
a) you'd get the handle of the webcam picture or
b) how you'd start recording
But there will be long and treacherous paths to achieving your means.
Yeah, whatever.
PS: Code is probably full of bugs, I've just written it off the top of my head. Not literally, obviously.
-
Jul 26th, 2000, 01:12 PM
#3
Fanatic Member
Oh yeah, remember to put Counter = Counter + 1 if ytou were to be so crazy as to use
my code. 
(and declare GetPixel, but you'll know that already)
-
Jul 26th, 2000, 01:14 PM
#4
Thread Starter
Hyperactive Member
Yeah the code, with the web cam will definately be a bummer. I wonder if some cams come with dll's or controls. That would be quiet nice. And would make this not to bad.
-
Jul 26th, 2000, 02:18 PM
#5
this, to me, sounds like you would have to query some (if not all) of the pixels in the webcam's current image, taking into accounts some 'leeway' to account for daylight variations (shining through a window). this would take up most of a computer's CPU time. Perhaps you would be better off getting an Infra-red security sensor, and incorporating that into the assembly somewhere to trigger your events when somebody moves something.
nightmare project! 
-
Jul 26th, 2000, 02:32 PM
#6
Thread Starter
Hyperactive Member
i think if ya had two still pict's, and with some percentage of error, you just could just compare the two files.
daylight wouldnt matter not by a window. ugg but still would be a processor hound.
-
Jul 27th, 2000, 07:49 AM
#7
Thread Starter
Hyperactive Member
anyone else know about this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|