AForge.Vision.Motion.MotionDetector.Reset C# (CSharp) Méthode

Reset() public méthode

Reset motion detector to initial state.

The method resets motion detection and motion processing algotithms by calling their IMotionDetector.Reset and IMotionProcessing.Reset methods.

public Reset ( ) : void
Résultat void
        public void Reset( )
        {
            lock ( sync )
            {
                if ( detector != null )
                {
                    detector.Reset( );
                }
                if ( processor != null )
                {
                    processor.Reset( );
                }

                videoWidth  = 0;
                videoHeight = 0;

                if ( zonesFrame != null )
                {
                    zonesFrame.Dispose( );
                    zonesFrame = null;
                }
            }
        }

Usage Example

Exemple #1
0
        private void CloseVideoSource()
        {
            // set busy cursor
            this.Cursor = Cursors.WaitCursor;

            // stop current video source
            videoSourcePlayer1.SignalToStop();

            // wait 2 seconds until camera stops
            for (int i = 0; (i < 50) && (videoSourcePlayer1.IsRunning); i++)
            {
                Thread.Sleep(100);
            }
            if (videoSourcePlayer1.IsRunning)
            {
                videoSourcePlayer1.Stop();
            }

            // stop timers
            timer.Stop();
            alarmTimer.Stop();

            motionHistory.Clear();

            // reset motion detector
            if (detector != null)
            {
                detector.Reset();
            }

            videoSourcePlayer1.BorderColor = Color.Black;
            this.Cursor = Cursors.Default;
        }
All Usage Examples Of AForge.Vision.Motion.MotionDetector::Reset