Emgu.CV.OpticalFlow.PyrLK C# (CSharp) Метод

PyrLK() публичный статический Метод

Calculates optical flow for a sparse feature set using iterative Lucas-Kanade method in pyramids
public static PyrLK ( Byte>.Image prev, Byte>.Image curr, Byte>.Image prevPyrBuffer, Byte>.Image currPyrBuffer, PointF prevFeatures, Size winSize, int level, MCvTermCriteria criteria, Emgu flags, PointF &currFeatures, Byte &status, float &trackError ) : void
prev Byte>.Image First frame, at time t
curr Byte>.Image Second frame, at time t + dt
prevPyrBuffer Byte>.Image Buffer for the pyramid for the first frame. If it 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
currPyrBuffer Byte>.Image Similar to prev_pyr, used for the second frame
prevFeatures System.Drawing.PointF Array of points for which the flow needs to be found
winSize System.Drawing.Size Size of the search window of each pyramid level
level int Maximal pyramid level number. If 0 , pyramids are not used (single level), if 1 , two levels are used, etc
criteria Emgu.CV.Structure.MCvTermCriteria Specifies when the iteration process of finding the flow for each point on each pyramid level should be stopped
flags Emgu Flags
currFeatures System.Drawing.PointF Array of 2D points containing calculated new positions of input features in the second image
status Byte Array. Every element of the array is set to 1 if the flow for the corresponding feature has been found, 0 otherwise
trackError float Array of double numbers containing difference between patches around the original and moved points
Результат void
        public static void PyrLK(
         Image<Gray, Byte> prev,
         Image<Gray, Byte> curr,
         Image<Gray, Byte> prevPyrBuffer,
         Image<Gray, Byte> currPyrBuffer,
         PointF[] prevFeatures,
         Size winSize,
         int level,
         MCvTermCriteria criteria,
         Emgu.CV.CvEnum.LKFLOW_TYPE flags,
         out PointF[] currFeatures,
         out Byte[] status,
         out float[] trackError)
        {
            Image<Gray, Byte> prevPyrBufferParam = prevPyrBuffer ?? new Image<Gray, byte>(prev.Width + 8, prev.Height / 3);
             Image<Gray, Byte> currPyrBufferParam = currPyrBuffer ?? prevPyrBufferParam.CopyBlank();

             status = new Byte[prevFeatures.Length];
             trackError = new float[prevFeatures.Length];

             currFeatures = new PointF[prevFeatures.Length];

             CvInvoke.cvCalcOpticalFlowPyrLK(
            prev,
            curr,
            prevPyrBufferParam,
            currPyrBufferParam,
            prevFeatures,
            currFeatures,
            prevFeatures.Length,
            winSize,
            level,
            status,
            trackError,
            criteria,
            flags);

             #region Release buffer images if they are create within this function call
             if (!object.ReferenceEquals(prevPyrBufferParam, prevPyrBuffer)) prevPyrBufferParam.Dispose();
             if (!object.ReferenceEquals(currPyrBufferParam, currPyrBuffer)) currPyrBufferParam.Dispose();
             #endregion
        }

Same methods

OpticalFlow::PyrLK ( Byte>.Image prev, Byte>.Image curr, PointF prevFeatures, Size winSize, int level, MCvTermCriteria criteria, PointF &currFeatures, Byte &status, float &trackError ) : void