Developer Reference for Intel® Integrated Performance Primitives 2019
Calculates optical flow for the set of feature points using the pyramidal Lucas-Kanade algorithm.
IppStatus ippiOpticalFlowPyrLK_<mod>(IppiPyramid* pPyr1, IppiPyramid* pPyr2, const IppiPoint_32f* pPrev, IppiPoint_32f* pNext, Ipp8s* pStatus, Ipp32f* pError, int numFeat, int winSize, int maxLev, int maxIter, Ipp32f threshold, IppiOptFlowPyrLK_<mod>* pState);
Supported values for mod:
8u_C1R |
16u_C1R |
32f_C1R |
ippcv.h
Headers: ippcore.h, ippvm.h, ipps.h, ippi.h
Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib
Pointer to the ROI in the first image pyramid structure.
Pointer to the ROI in the second image pyramid structure.
Pointer to the array of initial coordinates of the feature points.
Pointer to the array of new coordinates of feature point; as input it contains hints for new coordinates.
Pointer to the array of result indicators.
Pointer to the array of differences between neighborhoods of old and new point positions.
Number of feature points.
Size of the search window of each pyramid level.
Pyramid level to start the operation.
Maximum number of algorithm iterations for each pyramid level.
Threshold value.
Pointer to the pyramidal optical flow structure.
This function operates with ROI (see Regions of Interest in Intel IPP).
This function implements the iterative version of the Lucas-Kanade algorithms [Bou99]. It computes with sub-pixel accuracy new coordinates of the numFeat feature points of two images at time t and t+dt. Their initial coordinates are places in the pPrev array. Computed values of new coordinates of the feature points are stored in the array pNext, that initially contains estimations of them (or hints), for example, based on the flow values for the previous image in sequence. If there are not such hints, the pNext array contains the same initial coordinates as the pPrev array.
pStatus and pError are arrays of size numFeat with the respective data type.
The images are presented by the pyramid structures pPyr1 and pPyr2 respectively (see description of the PyramidGetSize and ippiPyramidInit functions for more details). These structures should be initialized by calling the function PyramidGetSize and ippiPyramidInit functions beforehand. The function uses the pyramidal optical flow structure pState that also should be previously initialized using OpticalFlowPyrLKGetSize and OpticalFlowPyrLKInit.
The function starts operation on the highest pyramid level (smallest image) that is specified by the maxLev parameter in the centered search window which size winSize could not exceed the corresponding value winSize that is specified in OpticalFlowPyrLKGetSize and OpticalFlowPyrLKInit. The operation for i-th feature point on the given pyramid level finishes if:
In first two cases for non-zero levels the new position coordinates are scaled to the next pyramid level and the operation continues on the next level. For zero level or for third case the operation stops, the number of the corresponding level is written to the pStatus[i] element, the new coordinates are scaled to zero level and are written to pNext[i]. The square root of the average squared difference between neighborhoods of old and new positions is written to pError[i].
ippStsNoErr |
Indicates no error. Any other value indicates an error or a warning. |
ippStsNullPtrErr |
Indicates an error if one of the specified pointer is NULL. |
ippStsSizeErr |
Indicates an error condition if numFeat or winSize has zero or negative value. |
ippStsBadArgErr |
Indicates an error condition if maxLev or threshold has negative value, or maxIter has zero or negative value. |