added helper macros to the function declarations

This commit is contained in:
Vadim Pisarevsky
2010-10-16 20:34:34 +00:00
parent b59b0fd7fc
commit 1b1eab8e67
10 changed files with 177 additions and 151 deletions

View File

@@ -112,17 +112,11 @@ typedef struct CvBGStatModel
//
// Releases memory used by BGStatModel
CV_INLINE void cvReleaseBGStatModel( CvBGStatModel** bg_model )
{
if( bg_model && *bg_model && (*bg_model)->release )
(*bg_model)->release( bg_model );
}
CVAPI(void) cvReleaseBGStatModel( CvBGStatModel** bg_model );
// Updates statistical model and returns number of found foreground regions
CV_INLINE int cvUpdateBGStatModel( IplImage* current_frame, CvBGStatModel* bg_model, double learningRate CV_DEFAULT(-1))
{
return bg_model && bg_model->update ? bg_model->update( current_frame, bg_model, learningRate ) : 0;
}
CVAPI(int) cvUpdateBGStatModel( IplImage* current_frame, CvBGStatModel* bg_model,
double learningRate CV_DEFAULT(-1));
// Performs FG post-processing using segmentation
// (all pixels of a region will be classified as foreground if majority of pixels of the region are FG).
@@ -365,7 +359,8 @@ public:
//! the virtual destructor
virtual ~BackgroundSubtractor();
//! the update operator that takes the next video frame and returns the current foreground mask as 8-bit binary image.
virtual void operator()(const Mat& image, Mat& fgmask, double learningRate=0);
virtual CV_WRAP_AS(apply) void operator()(const Mat& image, CV_OUT Mat& fgmask,
double learningRate=0);
};

View File

@@ -248,8 +248,8 @@ CV_EXPORTS void updateMotionHistory( const Mat& silhouette, Mat& mhi,
double timestamp, double duration );
//! computes the motion gradient orientation image from the motion history image
CV_EXPORTS void calcMotionGradient( const Mat& mhi, Mat& mask,
Mat& orientation,
CV_EXPORTS void calcMotionGradient( const Mat& mhi, CV_OUT Mat& mask,
CV_OUT Mat& orientation,
double delta1, double delta2,
int apertureSize=3 );
@@ -260,11 +260,11 @@ CV_EXPORTS double calcGlobalOrientation( const Mat& orientation, const Mat& mask
// TODO: need good API for cvSegmentMotion
//! updates the object tracking window using CAMSHIFT algorithm
CV_EXPORTS RotatedRect CamShift( const Mat& probImage, Rect& window,
CV_EXPORTS RotatedRect CamShift( const Mat& probImage, CV_OUT Rect& window,
TermCriteria criteria );
//! updates the object tracking window using meanshift algorithm
CV_EXPORTS int meanShift( const Mat& probImage, Rect& window,
CV_EXPORTS int meanShift( const Mat& probImage, CV_OUT Rect& window,
TermCriteria criteria );
/*!
@@ -313,8 +313,8 @@ enum { OPTFLOW_USE_INITIAL_FLOW=4, OPTFLOW_FARNEBACK_GAUSSIAN=256 };
//! computes sparse optical flow using multi-scale Lucas-Kanade algorithm
CV_EXPORTS void calcOpticalFlowPyrLK( const Mat& prevImg, const Mat& nextImg,
const vector<Point2f>& prevPts, vector<Point2f>& nextPts,
vector<uchar>& status, vector<float>& err,
const vector<Point2f>& prevPts, CV_OUT vector<Point2f>& nextPts,
CV_OUT vector<uchar>& status, CV_OUT vector<float>& err,
Size winSize=Size(15,15), int maxLevel=3,
TermCriteria criteria=TermCriteria(
TermCriteria::COUNT+TermCriteria::EPS,
@@ -323,8 +323,8 @@ CV_EXPORTS void calcOpticalFlowPyrLK( const Mat& prevImg, const Mat& nextImg,
int flags=0 );
//! computes dense optical flow using Farneback algorithm
CV_EXPORTS void calcOpticalFlowFarneback( const Mat& prev0, const Mat& next0,
Mat& flow0, double pyr_scale, int levels, int winsize,
CV_EXPORTS void calcOpticalFlowFarneback( const Mat& prev, const Mat& next,
CV_OUT Mat& flow, double pyr_scale, int levels, int winsize,
int iterations, int poly_n, double poly_sigma, int flags );
}