Constructs the image pyramid which can be passed to cv.calcOpticalFlowPyrLK
pyramid = cv.buildOpticalFlowPyramid(img)
[pyramid,maxLvl] = cv.buildOpticalFlowPyramid(img)
pyramid = cv.buildOpticalFlowPyramid(img, 'OptionName',optionValue, ...)
Input
Output
- pyramid output pyramid. A cell-array of matrices (pyramid levels),
interleaved with corresponding gradients if
WithDerivatives
flag is
true. Each gradient is a matrix of type int16
of same size as pyramid at
that level with 2-channels.
- maxLvl number of levels in constructed pyramid. Can be less than
MaxLevel
.
Options
- WinSize window size of optical flow algorithm. Must be not less than
WinSize
argument of cv.calcOpticalFlowPyrLK. It is needed to calculate
required padding for pyramid levels. default [21,21]
- MaxLevel 0-based maximal pyramid level number. default 3
- WithDerivatives set to precompute gradients for the every pyramid
level. If pyramid is constructed without the gradients then
cv.calcOpticalFlowPyrLK will calculate them internally. default true
- PyrBorder the border mode for pyramid layers. See cv.copyMakeBorder.
default 'Reflect101'
- DerivBorder the border mode for gradients. See cv.copyMakeBorder.
default 'Constant'
- TryReuseInputImage put ROI of input image into the pyramid if
possible. You can pass false to force data copying. default true