Class FarnebackOpticalFlow
Class computing a dense optical flow using the Gunnar Farneback's algorithm.
public class FarnebackOpticalFlow : UnmanagedObject, IDisposable, IDenseOpticalFlow, IAlgorithm
- Inheritance
-
FarnebackOpticalFlow
- Implements
- Inherited Members
- Extension Methods
Constructors
FarnebackOpticalFlow(int, double, bool, int, int, int, double, OpticalflowFarnebackFlag)
Create a FarnebackOpticalFlow object
public FarnebackOpticalFlow(int numLevels = 5, double pyrScale = 0.5, bool fastPyramids = false, int winSize = 13, int numIters = 10, int polyN = 5, double polySigma = 1.1, OpticalflowFarnebackFlag flags = OpticalflowFarnebackFlag.Default)
Parameters
numLevels
intThe number of pyramid layers, including the initial image. levels=1 means that no extra layers are created and only the original images are used
pyrScale
doubleSpecifies the image scale (!1) to build the pyramids for each image. pyrScale=0.5 means the classical pyramid, where each next layer is twice smaller than the previous
fastPyramids
boolFast Pyramids
winSize
intThe averaging window size; The larger values increase the algorithm robustness to image noise and give more chances for fast motion detection, but yield more blurred motion field
numIters
intThe number of iterations the algorithm does at each pyramid level
polyN
intSize of the pixel neighborhood used to find polynomial expansion in each pixel. The larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field. Typically, poly n=5 or 7
polySigma
doubleStandard deviation of the Gaussian that is used to smooth derivatives that are used as a basis for the polynomial expansion. For poly n=5 you can set poly sigma=1.1, for poly n=7 a good value would be poly sigma=1.5
flags
OpticalflowFarnebackFlagThe operation flags
Properties
AlgorithmPtr
Return the pointer to the algorithm object
public nint AlgorithmPtr { get; }
Property Value
DenseOpticalFlowPtr
Gets the dense optical flow pointer.
public nint DenseOpticalFlowPtr { get; }
Property Value
- nint
The pointer to the dense optical flow object.
Methods
DisposeObject()
Release the unmanaged resources
protected override void DisposeObject()