Click or drag to resize

Cv2BuildOpticalFlowPyramid Method (InputArray, OutputArray, Size, Int32, Boolean, BorderTypes, BorderTypes, Boolean)

Constructs a pyramid which can be used as input for calcOpticalFlowPyrLK

Namespace:  OpenCvSharp
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax
public static int BuildOpticalFlowPyramid(
	InputArray img,
	OutputArray pyramid,
	Size winSize,
	int maxLevel,
	bool withDerivatives = true,
	BorderTypes pyrBorder = BorderTypes.Reflect101,
	BorderTypes derivBorder = BorderTypes.Constant,
	bool tryReuseInputImage = true
)

Parameters

img
Type: OpenCvSharpInputArray
8-bit input image.
pyramid
Type: OpenCvSharpOutputArray
output pyramid.
winSize
Type: OpenCvSharpSize
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: OpenCvSharpBorderTypes
the border mode for pyramid layers.
derivBorder (Optional)
Type: OpenCvSharpBorderTypes
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