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

Namespace:  AForge.Vision.Motion
Assembly:  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.

Note: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:

CopyC#
// 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 )
        {
            // ...
        }
    }
}

Inheritance Hierarchy

System..::.Object
  AForge.Vision.Motion..::.BlobCountingObjectsProcessing

See Also