Emgu CV Library Documentation
cvCalcOpticalFlowPyrLK Method (prev, curr, prev_pyr, curr_pyr, prev_features, curr_features, count, win_size, level, status, track_error, criteria, flags)
NamespacesEmgu.CVCvInvokecvCalcOpticalFlowPyrLK(IntPtr, IntPtr, IntPtr, IntPtr, array<MCvPoint2D32f>[]()[], array<MCvPoint2D32f>[]()[], Int32, MCvSize, Int32, array<Byte>[]()[], array<Single>[]()[], MCvTermCriteria, LKFLOW_TYPE)

Implements sparse iterative version of Lucas-Kanade optical flow in pyramids ([Bouguet00]). It calculates coordinates of the feature points on the current video frame given their coordinates on the previous frame. The function finds the coordinates with sub-pixel accuracy.
Declaration Syntax
C#Visual BasicVisual C++
public static void cvCalcOpticalFlowPyrLK(
	IntPtr prev,
	IntPtr curr,
	IntPtr prev_pyr,
	IntPtr curr_pyr,
	MCvPoint2D32f[] prev_features,
	MCvPoint2D32f[] curr_features,
	int count,
	MCvSize win_size,
	int level,
	byte[] status,
	float[] track_error,
	MCvTermCriteria criteria,
Public Shared Sub cvCalcOpticalFlowPyrLK ( _
	prev As IntPtr, _
	curr As IntPtr, _
	prev_pyr As IntPtr, _
	curr_pyr As IntPtr, _
	prev_features As MCvPoint2D32f(), _
	curr_features As MCvPoint2D32f(), _
	count As Integer, _
	win_size As MCvSize, _
	level As Integer, _
	status As Byte(), _
	track_error As Single(), _
	criteria As MCvTermCriteria, _
	flags As LKFLOW_TYPE _
static void cvCalcOpticalFlowPyrLK(
	IntPtr prev, 
	IntPtr curr, 
	IntPtr prev_pyr, 
	IntPtr curr_pyr, 
	array<MCvPoint2D32f>^ prev_features, 
	array<MCvPoint2D32f>^ curr_features, 
	int count, 
	MCvSize win_size, 
	int level, 
	array<unsigned char>^ status, 
	array<float>^ track_error, 
	MCvTermCriteria criteria, 
prev (IntPtr)
First frame, at time t.
curr (IntPtr)
Second frame, at time t + dt .
prev_pyr (IntPtr)
Buffer for the pyramid for the first frame. If the pointer is not NULL , the buffer must have a sufficient size to store the pyramid from level 1 to level #level ; the total size of (image_width+8)*image_height/3 bytes is sufficient.
curr_pyr (IntPtr)
Similar to prev_pyr, used for the second frame.
prev_features (array< MCvPoint2D32f >[]()[])
Array of points for which the flow needs to be found.
curr_features (array< MCvPoint2D32f >[]()[])
Array of 2D points containing calculated new positions of input
count (Int32)
Number of feature points.
win_size (MCvSize)
Size of the search window of each pyramid level.
level (Int32)
Maximal pyramid level number. If 0 , pyramids are not used (single level), if 1 , two levels are used, etc.
status (array< Byte >[]()[])
Array. Every element of the array is set to 1 if the flow for the corresponding feature has been found, 0 otherwise.
track_error (array< Single >[]()[])
Array of double numbers containing difference between patches around the original and moved points. Optional parameter; can be NULL
criteria (MCvTermCriteria)
Specifies when the iteration process of finding the flow for each point on each pyramid level should be stopped.
Miscellaneous flags
Both parameters prev_pyr and curr_pyr comply with the following rules: if the image pointer is 0, the function allocates the buffer internally, calculates the pyramid, and releases the buffer after processing. Otherwise, the function calculates the pyramid and stores it in the buffer unless the flag CV_LKFLOW_PYR_A[B]_READY is set. The image should be large enough to fit the Gaussian pyramid data. After the function call both pyramids are calculated and the readiness flag for the corresponding image can be set in the next call (i.e., typically, for all the image pairs except the very first one CV_LKFLOW_PYR_A_READY is set).

Assembly: Emgu.CV (Module: Emgu.CV) Version: (