http://www.emgu.com
Calculates the general motion direction in the selected region and returns the angle between 0 and 360. At first the function builds the orientation histogram and finds the basic orientation as a coordinate of the histogram maximum. After that the function calculates the shift relative to the basic orientation as a weighted sum of all orientation vectors: the more recent is the motion, the greater is the weight. The resultant angle is a circular sum of the basic orientation and the shift.

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

Syntax

C#
public static double cvCalcGlobalOrientation(
	IntPtr orientation,
	IntPtr mask,
	IntPtr mhi,
	double timestamp,
	double duration
)
Visual Basic
Public Shared Function cvCalcGlobalOrientation ( _
	orientation As IntPtr, _
	mask As IntPtr, _
	mhi As IntPtr, _
	timestamp As Double, _
	duration As Double _
) As Double
Visual C++
public:
static double cvCalcGlobalOrientation(
	IntPtr orientation, 
	IntPtr mask, 
	IntPtr mhi, 
	double timestamp, 
	double duration
)

Parameters

orientation
Type: System..::..IntPtr
Motion gradient orientation image; calculated by the function cvCalcMotionGradient.
mask
Type: System..::..IntPtr
Mask image. It may be a conjunction of valid gradient mask, obtained with cvCalcMotionGradient and mask of the region, whose direction needs to be calculated.
mhi
Type: System..::..IntPtr
Motion history image.
timestamp
Type: System..::..Double
Current time in milliseconds or other units, it is better to store time passed to cvUpdateMotionHistory before and reuse it here, because running cvUpdateMotionHistory and cvCalcMotionGradient on large images may take some time.
duration
Type: System..::..Double
Maximal duration of motion track in milliseconds, the same as in cvUpdateMotionHistory

Return Value

The angle

See Also