I want to detects the motion level per motion zones. I have 7 motion zones and i need to detects the motion lever for each of them.
This is the example code of the sample liberary that i'm using:
private void defineMotionregionsToolStripMenuItem_Click( object sender, EventArgs e )
{
if ( videoSourcePlayer.VideoSource != null )
{
Bitmap currentVideoFrame = videoSourcePlayer.GetCurrentVideoFrame( );
if ( currentVideoFrame != null )
{
MotionRegionsForm form = new MotionRegionsForm( );
form.VideoFrame = currentVideoFrame;
form.MotionRectangles = detector.MotionZones;
// show the dialog
if ( form.ShowDialog( this ) == DialogResult.OK )
{
Rectangle[] rects = form.MotionRectangles;
if ( rects.Length == 0 )
rects = null;
detector.MotionZones = rects;
}
return;
}
}