Accord.Vision.Motion.MotionDetector.ProcessFrame C# (CSharp) Method

ProcessFrame() public method

Process new video frame.

See ProcessFrame(UnmanagedImage) for additional details.

public ProcessFrame ( Bitmap videoFrame ) : float
videoFrame System.Drawing.Bitmap 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;
        }

Same methods

MotionDetector::ProcessFrame ( BitmapData videoFrame ) : float
MotionDetector::ProcessFrame ( UnmanagedImage videoFrame ) : float