public ProcessFrame ( |
||
videoFrame | Video frame to process (detect motion in). | |
return | float |
public float ProcessFrame( Bitmap videoFrame )
{
float motionLevel = 0;
BitmapData videoData = videoFrame.LockBits(
new Rectangle( 0, 0, videoFrame.Width, videoFrame.Height ),
ImageLockMode.ReadWrite, videoFrame.PixelFormat );
try
{
motionLevel = ProcessFrame( new UnmanagedImage( videoData ) );
}
finally
{
videoFrame.UnlockBits( videoData );
}
return motionLevel;
}
MotionDetector::ProcessFrame ( |
|
MotionDetector::ProcessFrame ( |
private void frame(object s, NewFrameEventArgs e) { Bitmap img = (Bitmap)e.Frame.Clone(); Confidence = detector.ProcessFrame(img); pictureBox1.Image = img; }