Commit 266c4642 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

doxygenated opencv_video & opencv_calib3d modules (C++ part only)

parent eff42cda
......@@ -9,6 +9,7 @@ OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
SORT_BRIEF_DOCS = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
......
......@@ -1108,7 +1108,7 @@ enum { DFT_INVERSE=1, DFT_SCALE=2, DFT_ROWS=4, DFT_COMPLEX_OUTPUT=16, DFT_REAL_O
M.create(100,60,CV_8UC(15));
\endcode
As noted in the introduction of this chapter, \texttt{create()}
As noted in the introduction of this chapter, Mat::create()
will only allocate a new matrix when the current matrix dimensionality
or type are different from the specified.
......@@ -1243,7 +1243,8 @@ enum { DFT_INVERSE=1, DFT_SCALE=2, DFT_ROWS=4, DFT_COMPLEX_OUTPUT=16, DFT_REAL_O
addr(M_{ij})=&M.at<float>(i,j)
(where & is used to convert the reference returned by cv::Mat::at() to a pointer).
if you need to process a whole row of matrix, the most efficient way is to get the pointer to the row first, and then just use plain C operator \texttt{[]}:
if you need to process a whole row of matrix, the most efficient way is to get
the pointer to the row first, and then just use plain C operator []:
\code
// compute sum of positive matrix elements
......@@ -1291,7 +1292,8 @@ enum { DFT_INVERSE=1, DFT_SCALE=2, DFT_ROWS=4, DFT_COMPLEX_OUTPUT=16, DFT_REAL_O
sum += std::max(*it, 0.);
\endcode
The matrix iterators are random-access iterators, so they can be passed to any STL algorithm, including \texttt{std::sort()}.
The matrix iterators are random-access iterators, so they can be passed
to any STL algorithm, including std::sort().
*/
class CV_EXPORTS Mat
{
......@@ -2445,8 +2447,8 @@ class SparseMat;
In other aspects cv::MatND is also very similar to cv::Mat, with the following limitations and differences:
<ul>
<li> much less operations are implemented for \texttt{MatND}
<li> currently, algebraic expressions with \texttt{MatND}'s are not supported
<li> much less operations are implemented for cv::MatND
<li> currently, algebraic expressions with cv::MatND's are not supported
<li> the cv::MatND iterator is completely different from cv::Mat_ and cv::SparseMat_ iterators.
The latter are per-element iterators, while the former is per-slice iterator, see below.
</ul>
......
/*! \file imgproc.hpp
\brief The Image Processing
*/
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
......@@ -48,6 +52,9 @@
#ifdef __cplusplus
/*! \namespace cv
Namespace where all the C++ OpenCV functionality resides
*/
namespace cv
{
......
......@@ -353,22 +353,45 @@ CVAPI(CvSeq*) cvSegmentFGMask( CvArr *fgmask, int poly1Hull0 CV_DEFAULT(1),
namespace cv
{
/*!
The Base Class for Background/Foreground Segmentation
The class is only used to define the common interface for
the whole family of background/foreground segmentation algorithms.
*/
class CV_EXPORTS BackgroundSubtractor
{
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);
};
/*!
Gaussian Mixture-based Backbround/Foreground Segmentation Algorithm
The class implements the following algorithm:
"An improved adaptive background mixture model for real-time tracking with shadow detection"
P. KadewTraKuPong and R. Bowden,
Proc. 2nd European Workshp on Advanced Video-Based Surveillance Systems, 2001."
http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf
*/
class CV_EXPORTS BackgroundSubtractorMOG : public BackgroundSubtractor
{
public:
//! the default constructor
BackgroundSubtractorMOG();
//! the full constructor that takes the length of the history, the number of gaussian mixtures, the background ratio parameter and the noise strength
BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma=0);
//! the destructor
virtual ~BackgroundSubtractorMOG();
//! the update operator
virtual void operator()(const Mat& image, Mat& fgmask, double learningRate=0);
//! re-initiaization method
virtual void initialize(Size frameSize, int frameType);
Size frameSize;
......
/*! \file tracking.hpp
\brief The Object and Feature Tracking
*/
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
......@@ -230,58 +234,74 @@ CVAPI(const CvMat*) cvKalmanPredict( CvKalman* kalman,
(corrects state of the system and internal matrices) */
CVAPI(const CvMat*) cvKalmanCorrect( CvKalman* kalman, const CvMat* measurement );
#define cvKalmanUpdateByTime cvKalmanPredict
#define cvKalmanUpdateByMeasurement cvKalmanCorrect
#ifdef __cplusplus
}
namespace cv
{
//! updates motion history image using the current silhouette
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,
double delta1, double delta2,
int apertureSize=3 );
//! computes the global orientation of the selected motion history image part
CV_EXPORTS double calcGlobalOrientation( const Mat& orientation, const Mat& mask,
const Mat& mhi, double timestamp,
double duration );
// TODO: need good API for cvSegmentMotion
//! updates the object tracking window using CAMSHIFT algorithm
CV_EXPORTS RotatedRect CamShift( const Mat& probImage, Rect& window,
TermCriteria criteria );
//! updates the object tracking window using meanshift algorithm
CV_EXPORTS int meanShift( const Mat& probImage, Rect& window,
TermCriteria criteria );
/*!
Kalman filter.
The class implements standard Kalman filter \url{http://en.wikipedia.org/wiki/Kalman_filter}.
However, you can modify KalmanFilter::transitionMatrix, KalmanFilter::controlMatrix and
KalmanFilter::measurementMatrix to get the extended Kalman filter functionality.
*/
class CV_EXPORTS KalmanFilter
{
public:
//! the default constructor
KalmanFilter();
//! the full constructor taking the dimensionality of the state, of the measurement and of the control vector
KalmanFilter(int dynamParams, int measureParams, int controlParams=0);
//! re-initializes Kalman filter. The previous content is destroyed.
void init(int dynamParams, int measureParams, int controlParams=0);
//! computes predicted state
const Mat& predict(const Mat& control=Mat());
//! updates the predicted state from the measurement
const Mat& correct(const Mat& measurement);
Mat statePre; // predicted state (x'(k)):
// x(k)=A*x(k-1)+B*u(k)
Mat statePost; // corrected state (x(k)):
// x(k)=x'(k)+K(k)*(z(k)-H*x'(k))
Mat transitionMatrix; // state transition matrix (A)
Mat controlMatrix; // control matrix (B)
// (it is not used if there is no control)
Mat measurementMatrix; // measurement matrix (H)
Mat processNoiseCov; // process noise covariance matrix (Q)
Mat measurementNoiseCov;// measurement noise covariance matrix (R)
Mat errorCovPre; // priori error estimate covariance matrix (P'(k)):
// P'(k)=A*P(k-1)*At + Q)*/
Mat gain; // Kalman gain matrix (K(k)):
// K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)
Mat errorCovPost; // posteriori error estimate covariance matrix (P(k)):
// P(k)=(I-K(k)*H)*P'(k)
Mat temp1; // temporary matrices
Mat statePre; //!< predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k)
Mat statePost; //!< corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))
Mat transitionMatrix; //!< state transition matrix (A)
Mat controlMatrix; //!< control matrix (B) (not used if there is no control)
Mat measurementMatrix; //!< measurement matrix (H)
Mat processNoiseCov; //!< process noise covariance matrix (Q)
Mat measurementNoiseCov;//!< measurement noise covariance matrix (R)
Mat errorCovPre; //!< priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/
Mat gain; //!< Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)
Mat errorCovPost; //!< posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)
// temporary matrices
Mat temp1;
Mat temp2;
Mat temp3;
Mat temp4;
......@@ -289,12 +309,9 @@ public:
};
#define cvKalmanUpdateByTime cvKalmanPredict
#define cvKalmanUpdateByMeasurement cvKalmanCorrect
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,
......@@ -305,6 +322,7 @@ CV_EXPORTS void calcOpticalFlowPyrLK( const Mat& prevImg, const Mat& nextImg,
double derivLambda=0.5,
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,
int iterations, int poly_n, double poly_sigma, int flags );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment