Motion processing algorithm, which counts separate moving objects and highlights them.
Namespace:
AForge.Vision.MotionAssembly: AForge.Vision (in AForge.Vision.dll) Version: 2.2.4.0 (2.2.4.0)
Syntax
| C# |
|---|
public class BlobCountingObjectsProcessing : IMotionProcessing |
Remarks
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 trueTruetruetrue (True in Visual Basic), 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.
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 ) { // ... } } }