Refactored per-computed pyramid handling in calcOpticalFlowPyrLK #1321

This commit is contained in:
Andrey Kamaev
2012-05-17 10:29:53 +00:00
parent 00c30681bc
commit 8f3273bf07
3 changed files with 69 additions and 54 deletions

View File

@@ -48,7 +48,7 @@
#define __OPENCV_TRACKING_HPP__
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/imgproc/imgproc.hpp"
#ifdef __cplusplus
extern "C" {
@@ -303,16 +303,19 @@ enum
OPTFLOW_FARNEBACK_GAUSSIAN = 256
};
//! constructs a pyramid which can be used as input for calcOpticalFlowPyrLK
CV_EXPORTS_W int buildOpticalFlowPyramid(InputArray _img, OutputArrayOfArrays pyramid,
Size winSize, int maxLevel, bool withDerivatives = true,
int pyrBorder = BORDER_REFLECT_101, int derivBorder = BORDER_CONSTANT,
bool tryReuseInputImage = true);
//! computes sparse optical flow using multi-scale Lucas-Kanade algorithm
CV_EXPORTS_W void calcOpticalFlowPyrLK( InputArray prevImg, InputArray nextImg,
InputArray prevPts, CV_OUT InputOutputArray nextPts,
OutputArray status, OutputArray err,
Size winSize=Size(21,21), int maxLevel=3,
TermCriteria criteria=TermCriteria(
TermCriteria::COUNT+TermCriteria::EPS,
30, 0.01),
int flags=0,
double minEigThreshold=1e-4);
TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01),
int flags=0, double minEigThreshold=1e-4);
//! computes dense optical flow using Farneback algorithm
CV_EXPORTS_W void calcOpticalFlowFarneback( InputArray prev, InputArray next,