AForge.Vision.Motion.CustomFrameDifferenceDetector.SetBackgroundFrame C# (CSharp) Method

SetBackgroundFrame() public method

Set background frame.

The method sets background frame, which will be used to calculate difference with.

public SetBackgroundFrame ( Bitmap backgroundFrame ) : void
backgroundFrame System.Drawing.Bitmap Background frame to set.
return void
        public void SetBackgroundFrame( Bitmap backgroundFrame )
        {
            BitmapData data = backgroundFrame.LockBits(
                new Rectangle( 0, 0, backgroundFrame.Width, backgroundFrame.Height ),
                ImageLockMode.ReadOnly, backgroundFrame.PixelFormat );

            try
            {
                SetBackgroundFrame( data );
            }
            finally
            {
                backgroundFrame.UnlockBits( data );
            }
        }

Same methods

CustomFrameDifferenceDetector::SetBackgroundFrame ( BitmapData backgroundFrame ) : void
CustomFrameDifferenceDetector::SetBackgroundFrame ( UnmanagedImage backgroundFrame ) : void