[This is preliminary documentation and is subject to change.]
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.Namespace: Emgu.CV
Assembly: Emgu.CV (in Emgu.CV.dll) Version: 126.96.36.199 (188.8.131.52)
|C#||Visual Basic||Visual C++|
Public Shared Sub cvCalcOpticalFlowPyrLK ( _ prev As IntPtr, _ curr As IntPtr, _ prevPyr As IntPtr, _ currPyr As IntPtr, _ prevFeatures As PointF(), _ <OutAttribute> currFeatures As PointF(), _ count As Integer, _ winSize As Size, _ level As Integer, _ status As Byte(), _ trackError As Single(), _ criteria As MCvTermCriteria, _ flags As LKFLOW_TYPE _ )
public: static void cvCalcOpticalFlowPyrLK( IntPtr prev, IntPtr curr, IntPtr prevPyr, IntPtr currPyr, [InAttribute] array<PointF>^ prevFeatures, [OutAttribute] array<PointF>^ currFeatures, int count, Size winSize, int level, array<unsigned char>^ status, array<float>^ trackError, MCvTermCriteria criteria, LKFLOW_TYPE flags )
First frame, at time t.
Second frame, at time t + dt .
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.
Similar to prev_pyr, used for the second frame.
Array of points for which the flow needs to be found.
Array of 2D points containing calculated new positions of input
Number of feature points.
Size of the search window of each pyramid level.
Maximal pyramid level number. If 0 , pyramids are not used (single level), if 1 , two levels are used, etc.
Array. Every element of the array is set to 1 if the flow for the corresponding feature has been found, 0 otherwise.
Array of double numbers containing difference between patches around the original and moved points. Optional parameter; can be NULL
Specifies when the iteration process of finding the flow for each point on each pyramid level should be stopped.
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).