Back to Adaptive 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
inPrevImg Image First UINT8 single-channel or 3-channel input image.
inNextImg Image Second input image of the same size and the same type as inPrevImg.
inPrevPts Point2DArray Vector of 2D points for which the flow needs to be found.
inNextPts Point2DArray Input vector of initial points positions. When inUseInitialFlow is true, the vector must have the same size as in the input.
inWinWidth Integer 1 - Width of the search window at each pyramid level.
inWinHeight Integer 1 - Height of the search window at each pyramid level.
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.
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.
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.
inTcType CvTerminationCriteria Indicates which termination criteria will be used.
inMinEigThreshold Real Not used.
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.
outNextPts Point2DArray Output vector of 2D points containing the calculated new positions of input features in the second image.
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.
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.