Click or drag to resize
CvInvokeCalcOpticalFlowPyrLK Method (IInputArray, IInputArray, PointF, Size, Int32, MCvTermCriteria, PointF, Byte, Single, LKFlowFlag, Double)
Calculates optical flow for a sparse feature set using iterative Lucas-Kanade method in pyramids

Namespace: Emgu.CV
Assembly: Emgu.CV.World (in Emgu.CV.World.dll) Version: (
public static void CalcOpticalFlowPyrLK(
	IInputArray prev,
	IInputArray curr,
	PointF[] prevFeatures,
	Size winSize,
	int level,
	MCvTermCriteria criteria,
	out PointF[] currFeatures,
	out byte[] status,
	out float[] trackError,
	LKFlowFlag flags = LKFlowFlag.Default,
	double minEigThreshold = 0.0001


Type: Emgu.CVIInputArray
First frame, at time t
Type: Emgu.CVIInputArray
Second frame, at time t + dt
Type: System.DrawingPointF
Array of points for which the flow needs to be found
Type: System.DrawingSize
Size of the search window of each pyramid level
Type: SystemInt32
Maximal pyramid level number. If 0 , pyramids are not used (single level), if 1 , two levels are used, etc
Type: Emgu.CV.StructureMCvTermCriteria
Specifies when the iteration process of finding the flow for each point on each pyramid level should be stopped
Type: System.DrawingPointF
Array of 2D points containing calculated new positions of input features in the second image
Type: SystemByte
Array. Every element of the array is set to 1 if the flow for the corresponding feature has been found, 0 otherwise
Type: SystemSingle
Array of double numbers containing difference between patches around the original and moved points
flags (Optional)
Type: Emgu.CV.CvEnumLKFlowFlag
minEigThreshold (Optional)
Type: SystemDouble
the algorithm calculates the minimum eigen value of a 2x2 normal matrix of optical flow equations (this matrix is called a spatial gradient matrix in [Bouguet00]), divided by number of pixels in a window; if this value is less than minEigThreshold, then a corresponding feature is filtered out and its flow is not processed, so it allows to remove bad points and get a performance boost.
See Also