Method BuildOpticalFlowPyramid
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
BuildOpticalFlowPyramid(InputArray, OutputArray, Size, int, bool, BorderTypes, BorderTypes, bool)
Constructs a pyramid which can be used as input for calcOpticalFlowPyrLK
public static int BuildOpticalFlowPyramid(InputArray img, OutputArray pyramid, Size winSize, int maxLevel, bool withDerivatives = true, BorderTypes pyrBorder = BorderTypes.Default, BorderTypes derivBorder = BorderTypes.Constant, bool tryReuseInputImage = true)
Parameters
imgInputArray8-bit input image.
pyramidOutputArrayoutput pyramid.
winSizeSizewindow size of optical flow algorithm. Must be not less than winSize argument of calcOpticalFlowPyrLK(). It is needed to calculate required padding for pyramid levels.
maxLevelint0-based maximal pyramid level number.
withDerivativesboolset to precompute gradients for the every pyramid level. If pyramid is constructed without the gradients then calcOpticalFlowPyrLK() will calculate them internally.
pyrBorderBorderTypesthe border mode for pyramid layers.
derivBorderBorderTypesthe border mode for gradients.
tryReuseInputImageboolput ROI of input image into the pyramid if possible. You can pass false to force data copying.
Returns
- int
number of levels in constructed pyramid. Can be less than maxLevel.
BuildOpticalFlowPyramid(InputArray, out Mat[], Size, int, bool, BorderTypes, BorderTypes, bool)
Constructs a pyramid which can be used as input for calcOpticalFlowPyrLK
public static int BuildOpticalFlowPyramid(InputArray img, out Mat[] pyramid, Size winSize, int maxLevel, bool withDerivatives = true, BorderTypes pyrBorder = BorderTypes.Default, BorderTypes derivBorder = BorderTypes.Constant, bool tryReuseInputImage = true)
Parameters
imgInputArray8-bit input image.
pyramidMat[]output pyramid.
winSizeSizewindow size of optical flow algorithm. Must be not less than winSize argument of calcOpticalFlowPyrLK(). It is needed to calculate required padding for pyramid levels.
maxLevelint0-based maximal pyramid level number.
withDerivativesboolset to precompute gradients for the every pyramid level. If pyramid is constructed without the gradients then calcOpticalFlowPyrLK() will calculate them internally.
pyrBorderBorderTypesthe border mode for pyramid layers.
derivBorderBorderTypesthe border mode for gradients.
tryReuseInputImageboolput ROI of input image into the pyramid if possible. You can pass false to force data copying.
Returns
- int
number of levels in constructed pyramid. Can be less than maxLevel.