OpenCvSharp.Cv2.calcOpticalFlowSF C# (CSharp) Method

calcOpticalFlowSF() public static method

computes dense optical flow using Simple Flow algorithm
public static calcOpticalFlowSF ( Mat from, Mat to, Mat flow, int layers, int averagingBlockSize, int maxFlow, double sigmaDist, double sigmaColor, int postprocessWindow, double sigmaDistFix, double sigmaColorFix, double occThr, int upscaleAveragingRadius, double upscaleSigmaDist, double upscaleSigmaColor, double speedUpThr ) : void
from Mat First 8-bit 3-channel image.
to Mat Second 8-bit 3-channel image
flow Mat Estimated flow
layers int Number of layers
averagingBlockSize int Size of block through which we sum up when calculate cost function for pixel
maxFlow int maximal flow that we search at each level
sigmaDist double vector smooth spatial sigma parameter
sigmaColor double vector smooth color sigma parameter
postprocessWindow int window size for postprocess cross bilateral filter
sigmaDistFix double spatial sigma for postprocess cross bilateralf filter
sigmaColorFix double color sigma for postprocess cross bilateral filter
occThr double threshold for detecting occlusions
upscaleAveragingRadius int window size for bilateral upscale operation
upscaleSigmaDist double spatial sigma for bilateral upscale operation
upscaleSigmaColor double color sigma for bilateral upscale operation
speedUpThr double threshold to detect point with irregular flow - where flow should be recalculated after upscale
return void
        public static void calcOpticalFlowSF(
            Mat from,
            Mat to,
            Mat flow,
            int layers,
            int averagingBlockSize,
            int maxFlow,
            double sigmaDist,
            double sigmaColor,
            int postprocessWindow,
            double sigmaDistFix,
            double sigmaColorFix,
            double occThr,
            int upscaleAveragingRadius,
            double upscaleSigmaDist,
            double upscaleSigmaColor,
            double speedUpThr)
        {
            if (from == null)
                throw new ArgumentNullException(nameof(@from));
            if (to == null)
                throw new ArgumentNullException(nameof(to));
            if (flow == null)
                throw new ArgumentNullException(nameof(flow));
            from.ThrowIfDisposed();
            to.ThrowIfDisposed();
            flow.ThrowIfDisposed();

            NativeMethods.optflow_calcOpticalFlowSF2(
                from.CvPtr, to.CvPtr, flow.CvPtr,
                layers, averagingBlockSize, maxFlow,
                sigmaDist, sigmaColor, postprocessWindow, sigmaDistFix,
                sigmaColorFix, occThr, upscaleAveragingRadius,
                upscaleSigmaDist, upscaleSigmaColor, speedUpThr);
        }
    }
Cv2