Back to Aurora Vision Studio website

You are here: Start » Filter Reference » OpenCV » Video Analysis » cvCalcOpticalFlowPyrLK

cvCalcOpticalFlowPyrLK


Module: OpenCV

Calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with pyramids.

Name Type Range Description
Input value inPrevImg Image First UINT8 single-channel or 3-channel input image.
Input value inNextImg Image Second input image of the same size and the same type as inPrevImg.
Input value inPrevPts Point2DArray Vector of 2D points for which the flow needs to be found.
Input value inNextPts Point2DArray Input vector of initial points positions. When inUseInitialFlow is true, the vector must have the same size as in the input.
Input value inWinWidth Integer 3 - Width of the search window at each pyramid level.
Input value inWinHeight Integer 3 - Height of the search window at each pyramid level.
Input value inMaxLevel Integer 0 - 0-based maximal pyramid level number. If set to 0, pyramids are not used. If set to 1, two levels are used, and so on.
Input value inTcEpsilon Real Criteria termination of the iterative process of corner refinement. Process stops when either after inTcMaxCount iterations or when the corner position moves by less than inTcEpsilon.
Input value inTcMaxCount Integer Criteria termination of the iterative process of corner refinement. Process stops when either after inTcMaxCount iterations or when the corner position moves by less than inTcEpsilon.
Input value inTcType CvTerminationCriteria Indicates which termination criteria will be used.
Input value inMinEigThreshold Real The algorithm calculates the minimum eigen value of a 2x2 normal matrix of optical flow equation.
Input value inUseInitialFlow Bool Use initial estimations stored in nextPts. If it is false, then prevPts is copied to nextPts and is considered as the initial estimate.
Output value outNextPts Point2DArray Output vector of 2D points containing the calculated new positions of input features in the second image.
Output value outStatus IntegerArray Output status vector. Each element of the vector is set to 1 if the flow for the corresponding features has been found. Otherwise, it is set to 0.
Output value outErr RealArray Output vector that contains the difference between patches around the original and moved points.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError inNextImg must have the same size, pixel type and depth as inPrevImg in cvCalcOpticalFlowPyrLK.
DomainError inPrevImg must be UINT8 single-channel or 3-channel image in cvCalcOpticalFlowPyrLK.
DomainError inPrevPts must have at least one point cvCalcOpticalFlowPyrLK.

Complexity Level

This filter is available on Basic Complexity Level.