C# 클래스 AForge.Vision.Motion.TwoFramesDifferenceDetector

Motion detector based on two continues frames difference.

The class implements the simplest motion detection algorithm, which is based on difference of two continues frames. The difference frame is thresholded and the amount of difference pixels is calculated. To suppress stand-alone noisy pixels erosion morphological operator may be applied, which is controlled by SuppressNoise property.

Although the class may be used on its own to perform motion detection, it is preferred to use it in conjunction with MotionDetector class, which provides additional features and allows to use moton post processing algorithms.

Sample usage:

// create motion detector MotionDetector detector = new MotionDetector( new TwoFramesDifferenceDetector( ), new MotionAreaHighlighting( ) ); // continuously feed video frames to motion detector while ( ... ) { // process new video frame and check motion level if ( detector.ProcessFrame( videoFrame ) > 0.02 ) { // ring alarm or do somethng else } }
상속: IMotionDetector
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
ProcessFrame ( UnmanagedImage videoFrame ) : void

Process new video frame.

Processes new frame from video source and detects motion in it.

Check MotionLevel property to get information about amount of motion (changes) in the processed frame.

Reset ( ) : void

Reset motion detector to initial state.

Resets internal state and variables of motion detection algorithm. Usually this is required to be done before processing new video source, but may be also done at any time to restart motion detection algorithm.

TwoFramesDifferenceDetector ( ) : System

Initializes a new instance of the TwoFramesDifferenceDetector class.

TwoFramesDifferenceDetector ( bool suppressNoise ) : System

Initializes a new instance of the TwoFramesDifferenceDetector class.

메소드 상세

ProcessFrame() 공개 메소드

Process new video frame.

Processes new frame from video source and detects motion in it.

Check MotionLevel property to get information about amount of motion (changes) in the processed frame.

public ProcessFrame ( UnmanagedImage videoFrame ) : void
videoFrame AForge.Imaging.UnmanagedImage Video frame to process (detect motion in).
리턴 void

Reset() 공개 메소드

Reset motion detector to initial state.

Resets internal state and variables of motion detection algorithm. Usually this is required to be done before processing new video source, but may be also done at any time to restart motion detection algorithm.

public Reset ( ) : void
리턴 void

TwoFramesDifferenceDetector() 공개 메소드

Initializes a new instance of the TwoFramesDifferenceDetector class.
public TwoFramesDifferenceDetector ( ) : System
리턴 System

TwoFramesDifferenceDetector() 공개 메소드

Initializes a new instance of the TwoFramesDifferenceDetector class.
public TwoFramesDifferenceDetector ( bool suppressNoise ) : System
suppressNoise bool Suppress noise in video frames or not (see property).
리턴 System