http://www.emgu.com
Finds all the motion segments and marks them in segMask with individual values each (1,2,...). It also returns a sequence of CvConnectedComp structures, one per each motion components. After than the motion direction for every component can be calculated with cvCalcGlobalOrientation using extracted mask of the particular component (using cvCmp)

Namespace: Emgu.CV
Assembly: Emgu.CV (in Emgu.CV.dll) Version: 2.4.0.1717 (2.4.0.1717)

Syntax

C#
public static IntPtr cvSegmentMotion(
	IntPtr mhi,
	IntPtr segMask,
	IntPtr storage,
	double timestamp,
	double segThresh
)
Visual Basic
Public Shared Function cvSegmentMotion ( _
	mhi As IntPtr, _
	segMask As IntPtr, _
	storage As IntPtr, _
	timestamp As Double, _
	segThresh As Double _
) As IntPtr
Visual C++
public:
static IntPtr cvSegmentMotion(
	IntPtr mhi, 
	IntPtr segMask, 
	IntPtr storage, 
	double timestamp, 
	double segThresh
)

Parameters

mhi
Type: System..::..IntPtr
Motion history image
segMask
Type: System..::..IntPtr
Image where the mask found should be stored, single-channel, 32-bit floating-point
storage
Type: System..::..IntPtr
Memory storage that will contain a sequence of motion connected components
timestamp
Type: System..::..Double
Current time in milliseconds or other units
segThresh
Type: System..::..Double
Segmentation threshold; recommended to be equal to the interval between motion history "steps" or greater

Return Value

Pointer to the sequence of MCvConnectedComp

See Also