Cv2BuildOpticalFlowPyramid Method (InputArray, Mat, Size, Int32, Boolean, BorderType, BorderType, Boolean) OpenCvSharp Class Library
Constructs a pyramid which can be used as input for calcOpticalFlowPyrLK

Namespace:  OpenCvSharp.CPlusPlus
Assembly:  OpenCvSharp.CPlusPlus (in OpenCvSharp.CPlusPlus.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public static int BuildOpticalFlowPyramid(
	InputArray img,
	out Mat[] pyramid,
	Size winSize,
	int maxLevel,
	bool withDerivatives = true,
	BorderType pyrBorder = BorderType.Reflect101,
	BorderType derivBorder = BorderType.Constant,
	bool tryReuseInputImage = true
)

Parameters

img
Type: OpenCvSharp.CPlusPlusInputArray
8-bit input image.
pyramid
Type: OpenCvSharp.CPlusPlusMat
output pyramid.
winSize
Type: OpenCvSharp.CPlusPlusSize
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
Type: SystemInt32
0-based maximal pyramid level number.
withDerivatives (Optional)
Type: SystemBoolean
set to precompute gradients for the every pyramid level. If pyramid is constructed without the gradients then calcOpticalFlowPyrLK() will calculate them internally.
pyrBorder (Optional)
Type: OpenCvSharpBorderType
the border mode for pyramid layers.
derivBorder (Optional)
Type: OpenCvSharpBorderType
the border mode for gradients.
tryReuseInputImage (Optional)
Type: SystemBoolean
put ROI of input image into the pyramid if possible. You can pass false to force data copying.

Return Value

Type: Int32
number of levels in constructed pyramid. Can be less than maxLevel.
See Also

Reference