| Cv2CalcOpticalFlowFarneback Method |
Computes a dense optical flow using the Gunnar Farneback's algorithm.
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax public static void CalcOpticalFlowFarneback(
InputArray prev,
InputArray next,
InputOutputArray flow,
double pyrScale,
int levels,
int winsize,
int iterations,
int polyN,
double polySigma,
OpticalFlowFlags flags
)
Public Shared Sub CalcOpticalFlowFarneback (
prev As InputArray,
next As InputArray,
flow As InputOutputArray,
pyrScale As Double,
levels As Integer,
winsize As Integer,
iterations As Integer,
polyN As Integer,
polySigma As Double,
flags As OpticalFlowFlags
)
public:
static void CalcOpticalFlowFarneback(
InputArray^ prev,
InputArray^ next,
InputOutputArray^ flow,
double pyrScale,
int levels,
int winsize,
int iterations,
int polyN,
double polySigma,
OpticalFlowFlags flags
)
static member CalcOpticalFlowFarneback :
prev : InputArray *
next : InputArray *
flow : InputOutputArray *
pyrScale : float *
levels : int *
winsize : int *
iterations : int *
polyN : int *
polySigma : float *
flags : OpticalFlowFlags -> unit
Parameters
- prev
- Type: OpenCvSharpInputArray
first 8-bit single-channel input image. - next
- Type: OpenCvSharpInputArray
second input image of the same size and the same type as prev. - flow
- Type: OpenCvSharpInputOutputArray
computed flow image that has the same size as prev and type CV_32FC2. - pyrScale
- Type: SystemDouble
parameter, 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. - levels
- Type: SystemInt32
number of pyramid layers including the initial image;
levels=1 means that no extra layers are created and only the original images are used. - winsize
- Type: SystemInt32
averaging 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. - iterations
- Type: SystemInt32
number of iterations the algorithm does at each pyramid level. - polyN
- Type: SystemInt32
size 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 poly_n =5 or 7. - polySigma
- Type: SystemDouble
standard 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. - flags
- Type: OpenCvSharpOpticalFlowFlags
operation flags that can be a combination of OPTFLOW_USE_INITIAL_FLOW and/or OPTFLOW_FARNEBACK_GAUSSIAN
See Also