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

Motion processing algorithm, which counts separate moving objects and highlights them.

The aim of this motion processing algorithm is to count separate objects in the motion frame, which is provided by motion detection algorithm. In the case if HighlightMotionRegions property is set to , found objects are also highlighted on the original video frame. The algorithm counts and highlights only those objects, which size satisfies MinObjectsWidth and MinObjectsHeight properties.

The motion processing algorithm is supposed to be used only with motion detection algorithms, which are based on finding difference with background frame (see SimpleBackgroundModelingDetector and CustomFrameDifferenceDetector as simple implementations) and allow extract moving objects clearly.

Sample usage:

// create instance of motion detection algorithm IMotionDetector motionDetector = new ... ; // create instance of motion processing algorithm BlobCountingObjectsProcessing motionProcessing = new BlobCountingObjectsProcessing( ); // create motion detector MotionDetector detector = new MotionDetector( motionDetector, motionProcessing ); // continuously feed video frames to motion detector while ( ... ) { // process new video frame and check motion level if ( detector.ProcessFrame( videoFrame ) > 0.02 ) { // check number of detected objects if ( motionProcessing.ObjectsCount > 1 ) { // ... } } }
상속: IMotionProcessing
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
BlobCountingObjectsProcessing ( ) : System

Initializes a new instance of the BlobCountingObjectsProcessing class.

BlobCountingObjectsProcessing ( bool highlightMotionRegions ) : System

Initializes a new instance of the BlobCountingObjectsProcessing class.

BlobCountingObjectsProcessing ( int minWidth, int minHeight ) : System

Initializes a new instance of the BlobCountingObjectsProcessing class.

BlobCountingObjectsProcessing ( int minWidth, int minHeight, Color highlightColor ) : System

Initializes a new instance of the BlobCountingObjectsProcessing class.

BlobCountingObjectsProcessing ( int minWidth, int minHeight, bool highlightMotionRegions ) : System

Initializes a new instance of the BlobCountingObjectsProcessing class.

ProcessFrame ( UnmanagedImage videoFrame, UnmanagedImage motionFrame ) : void

Process video and motion frames doing further post processing after performed motion detection.

Processes provided motion frame and counts number of separate objects, which size satisfies MinObjectsWidth and MinObjectsHeight properties. In the case if HighlightMotionRegions property is set to , the found object are also highlighted on the original video frame.

Reset ( ) : void

Reset internal state of motion processing algorithm.

The method allows to reset internal state of motion processing algorithm and prepare it for processing of next video stream or to restart the algorithm.

메소드 상세

BlobCountingObjectsProcessing() 공개 메소드

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

BlobCountingObjectsProcessing() 공개 메소드

Initializes a new instance of the BlobCountingObjectsProcessing class.
public BlobCountingObjectsProcessing ( bool highlightMotionRegions ) : System
highlightMotionRegions bool Highlight motion regions or not (see property).
리턴 System

BlobCountingObjectsProcessing() 공개 메소드

Initializes a new instance of the BlobCountingObjectsProcessing class.
public BlobCountingObjectsProcessing ( int minWidth, int minHeight ) : System
minWidth int Minimum width of acceptable object (see property).
minHeight int Minimum height of acceptable object (see property).
리턴 System

BlobCountingObjectsProcessing() 공개 메소드

Initializes a new instance of the BlobCountingObjectsProcessing class.
public BlobCountingObjectsProcessing ( int minWidth, int minHeight, Color highlightColor ) : System
minWidth int Minimum width of acceptable object (see property).
minHeight int Minimum height of acceptable object (see property).
highlightColor Color Color used to highlight motion regions.
리턴 System

BlobCountingObjectsProcessing() 공개 메소드

Initializes a new instance of the BlobCountingObjectsProcessing class.
public BlobCountingObjectsProcessing ( int minWidth, int minHeight, bool highlightMotionRegions ) : System
minWidth int Minimum width of acceptable object (see property).
minHeight int Minimum height of acceptable object (see property).
highlightMotionRegions bool Highlight motion regions or not (see property).
리턴 System

ProcessFrame() 공개 메소드

Process video and motion frames doing further post processing after performed motion detection.

Processes provided motion frame and counts number of separate objects, which size satisfies MinObjectsWidth and MinObjectsHeight properties. In the case if HighlightMotionRegions property is set to , the found object are also highlighted on the original video frame.

Motion frame is not 8 bpp image, but it must be so. Video frame must be 8 bpp grayscale image or 24/32 bpp color image.
public ProcessFrame ( UnmanagedImage videoFrame, UnmanagedImage motionFrame ) : void
videoFrame AForge.Imaging.UnmanagedImage Original video frame.
motionFrame AForge.Imaging.UnmanagedImage Motion frame provided by motion detection /// algorithm (see ).
리턴 void

Reset() 공개 메소드

Reset internal state of motion processing algorithm.

The method allows to reset internal state of motion processing algorithm and prepare it for processing of next video stream or to restart the algorithm.

public Reset ( ) : void
리턴 void