## Motion Detection with VB

### Motion Detection with VB

Am currently working on a school project, trying to develop a motion
detector from software using commercially available *s, and after

Am really looking for information on how to compare clips from an avi steam
taken from a Logitech camera, in order to develop a basic software motion
detector.

Any help will appreciate

Thank You

San Juan, Puerto Rico

### Motion Detection with VB

Am currently working on a school project, trying to develop a motion
detector from software using commercially available *s, and after

Am really looking for information on how to compare clips from an avi steam
taken from a Logitech camera, in order to develop a basic software motion
detector.

Any help will appreciate

Thank You

San Juan, Puerto Rico

### Motion Detection with VB

Hi Angel,

I use a very simple mechanism:
- Load the picture from the video capture buffer into a bitmap structure
(this is the reference image)
- Wait a couple of frames - depending on how sensitive the motion detection
needs to be. At a framerate of 10 fps, wait 5 frames to check every half
second.
- Load frame into another bmp structure.
- Check the pixels one by one comparing the pixel on frame 1 to the pixel on
frame 2. For less sensitive application, and to go faster, check every tenth
of 50th pixel. This is fine to detect a person moving across the screen for
instance.
- To check the pixels, do a pixelref = (red value + green value + blue
value)/3    pixelcheck = (red value + green value + blue value)/3.
Difference = abs(pixelref-pixelcheck).
- Compare the Difference to some variable you set (I call it
SignificantDifference) indicating that the two pixels are quite different in
colour.
- Count the number of pixels with significant differences until some
threshold is reached - which then tells you there's motion - and you can
exit the loop immediately.
- If you reach the end of the loop, with no significant count, then you know
the two images are very much the same.

I get good results with the following parameters with 388 x 244 video to
detect a person walking past the camera:
- Check every 100th pixel (94672 pixels in total -so I check 1% of pixels)
- The pixels are significantly different if the (r+g+b)/3 > 50.
- If I get more than 10% such pixels, I know there's motion.

You can play with the sensitivity by changing the above parameters.

You can find a lot of info re video at http://www.veryComputer.com/

Rudie

>Am currently working on a school project, trying to develop a motion
>detector from software using commercially available *s, and after

>Am really looking for information on how to compare clips from an avi steam
>taken from a Logitech camera, in order to develop a basic software motion
>detector.

>Any help will appreciate

>Thank You

>San Juan, Puerto Rico

hi,
in the following script below, i am not able to understand what
javascript does and what vb script does.
is javascript checking netscape plugin and vb script checking
explorer??
what does navigatot mean in javascript? is it any browser that is
called navigator or only netscape is called navigator?
ps let me know.
- himanshu
ps . alo any experiences with this kind of sniffer scripts? are
they succesful? any other alternatives??
---------
<HTML>

<BODY>

<SCRIPT LANGUAGE="JavaScript">
<!--
var useFlash = navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"] &&
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;

//-->

</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
On error resume next
useFlash = NOT
IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))
-->

</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
if ( useFlash ) {
window.location = "index.html";
} else {
window.location = "indexnonflash.html";
}
//-->
</SCRIPT>

</BODY>
</HTML>

--
Posted via CNET Help.com
http://www.help.com/