Table of Contents

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

img InputArray

8-bit input image.

pyramid OutputArray

output pyramid.

winSize Size

window size of optical flow algorithm. Must be not less than winSize argument of calcOpticalFlowPyrLK(). It is needed to calculate required padding for pyramid levels.

maxLevel int

0-based maximal pyramid level number.

withDerivatives bool

set to precompute gradients for the every pyramid level. If pyramid is constructed without the gradients then calcOpticalFlowPyrLK() will calculate them internally.

pyrBorder BorderTypes

the border mode for pyramid layers.

derivBorder BorderTypes

the border mode for gradients.

tryReuseInputImage bool

put 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

img InputArray

8-bit input image.

pyramid Mat[]

output pyramid.

winSize Size

window size of optical flow algorithm. Must be not less than winSize argument of calcOpticalFlowPyrLK(). It is needed to calculate required padding for pyramid levels.

maxLevel int

0-based maximal pyramid level number.

withDerivatives bool

set to precompute gradients for the every pyramid level. If pyramid is constructed without the gradients then calcOpticalFlowPyrLK() will calculate them internally.

pyrBorder BorderTypes

the border mode for pyramid layers.

derivBorder BorderTypes

the border mode for gradients.

tryReuseInputImage bool

put 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.