Method Create
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
Create(int, double, bool, int, int, int, double, int)
Creates instance of cv::FarnebackOpticalFlow.
public static FarnebackOpticalFlow Create(int numLevels = 5, double pyrScale = 0.5, bool fastPyramids = false, int winSize = 13, int numIters = 10, int polyN = 5, double polySigma = 1.1, int flags = 0)
Parameters
numLevelsintnumber of pyramid layers including the initial image; levels=1 means that no extra layers are created and only the original images are used.
pyrScaledoubleparameter, specifying the image scale (<1) to build pyramids for each image; pyrScale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous one.
fastPyramidsboolwinSizeintaveraging window size; larger values increase the algorithm robustness to image noise and give more chances for fast motion detection, but yield more blurred motion field.
numItersintnumber of iterations the algorithm does at each pyramid level.
polyNintsize of the pixel neighborhood used to find polynomial expansion in each pixel; larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field, typically polyN =5 or 7.
polySigmadoublestandard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion; for polyN=5, you can set polySigma=1.1, for polyN=7, a good value would be polySigma=1.5.
flagsintoperation flags that can be a combination of OPTFLOW_USE_INITIAL_FLOW and/or OPTFLOW_FARNEBACK_GAUSSIAN