calcOpticalFlowPyrLK function
(VecPoint2f, VecUChar?, VecF32?)
calcOpticalFlowPyrLK(
- InputArray prevImg,
- InputArray nextImg,
- VecPoint2f prevPts,
- VecPoint2f nextPts, {
- VecUChar? status,
- VecF32? err,
- (int, int) winSize = (21, 21),
- int maxLevel = 3,
- (int, int, double) criteria = (TERM_COUNT + TERM_EPS, 30, 1e-4),
- int flags = 0,
- double minEigThreshold = 1e-4,
CalcOpticalFlowPyrLK calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with pyramids.
For further details, please see: https://docs.opencv.org/master/dc/d6b/group__video__track.html#ga473e4b886d0bcc6b65831eb88ed93323
Implementation
(VecPoint2f nextPts, VecUChar? status, VecF32? error) calcOpticalFlowPyrLK(
InputArray prevImg,
InputArray nextImg,
VecPoint2f prevPts,
VecPoint2f nextPts, {
VecUChar? status,
VecF32? err,
(int, int) winSize = (21, 21),
int maxLevel = 3,
(int, int, double) criteria = (TERM_COUNT + TERM_EPS, 30, 1e-4),
int flags = 0,
double minEigThreshold = 1e-4,
}) {
final s = status?.ptr ?? calloc<cvideo.VecUChar>();
final e = err?.ptr ?? calloc<cvideo.VecF32>();
cvRun(
() => cvideo.CalcOpticalFlowPyrLKWithParams(
prevImg.ref,
nextImg.ref,
prevPts.ref,
nextPts.ptr,
s,
e,
winSize.cvd.ref,
maxLevel,
criteria.toTermCriteria().ref,
flags,
minEigThreshold,
),
);
nextPts.reattach();
return (nextPts, status ?? VecUChar.fromPointer(s), VecF32.fromPointer(e));
}