Fast dense optical flow based on PyrLK sparse matches interpolation
flow = cv.calcOpticalFlowSparseToDense(from, to)
flow = cv.calcOpticalFlowSparseToDense(from, to, 'OptionName',optionValue, ...)
Input
- from first 8-bit 3-channel or 1-channel image.
- to second 8-bit 3-channel or 1-channel image of the same size as
from
.
Output
- flow computed flow image that has the same size as
from
and type
single
(2-channels). Flow for (x,y)
is stored in the third dimension.
Options
- GridStep stride used in sparse match computation. Lower values usually
result in higher quality but slow down the algorithm. default 8
- K number of nearest-neighbor matches considered, when fitting a
locally affine model. Lower values can make the algorithm noticeably
faster at the cost of some quality degradation. default 128
- Sigma parameter defining how fast the weights decrease in the
locally-weighted affine fitting. Higher values can help preserve fine
details, lower values can help to get rid of the noise in the output flow.
default 0.05
- UsePostProcessing defines whether the
cv.FastGlobalSmootherFilter.fastGlobalSmootherFilter is used for
post-processing after interpolation. default true
- FGSLambda see the respective parameter of
cv.FastGlobalSmootherFilter.fastGlobalSmootherFilter, default 500.0
- FGSSigma see the respective parameter of
cv.FastGlobalSmootherFilter.fastGlobalSmootherFilter, default 1.5