the first round of cleaning up the RST docs

This commit is contained in:
Vadim Pisarevsky 2011-02-28 21:26:43 +00:00
parent eb8c0b8b4b
commit 4bb893aa9f
48 changed files with 1664 additions and 1649 deletions

View File

@ -77,25 +77,19 @@ be used for images of
The functions below use the above model to
*
Project 3D points to the image plane given intrinsic and extrinsic parameters
* Project 3D points to the image plane given intrinsic and extrinsic parameters
*
Compute extrinsic parameters given intrinsic parameters, a few 3D points and their projections.
* Compute extrinsic parameters given intrinsic parameters, a few 3D points and their projections.
*
Estimate intrinsic and extrinsic camera parameters from several views of a known calibration pattern (i.e. every view is described by several 3D-2D point correspondences).
* Estimate intrinsic and extrinsic camera parameters from several views of a known calibration pattern (i.e. every view is described by several 3D-2D point correspondences).
*
Estimate the relative position and orientation of the stereo camera "heads" and compute the
*rectification*
transformation that makes the camera optical axes parallel.
* Estimate the relative position and orientation of the stereo camera "heads" and compute the *rectification* transformation that makes the camera optical axes parallel.
.. index:: calibrateCamera
cv::calibrateCamera
-------------------
.. cfunction:: double calibrateCamera( const vector<vector<Point3f> >\& objectPoints, const vector<vector<Point2f> >\& imagePoints, Size imageSize, Mat\& cameraMatrix, Mat\& distCoeffs, vector<Mat>\& rvecs, vector<Mat>\& tvecs, int flags=0 )
.. c:function:: double calibrateCamera( const vector<vector<Point3f> >& objectPoints, const vector<vector<Point2f> >& imagePoints, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector<Mat>& rvecs, vector<Mat>& tvecs, int flags=0 )
Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
@ -168,7 +162,7 @@ See also:
cv::calibrationMatrixValues
---------------------------
.. cfunction:: void calibrationMatrixValues( const Mat\& cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double\& fovx, double\& fovy, double\& focalLength, Point2d\& principalPoint, double\& aspectRatio )
.. c:function:: void calibrationMatrixValues( const Mat& cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double& fovx, double& fovy, double& focalLength, Point2d& principalPoint, double& aspectRatio )
Computes some useful camera characteristics from the camera matrix
@ -188,15 +182,16 @@ cv::calibrationMatrixValues
:param principalPoint: The principal point in pixels
:param aspectRatio: :math:`f_y/f_x`
The function computes various useful camera characteristics from the previously estimated camera matrix.
.. index:: composeRT
cv::composeRT
-------------
.. cfunction:: void composeRT( const Mat\& rvec1, const Mat\& tvec1, const Mat\& rvec2, const Mat\& tvec2, Mat\& rvec3, Mat\& tvec3 )
.. c:function:: void composeRT( const Mat& rvec1, const Mat& tvec1, const Mat& rvec2, const Mat& tvec2, Mat& rvec3, Mat& tvec3 )
.. cfunction:: void composeRT( const Mat\& rvec1, const Mat\& tvec1, const Mat\& rvec2, const Mat\& tvec2, Mat\& rvec3, Mat\& tvec3, Mat\& dr3dr1, Mat\& dr3dt1, Mat\& dr3dr2, Mat\& dr3dt2, Mat\& dt3dr1, Mat\& dt3dt1, Mat\& dt3dr2, Mat\& dt3dt2 )
.. c:function:: void composeRT( const Mat& rvec1, const Mat& tvec1, const Mat& rvec2, const Mat& tvec2, Mat& rvec3, Mat& tvec3, Mat& dr3dr1, Mat& dr3dt1, Mat& dr3dr2, Mat& dr3dt2, Mat& dt3dr1, Mat& dt3dt1, Mat& dt3dr2, Mat& dt3dt2 )
Combines two rotation-and-shift transformations
@ -213,35 +208,35 @@ cv::composeRT
:param tvec3: The output translation vector of the superposition
:param d??d??: The optional output derivatives of ``rvec3`` or ``tvec3`` w.r.t. ``rvec?`` or ``tvec?``
The functions compute:
.. math::
\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,
where
:math:`\mathrm{rodrigues}` denotes a rotation vector to rotation matrix transformation, and
:math:`\mathrm{rodrigues}^{-1}` denotes the inverse transformation, see
:func:`Rodrigues` .
where :math:`\mathrm{rodrigues}` denotes a rotation vector to rotation matrix transformation, and
:math:`\mathrm{rodrigues}^{-1}` denotes the inverse transformation, see :func:`Rodrigues`.
Also, the functions can compute the derivatives of the output vectors w.r.t the input vectors (see
:func:`matMulDeriv` ).
The functions are used inside
:func:`stereoCalibrate` but can also be used in your own code where Levenberg-Marquardt or another gradient-based solver is used to optimize a function that contains matrix multiplication.
Also, the functions can compute the derivatives of the output vectors w.r.t the input vectors (see :func:`matMulDeriv` ).
The functions are used inside :func:`stereoCalibrate` but can also be used in your own code where Levenberg-Marquardt or another gradient-based solver is used to optimize a function that contains matrix multiplication.
.. index:: computeCorrespondEpilines
cv::computeCorrespondEpilines
-----------------------------
.. cfunction:: void computeCorrespondEpilines( const Mat\& points, int whichImage, const Mat\& F, vector<Vec3f>\& lines )
.. c:function:: void computeCorrespondEpilines( const Mat& points, int whichImage, const Mat& F, vector<Vec3f>& lines )
For points in one image of a stereo pair, computes the corresponding epilines in the other image.
:param points: The input points. :math:`N \times 1` or :math:`1 \times N` matrix of type ``CV_32FC2`` or ``vector<Point2f>``
:param whichImage: Index of the image (1 or 2) that contains the ``points``
:param F: The fundamental matrix that can be estimated using :ref:`FindFundamentalMat` or :ref:`StereoRectify` .
:param lines: The output vector of the corresponding to the points epipolar lines in the other image. Each line :math:`ax + by + c=0` is encoded by 3 numbers :math:`(a, b, c)`
:param lines: The output vector of the corresponding to the points epipolar lines in the other image. Each line :math:`ax + by + c=0` is encoded by 3 numbers :math:`(a, b, c)`
For every point in one of the two images of a stereo-pair the function finds the equation of the
corresponding epipolar line in the other image.
@ -269,9 +264,9 @@ Line coefficients are defined up to a scale. They are normalized, such that
cv::convertPointsHomogeneous
----------------------------
.. cfunction:: void convertPointsHomogeneous( const Mat\& src, vector<Point3f>\& dst )
.. c:function:: void convertPointsHomogeneous( const Mat& src, vector<Point3f>& dst )
.. cfunction:: void convertPointsHomogeneous( const Mat\& src, vector<Point2f>\& dst )
.. c:function:: void convertPointsHomogeneous( const Mat& src, vector<Point2f>& dst )
Convert points to/from homogeneous coordinates.
@ -279,10 +274,7 @@ cv::convertPointsHomogeneous
:param dst: The output vector of 2D or 2D points
The
functions convert
2D or 3D points from/to homogeneous coordinates, or simply
copy or transpose
The functions convert 2D or 3D points from/to homogeneous coordinates, or simply copy or transpose
the array. If the input array dimensionality is larger than the output, each coordinate is divided by the last coordinate:
.. math::
@ -295,9 +287,9 @@ If the output array dimensionality is larger, an extra 1 is appended to each poi
cv::decomposeProjectionMatrix
-----------------------------
.. cfunction:: void decomposeProjectionMatrix( const Mat\& projMatrix, Mat\& cameraMatrix, Mat\& rotMatrix, Mat\& transVect )
.. c:function:: void decomposeProjectionMatrix( const Mat& projMatrix, Mat& cameraMatrix, Mat& rotMatrix, Mat& transVect )
.. cfunction:: void decomposeProjectionMatrix( const Mat\& projMatrix, Mat\& cameraMatrix, Mat\& rotMatrix, Mat\& transVect, Mat\& rotMatrixX, Mat\& rotMatrixY, Mat\& rotMatrixZ, Vec3d\& eulerAngles )
.. c:function:: void decomposeProjectionMatrix( const Mat& projMatrix, Mat& cameraMatrix, Mat& rotMatrix, Mat& transVect, Mat& rotMatrixX, Mat& rotMatrixY, Mat& rotMatrixZ, Vec3d& eulerAngles )
Decomposes the projection matrix into a rotation matrix and a camera matrix.
@ -328,7 +320,7 @@ The function is based on
cv::drawChessboardCorners
-------------------------
.. cfunction:: void drawChessboardCorners( Mat\& image, Size patternSize, const Mat\& corners, bool patternWasFound )
.. c:function:: void drawChessboardCorners( Mat& image, Size patternSize, const Mat& corners, bool patternWasFound )
Renders the detected chessboard corners.
@ -346,7 +338,7 @@ The function draws the individual chessboard corners detected as red circles if
cv::findChessboardCorners
-------------------------
.. cfunction:: bool findChessboardCorners( const Mat\& image, Size patternSize, vector<Point2f>\& corners, int flags=CV_CALIB_CB_ADAPTIVE_THRESH+ CV_CALIB_CB_NORMALIZE_IMAGE )
.. c:function:: bool findChessboardCorners( const Mat& image, Size patternSize, vector<Point2f>& corners, int flags=CV_CALIB_CB_ADAPTIVE_THRESH+ CV_CALIB_CB_NORMALIZE_IMAGE )
Finds the positions of the internal corners of the chessboard.
@ -398,7 +390,6 @@ Sample usage of detecting and drawing chessboard corners: ::
TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
..
**Note:**
the function requires some white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environment (otherwise if there is no border and the background is dark, the outer black squares could not be segmented properly and so the square grouping and ordering algorithm will fail).
@ -407,7 +398,7 @@ the function requires some white space (like a square-thick border, the wider th
cv::findCirclesGrid
-------------------
.. cfunction:: bool findCirclesGrid( const Mat\& image, Size patternSize, vector<Point2f>\& centers, int flags=CALIB_CB_SYMMETRIC_GRID )
.. c:function:: bool findCirclesGrid( const Mat& image, Size patternSize, vector<Point2f>& centers, int flags=CALIB_CB_SYMMETRIC_GRID )
Finds the centers of the cirlces' grid.
@ -443,7 +434,6 @@ Sample usage of detecting and drawing circles' centers: ::
bool patternfound = findCirclesGrid(gray, patternsize, centers);
drawChessboardCorners(img, patternsize, Mat(centers), patternfound);
..
**Note:**
the function requires some white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environment.
@ -452,7 +442,7 @@ the function requires some white space (like a square-thick border, the wider th
cv::solvePnP
------------
.. cfunction:: void solvePnP( const Mat\& objectPoints, const Mat\& imagePoints, const Mat\& cameraMatrix, const Mat\& distCoeffs, Mat\& rvec, Mat\& tvec, bool useExtrinsicGuess=false )
.. c:function:: void solvePnP( const Mat& objectPoints, const Mat& imagePoints, const Mat& cameraMatrix, const Mat& distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess=false )
Finds the object pose from the 3D-2D point correspondences
@ -476,9 +466,9 @@ The function estimates the object pose given a set of object points, their corre
cv::findFundamentalMat
----------------------
.. cfunction:: Mat findFundamentalMat( const Mat\& points1, const Mat\& points2, vector<uchar>\& status, int method=FM_RANSAC, double param1=3., double param2=0.99 )
.. c:function:: Mat findFundamentalMat( const Mat& points1, const Mat& points2, vector<uchar>& status, int method=FM_RANSAC, double param1=3., double param2=0.99 )
.. cfunction:: Mat findFundamentalMat( const Mat\& points1, const Mat\& points2, int method=FM_RANSAC, double param1=3., double param2=0.99 )
.. c:function:: Mat findFundamentalMat( const Mat& points1, const Mat& points2, int method=FM_RANSAC, double param1=3., double param2=0.99 )
Calculates the fundamental matrix from the corresponding points in two images.
@ -532,17 +522,16 @@ corresponding to the specified points. It can also be passed to
Mat fundamental_matrix =
findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);
..
.. index:: findHomography
cv::findHomography
------------------
.. cfunction:: Mat findHomography( const Mat\& srcPoints, const Mat\& dstPoints, Mat\& status, int method=0, double ransacReprojThreshold=3 )
.. c:function:: Mat findHomography( const Mat& srcPoints, const Mat& dstPoints, Mat& status, int method=0, double ransacReprojThreshold=3 )
.. cfunction:: Mat findHomography( const Mat\& srcPoints, const Mat\& dstPoints, vector<uchar>\& status, int method=0, double ransacReprojThreshold=3 )
.. c:function:: Mat findHomography( const Mat& srcPoints, const Mat& dstPoints, vector<uchar>& status, int method=0, double ransacReprojThreshold=3 )
.. cfunction:: Mat findHomography( const Mat\& srcPoints, const Mat\& dstPoints, int method=0, double ransacReprojThreshold=3 )
.. c:function:: Mat findHomography( const Mat& srcPoints, const Mat& dstPoints, int method=0, double ransacReprojThreshold=3 )
Finds the perspective transformation between two planes.
@ -568,10 +557,7 @@ cv::findHomography
:param status: The optional output mask set by a robust method ( ``CV_RANSAC`` or ``CV_LMEDS`` ). *Note that the input mask values are ignored.*
The
functions find and return
the perspective transformation
:math:`H` between the source and the destination planes:
The functions find and return the perspective transformation :math:`H` between the source and the destination planes:
.. math::
@ -622,7 +608,7 @@ See also:
cv::getDefaultNewCameraMatrix
-----------------------------
.. cfunction:: Mat getDefaultNewCameraMatrix( const Mat\& cameraMatrix, Size imgSize=Size(), bool centerPrincipalPoint=false )
.. c:function:: Mat getDefaultNewCameraMatrix( const Mat& cameraMatrix, Size imgSize=Size(), bool centerPrincipalPoint=false )
Returns the default new camera matrix
@ -652,7 +638,7 @@ By default, the undistortion functions in OpenCV (see ``initUndistortRectifyMap`
cv::getOptimalNewCameraMatrix
-----------------------------
.. cfunction:: Mat getOptimalNewCameraMatrix( const Mat\& cameraMatrix, const Mat\& distCoeffs, Size imageSize, double alpha, Size newImageSize=Size(), Rect* validPixROI=0)
.. c:function:: Mat getOptimalNewCameraMatrix( const Mat& cameraMatrix, const Mat& distCoeffs, Size imageSize, double alpha, Size newImageSize=Size(), Rect* validPixROI=0)
Returns the new camera matrix based on the free scaling parameter
@ -668,8 +654,8 @@ cv::getOptimalNewCameraMatrix
:param newImageSize: The image size after rectification. By default it will be set to ``imageSize`` .
:param validPixROI: The optional output rectangle that will outline all-good-pixels region in the undistorted image. See ``roi1, roi2`` description in :ref:`StereoRectify`
The function computes
and returns
The function computes and returns
the optimal new camera matrix based on the free scaling parameter. By varying this parameter the user may retrieve only sensible pixels ``alpha=0`` , keep all the original image pixels if there is valuable information in the corners ``alpha=1`` , or get something in between. When ``alpha>0`` , the undistortion result will likely have some black pixels corresponding to "virtual" pixels outside of the captured distorted image. The original camera matrix, distortion coefficients, the computed new camera matrix and the ``newImageSize`` should be passed to
:ref:`InitUndistortRectifyMap` to produce the maps for
:ref:`Remap` .
@ -678,15 +664,18 @@ the optimal new camera matrix based on the free scaling parameter. By varying t
cv::initCameraMatrix2D
----------------------
.. cfunction:: Mat initCameraMatrix2D( const vector<vector<Point3f> >\& objectPoints, const vector<vector<Point2f> >\& imagePoints, Size imageSize, double aspectRatio=1.)
.. c:function:: Mat initCameraMatrix2D( const vector<vector<Point3f> >& objectPoints, const vector<vector<Point2f> >& imagePoints, Size imageSize, double aspectRatio=1.)
Finds the initial camera matrix from the 3D-2D point correspondences
:param objectPoints: The vector of vectors of the object points. See :func:`calibrateCamera`
:param imagePoints: The vector of vectors of the corresponding image points. See :func:`calibrateCamera`
:param imageSize: The image size in pixels; used to initialize the principal point
:param aspectRatio: If it is zero or negative, both :math:`f_x` and :math:`f_y` are estimated independently. Otherwise :math:`f_x = f_y * \texttt{aspectRatio}`
The function estimates and returns the initial camera matrix for camera calibration process.
Currently, the function only supports planar calibration patterns, i.e. patterns where each object point has z-coordinate =0.
@ -694,19 +683,23 @@ Currently, the function only supports planar calibration patterns, i.e. patterns
cv::initUndistortRectifyMap
---------------------------
.. cfunction:: void initUndistortRectifyMap( const Mat\& cameraMatrix, const Mat\& distCoeffs, const Mat\& R, const Mat\& newCameraMatrix, Size size, int m1type, Mat\& map1, Mat\& map2 )
.. c:function:: void initUndistortRectifyMap( const Mat& cameraMatrix, const Mat& distCoeffs, const Mat& R, const Mat& newCameraMatrix, Size size, int m1type, Mat& map1, Mat& map2 )
Computes the undistortion and rectification transformation map.
:param cameraMatrix: The input camera matrix :math:`A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}`
:param distCoeffs: The input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5 or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
:param R: The optional rectification transformation in object space (3x3 matrix). ``R1`` or ``R2`` , computed by :ref:`StereoRectify` can be passed here. If the matrix is empty , the identity transformation is assumed
:param newCameraMatrix: The new camera matrix :math:`A'=\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}`
:param size: The undistorted image size
:param m1type: The type of the first output map, can be ``CV_32FC1`` or ``CV_16SC2`` . See :func:`convertMaps`
:param map1: The first output map
:param map2: The second output map
@ -744,7 +737,8 @@ where the ``cameraMatrix`` can be chosen arbitrarily.
cv::matMulDeriv
---------------
.. cfunction:: void matMulDeriv( const Mat\& A, const Mat\& B, Mat\& dABdA, Mat\& dABdB )
.. c:function:: void matMulDeriv( const Mat& A, const Mat& B, Mat& dABdA, Mat& dABdB )
Computes partial derivatives of the matrix product w.r.t each multiplied matrix
@ -753,7 +747,9 @@ cv::matMulDeriv
:param B: The second multiplied matrix
:param dABdA: The first output derivative matrix ``d(A*B)/dA`` of size :math:`\texttt{A.rows*B.cols} \times {A.rows*A.cols}`
:param dABdA: The second output derivative matrix ``d(A*B)/dB`` of size :math:`\texttt{A.rows*B.cols} \times {B.rows*B.cols}`
The function computes the partial derivatives of the elements of the matrix product
:math:`A*B` w.r.t. the elements of each of the two input matrices. The function is used to compute Jacobian matrices in
:func:`stereoCalibrate` , but can also be used in any other similar optimization function.
@ -762,18 +758,21 @@ The function computes the partial derivatives of the elements of the matrix prod
cv::projectPoints
-----------------
.. cfunction:: void projectPoints( const Mat\& objectPoints, const Mat\& rvec, const Mat\& tvec, const Mat\& cameraMatrix, const Mat\& distCoeffs, vector<Point2f>\& imagePoints )
.. cfunction:: void projectPoints( const Mat\& objectPoints, const Mat\& rvec, const Mat\& tvec, const Mat\& cameraMatrix, const Mat\& distCoeffs, vector<Point2f>\& imagePoints, Mat\& dpdrot, Mat\& dpdt, Mat\& dpdf, Mat\& dpdc, Mat\& dpddist, double aspectRatio=0 )
.. c:function:: void projectPoints( const Mat& objectPoints, const Mat& rvec, const Mat& tvec, const Mat& cameraMatrix, const Mat& distCoeffs, vector<Point2f>& imagePoints )
.. c:function:: void projectPoints( const Mat& objectPoints, const Mat& rvec, const Mat& tvec, const Mat& cameraMatrix, const Mat& distCoeffs, vector<Point2f>& imagePoints, Mat& dpdrot, Mat& dpdt, Mat& dpdf, Mat& dpdc, Mat& dpddist, double aspectRatio=0 )
Project 3D points on to an image plane.
:param objectPoints: The array of object points, 3xN or Nx3 1-channel or 1xN or Nx1 3-channel (or ``vector<Point3f>`` ) , where N is the number of points in the view
:param rvec: The rotation vector, see :ref:`Rodrigues2`
:param tvec: The translation vector
:param cameraMatrix: The camera matrix :math:`A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}`
:param distCoeffs: The input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5 or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
:param imagePoints: The output array of image points, 2xN or Nx2 1-channel or 1xN or Nx1 2-channel (or ``vector<Point2f>`` )
@ -783,7 +782,9 @@ cv::projectPoints
:param dpdt: Optional 2Nx3 matrix of derivatives of image points with respect to components of the translation vector
:param dpdf: Optional 2Nx2 matrix of derivatives of image points with respect to :math:`f_x` and :math:`f_y`
:param dpdc: Optional 2Nx2 matrix of derivatives of image points with respect to :math:`c_x` and :math:`c_y`
:param dpddist: Optional 2Nx4 matrix of derivatives of image points with respect to distortion coefficients
The function computes projections of 3D
@ -804,7 +805,8 @@ Note, that by setting ``rvec=tvec=(0,0,0)`` , or by setting ``cameraMatrix`` to
cv::reprojectImageTo3D
----------------------
.. cfunction:: void reprojectImageTo3D( const Mat\& disparity, Mat\& _3dImage, const Mat\& Q, bool handleMissingValues=false )
.. c:function:: void reprojectImageTo3D( const Mat& disparity, Mat& _3dImage, const Mat& Q, bool handleMissingValues=false )
Reprojects disparity image to 3D space.
@ -814,6 +816,7 @@ cv::reprojectImageTo3D
Each element of ``_3dImage(x,y)`` will contain the 3D coordinates of the point ``(x,y)`` , computed from the disparity map.
:param Q: The :math:`4 \times 4` perspective transformation matrix that can be obtained with :ref:`StereoRectify`
:param handleMissingValues: If true, when the pixels with the minimal disparity (that corresponds to the outliers; see :ref:`FindStereoCorrespondenceBM` ) will be transformed to 3D points with some very large Z value (currently set to 10000)
The function transforms 1-channel disparity map to 3-channel image representing a 3D surface. That is, for each pixel ``(x,y)`` and the corresponding disparity ``d=disparity(x,y)`` it computes:
@ -831,9 +834,9 @@ The matrix ``Q`` can be arbitrary
cv::RQDecomp3x3
---------------
.. cfunction:: void RQDecomp3x3( const Mat\& M, Mat\& R, Mat\& Q )
.. c:function:: void RQDecomp3x3( const Mat& M, Mat& R, Mat& Q )
.. cfunction:: Vec3d RQDecomp3x3( const Mat\& M, Mat\& R, Mat\& Q, Mat\& Qx, Mat\& Qy, Mat\& Qz )
.. c:function:: Vec3d RQDecomp3x3( const Mat& M, Mat& R, Mat& Q, Mat& Qx, Mat& Qy, Mat& Qz )
Computes the 'RQ' decomposition of 3x3 matrices.
@ -860,9 +863,9 @@ that could be used in OpenGL.
cv::Rodrigues
-------------
.. cfunction:: void Rodrigues(const Mat\& src, Mat\& dst)
.. c:function:: void Rodrigues(const Mat& src, Mat& dst)
.. cfunction:: void Rodrigues(const Mat\& src, Mat\& dst, Mat\& jacobian)
.. c:function:: void Rodrigues(const Mat& src, Mat& dst, Mat& jacobian)
Converts a rotation matrix to a rotation vector or vice versa.
@ -894,7 +897,7 @@ used in the global 3D geometry optimization procedures like
StereoBM
--------
.. ctype:: StereoBM
.. c:type:: StereoBM
The class for computing stereo correspondence using block matching algorithm. ::
@ -920,11 +923,9 @@ The class for computing stereo correspondence using block matching algorithm. ::
Ptr<CvStereoBMState> state;
};
..
The class is a C++ wrapper for
and the associated functions. In particular, ``StereoBM::operator ()`` is the wrapper for
:ref:`FindStereoCorrespondceBM` . See the respective descriptions.
The class is a C++ wrapper for and the associated functions. In particular, ``StereoBM::operator ()`` is the wrapper for
:ref:`FindStereoCorrespondceBM`. See the respective descriptions.
.. index:: StereoSGBM
@ -932,7 +933,7 @@ and the associated functions. In particular, ``StereoBM::operator ()`` is the wr
StereoSGBM
----------
.. ctype:: StereoSGBM
.. c:type:: StereoSGBM
The class for computing stereo correspondence using semi-global block matching algorithm. ::
@ -961,7 +962,6 @@ The class for computing stereo correspondence using semi-global block matching a
...
};
..
The class implements modified H. Hirschmuller algorithm
HH08
@ -988,9 +988,9 @@ HH08
cv::StereoSGBM::StereoSGBM
--------------------------
.. cfunction:: StereoSGBM::StereoSGBM()
.. c:function:: StereoSGBM::StereoSGBM()
.. cfunction:: StereoSGBM::StereoSGBM( int minDisparity, int numDisparities, int SADWindowSize, int P1=0, int P2=0, int disp12MaxDiff=0, int preFilterCap=0, int uniquenessRatio=0, int speckleWindowSize=0, int speckleRange=0, bool fullDP=false)
.. c:function:: StereoSGBM::StereoSGBM( int minDisparity, int numDisparities, int SADWindowSize, int P1=0, int P2=0, int disp12MaxDiff=0, int preFilterCap=0, int uniquenessRatio=0, int speckleWindowSize=0, int speckleRange=0, bool fullDP=false)
StereoSGBM constructors
@ -998,9 +998,7 @@ cv::StereoSGBM::StereoSGBM
:param numDisparities: This is maximum disparity minus minimum disparity. Always greater than 0. In the current implementation this parameter must be divisible by 16.
:param SADWindowSize: The matched block size. Must be an odd number ``>=1`` . Normally, it should be somewhere in ``3..11`` range
.
:param SADWindowSize: The matched block size. Must be an odd number ``>=1`` . Normally, it should be somewhere in ``3..11`` range.
:param P1, P2: Parameters that control disparity smoothness. The larger the values, the smoother the disparity. ``P1`` is the penalty on the disparity change by plus or minus 1 between neighbor pixels. ``P2`` is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires ``P2 > P1`` . See ``stereo_match.cpp`` sample where some reasonably good ``P1`` and ``P2`` values are shown (like ``8*number_of_image_channels*SADWindowSize*SADWindowSize`` and ``32*number_of_image_channels*SADWindowSize*SADWindowSize`` , respectively).
@ -1015,13 +1013,15 @@ cv::StereoSGBM::StereoSGBM
:param speckleRange: Maximum disparity variation within each connected component. If you do speckle filtering, set it to some positive value, multiple of 16. Normally, 16 or 32 is good enough.
:param fullDP: Set it to ``true`` to run full-scale 2-pass dynamic programming algorithm. It will consume O(W*H*numDisparities) bytes, which is large for 640x480 stereo and huge for HD-size pictures. By default this is ``false``
The first constructor initializes ``StereoSGBM`` with all the default parameters (so actually one will only have to set ``StereoSGBM::numberOfDisparities`` at minimum). The second constructor allows you to set each parameter to a custom value.
.. index:: StereoSGBM::operator ()
cv::StereoSGBM::operator ()
---------------------------
.. cfunction:: void SGBM::operator()(const Mat\& left, const Mat\& right, Mat\& disp)
.. c:function:: void SGBM::operator()(const Mat& left, const Mat& right, Mat& disp)
Computes disparity using SGBM algorithm for a rectified stereo pair
@ -1037,7 +1037,7 @@ The method executes SGBM algorithm on a rectified stereo pair. See ``stereo_matc
cv::stereoCalibrate
-------------------
.. cfunction:: double stereoCalibrate( const vector<vector<Point3f> >\& objectPoints, const vector<vector<Point2f> >\& imagePoints1, const vector<vector<Point2f> >\& imagePoints2, Mat\& cameraMatrix1, Mat\& distCoeffs1, Mat\& cameraMatrix2, Mat\& distCoeffs2, Size imageSize, Mat\& R, Mat\& T, Mat\& E, Mat\& F, TermCriteria term_crit = TermCriteria(TermCriteria::COUNT+ TermCriteria::EPS, 30, 1e-6), int flags=CALIB_FIX_INTRINSIC )
.. c:function:: double stereoCalibrate( const vector<vector<Point3f> >& objectPoints, const vector<vector<Point2f> >& imagePoints1, const vector<vector<Point2f> >& imagePoints2, Mat& cameraMatrix1, Mat& distCoeffs1, Mat& cameraMatrix2, Mat& distCoeffs2, Size imageSize, Mat& R, Mat& T, Mat& E, Mat& F, TermCriteria term_crit = TermCriteria(TermCriteria::COUNT+ TermCriteria::EPS, 30, 1e-6), int flags=CALIB_FIX_INTRINSIC )
Calibrates stereo camera.
@ -1123,9 +1123,9 @@ The function returns the final value of the re-projection error.
cv::stereoRectify
-----------------
.. cfunction:: void stereoRectify( const Mat\& cameraMatrix1, const Mat\& distCoeffs1, const Mat\& cameraMatrix2, const Mat\& distCoeffs2, Size imageSize, const Mat\& R, const Mat\& T, Mat\& R1, Mat\& R2, Mat\& P1, Mat\& P2, Mat\& Q, int flags=CALIB_ZERO_DISPARITY )
.. c:function:: void stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1, const Mat& cameraMatrix2, const Mat& distCoeffs2, Size imageSize, const Mat& R, const Mat& T, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, int flags=CALIB_ZERO_DISPARITY )
.. cfunction:: void stereoRectify( const Mat\& cameraMatrix1, const Mat\& distCoeffs1, const Mat\& cameraMatrix2, const Mat\& distCoeffs2, Size imageSize, const Mat\& R, const Mat\& T, Mat\& R1, Mat\& R2, Mat\& P1, Mat\& P2, Mat\& Q, double alpha, Size newImageSize=Size(), Rect* roi1=0, Rect* roi2=0, int flags=CALIB_ZERO_DISPARITY )
.. c:function:: void stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1, const Mat& cameraMatrix2, const Mat& distCoeffs2, Size imageSize, const Mat& R, const Mat& T, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, double alpha, Size newImageSize=Size(), Rect* roi1=0, Rect* roi2=0, int flags=CALIB_ZERO_DISPARITY )
Computes rectification transforms for each head of a calibrated stereo camera.
@ -1198,7 +1198,7 @@ Below is the screenshot from ``stereo_calib.cpp`` sample. Some red horizontal li
cv::stereoRectifyUncalibrated
-----------------------------
.. cfunction:: bool stereoRectifyUncalibrated( const Mat\& points1, const Mat\& points2, const Mat\& F, Size imgSize, Mat\& H1, Mat\& H2, double threshold=5 )
.. c:function:: bool stereoRectifyUncalibrated( const Mat& points1, const Mat& points2, const Mat& F, Size imgSize, Mat& H1, Mat& H2, double threshold=5 )
Computes rectification transform for uncalibrated stereo camera.
@ -1227,14 +1227,16 @@ Note that while the algorithm does not need to know the intrinsic parameters of
cv::undistort
-------------
.. cfunction:: void undistort( const Mat\& src, Mat\& dst, const Mat\& cameraMatrix, const Mat\& distCoeffs, const Mat\& newCameraMatrix=Mat() )
.. c:function:: void undistort( const Mat& src, Mat& dst, const Mat& cameraMatrix, const Mat& distCoeffs, const Mat& newCameraMatrix=Mat() )
Transforms an image to compensate for lens distortion.
:param src: The input (distorted) image
:param dst: The output (corrected) image; will have the same size and the same type as ``src``
:param cameraMatrix: The input camera matrix :math:`A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}`
:param distCoeffs: The input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5 or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
:param newCameraMatrix: Camera matrix of the distorted image. By default it is the same as ``cameraMatrix`` , but you may additionally scale and shift the result by using some different matrix
@ -1259,9 +1261,9 @@ The camera matrix and the distortion parameters can be determined using
cv::undistortPoints
-------------------
.. cfunction:: void undistortPoints( const Mat\& src, vector<Point2f>\& dst, const Mat\& cameraMatrix, const Mat\& distCoeffs, const Mat\& R=Mat(), const Mat\& P=Mat())
.. c:function:: void undistortPoints( const Mat& src, vector<Point2f>& dst, const Mat& cameraMatrix, const Mat& distCoeffs, const Mat& R=Mat(), const Mat& P=Mat())
.. cfunction:: void undistortPoints( const Mat\& src, Mat\& dst, const Mat\& cameraMatrix, const Mat\& distCoeffs, const Mat\& R=Mat(), const Mat\& P=Mat())
.. c:function:: void undistortPoints( const Mat& src, Mat& dst, const Mat& cameraMatrix, const Mat& distCoeffs, const Mat& R=Mat(), const Mat& P=Mat())
Computes the ideal point coordinates from the observed point coordinates.
@ -1270,6 +1272,7 @@ cv::undistortPoints
:param dst: The output ideal point coordinates, after undistortion and reverse perspective transformation .
:param cameraMatrix: The camera matrix :math:`\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}`
:param distCoeffs: The input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5 or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
:param R: The rectification transformation in object space (3x3 matrix). ``R1`` or ``R2`` , computed by :func:`StereoRectify` can be passed here. If the matrix is empty, the identity transformation is used
@ -1291,7 +1294,6 @@ The function is similar to
x = X/W, y = Y/W
u' = x*fx' + cx'
v' = y*fy' + cy',
..
where undistort() is approximate iterative algorithm that estimates the normalized original point coordinates out of the normalized distorted point coordinates ("normalized" means that the coordinates do not depend on the camera matrix).

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,9 @@ Clustering
.. index:: kmeans
cv::kmeans
kmeans
----------
.. cfunction:: double kmeans( const Mat\& samples, int clusterCount, Mat\& labels, TermCriteria termcrit, int attempts, int flags, Mat* centers )
.. c:function:: double kmeans( const Mat\& samples, int clusterCount, Mat\& labels, TermCriteria termcrit, int attempts, int flags, Mat* centers )
Finds the centers of clusters and groups the input samples around the clusters.
@ -53,11 +53,11 @@ attempts to 1, initialize labels each time using some custom algorithm and pass
.. index:: partition
cv::partition
partition
-------------
.. cfunction:: template<typename _Tp, class _EqPredicate> int
.. c:function:: template<typename _Tp, class _EqPredicate> int
.. cfunction:: partition( const vector<_Tp>\& vec, vector<int>\& labels, _EqPredicate predicate=_EqPredicate())
.. c:function:: partition( const vector<_Tp>\& vec, vector<int>\& labels, _EqPredicate predicate=_EqPredicate())
Splits an element set into equivalency classes.

View File

@ -31,9 +31,9 @@ Also, note that the functions do not support alpha-transparency - when the targe
.. index:: circle
cv::circle
circle
----------
.. cfunction:: void circle(Mat\& img, Point center, int radius, const Scalar\& color, int thickness=1, int lineType=8, int shift=0)
.. c:function:: void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
Draws a circle
@ -56,11 +56,11 @@ given center and radius.
.. index:: clipLine
cv::clipLine
clipLine
------------
.. cfunction:: bool clipLine(Size imgSize, Point\& pt1, Point\& pt2)
.. c:function:: bool clipLine(Size imgSize, Point& pt1, Point& pt2)
.. cfunction:: bool clipLine(Rect imgRect, Point\& pt1, Point\& pt2)
.. c:function:: bool clipLine(Rect imgRect, Point& pt1, Point& pt2)
Clips the line against the image rectangle
@ -76,11 +76,11 @@ They return ``false`` if the line segment is completely outside the rectangle an
.. index:: ellipse
cv::ellipse
ellipse
-----------
.. cfunction:: void ellipse(Mat\& img, Point center, Size axes, double angle, double startAngle, double endAngle, const Scalar\& color, int thickness=1, int lineType=8, int shift=0)
.. c:function:: void ellipse(Mat& img, Point center, Size axes, double angle, double startAngle, double endAngle, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
.. cfunction:: void ellipse(Mat\& img, const RotatedRect\& box, const Scalar\& color, int thickness=1, int lineType=8)
.. c:function:: void ellipse(Mat& img, const RotatedRect& box, const Scalar& color, int thickness=1, int lineType=8)
Draws a simple or thick elliptic arc or an fills ellipse sector.
@ -120,9 +120,9 @@ Parameters of Elliptic Arc
.. index:: ellipse2Poly
cv::ellipse2Poly
ellipse2Poly
----------------
.. cfunction:: void ellipse2Poly( Point center, Size axes, int angle, int startAngle, int endAngle, int delta, vector<Point>\& pts )
.. c:function:: void ellipse2Poly( Point center, Size axes, int angle, int startAngle, int endAngle, int delta, vector<Point>& pts )
Approximates an elliptic arc with a polyline
@ -141,9 +141,9 @@ The function ``ellipse2Poly`` computes the vertices of a polyline that approxima
.. index:: fillConvexPoly
cv::fillConvexPoly
fillConvexPoly
------------------
.. cfunction:: void fillConvexPoly(Mat\& img, const Point* pts, int npts, const Scalar\& color, int lineType=8, int shift=0)
.. c:function:: void fillConvexPoly(Mat& img, const Point* pts, int npts, const Scalar& color, int lineType=8, int shift=0)
Fills a convex polygon.
@ -166,9 +166,9 @@ line) twice at the most (though, its top-most and/or the bottom edge could be ho
.. index:: fillPoly
cv::fillPoly
fillPoly
------------
.. cfunction:: void fillPoly(Mat\& img, const Point** pts, const int* npts, int ncontours, const Scalar\& color, int lineType=8, int shift=0, Point offset=Point() )
.. c:function:: void fillPoly(Mat& img, const Point** pts, const int* npts, int ncontours, const Scalar& color, int lineType=8, int shift=0, Point offset=Point() )
Fills the area bounded by one or more polygons
@ -192,9 +192,9 @@ areas with holes, contours with self-intersections (some of thier parts), and so
.. index:: getTextSize
cv::getTextSize
getTextSize
---------------
.. cfunction:: Size getTextSize(const string\& text, int fontFace, double fontScale, int thickness, int* baseLine)
.. c:function:: Size getTextSize(const string& text, int fontFace, double fontScale, int thickness, int* baseLine)
Calculates the width and height of a text string.
@ -234,13 +234,12 @@ That is, the following code will render some text, the tight box surrounding it
// then put the text itself
putText(img, text, textOrg, fontFace, fontScale,
Scalar::all(255), thickness, 8);
..
.. index:: line
cv::line
line
--------
.. cfunction:: void line(Mat\& img, Point pt1, Point pt2, const Scalar\& color, int thickness=1, int lineType=8, int shift=0)
.. c:function:: void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
Draws a line segment connecting two points
@ -277,7 +276,7 @@ the line color, the user may use the macro ``CV_RGB(r, g, b)`` .
LineIterator
------------
.. ctype:: LineIterator
.. c:type:: LineIterator
Class for iterating pixels on a raster line ::
@ -304,7 +303,6 @@ Class for iterating pixels on a raster line ::
int minusDelta, plusDelta;
int minusStep, plusStep;
};
..
The class ``LineIterator`` is used to get each pixel of a raster line. It can be treated as versatile implementation of the Bresenham algorithm, where you can stop at each pixel and do some extra processing, for example, grab pixel values along the line, or draw a line with some effect (e.g. with XOR operation).
@ -317,13 +315,12 @@ The number of pixels along the line is store in ``LineIterator::count`` . ::
for(int i = 0; i < it.count; i++, ++it)
buf[i] = *(const Vec3b)*it;
..
.. index:: rectangle
cv::rectangle
rectangle
-------------
.. cfunction:: void rectangle(Mat\& img, Point pt1, Point pt2, const Scalar\& color, int thickness=1, int lineType=8, int shift=0)
.. c:function:: void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
Draws a simple, thick, or filled up-right rectangle.
@ -345,9 +342,9 @@ The function ``rectangle`` draws a rectangle outline or a filled rectangle, whic
.. index:: polylines
cv::polylines
polylines
-------------
.. cfunction:: void polylines(Mat\& img, const Point** pts, const int* npts, int ncontours, bool isClosed, const Scalar\& color, int thickness=1, int lineType=8, int shift=0 )
.. c:function:: void polylines(Mat& img, const Point** pts, const int* npts, int ncontours, bool isClosed, const Scalar& color, int thickness=1, int lineType=8, int shift=0 )
Draws several polygonal curves
@ -373,9 +370,9 @@ The function ``polylines`` draws one or more polygonal curves.
.. index:: putText
cv::putText
putText
-----------
.. cfunction:: void putText( Mat\& img, const string\& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
.. c:function:: void putText( Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
Draws a text string

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,9 @@ Utility and System Functions and Macros
.. index:: alignPtr
cv::alignPtr
alignPtr
------------
.. cfunction:: template<typename _Tp> _Tp* alignPtr(_Tp* ptr, int n=sizeof(_Tp))
.. c:function:: template<typename _Tp> _Tp* alignPtr(_Tp* ptr, int n=sizeof(_Tp))
Aligns pointer to the specified number of bytes
@ -23,9 +23,9 @@ The function returns the aligned pointer of the same type as the input pointer:
.. index:: alignSize
cv::alignSize
alignSize
-------------
.. cfunction:: size_t alignSize(size_t sz, int n)
.. c:function:: size_t alignSize(size_t sz, int n)
Aligns a buffer size to the specified number of bytes
@ -41,9 +41,9 @@ The function returns the minimum number that is greater or equal to ``sz`` and i
.. index:: allocate
cv::allocate
allocate
------------
.. cfunction:: template<typename _Tp> _Tp* allocate(size_t n)
.. c:function:: template<typename _Tp> _Tp* allocate(size_t n)
Allocates an array of elements
@ -53,9 +53,9 @@ The generic function ``allocate`` allocates buffer for the specified number of e
.. index:: deallocate
cv::deallocate
deallocate
--------------
.. cfunction:: template<typename _Tp> void deallocate(_Tp* ptr, size_t n)
.. c:function:: template<typename _Tp> void deallocate(_Tp* ptr, size_t n)
Allocates an array of elements
@ -73,7 +73,7 @@ The generic function ``deallocate`` deallocates the buffer allocated with
CV_Assert
---------
.. cfunction:: CV_Assert(expr)
.. c:function:: CV_Assert(expr)
Checks a condition at runtime. ::
@ -88,13 +88,13 @@ The macros ``CV_Assert`` and ``CV_DbgAssert`` evaluate the specified expression
.. index:: error
cv::error
error
---------
.. cfunction:: void error( const Exception\& exc )
.. c:function:: void error( const Exception\& exc )
.. cfunction:: \#define CV_Error( code, msg ) <...>
.. c:function:: \#define CV_Error( code, msg ) <...>
.. cfunction:: \#define CV_Error_( code, args ) <...>
.. c:function:: \#define CV_Error_( code, args ) <...>
Signals an error and raises the exception
@ -120,7 +120,7 @@ The macro ``CV_Error_`` can be used to construct the error message on-fly to inc
Exception
---------
.. ctype:: Exception
.. c:type:: Exception
The exception class passed to error ::
@ -152,9 +152,9 @@ The class ``Exception`` encapsulates all or almost all the necessary information
.. index:: fastMalloc
cv::fastMalloc
fastMalloc
--------------
.. cfunction:: void* fastMalloc(size_t size)
.. c:function:: void* fastMalloc(size_t size)
Allocates aligned memory buffer
@ -164,9 +164,9 @@ The function allocates buffer of the specified size and returns it. When the buf
.. index:: fastFree
cv::fastFree
fastFree
------------
.. cfunction:: void fastFree(void* ptr)
.. c:function:: void fastFree(void* ptr)
Deallocates memory buffer
@ -178,9 +178,9 @@ If NULL pointer is passed, the function does nothing.
.. index:: format
cv::format
format
----------
.. cfunction:: string format( const char* fmt, ... )
.. c:function:: string format( const char* fmt, ... )
Returns a text string formatted using printf-like expression
@ -191,9 +191,9 @@ The function acts like ``sprintf`` , but forms and returns STL string. It can be
.. index:: getNumThreads
cv::getNumThreads
getNumThreads
-----------------
.. cfunction:: int getNumThreads()
.. c:function:: int getNumThreads()
Returns the number of threads used by OpenCV
@ -204,9 +204,9 @@ See also:
.. index:: getThreadNum
cv::getThreadNum
getThreadNum
----------------
.. cfunction:: int getThreadNum()
.. c:function:: int getThreadNum()
Returns index of the currently executed thread
@ -217,9 +217,9 @@ See also:
.. index:: getTickCount
cv::getTickCount
getTickCount
----------------
.. cfunction:: int64 getTickCount()
.. c:function:: int64 getTickCount()
Returns the number of ticks
@ -229,9 +229,9 @@ It can be used to initialize
.. index:: getTickFrequency
cv::getTickFrequency
getTickFrequency
--------------------
.. cfunction:: double getTickFrequency()
.. c:function:: double getTickFrequency()
Returns the number of ticks per second
@ -245,9 +245,9 @@ That is, the following code computes the execution time in seconds. ::
.. index:: setNumThreads
cv::setNumThreads
setNumThreads
-----------------
.. cfunction:: void setNumThreads(int nthreads)
.. c:function:: void setNumThreads(int nthreads)
Sets the number of threads used by OpenCV

View File

@ -9,7 +9,7 @@ XML/YAML Persistence
FileStorage
-----------
.. ctype:: FileStorage
.. c:type:: FileStorage
The XML/YAML file storage class ::
@ -73,7 +73,7 @@ The XML/YAML file storage class ::
FileNode
--------
.. ctype:: FileNode
.. c:type:: FileNode
The XML/YAML file node class ::
@ -124,7 +124,7 @@ The XML/YAML file node class ::
FileNodeIterator
----------------
.. ctype:: FileNodeIterator
.. c:type:: FileNodeIterator
The XML/YAML file node iterator class ::

View File

@ -15,7 +15,7 @@ descriptor extractors inherit
DescriptorExtractor
-------------------
.. ctype:: DescriptorExtractor
.. c:type:: DescriptorExtractor
Abstract base class for computing descriptors for image keypoints. ::
@ -51,9 +51,9 @@ descriptors as a
.. index:: DescriptorExtractor::compute
cv::DescriptorExtractor::compute
DescriptorExtractor::compute
--------------------------------
.. cfunction:: void DescriptorExtractor::compute( const Mat\& image, vector<KeyPoint>\& keypoints, Mat\& descriptors ) const
.. c:function:: void DescriptorExtractor::compute( const Mat\& image, vector<KeyPoint>\& keypoints, Mat\& descriptors ) const
Compute the descriptors for a set of keypoints detected in an image (first variant)
or image set (second variant).
@ -64,7 +64,7 @@ or image set (second variant).
:param descriptors: The descriptors. Row i is the descriptor for keypoint i.
.. cfunction:: void DescriptorExtractor::compute( const vector<Mat>\& images, vector<vector<KeyPoint> >\& keypoints, vector<Mat>\& descriptors ) const
.. c:function:: void DescriptorExtractor::compute( const vector<Mat>\& images, vector<vector<KeyPoint> >\& keypoints, vector<Mat>\& descriptors ) const
* **images** The image set.
@ -77,9 +77,9 @@ or image set (second variant).
.. index:: DescriptorExtractor::read
cv::DescriptorExtractor::read
DescriptorExtractor::read
-----------------------------
.. cfunction:: void DescriptorExtractor::read( const FileNode\& fn )
.. c:function:: void DescriptorExtractor::read( const FileNode\& fn )
Read descriptor extractor object from file node.
@ -87,9 +87,9 @@ cv::DescriptorExtractor::read
.. index:: DescriptorExtractor::write
cv::DescriptorExtractor::write
DescriptorExtractor::write
------------------------------
.. cfunction:: void DescriptorExtractor::write( FileStorage\& fs ) const
.. c:function:: void DescriptorExtractor::write( FileStorage\& fs ) const
Write descriptor extractor object to file storage.
@ -97,10 +97,10 @@ cv::DescriptorExtractor::write
.. index:: DescriptorExtractor::create
cv::DescriptorExtractor::create
DescriptorExtractor::create
-------------------------------
:func:`DescriptorExtractor`
.. cfunction:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const string\& descriptorExtractorType )
.. c:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const string\& descriptorExtractorType )
Descriptor extractor factory that creates of given type with
default parameters (rather using default constructor).
@ -123,7 +123,7 @@ e.g. ``"OpponentSIFT"`` , etc.
SiftDescriptorExtractor
-----------------------
.. ctype:: SiftDescriptorExtractor
.. c:type:: SiftDescriptorExtractor
Wrapping class for descriptors computing using
:func:`SIFT` class. ::
@ -155,7 +155,7 @@ Wrapping class for descriptors computing using
SurfDescriptorExtractor
-----------------------
.. ctype:: SurfDescriptorExtractor
.. c:type:: SurfDescriptorExtractor
Wrapping class for descriptors computing using
:func:`SURF` class. ::
@ -181,7 +181,7 @@ Wrapping class for descriptors computing using
CalonderDescriptorExtractor
---------------------------
.. ctype:: CalonderDescriptorExtractor
.. c:type:: CalonderDescriptorExtractor
Wrapping class for descriptors computing using
:func:`RTreeClassifier` class. ::
@ -207,7 +207,7 @@ Wrapping class for descriptors computing using
OpponentColorDescriptorExtractor
--------------------------------
.. ctype:: OpponentColorDescriptorExtractor
.. c:type:: OpponentColorDescriptorExtractor
Adapts a descriptor extractor to compute descripors in Opponent Color Space
(refer to van de Sande et al., CGIV 2008 "Color Descriptors for Object Category Recognition").
@ -235,7 +235,7 @@ them into a single color descriptor. ::
BriefDescriptorExtractor
------------------------
.. ctype:: BriefDescriptorExtractor
.. c:type:: BriefDescriptorExtractor
Class for computing BRIEF descriptors described in paper of Calonder M., Lepetit V.,
Strecha C., Fua P.: ''BRIEF: Binary Robust Independent Elementary Features.''

View File

@ -15,7 +15,7 @@ descriptor matchers inherit
DMatch
------
.. ctype:: DMatch
.. c:type:: DMatch
Match between two keypoint descriptors: query descriptor index,
train descriptor index, train image index and distance between descriptors. ::
@ -48,7 +48,7 @@ train descriptor index, train image index and distance between descriptors. ::
DescriptorMatcher
-----------------
.. ctype:: DescriptorMatcher
.. c:type:: DescriptorMatcher
Abstract base class for matching keypoint descriptors. It has two groups
of match methods: for matching descriptors of one image with other image or
@ -106,9 +106,9 @@ with image set. ::
.. index:: DescriptorMatcher::add
cv::DescriptorMatcher::add
DescriptorMatcher::add
-------------------------- ````
.. cfunction:: void add( const vector<Mat>\& descriptors )
.. c:function:: void add( const vector<Mat>\& descriptors )
Add descriptors to train descriptor collection. If collection trainDescCollectionis not empty
the new descriptors are added to existing train descriptors.
@ -118,41 +118,41 @@ the new descriptors are added to existing train descriptors.
.. index:: DescriptorMatcher::getTrainDescriptors
cv::DescriptorMatcher::getTrainDescriptors
DescriptorMatcher::getTrainDescriptors
------------------------------------------ ````
.. cfunction:: const vector<Mat>\& getTrainDescriptors() const
.. c:function:: const vector<Mat>\& getTrainDescriptors() const
Returns constant link to the train descriptor collection (i.e. trainDescCollection).
.. index:: DescriptorMatcher::clear
cv::DescriptorMatcher::clear
DescriptorMatcher::clear
----------------------------
.. cfunction:: void DescriptorMatcher::clear()
.. c:function:: void DescriptorMatcher::clear()
Clear train descriptor collection.
.. index:: DescriptorMatcher::empty
cv::DescriptorMatcher::empty
DescriptorMatcher::empty
----------------------------
.. cfunction:: bool DescriptorMatcher::empty() const
.. c:function:: bool DescriptorMatcher::empty() const
Return true if there are not train descriptors in collection.
.. index:: DescriptorMatcher::isMaskSupported
cv::DescriptorMatcher::isMaskSupported
DescriptorMatcher::isMaskSupported
--------------------------------------
.. cfunction:: bool DescriptorMatcher::isMaskSupported()
.. c:function:: bool DescriptorMatcher::isMaskSupported()
Returns true if descriptor matcher supports masking permissible matches.
.. index:: DescriptorMatcher::train
cv::DescriptorMatcher::train
DescriptorMatcher::train
----------------------------
.. cfunction:: void DescriptorMatcher::train()
.. c:function:: void DescriptorMatcher::train()
Train descriptor matcher (e.g. train flann index). In all methods to match the method train()
is run every time before matching. Some descriptor matchers (e.g. BruteForceMatcher) have empty
@ -161,9 +161,9 @@ trains flann::Index)
.. index:: DescriptorMatcher::match
cv::DescriptorMatcher::match
DescriptorMatcher::match
---------------------------- ```` ```` ```` ````
.. cfunction:: void DescriptorMatcher::match( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const
.. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const
Find the best match for each descriptor from a query set with train descriptors.
Supposed that the query descriptors are of keypoints detected on the same query image.
@ -172,7 +172,7 @@ supposed that they are of keypoints detected on the same train image. In second
of the method train descriptors collection that was set using addmethod is used.
Optional mask (or masks) can be set to describe which descriptors can be matched. queryDescriptors[i]can be matched with trainDescriptors[j]only if mask.at<uchar>(i,j)is non-zero.
.. cfunction:: void DescriptorMatcher::match( const Mat\& queryDescriptors, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() )
.. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() )
:param queryDescriptors: Query set of descriptors.
@ -189,16 +189,16 @@ Optional mask (or masks) can be set to describe which descriptors can be matched
.. index:: DescriptorMatcher::knnMatch
cv::DescriptorMatcher::knnMatch
DescriptorMatcher::knnMatch
-------------------------------
:func:`DescriptorMatcher::match`
.. cfunction:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<vector<DMatch> >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const
.. c:function:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<vector<DMatch> >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const
Find the k best matches for each descriptor from a query set with train descriptors.
Found k (or less if not possible) matches are returned in distance increasing order.
Details about query and train descriptors see in .
.. cfunction:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, vector<vector<DMatch> >\& matches, int k, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
.. c:function:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, vector<vector<DMatch> >\& matches, int k, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
:param queryDescriptors, trainDescriptors, mask, masks: See in :func:`DescriptorMatcher::match` .
@ -210,16 +210,16 @@ Details about query and train descriptors see in .
.. index:: DescriptorMatcher::radiusMatch
cv::DescriptorMatcher::radiusMatch
DescriptorMatcher::radiusMatch
----------------------------------
:func:`DescriptorMatcher::match`
.. cfunction:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<vector<DMatch> >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const
.. c:function:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<vector<DMatch> >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const
Find the best matches for each query descriptor which have distance less than given threshold.
Found matches are returned in distance increasing order. Details about query and train
descriptors see in .
.. cfunction:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, vector<vector<DMatch> >\& matches, float maxDistance, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
.. c:function:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, vector<vector<DMatch> >\& matches, float maxDistance, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
:param queryDescriptors, trainDescriptors, mask, masks: See in :func:`DescriptorMatcher::match` .
@ -229,9 +229,9 @@ descriptors see in .
.. index:: DescriptorMatcher::clone
cv::DescriptorMatcher::clone
DescriptorMatcher::clone
----------------------------
.. cfunction:: Ptr<DescriptorMatcher> \\DescriptorMatcher::clone( bool emptyTrainData ) const
.. c:function:: Ptr<DescriptorMatcher> \\DescriptorMatcher::clone( bool emptyTrainData ) const
Clone the matcher.
@ -241,10 +241,10 @@ cv::DescriptorMatcher::clone
.. index:: DescriptorMatcher::create
cv::DescriptorMatcher::create
DescriptorMatcher::create
-----------------------------
:func:`DescriptorMatcher`
.. cfunction:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const string\& descriptorMatcherType )
.. c:function:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const string\& descriptorMatcherType )
Descriptor matcher factory that creates of
given type with default parameters (rather using default constructor).
@ -259,7 +259,7 @@ Now the following matcher types are supported: ``"BruteForce"`` (it uses ``L2``
BruteForceMatcher
-----------------
.. ctype:: BruteForceMatcher
.. c:type:: BruteForceMatcher
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest
descriptor in the second set by trying each one. This descriptor matcher supports masking
@ -348,7 +348,7 @@ For float descriptors, a common choice would be ``L2<float>`` . Class of support
FlannBasedMatcher
-----------------
.. ctype:: FlannBasedMatcher
.. c:type:: FlannBasedMatcher
Flann based descriptor matcher. This matcher trains
:func:`flann::Index` on

View File

@ -14,7 +14,7 @@ inherit
KeyPoint
--------
.. ctype:: KeyPoint
.. c:type:: KeyPoint
Data structure for salient point detectors. ::
@ -73,7 +73,7 @@ Data structure for salient point detectors. ::
FeatureDetector
---------------
.. ctype:: FeatureDetector
.. c:type:: FeatureDetector
Abstract base class for 2D image feature detectors. ::
@ -101,9 +101,9 @@ Abstract base class for 2D image feature detectors. ::
.. index:: FeatureDetector::detect
cv::FeatureDetector::detect
FeatureDetector::detect
---------------------------
.. cfunction:: void FeatureDetector::detect( const Mat\& image, vector<KeyPoint>\& keypoints, const Mat\& mask=Mat() ) const
.. c:function:: void FeatureDetector::detect( const Mat\& image, vector<KeyPoint>\& keypoints, const Mat\& mask=Mat() ) const
Detect keypoints in an image (first variant) or image set (second variant).
@ -114,7 +114,7 @@ cv::FeatureDetector::detect
:param mask: Mask specifying where to look for keypoints (optional). Must be a char matrix
with non-zero values in the region of interest.
.. cfunction:: void FeatureDetector::detect( const vector<Mat>\& images, vector<vector<KeyPoint> >\& keypoints, const vector<Mat>\& masks=vector<Mat>() ) const
.. c:function:: void FeatureDetector::detect( const vector<Mat>\& images, vector<vector<KeyPoint> >\& keypoints, const vector<Mat>\& masks=vector<Mat>() ) const
* **images** Images set.
@ -125,9 +125,9 @@ cv::FeatureDetector::detect
.. index:: FeatureDetector::read
cv::FeatureDetector::read
FeatureDetector::read
-------------------------
.. cfunction:: void FeatureDetector::read( const FileNode\& fn )
.. c:function:: void FeatureDetector::read( const FileNode\& fn )
Read feature detector object from file node.
@ -135,9 +135,9 @@ cv::FeatureDetector::read
.. index:: FeatureDetector::write
cv::FeatureDetector::write
FeatureDetector::write
--------------------------
.. cfunction:: void FeatureDetector::write( FileStorage\& fs ) const
.. c:function:: void FeatureDetector::write( FileStorage\& fs ) const
Write feature detector object to file storage.
@ -145,10 +145,10 @@ cv::FeatureDetector::write
.. index:: FeatureDetector::create
cv::FeatureDetector::create
FeatureDetector::create
---------------------------
:func:`FeatureDetector`
.. cfunction:: Ptr<FeatureDetector> FeatureDetector::create( const string\& detectorType )
.. c:function:: Ptr<FeatureDetector> FeatureDetector::create( const string\& detectorType )
Feature detector factory that creates of given type with
default parameters (rather using default constructor).
@ -176,7 +176,7 @@ e.g. ``"GridFAST"``,``"PyramidSTAR"`` , etc.
FastFeatureDetector
-------------------
.. ctype:: FastFeatureDetector
.. c:type:: FastFeatureDetector
Wrapping class for feature detection using
:func:`FAST` method. ::
@ -198,7 +198,7 @@ Wrapping class for feature detection using
GoodFeaturesToTrackDetector
---------------------------
.. ctype:: GoodFeaturesToTrackDetector
.. c:type:: GoodFeaturesToTrackDetector
Wrapping class for feature detection using
:func:`goodFeaturesToTrack` function. ::
@ -241,7 +241,7 @@ Wrapping class for feature detection using
MserFeatureDetector
-------------------
.. ctype:: MserFeatureDetector
.. c:type:: MserFeatureDetector
Wrapping class for feature detection using
:func:`MSER` class. ::
@ -267,7 +267,7 @@ Wrapping class for feature detection using
StarFeatureDetector
-------------------
.. ctype:: StarFeatureDetector
.. c:type:: StarFeatureDetector
Wrapping class for feature detection using
:func:`StarDetector` class. ::
@ -291,7 +291,7 @@ Wrapping class for feature detection using
SiftFeatureDetector
-------------------
.. ctype:: SiftFeatureDetector
.. c:type:: SiftFeatureDetector
Wrapping class for feature detection using
:func:`SIFT` class. ::
@ -320,7 +320,7 @@ Wrapping class for feature detection using
SurfFeatureDetector
-------------------
.. ctype:: SurfFeatureDetector
.. c:type:: SurfFeatureDetector
Wrapping class for feature detection using
:func:`SURF` class. ::
@ -343,7 +343,7 @@ Wrapping class for feature detection using
GridAdaptedFeatureDetector
--------------------------
.. ctype:: GridAdaptedFeatureDetector
.. c:type:: GridAdaptedFeatureDetector
Adapts a detector to partition the source image into a grid and detect
points in each cell. ::
@ -374,7 +374,7 @@ points in each cell. ::
PyramidAdaptedFeatureDetector
-----------------------------
.. ctype:: PyramidAdaptedFeatureDetector
.. c:type:: PyramidAdaptedFeatureDetector
Adapts a detector to detect points over multiple levels of a Gaussian
pyramid. Useful for detectors that are not inherently scaled. ::
@ -397,7 +397,7 @@ pyramid. Useful for detectors that are not inherently scaled. ::
DynamicAdaptedFeatureDetector
-----------------------------
.. ctype:: DynamicAdaptedFeatureDetector
.. c:type:: DynamicAdaptedFeatureDetector
An adaptively adjusting detector that iteratively detects until the desired number
of features are found.
@ -442,9 +442,9 @@ Here is a sample of how to create a DynamicAdaptedFeatureDetector. ::
.. index:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector
cv::DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector
DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector
----------------------------------------------------------------
.. cfunction:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>\& adjaster, int min_features, int max_features, int max_iters )
.. c:function:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>\& adjaster, int min_features, int max_features, int max_iters )
DynamicAdaptedFeatureDetector constructor.
@ -464,7 +464,7 @@ cv::DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector
AdjusterAdapter
---------------
.. ctype:: AdjusterAdapter
.. c:type:: AdjusterAdapter
A feature detector parameter adjuster interface, this is used by the
:func:`DynamicAdaptedFeatureDetector` and is a wrapper for
@ -485,9 +485,9 @@ See
.. index:: AdjusterAdapter::tooFew
cv::AdjusterAdapter::tooFew
AdjusterAdapter::tooFew
---------------------------
.. cfunction:: virtual void tooFew(int min, int n_detected) = 0
.. c:function:: virtual void tooFew(int min, int n_detected) = 0
Too few features were detected so, adjust the detector parameters accordingly - so that the next
detection detects more features.
@ -506,9 +506,9 @@ An example implementation of this is ::
.. index:: AdjusterAdapter::tooMany
cv::AdjusterAdapter::tooMany
AdjusterAdapter::tooMany
----------------------------
.. cfunction:: virtual void tooMany(int max, int n_detected) = 0
.. c:function:: virtual void tooMany(int max, int n_detected) = 0
Too many features were detected so, adjust the detector parameters accordingly - so that the next
detection detects less features.
@ -527,9 +527,9 @@ An example implementation of this is ::
.. index:: AdjusterAdapter::good
cv::AdjusterAdapter::good
AdjusterAdapter::good
-------------------------
.. cfunction:: virtual bool good() const = 0
.. c:function:: virtual bool good() const = 0
Are params maxed out or still valid? Returns false if the parameters can't be adjusted any more.
@ -547,7 +547,7 @@ An example implementation of this is ::
FastAdjuster
------------
.. ctype:: FastAdjuster
.. c:type:: FastAdjuster
An
:func:`AdjusterAdapter` for the
@ -568,7 +568,7 @@ threshhold by 1 ::
StarAdjuster
------------
.. ctype:: StarAdjuster
.. c:type:: StarAdjuster
An
:func:`AdjusterAdapter` for the
@ -588,7 +588,7 @@ StarFeatureDetector. ::
SurfAdjuster
------------
.. ctype:: SurfAdjuster
.. c:type:: SurfAdjuster
An
:func:`AdjusterAdapter` for the

View File

@ -18,7 +18,7 @@ There are descriptors such as One way descriptor and Ferns that have ``GenericDe
GenericDescriptorMatcher
------------------------
.. ctype:: GenericDescriptorMatcher
.. c:type:: GenericDescriptorMatcher
Abstract interface for a keypoint descriptor extracting and matching.
There is
@ -92,9 +92,9 @@ with image set. ::
.. index:: GenericDescriptorMatcher::add
cv::GenericDescriptorMatcher::add
GenericDescriptorMatcher::add
---------------------------------
.. cfunction:: void GenericDescriptorMatcher::add( const vector<Mat>\& images, vector<vector<KeyPoint> >\& keypoints )
.. c:function:: void GenericDescriptorMatcher::add( const vector<Mat>\& images, vector<vector<KeyPoint> >\& keypoints )
Adds images and keypoints from them to the train collection (descriptors are supposed to be calculated here).
If train collection is not empty new image and keypoints from them will be added to
@ -107,56 +107,56 @@ existing data.
.. index:: GenericDescriptorMatcher::getTrainImages
cv::GenericDescriptorMatcher::getTrainImages
GenericDescriptorMatcher::getTrainImages
--------------------------------------------
.. cfunction:: const vector<Mat>\& GenericDescriptorMatcher::getTrainImages() const
.. c:function:: const vector<Mat>\& GenericDescriptorMatcher::getTrainImages() const
Returns train image collection.
.. index:: GenericDescriptorMatcher::getTrainKeypoints
cv::GenericDescriptorMatcher::getTrainKeypoints
GenericDescriptorMatcher::getTrainKeypoints
-----------------------------------------------
.. cfunction:: const vector<vector<KeyPoint> >\& GenericDescriptorMatcher::getTrainKeypoints() const
.. c:function:: const vector<vector<KeyPoint> >\& GenericDescriptorMatcher::getTrainKeypoints() const
Returns train keypoints collection.
.. index:: GenericDescriptorMatcher::clear
cv::GenericDescriptorMatcher::clear
GenericDescriptorMatcher::clear
-----------------------------------
.. cfunction:: void GenericDescriptorMatcher::clear()
.. c:function:: void GenericDescriptorMatcher::clear()
Clear train collection (iamges and keypoints).
.. index:: GenericDescriptorMatcher::train
cv::GenericDescriptorMatcher::train
GenericDescriptorMatcher::train
-----------------------------------
.. cfunction:: void GenericDescriptorMatcher::train()
.. c:function:: void GenericDescriptorMatcher::train()
Train the object, e.g. tree-based structure to extract descriptors or
to optimize descriptors matching.
.. index:: GenericDescriptorMatcher::isMaskSupported
cv::GenericDescriptorMatcher::isMaskSupported
GenericDescriptorMatcher::isMaskSupported
---------------------------------------------
.. cfunction:: void GenericDescriptorMatcher::isMaskSupported()
.. c:function:: void GenericDescriptorMatcher::isMaskSupported()
Returns true if generic descriptor matcher supports masking permissible matches.
.. index:: GenericDescriptorMatcher::classify
cv::GenericDescriptorMatcher::classify
GenericDescriptorMatcher::classify
--------------------------------------
:func:`GenericDescriptorMatcher::add`
.. cfunction:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints ) const
.. c:function:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints ) const
Classifies query keypoints under keypoints of one train image qiven as input argument
(first version of the method) or train image collection that set using (second version).
.. cfunction:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints )
.. c:function:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints )
:param queryImage: The query image.
@ -168,16 +168,16 @@ cv::GenericDescriptorMatcher::classify
.. index:: GenericDescriptorMatcher::match
cv::GenericDescriptorMatcher::match
GenericDescriptorMatcher::match
-----------------------------------
:func:`GenericDescriptorMatcher::add` :func:`DescriptorMatcher::match`
.. cfunction:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const
.. c:function:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const
Find best match for query keypoints to the training set. In first version of method
one train image and keypoints detected on it - are input arguments. In second version
query keypoints are matched to training collectin that set using . As in the mask can be set.
.. cfunction:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() )
.. c:function:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() )
:param queryImage: Query image.
@ -199,50 +199,50 @@ query keypoints are matched to training collectin that set using . As in the mas
.. index:: GenericDescriptorMatcher::knnMatch
cv::GenericDescriptorMatcher::knnMatch
GenericDescriptorMatcher::knnMatch
--------------------------------------
:func:`GenericDescriptorMatcher::match` :func:`DescriptorMatcher::knnMatch`
.. cfunction:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<vector<DMatch> >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const
.. c:function:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<vector<DMatch> >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const
Find the knn best matches for each keypoint from a query set with train keypoints.
Found knn (or less if not possible) matches are returned in distance increasing order.
Details see in and .
.. cfunction:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<vector<DMatch> >\& matches, int k, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
.. c:function:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<vector<DMatch> >\& matches, int k, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
.. index:: GenericDescriptorMatcher::radiusMatch
cv::GenericDescriptorMatcher::radiusMatch
GenericDescriptorMatcher::radiusMatch
-----------------------------------------
:func:`GenericDescriptorMatcher::match` :func:`DescriptorMatcher::radiusMatch`
.. cfunction:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<vector<DMatch> >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const
.. c:function:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<vector<DMatch> >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const
Find the best matches for each query keypoint which have distance less than given threshold.
Found matches are returned in distance increasing order. Details see in and .
.. cfunction:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<vector<DMatch> >\& matches, float maxDistance, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
.. c:function:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<vector<DMatch> >\& matches, float maxDistance, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
.. index:: GenericDescriptorMatcher::read
cv::GenericDescriptorMatcher::read
GenericDescriptorMatcher::read
----------------------------------
.. cfunction:: void GenericDescriptorMatcher::read( const FileNode\& fn )
.. c:function:: void GenericDescriptorMatcher::read( const FileNode\& fn )
Reads matcher object from a file node.
.. index:: GenericDescriptorMatcher::write
cv::GenericDescriptorMatcher::write
GenericDescriptorMatcher::write
-----------------------------------
.. cfunction:: void GenericDescriptorMatcher::write( FileStorage\& fs ) const
.. c:function:: void GenericDescriptorMatcher::write( FileStorage\& fs ) const
Writes match object to a file storage
.. index:: GenericDescriptorMatcher::clone
cv::GenericDescriptorMatcher::clone
GenericDescriptorMatcher::clone
-----------------------------------
.. cfunction:: Ptr<GenericDescriptorMatcher>\\GenericDescriptorMatcher::clone( bool emptyTrainData ) const
.. c:function:: Ptr<GenericDescriptorMatcher>\\GenericDescriptorMatcher::clone( bool emptyTrainData ) const
Clone the matcher.
@ -256,7 +256,7 @@ cv::GenericDescriptorMatcher::clone
OneWayDescriptorMatcher
-----------------------
.. ctype:: OneWayDescriptorMatcher
.. c:type:: OneWayDescriptorMatcher
Wrapping class for computing, matching and classification of descriptors using
:func:`OneWayDescriptorBase` class. ::
@ -317,7 +317,7 @@ Wrapping class for computing, matching and classification of descriptors using
FernDescriptorMatcher
---------------------
.. ctype:: FernDescriptorMatcher
.. c:type:: FernDescriptorMatcher
Wrapping class for computing, matching and classification of descriptors using
:func:`FernClassifier` class. ::
@ -376,7 +376,7 @@ Wrapping class for computing, matching and classification of descriptors using
VectorDescriptorMatcher
-----------------------
.. ctype:: VectorDescriptorMatcher
.. c:type:: VectorDescriptorMatcher
Class used for matching descriptors that can be described as vectors in a finite-dimensional space. ::

View File

@ -5,14 +5,14 @@ Drawing Function of Keypoints and Matches
.. index:: drawMatches
cv::drawMatches
drawMatches
---------------
.. cfunction:: void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1, const Mat\& img2, const vector<KeyPoint>\& keypoints2, const vector<DMatch>\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector<char>\& matchesMask=vector<char>(), int flags=DrawMatchesFlags::DEFAULT )
.. c:function:: void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1, const Mat\& img2, const vector<KeyPoint>\& keypoints2, const vector<DMatch>\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector<char>\& matchesMask=vector<char>(), int flags=DrawMatchesFlags::DEFAULT )
This function draws matches of keypints from two images on output image.
Match is a line connecting two keypoints (circles).
.. cfunction:: void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1, const Mat\& img2, const vector<KeyPoint>\& keypoints2, const vector<vector<DMatch> >\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector<vector<char>>\& matchesMask= vector<vector<char> >(), int flags=DrawMatchesFlags::DEFAULT )
.. c:function:: void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1, const Mat\& img2, const vector<KeyPoint>\& keypoints2, const vector<vector<DMatch> >\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector<vector<char>>\& matchesMask= vector<vector<char> >(), int flags=DrawMatchesFlags::DEFAULT )
:param img1: First source image.
@ -60,9 +60,9 @@ Match is a line connecting two keypoints (circles).
.. index:: drawKeypoints
cv::drawKeypoints
drawKeypoints
-----------------
.. cfunction:: void drawKeypoints( const Mat\& image, const vector<KeyPoint>\& keypoints, Mat\& outImg, const Scalar\& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT )
.. c:function:: void drawKeypoints( const Mat\& image, const vector<KeyPoint>\& keypoints, Mat\& outImg, const Scalar\& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT )
Draw keypoints.

View File

@ -5,9 +5,9 @@ Feature detection and description
.. index:: FAST
cv::FAST
FAST
--------
.. cfunction:: void FAST( const Mat\& image, vector<KeyPoint>\& keypoints, int threshold, bool nonmaxSupression=true )
.. c:function:: void FAST( const Mat& image, vector<KeyPoint>& keypoints, int threshold, bool nonmaxSupression=true )
Detects corners using FAST algorithm by E. Rosten (''Machine learning for high-speed corner detection'', 2006).
@ -26,7 +26,7 @@ cv::FAST
MSER
----
.. ctype:: MSER
.. c:type:: MSER
Maximally-Stable Extremal Region Extractor ::
@ -45,11 +45,9 @@ Maximally-Stable Extremal Region Extractor ::
// the optional mask marks the area where MSERs are searched for
void operator()( const Mat& image, vector<vector<Point> >& msers, const Mat& mask ) const;
};
..
The class encapsulates all the parameters of MSER (see
http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions
) extraction algorithm.
http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions) extraction algorithm.
.. index:: StarDetector
@ -57,7 +55,7 @@ http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions
StarDetector
------------
.. ctype:: StarDetector
.. c:type:: StarDetector
Implements Star keypoint detector ::
@ -86,7 +84,6 @@ Implements Star keypoint detector ::
// finds keypoints in an image
void operator()(const Mat& image, vector<KeyPoint>& keypoints) const;
};
..
The class implements a modified version of CenSurE keypoint detector described in
Agrawal08
@ -97,7 +94,7 @@ Agrawal08
SIFT
----
.. ctype:: SIFT
.. c:type:: SIFT
Class for extracting keypoints and computing descriptors using approach named Scale Invariant Feature Transform (SIFT). ::
@ -179,7 +176,7 @@ Class for extracting keypoints and computing descriptors using approach named Sc
protected:
...
};
..
.. index:: SURF
@ -187,14 +184,14 @@ Class for extracting keypoints and computing descriptors using approach named Sc
SURF
----
.. ctype:: SURF
.. c:type:: SURF
Class for extracting Speeded Up Robust Features from an image. ::
class SURF : public CvSURFParams
{
public:
// default constructor
// c:function::default constructor
SURF();
// constructor that initializes all the algorithm parameters
SURF(double _hessianThreshold, int _nOctaves=4,
@ -213,11 +210,8 @@ Class for extracting Speeded Up Robust Features from an image. ::
vector<float>& descriptors,
bool useProvidedKeypoints=false) const;
};
..
The class ``SURF`` implements Speeded Up Robust Features descriptor
Bay06
.
The class ``SURF`` implements Speeded Up Robust Features descriptor Bay06.
There is fast multi-scale Hessian keypoint detector that can be used to find the keypoints
(which is the default option), but the descriptors can be also computed for the user-specified keypoints.
The function can be used for object tracking and localization, image stitching etc. See the ``find_obj.cpp`` demo in OpenCV samples directory.
@ -228,7 +222,7 @@ The function can be used for object tracking and localization, image stitching e
RandomizedTree
--------------
.. ctype:: RandomizedTree
.. c:type:: RandomizedTree
The class contains base structure for ``RTreeClassifier`` ::
@ -241,10 +235,10 @@ The class contains base structure for ``RTreeClassifier`` ::
~RandomizedTree();
void train(std::vector<BaseKeypoint> const& base_set,
cv::RNG &rng, int depth, int views,
RNG &rng, int depth, int views,
size_t reduced_num_dim, int num_quant_bits);
void train(std::vector<BaseKeypoint> const& base_set,
cv::RNG &rng, PatchGenerator &make_patch, int depth,
RNG &rng, PatchGenerator &make_patch, int depth,
int views, size_t reduced_num_dim, int num_quant_bits);
// following two funcs are EXPERIMENTAL
@ -281,11 +275,11 @@ The class contains base structure for ``RTreeClassifier`` ::
uchar **posteriors2_; // 16-bytes aligned posteriors
std::vector<int> leaf_counts_;
void createNodes(int num_nodes, cv::RNG &rng);
void createNodes(int num_nodes, RNG &rng);
void allocPosteriorsAligned(int num_leaves, int num_classes);
void freePosteriors(int which);
// which: 1=posteriors_, 2=posteriors2_, 3=both
void init(int classes, int depth, cv::RNG &rng);
void init(int classes, int depth, RNG &rng);
void addExample(int class_id, uchar* patch_data);
void finalize(size_t reduced_num_dim, int num_quant_bits);
int getIndex(uchar* patch_data) const;
@ -297,19 +291,18 @@ The class contains base structure for ``RTreeClassifier`` ::
void compressLeaves(size_t reduced_num_dim);
void estimateQuantPercForPosteriors(float perc[2]);
};
..
.. index:: RandomizedTree::train
cv::RandomizedTree::train
RandomizedTree::train
-------------------------
.. cfunction:: void train(std::vector<BaseKeypoint> const\& base_set, cv::RNG \&rng, PatchGenerator \&make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
.. c:function:: void train(std::vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
Trains a randomized tree using input set of keypoints
.. cfunction:: void train(std::vector<BaseKeypoint> const\& base_set, cv::RNG \&rng, PatchGenerator \&make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
.. c:function:: void train(std::vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
{Vector of ``BaseKeypoint`` type. Contains keypoints from the image are used for training}
{Vector of ``BaseKeypoint`` type. Contains keypoints from the image are used for training}
{Random numbers generator is used for training}
{Patch generator is used for training}
{Maximum tree depth}
@ -319,13 +312,13 @@ cv::RandomizedTree::train
.. index:: RandomizedTree::read
cv::RandomizedTree::read
RandomizedTree::read
------------------------
.. cfunction:: read(const char* file_name, int num_quant_bits)
.. c:function:: read(const char* file_name, int num_quant_bits)
Reads pre-saved randomized tree from file or stream
.. cfunction:: read(std::istream \&is, int num_quant_bits)
.. c:function:: read(std::istream \&is, int num_quant_bits)
:param file_name: Filename of file contains randomized tree data
@ -335,13 +328,13 @@ cv::RandomizedTree::read
.. index:: RandomizedTree::write
cv::RandomizedTree::write
RandomizedTree::write
-------------------------
.. cfunction:: void write(const char* file_name) const
.. c:function:: void write(const char* file_name) const
Writes current randomized tree to a file or stream
.. cfunction:: void write(std::ostream \&os) const
.. c:function:: void write(std::ostream \&os) const
:param file_name: Filename of file where randomized tree data will be stored
@ -349,9 +342,9 @@ cv::RandomizedTree::write
.. index:: RandomizedTree::applyQuantization
cv::RandomizedTree::applyQuantization
RandomizedTree::applyQuantization
-------------------------------------
.. cfunction:: void applyQuantization(int num_quant_bits)
.. c:function:: void applyQuantization(int num_quant_bits)
Applies quantization to the current randomized tree
@ -363,7 +356,7 @@ cv::RandomizedTree::applyQuantization
RTreeNode
---------
.. ctype:: RTreeNode
.. c:type:: RTreeNode
The class contains base structure for ``RandomizedTree`` ::
@ -384,7 +377,6 @@ The class contains base structure for ``RandomizedTree`` ::
return patch_data[offset1] > patch_data[offset2];
}
};
..
.. index:: RTreeClassifier
@ -392,7 +384,7 @@ The class contains base structure for ``RandomizedTree`` ::
RTreeClassifier
---------------
.. ctype:: RTreeClassifier
.. c:type:: RTreeClassifier
The class contains ``RTreeClassifier`` . It represents calonder descriptor which was originally introduced by Michael Calonder ::
@ -405,7 +397,7 @@ The class contains ``RTreeClassifier`` . It represents calonder descriptor which
RTreeClassifier();
void train(std::vector<BaseKeypoint> const& base_set,
cv::RNG &rng,
RNG &rng,
int num_trees = RTreeClassifier::DEFAULT_TREES,
int depth = DEFAULT_DEPTH,
int views = DEFAULT_VIEWS,
@ -413,7 +405,7 @@ The class contains ``RTreeClassifier`` . It represents calonder descriptor which
int num_quant_bits = DEFAULT_NUM_QUANT_BITS,
bool print_status = true);
void train(std::vector<BaseKeypoint> const& base_set,
cv::RNG &rng,
RNG &rng,
PatchGenerator &make_patch,
int num_trees = RTreeClassifier::DEFAULT_TREES,
int depth = DEFAULT_DEPTH,
@ -457,17 +449,16 @@ The class contains ``RTreeClassifier`` . It represents calonder descriptor which
int original_num_classes_;
bool keep_floats_;
};
..
.. index:: RTreeClassifier::train
cv::RTreeClassifier::train
RTreeClassifier::train
--------------------------
.. cfunction:: void train(std::vector<BaseKeypoint> const\& base_set, cv::RNG \&rng, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
.. c:function:: void train(vector<BaseKeypoint> const& base_set, RNG& rng, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
Trains a randomized tree classificator using input set of keypoints
.. cfunction:: void train(std::vector<BaseKeypoint> const\& base_set, cv::RNG \&rng, PatchGenerator \&make_patch, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
.. c:function:: void train(vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
{Vector of ``BaseKeypoint`` type. Contains keypoints from the image are used for training}
{Random numbers generator is used for training}
@ -481,34 +472,35 @@ cv::RTreeClassifier::train
.. index:: RTreeClassifier::getSignature
cv::RTreeClassifier::getSignature
RTreeClassifier::getSignature
---------------------------------
.. cfunction:: void getSignature(IplImage *patch, uchar *sig)
.. c:function:: void getSignature(IplImage *patch, uchar *sig)
Returns signature for image patch
.. cfunction:: void getSignature(IplImage *patch, float *sig)
.. c:function:: void getSignature(IplImage *patch, float *sig)
{Image patch to calculate signature for}
{Output signature (array dimension is ``reduced_num_dim)`` }
.. index:: RTreeClassifier::getSparseSignature
cv::RTreeClassifier::getSparseSignature
--------------------------------------- ````
.. cfunction:: void getSparseSignature(IplImage *patch, float *sig, float thresh)
RTreeClassifier::getSparseSignature
---------------------------------------
.. c:function:: void getSparseSignature(IplImage *patch, float *sig, float thresh)
The function is simular to getSignaturebut uses the threshold for removing all signature elements less than the threshold. So that the signature is compressed
{Image patch to calculate signature for}
{Output signature (array dimension is ``reduced_num_dim)`` }
{Output signature (array dimension is ``reduced_num_dim)``}
{The threshold that is used for compressing the signature}
.. index:: RTreeClassifier::countNonZeroElements
cv::RTreeClassifier::countNonZeroElements
RTreeClassifier::countNonZeroElements
-----------------------------------------
.. cfunction:: static int countNonZeroElements(float *vec, int n, double tol=1e-10)
.. c:function:: static int countNonZeroElements(float *vec, int n, double tol=1e-10)
The function returns the number of non-zero elements in the input array.
@ -520,13 +512,13 @@ cv::RTreeClassifier::countNonZeroElements
.. index:: RTreeClassifier::read
cv::RTreeClassifier::read
RTreeClassifier::read
-------------------------
.. cfunction:: read(const char* file_name)
.. c:function:: read(const char* file_name)
Reads pre-saved RTreeClassifier from file or stream
.. cfunction:: read(std::istream \&is)
.. c:function:: read(std::istream& is)
:param file_name: Filename of file contains randomized tree data
@ -534,13 +526,13 @@ cv::RTreeClassifier::read
.. index:: RTreeClassifier::write
cv::RTreeClassifier::write
RTreeClassifier::write
--------------------------
.. cfunction:: void write(const char* file_name) const
.. c:function:: void write(const char* file_name) const
Writes current RTreeClassifier to a file or stream
.. cfunction:: void write(std::ostream \&os) const
.. c:function:: void write(std::ostream \&os) const
:param file_name: Filename of file where randomized tree data will be stored
@ -548,9 +540,9 @@ cv::RTreeClassifier::write
.. index:: RTreeClassifier::setQuantization
cv::RTreeClassifier::setQuantization
RTreeClassifier::setQuantization
------------------------------------
.. cfunction:: void setQuantization(int num_quant_bits)
.. c:function:: void setQuantization(int num_quant_bits)
Applies quantization to the current randomized tree
@ -569,26 +561,26 @@ Below there is an example of ``RTreeClassifier`` usage for feature matching. The
cvExtractSURF( train_image, 0, &objectKeypoints, &objectDescriptors,
storage, params );
cv::RTreeClassifier detector;
int patch_width = cv::PATCH_SIZE;
iint patch_height = cv::PATCH_SIZE;
vector<cv::BaseKeypoint> base_set;
RTreeClassifier detector;
int patch_width = PATCH_SIZE;
iint patch_height = PATCH_SIZE;
vector<BaseKeypoint> base_set;
int i=0;
CvSURFPoint* point;
for (i=0;i<(n_points > 0 ? n_points : objectKeypoints->total);i++)
{
point=(CvSURFPoint*)cvGetSeqElem(objectKeypoints,i);
base_set.push_back(
cv::BaseKeypoint(point->pt.x,point->pt.y,train_image));
BaseKeypoint(point->pt.x,point->pt.y,train_image));
}
//Detector training
cv::RNG rng( cvGetTickCount() );
cv::PatchGenerator gen(0,255,2,false,0.7,1.3,-CV_PI/3,CV_PI/3,
RNG rng( cvGetTickCount() );
PatchGenerator gen(0,255,2,false,0.7,1.3,-CV_PI/3,CV_PI/3,
-CV_PI/3,CV_PI/3);
printf("RTree Classifier training...n");
detector.train(base_set,rng,gen,24,cv::DEFAULT_DEPTH,2000,
detector.train(base_set,rng,gen,24,DEFAULT_DEPTH,2000,
(int)base_set.size(), detector.DEFAULT_NUM_QUANT_BITS);
printf("Donen");
@ -643,5 +635,5 @@ Below there is an example of ``RTreeClassifier`` usage for feature matching. The
}
cvResetImageROI(test_image);
}
..
..

View File

@ -12,7 +12,7 @@ are described in this section.
BOWTrainer
----------
.. ctype:: BOWTrainer
.. c:type:: BOWTrainer
Abstract base class for training ''bag of visual words'' vocabulary from a set of descriptors.
See e.g. ''Visual Categorization with Bags of Keypoints'' of Gabriella Csurka, Christopher R. Dance,
@ -40,9 +40,9 @@ Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. ::
.. index:: BOWTrainer::add
cv::BOWTrainer::add
BOWTrainer::add
------------------- ````
.. cfunction:: void BOWTrainer::add( const Mat\& descriptors )
.. c:function:: void BOWTrainer::add( const Mat\& descriptors )
Add descriptors to training set. The training set will be clustered using clustermethod to construct vocabulary.
@ -50,31 +50,31 @@ cv::BOWTrainer::add
.. index:: BOWTrainer::getDescriptors
cv::BOWTrainer::getDescriptors
BOWTrainer::getDescriptors
------------------------------
.. cfunction:: const vector<Mat>\& BOWTrainer::getDescriptors() const
.. c:function:: const vector<Mat>\& BOWTrainer::getDescriptors() const
Returns training set of descriptors.
.. index:: BOWTrainer::descripotorsCount
cv::BOWTrainer::descripotorsCount
BOWTrainer::descripotorsCount
---------------------------------
.. cfunction:: const vector<Mat>\& BOWTrainer::descripotorsCount() const
.. c:function:: const vector<Mat>\& BOWTrainer::descripotorsCount() const
Returns count of all descriptors stored in the training set.
.. index:: BOWTrainer::cluster
cv::BOWTrainer::cluster
BOWTrainer::cluster
-----------------------
.. cfunction:: Mat BOWTrainer::cluster() const
.. c:function:: Mat BOWTrainer::cluster() const
Cluster train descriptors. Vocabulary consists from cluster centers. So this method
returns vocabulary. In first method variant the stored in object train descriptors will be
clustered, in second variant -- input descriptors will be clustered.
.. cfunction:: Mat BOWTrainer::cluster( const Mat\& descriptors ) const
.. c:function:: Mat BOWTrainer::cluster( const Mat\& descriptors ) const
:param descriptors: Descriptors to cluster. Each row of ``descriptors`` matrix is a one descriptor. Descriptors will not be added
to the inner train descriptor set.
@ -85,7 +85,7 @@ clustered, in second variant -- input descriptors will be clustered.
BOWKMeansTrainer
----------------
.. ctype:: BOWKMeansTrainer
.. c:type:: BOWKMeansTrainer
:func:`kmeans` based class to train visual vocabulary using the ''bag of visual words'' approach. ::
@ -115,7 +115,7 @@ arguments.
BOWImgDescriptorExtractor
-------------------------
.. ctype:: BOWImgDescriptorExtractor
.. c:type:: BOWImgDescriptorExtractor
Class to compute image descriptor using ''bad of visual words''. In few,
such computing consists from the following steps:
@ -149,9 +149,9 @@ Class to compute image descriptor using ''bad of visual words''. In few,
.. index:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
cv::BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
--------------------------------------------------------
.. cfunction:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor( const Ptr<DescriptorExtractor>\& dextractor, const Ptr<DescriptorMatcher>\& dmatcher )
.. c:function:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor( const Ptr<DescriptorExtractor>\& dextractor, const Ptr<DescriptorMatcher>\& dmatcher )
Constructor.
@ -163,9 +163,9 @@ cv::BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
.. index:: BOWImgDescriptorExtractor::setVocabulary
cv::BOWImgDescriptorExtractor::setVocabulary
BOWImgDescriptorExtractor::setVocabulary
--------------------------------------------
.. cfunction:: void BOWImgDescriptorExtractor::setVocabulary( const Mat\& vocabulary )
.. c:function:: void BOWImgDescriptorExtractor::setVocabulary( const Mat\& vocabulary )
Method to set visual vocabulary.
@ -174,17 +174,17 @@ cv::BOWImgDescriptorExtractor::setVocabulary
.. index:: BOWImgDescriptorExtractor::getVocabulary
cv::BOWImgDescriptorExtractor::getVocabulary
BOWImgDescriptorExtractor::getVocabulary
--------------------------------------------
.. cfunction:: const Mat\& BOWImgDescriptorExtractor::getVocabulary() const
.. c:function:: const Mat\& BOWImgDescriptorExtractor::getVocabulary() const
Returns set vocabulary.
.. index:: BOWImgDescriptorExtractor::compute
cv::BOWImgDescriptorExtractor::compute
BOWImgDescriptorExtractor::compute
--------------------------------------
.. cfunction:: void BOWImgDescriptorExtractor::compute( const Mat\& image, vector<KeyPoint>\& keypoints, Mat\& imgDescriptor, vector<vector<int> >* pointIdxsOfClusters=0, Mat* descriptors=0 )
.. c:function:: void BOWImgDescriptorExtractor::compute( const Mat\& image, vector<KeyPoint>\& keypoints, Mat\& imgDescriptor, vector<vector<int> >* pointIdxsOfClusters=0, Mat* descriptors=0 )
Compute image descriptor using set visual vocabulary.
@ -201,17 +201,17 @@ cv::BOWImgDescriptorExtractor::compute
.. index:: BOWImgDescriptorExtractor::descriptorSize
cv::BOWImgDescriptorExtractor::descriptorSize
BOWImgDescriptorExtractor::descriptorSize
---------------------------------------------
.. cfunction:: int BOWImgDescriptorExtractor::descriptorSize() const
.. c:function:: int BOWImgDescriptorExtractor::descriptorSize() const
Returns image discriptor size, if vocabulary was set, and 0 otherwise.
.. index:: BOWImgDescriptorExtractor::descriptorType
cv::BOWImgDescriptorExtractor::descriptorType
BOWImgDescriptorExtractor::descriptorType
---------------------------------------------
.. cfunction:: int BOWImgDescriptorExtractor::descriptorType() const
.. c:function:: int BOWImgDescriptorExtractor::descriptorType() const
Returns image descriptor type.

View File

@ -9,7 +9,7 @@ Camera Calibration and 3d Reconstruction
gpu::StereoBM_GPU
-----------------
.. ctype:: gpu::StereoBM_GPU
.. c:type:: gpu::StereoBM_GPU
The class for computing stereo correspondence using block matching algorithm. ::
@ -39,7 +39,7 @@ The class for computing stereo correspondence using block matching algorithm. ::
...
};
..
This class computes the disparity map using block matching algorithm. The class also performs pre- and post- filtering steps: sobel prefiltering (if PREFILTER_XSOBEL flag is set) and low textureness filtering (if averageTexThreshols
:math:`>` 0). If ``avergeTexThreshold = 0`` low textureness filtering is disabled, otherwise disparity is set to 0 in each point ``(x, y)`` where for left image
@ -51,9 +51,9 @@ This class computes the disparity map using block matching algorithm. The class
cv::gpu::StereoBM_GPU::StereoBM_GPU
-----------------------------------_
.. cfunction:: StereoBM_GPU::StereoBM_GPU()
.. c:function:: StereoBM_GPU::StereoBM_GPU()
.. cfunction:: StereoBM_GPU::StereoBM_GPU(int preset, int ndisparities = DEFAULT_NDISP, int winSize = DEFAULT_WINSZ)
.. c:function:: StereoBM_GPU::StereoBM_GPU(int preset, int ndisparities = DEFAULT_NDISP, int winSize = DEFAULT_WINSZ)
StereoBMGPU constructors.
@ -73,9 +73,9 @@ cv::gpu::StereoBM_GPU::StereoBM_GPU
cv::gpu::StereoBM_GPU::operator ()
----------------------------------
.. cfunction:: void StereoBM_GPU::operator() (const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
.. c:function:: void StereoBM_GPU::operator() (const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
.. cfunction:: void StereoBM_GPU::operator() (const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity, const Stream\& stream)
.. c:function:: void StereoBM_GPU::operator() (const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity, const Stream\& stream)
The stereo correspondence operator. Finds the disparity for the specified rectified stereo pair.
@ -93,7 +93,7 @@ cv::gpu::StereoBM_GPU::operator ()
cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable
-----------------------------------------------
.. cfunction:: bool StereoBM_GPU::checkIfGpuCallReasonable()
.. c:function:: bool StereoBM_GPU::checkIfGpuCallReasonable()
Some heuristics that tries to estmate if the current GPU will be faster then CPU in this algorithm. It queries current active device.
@ -103,7 +103,7 @@ cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable
gpu::StereoBeliefPropagation
----------------------------
.. ctype:: gpu::StereoBeliefPropagation
.. c:type:: gpu::StereoBeliefPropagation
The class for computing stereo correspondence using belief propagation algorithm. ::
@ -147,7 +147,7 @@ The class for computing stereo correspondence using belief propagation algorithm
...
};
..
The class implements Pedro F. Felzenszwalb algorithm
felzenszwalb_bp
@ -171,9 +171,9 @@ for data cost storage. ``width_step`` is the number of bytes in a line including
cv::gpu::StereoBeliefPropagation::StereoBeliefPropagation
---------------------------------------------------------
.. cfunction:: StereoBeliefPropagation::StereoBeliefPropagation( int ndisp = DEFAULT_NDISP, int iters = DEFAULT_ITERS, int levels = DEFAULT_LEVELS, int msg_type = CV_32F)
.. c:function:: StereoBeliefPropagation::StereoBeliefPropagation( int ndisp = DEFAULT_NDISP, int iters = DEFAULT_ITERS, int levels = DEFAULT_LEVELS, int msg_type = CV_32F)
.. cfunction:: StereoBeliefPropagation::StereoBeliefPropagation( int ndisp, int iters, int levels, float max_data_term, float data_weight, float max_disc_term, float disc_single_jump, int msg_type = CV_32F)
.. c:function:: StereoBeliefPropagation::StereoBeliefPropagation( int ndisp, int iters, int levels, float max_data_term, float data_weight, float max_disc_term, float disc_single_jump, int msg_type = CV_32F)
StereoBeliefPropagation constructors.
@ -216,7 +216,7 @@ By default ``StereoBeliefPropagation`` uses floating-point arithmetics and ``CV_
cv::gpu::StereoBeliefPropagation::estimateRecommendedParams
----------------------------------------------------------- ```` ```` ```` ```` ````
.. cfunction:: void StereoBeliefPropagation::estimateRecommendedParams( int width, int height, int\& ndisp, int\& iters, int\& levels)
.. c:function:: void StereoBeliefPropagation::estimateRecommendedParams( int width, int height, int\& ndisp, int\& iters, int\& levels)
Some heuristics that tries to compute recommended parameters (ndisp, itersand levels) for specified image size (widthand height).
@ -224,9 +224,9 @@ cv::gpu::StereoBeliefPropagation::estimateRecommendedParams
cv::gpu::StereoBeliefPropagation::operator ()
---------------------------------------------
.. cfunction:: void StereoBeliefPropagation::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
.. c:function:: void StereoBeliefPropagation::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
.. cfunction:: void StereoBeliefPropagation::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity, Stream\& stream)
.. c:function:: void StereoBeliefPropagation::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity, Stream\& stream)
The stereo correspondence operator. Finds the disparity for the specified rectified stereo pair or data cost.
@ -238,9 +238,9 @@ cv::gpu::StereoBeliefPropagation::operator ()
:param stream: Stream for the asynchronous version.
.. cfunction:: void StereoBeliefPropagation::operator()( const GpuMat\& data, GpuMat\& disparity)
.. c:function:: void StereoBeliefPropagation::operator()( const GpuMat\& data, GpuMat\& disparity)
.. cfunction:: void StereoBeliefPropagation::operator()( const GpuMat\& data, GpuMat\& disparity, Stream\& stream)
.. c:function:: void StereoBeliefPropagation::operator()( const GpuMat\& data, GpuMat\& disparity, Stream\& stream)
* **data** The user specified data cost. It must have ``msg_type`` type and :math:`\texttt{imgRows} \cdot \texttt{ndisp} \times \texttt{imgCols}` size.
@ -254,7 +254,7 @@ cv::gpu::StereoBeliefPropagation::operator ()
gpu::StereoConstantSpaceBP
--------------------------
.. ctype:: gpu::StereoConstantSpaceBP
.. c:type:: gpu::StereoConstantSpaceBP
The class for computing stereo correspondence using constant space belief propagation algorithm. ::
@ -305,7 +305,7 @@ The class for computing stereo correspondence using constant space belief propag
...
};
..
The class implements Q. Yang algorithm
qx_csbp
@ -315,9 +315,9 @@ qx_csbp
cv::gpu::StereoConstantSpaceBP::StereoConstantSpaceBP
-----------------------------------------------------
.. cfunction:: StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp = DEFAULT_NDISP, int iters = DEFAULT_ITERS, int levels = DEFAULT_LEVELS, int nr_plane = DEFAULT_NR_PLANE, int msg_type = CV_32F)
.. c:function:: StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp = DEFAULT_NDISP, int iters = DEFAULT_ITERS, int levels = DEFAULT_LEVELS, int nr_plane = DEFAULT_NR_PLANE, int msg_type = CV_32F)
.. cfunction:: StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp, int iters, int levels, int nr_plane, float max_data_term, float data_weight, float max_disc_term, float disc_single_jump, int min_disp_th = 0, int msg_type = CV_32F)
.. c:function:: StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp, int iters, int levels, int nr_plane, float max_data_term, float data_weight, float max_disc_term, float disc_single_jump, int min_disp_th = 0, int msg_type = CV_32F)
StereoConstantSpaceBP constructors.
@ -364,7 +364,7 @@ By default ``StereoConstantSpaceBP`` uses floating-point arithmetics and ``CV_32
cv::gpu::StereoConstantSpaceBP::estimateRecommendedParams
--------------------------------------------------------- ```` ```` ```` ``_`` ```` ````
.. cfunction:: void StereoConstantSpaceBP::estimateRecommendedParams( int width, int height, int\& ndisp, int\& iters, int\& levels, int\& nr_plane)
.. c:function:: void StereoConstantSpaceBP::estimateRecommendedParams( int width, int height, int\& ndisp, int\& iters, int\& levels, int\& nr_plane)
Some heuristics that tries to compute parameters (ndisp, iters, levelsand nrplane) for specified image size (widthand height).
@ -372,9 +372,9 @@ cv::gpu::StereoConstantSpaceBP::estimateRecommendedParams
cv::gpu::StereoConstantSpaceBP::operator ()
-------------------------------------------
.. cfunction:: void StereoConstantSpaceBP::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
.. c:function:: void StereoConstantSpaceBP::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
.. cfunction:: void StereoConstantSpaceBP::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity, Stream\& stream)
.. c:function:: void StereoConstantSpaceBP::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity, Stream\& stream)
The stereo correspondence operator. Finds the disparity for the specified rectified stereo pair.
@ -392,7 +392,7 @@ cv::gpu::StereoConstantSpaceBP::operator ()
gpu::DisparityBilateralFilter
-----------------------------
.. ctype:: gpu::DisparityBilateralFilter
.. c:type:: gpu::DisparityBilateralFilter
The class for disparity map refinement using joint bilateral filtering. ::
@ -417,7 +417,7 @@ The class for disparity map refinement using joint bilateral filtering. ::
...
};
..
The class implements Q. Yang algorithm
qx_csbp
@ -427,9 +427,9 @@ qx_csbp
cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter
-----------------------------------------------------------
.. cfunction:: DisparityBilateralFilter::DisparityBilateralFilter( int ndisp = DEFAULT_NDISP, int radius = DEFAULT_RADIUS, int iters = DEFAULT_ITERS)
.. c:function:: DisparityBilateralFilter::DisparityBilateralFilter( int ndisp = DEFAULT_NDISP, int radius = DEFAULT_RADIUS, int iters = DEFAULT_ITERS)
.. cfunction:: DisparityBilateralFilter::DisparityBilateralFilter( int ndisp, int radius, int iters, float edge_threshold, float max_disc_threshold, float sigma_range)
.. c:function:: DisparityBilateralFilter::DisparityBilateralFilter( int ndisp, int radius, int iters, float edge_threshold, float max_disc_threshold, float sigma_range)
DisparityBilateralFilter constructors.
@ -449,9 +449,9 @@ cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter
cv::gpu::DisparityBilateralFilter::operator ()
----------------------------------------------
.. cfunction:: void DisparityBilateralFilter::operator()( const GpuMat\& disparity, const GpuMat\& image, GpuMat\& dst)
.. c:function:: void DisparityBilateralFilter::operator()( const GpuMat\& disparity, const GpuMat\& image, GpuMat\& dst)
.. cfunction:: void DisparityBilateralFilter::operator()( const GpuMat\& disparity, const GpuMat\& image, GpuMat\& dst, Stream\& stream)
.. c:function:: void DisparityBilateralFilter::operator()( const GpuMat\& disparity, const GpuMat\& image, GpuMat\& dst, Stream\& stream)
Refines disparity map using joint bilateral filtering.
@ -467,9 +467,9 @@ cv::gpu::DisparityBilateralFilter::operator ()
cv::gpu::drawColorDisp
----------------------
.. cfunction:: void drawColorDisp(const GpuMat\& src_disp, GpuMat\& dst_disp, int ndisp)
.. c:function:: void drawColorDisp(const GpuMat\& src_disp, GpuMat\& dst_disp, int ndisp)
.. cfunction:: void drawColorDisp(const GpuMat\& src_disp, GpuMat\& dst_disp, int ndisp, const Stream\& stream)
.. c:function:: void drawColorDisp(const GpuMat\& src_disp, GpuMat\& dst_disp, int ndisp, const Stream\& stream)
Does coloring of disparity image.
@ -489,9 +489,9 @@ This function converts
cv::gpu::reprojectImageTo3D
---------------------------
.. cfunction:: void reprojectImageTo3D(const GpuMat\& disp, GpuMat\& xyzw, const Mat\& Q)
.. c:function:: void reprojectImageTo3D(const GpuMat\& disp, GpuMat\& xyzw, const Mat\& Q)
.. cfunction:: void reprojectImageTo3D(const GpuMat\& disp, GpuMat\& xyzw, const Mat\& Q, const Stream\& stream)
.. c:function:: void reprojectImageTo3D(const GpuMat\& disp, GpuMat\& xyzw, const Mat\& Q, const Stream\& stream)
Reprojects disparity image to 3D space.

View File

@ -9,7 +9,7 @@ Data Structures
gpu::DevMem2D_
--------------
.. ctype:: gpu::DevMem2D_
.. c:type:: gpu::DevMem2D_
This is a simple lightweight class that encapsulate pitched memory on GPU. It is intended to pass to nvcc-compiled code, i.e. CUDA kernels. So it is used internally by OpenCV and by users writes own device code. Its members can be called both from host and from device code. ::
@ -35,7 +35,7 @@ This is a simple lightweight class that encapsulate pitched memory on GPU. It is
__CV_GPU_HOST_DEVICE__ T* ptr(int y = 0);
__CV_GPU_HOST_DEVICE__ const T* ptr(int y = 0) const;
};
..
.. index:: gpu::PtrStep_
@ -43,7 +43,7 @@ This is a simple lightweight class that encapsulate pitched memory on GPU. It is
gpu::PtrStep_
-------------
.. ctype:: gpu::PtrStep_
.. c:type:: gpu::PtrStep_
This is structure is similar to DevMem2D_but contains only pointer and row step. Width and height fields are excluded due to performance reasons. The structure is for internal use or for users who write own device code. ::
@ -62,7 +62,7 @@ This is structure is similar to DevMem2D_but contains only pointer and row step.
__CV_GPU_HOST_DEVICE__ T* ptr(int y = 0);
__CV_GPU_HOST_DEVICE__ const T* ptr(int y = 0) const;
};
..
.. index:: gpu::PtrElemStrp_
@ -70,7 +70,7 @@ This is structure is similar to DevMem2D_but contains only pointer and row step.
gpu::PtrElemStrp_
-----------------
.. ctype:: gpu::PtrElemStrp_
.. c:type:: gpu::PtrElemStrp_
This is structure is similar to DevMem2D_but contains only pointer and row step in elements. Width and height fields are excluded due to performance reasons. This class is can only be constructed if sizeof(T) is a multiple of 256. The structure is for internal use or for users who write own device code. ::
@ -80,7 +80,7 @@ This is structure is similar to DevMem2D_but contains only pointer and row step
__CV_GPU_HOST_DEVICE__ T* ptr(int y = 0);
__CV_GPU_HOST_DEVICE__ const T* ptr(int y = 0) const;
};
..
.. index:: gpu::GpuMat
@ -88,7 +88,7 @@ This is structure is similar to DevMem2D_but contains only pointer and row step
gpu::GpuMat
-----------
.. ctype:: gpu::GpuMat
.. c:type:: gpu::GpuMat
The base storage class for GPU memory with reference counting. Its interface is almost
:func:`Mat` interface with some limitations, so using it won't be a problem. The limitations are no arbitrary dimensions support (only 2D), no functions that returns references to its data (because references on GPU are not valid for CPU), no expression templates technique support. Because of last limitation please take care with overloaded matrix operators - they cause memory allocations. The GpuMat class is convertible to
@ -129,7 +129,7 @@ In contrast with
//! download async
void download(CudaMem& m, Stream& stream) const;
};
..
**Please note:**
Is it a bad practice to leave static or global GpuMat variables allocated, i.e. to rely on its destructor. That is because destruction order of such variables and CUDA context is undefined and GPU memory release function returns error if CUDA context has been destroyed before.
@ -142,7 +142,7 @@ See also:
gpu::CudaMem
------------
.. ctype:: gpu::CudaMem
.. c:type:: gpu::CudaMem
This is a class with reference counting that wraps special memory type allocation functions from CUDA. Its interface is also
:func:`Mat` -like but with additional memory type parameter:
@ -183,16 +183,16 @@ Please note that allocation size of such memory types is usually limited. For mo
int alloc_type;
};
..
.. index:: gpu::CudaMem::createMatHeader
cv::gpu::CudaMem::createMatHeader
---------------------------------
:func:`Mat`
.. cfunction:: Mat CudaMem::createMatHeader() const
.. c:function:: Mat CudaMem::createMatHeader() const
.. cfunction:: CudaMem::operator Mat() const
.. c:function:: CudaMem::operator Mat() const
Creates header without reference counting to CudaMem data.
@ -201,9 +201,9 @@ cv::gpu::CudaMem::createMatHeader
cv::gpu::CudaMem::createGpuMatHeader
------------------------------------
:func:`gpu::GpuMat` ``_``
.. cfunction:: GpuMat CudaMem::createGpuMatHeader() const
.. c:function:: GpuMat CudaMem::createGpuMatHeader() const
.. cfunction:: CudaMem::operator GpuMat() const
.. c:function:: CudaMem::operator GpuMat() const
Maps CPU memory to GPU address space and creates header without reference counting for it. This can be done only if memory was allocated with ALLOCZEROCOPYflag and if it is supported by hardware (laptops often share video and CPU memory, so address spaces can be mapped, and that eliminates extra copy).
@ -211,7 +211,7 @@ cv::gpu::CudaMem::createGpuMatHeader
cv::gpu::CudaMem::canMapHostMemory
---------------------------------- ``_``
.. cfunction:: static bool CudaMem::canMapHostMemory()
.. c:function:: static bool CudaMem::canMapHostMemory()
Returns true if the current hardware supports address space mapping and ALLOCZEROCOPYmemory allocation
@ -221,7 +221,7 @@ cv::gpu::CudaMem::canMapHostMemory
gpu::Stream
-----------
.. ctype:: gpu::Stream
.. c:type:: gpu::Stream
This class encapsulated queue of the asynchronous calls. Some functions have overloads with additional
:func:`gpu::Stream` parameter. The overloads do initialization work (allocate output buffers, upload constants, etc.), start GPU kernel and return before results are ready. A check if all operation are complete can be performed via
@ -266,13 +266,13 @@ This class encapsulated queue of the asynchronous calls. Some functions have ove
void enqueueConvert(const GpuMat& src, GpuMat& dst, int type,
double a = 1, double b = 0);
};
..
.. index:: gpu::Stream::queryIfComplete
cv::gpu::Stream::queryIfComplete
--------------------------------
.. cfunction:: bool Stream::queryIfComplete()
.. c:function:: bool Stream::queryIfComplete()
Returns true if the current stream queue is finished, otherwise false.
@ -280,7 +280,7 @@ cv::gpu::Stream::queryIfComplete
cv::gpu::Stream::waitForCompletion
----------------------------------
.. cfunction:: void Stream::waitForCompletion()
.. c:function:: void Stream::waitForCompletion()
Blocks until all operations in the stream are complete.
@ -290,7 +290,7 @@ cv::gpu::Stream::waitForCompletion
gpu::StreamAccessor
-------------------
.. ctype:: gpu::StreamAccessor
.. c:type:: gpu::StreamAccessor
This class provides possibility to get ``cudaStream_t`` from
:func:`gpu::Stream` . This class is declared in ``stream_accessor.hpp`` because that is only public header that depend on Cuda Runtime API. Including it will bring the dependency to your code. ::
@ -299,13 +299,13 @@ This class provides possibility to get ``cudaStream_t`` from
{
CV_EXPORTS static cudaStream_t getStream(const Stream& stream);
};
..
.. index:: gpu::createContinuous
cv::gpu::createContinuous
-------------------------
.. cfunction:: void createContinuous(int rows, int cols, int type, GpuMat\& m)
.. c:function:: void createContinuous(int rows, int cols, int type, GpuMat\& m)
Creates continuous matrix in GPU memory.
@ -319,11 +319,11 @@ cv::gpu::createContinuous
Also the following wrappers are available:
.. cfunction:: GpuMat createContinuous(int rows, int cols, int type)
.. c:function:: GpuMat createContinuous(int rows, int cols, int type)
.. cfunction:: void createContinuous(Size size, int type, GpuMat\& m)
.. c:function:: void createContinuous(Size size, int type, GpuMat\& m)
.. cfunction:: GpuMat createContinuous(Size size, int type)
.. c:function:: GpuMat createContinuous(Size size, int type)
Matrix is called continuous if its elements are stored continuously, i.e. wuthout gaps in the end of each row.
@ -331,7 +331,7 @@ Matrix is called continuous if its elements are stored continuously, i.e. wuthou
cv::gpu::ensureSizeIsEnough
---------------------------
.. cfunction:: void ensureSizeIsEnough(int rows, int cols, int type, GpuMat\& m)
.. c:function:: void ensureSizeIsEnough(int rows, int cols, int type, GpuMat\& m)
Ensures that size of matrix is big enough and matrix has proper type. The function doesn't reallocate memory if the matrix has proper attributes already.
@ -345,5 +345,5 @@ cv::gpu::ensureSizeIsEnough
Also the following wrapper is available:
.. cfunction:: void ensureSizeIsEnough(Size size, int type, GpuMat\& m)
.. c:function:: void ensureSizeIsEnough(Size size, int type, GpuMat\& m)

View File

@ -9,7 +9,7 @@ Feature Detection and Description
gpu::SURF_GPU
-------------
.. ctype:: gpu::SURF_GPU
.. c:type:: gpu::SURF_GPU
Class for extracting Speeded Up Robust Features from an image. ::
@ -62,7 +62,7 @@ Class for extracting Speeded Up Robust Features from an image. ::
GpuMat maxPosBuffer;
GpuMat featuresBuffer;
};
..
The class ``SURF_GPU`` implements Speeded Up Robust Features descriptor. There is fast multi-scale Hessian keypoint detector that can be used to find the keypoints (which is the default option), but the descriptors can be also computed for the user-specified keypoints. Supports only 8 bit grayscale images.
@ -81,7 +81,7 @@ See also:
gpu::BruteForceMatcher_GPU
--------------------------
.. ctype:: gpu::BruteForceMatcher_GPU
.. c:type:: gpu::BruteForceMatcher_GPU
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches between descriptor sets. ::
@ -166,7 +166,7 @@ Brute-force descriptor matcher. For each descriptor in the first set, this match
private:
std::vector<GpuMat> trainDescCollection;
};
..
The class ``BruteForceMatcher_GPU`` has the similar interface to class
. It has two groups of match methods: for matching descriptors of one image with other image or with image set. Also all functions have alternative: save results to GPU memory or to CPU memory.
@ -180,9 +180,9 @@ See also:,.
cv::gpu::BruteForceMatcher_GPU::match
-------------------------------------
.. cfunction:: void match(const GpuMat\& queryDescs, const GpuMat\& trainDescs, std::vector<DMatch>\& matches, const GpuMat\& mask = GpuMat())
.. c:function:: void match(const GpuMat\& queryDescs, const GpuMat\& trainDescs, std::vector<DMatch>\& matches, const GpuMat\& mask = GpuMat())
.. cfunction:: void match(const GpuMat\& queryDescs, std::vector<DMatch>\& matches, const std::vector<GpuMat>\& masks = std::vector<GpuMat>())
.. c:function:: void match(const GpuMat\& queryDescs, std::vector<DMatch>\& matches, const std::vector<GpuMat>\& masks = std::vector<GpuMat>())
Finds the best match for each descriptor from a query set with train descriptors.
@ -195,7 +195,7 @@ See also:
cv::gpu::BruteForceMatcher_GPU::matchSingle
-------------------------------------------
.. cfunction:: void matchSingle(const GpuMat\& queryDescs, const GpuMat\& trainDescs, GpuMat\& trainIdx, GpuMat\& distance, const GpuMat\& mask = GpuMat())
.. c:function:: void matchSingle(const GpuMat\& queryDescs, const GpuMat\& trainDescs, GpuMat\& trainIdx, GpuMat\& distance, const GpuMat\& mask = GpuMat())
Finds the best match for each query descriptor. Results will be stored to GPU memory.
@ -212,7 +212,7 @@ cv::gpu::BruteForceMatcher_GPU::matchSingle
cv::gpu::BruteForceMatcher_GPU::matchCollection
-----------------------------------------------
.. cfunction:: void matchCollection(const GpuMat\& queryDescs, const GpuMat\& trainCollection, GpuMat\& trainIdx, GpuMat\& imgIdx, GpuMat\& distance, const GpuMat\& maskCollection)
.. c:function:: void matchCollection(const GpuMat\& queryDescs, const GpuMat\& trainCollection, GpuMat\& trainIdx, GpuMat\& imgIdx, GpuMat\& distance, const GpuMat\& maskCollection)
Find the best match for each query descriptor from train collection. Results will be stored to GPU memory.
@ -231,7 +231,7 @@ cv::gpu::BruteForceMatcher_GPU::matchCollection
cv::gpu::BruteForceMatcher_GPU::makeGpuCollection
-------------------------------------------------
.. cfunction:: void makeGpuCollection(GpuMat\& trainCollection, GpuMat\& maskCollection, const vector<GpuMat>\& masks = std::vector<GpuMat>())
.. c:function:: void makeGpuCollection(GpuMat\& trainCollection, GpuMat\& maskCollection, const vector<GpuMat>\& masks = std::vector<GpuMat>())
Makes gpu collection of train descriptors and masks in suitable format for function.
@ -241,9 +241,9 @@ cv::gpu::BruteForceMatcher_GPU::makeGpuCollection
cv::gpu::BruteForceMatcher_GPU::matchDownload
--------------------------------------------- ```` ```` ````
.. cfunction:: void matchDownload(const GpuMat\& trainIdx, const GpuMat\& distance, std::vector<DMatch>\& matches)
.. c:function:: void matchDownload(const GpuMat\& trainIdx, const GpuMat\& distance, std::vector<DMatch>\& matches)
.. cfunction:: void matchDownload(const GpuMat\& trainIdx, GpuMat\& imgIdx, const GpuMat\& distance, std::vector<DMatch>\& matches)
.. c:function:: void matchDownload(const GpuMat\& trainIdx, GpuMat\& imgIdx, const GpuMat\& distance, std::vector<DMatch>\& matches)
Downloads trainIdx, imgIdxand distancematrices obtained via or to CPU vector with .
@ -253,11 +253,11 @@ cv::gpu::BruteForceMatcher_GPU::matchDownload
cv::gpu::BruteForceMatcher_GPU::knnMatch
----------------------------------------
.. cfunction:: void knnMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, std::vector< std::vector<DMatch> >\& matches, int k, const GpuMat\& mask = GpuMat(), bool compactResult = false)
.. c:function:: void knnMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, std::vector< std::vector<DMatch> >\& matches, int k, const GpuMat\& mask = GpuMat(), bool compactResult = false)
Finds the k best matches for each descriptor from a query set with train descriptors. Found k (or less if not possible) matches are returned in distance increasing order.
.. cfunction:: void knnMatch(const GpuMat\& queryDescs, std::vector< std::vector<DMatch> >\& matches, int k, const std::vector<GpuMat>\& masks = std::vector<GpuMat>(), bool compactResult = false )
.. c:function:: void knnMatch(const GpuMat\& queryDescs, std::vector< std::vector<DMatch> >\& matches, int k, const std::vector<GpuMat>\& masks = std::vector<GpuMat>(), bool compactResult = false )
See also:
:func:`DescriptorMatcher::knnMatch` .
@ -268,7 +268,7 @@ See also:
cv::gpu::BruteForceMatcher_GPU::knnMatch
----------------------------------------
.. cfunction:: void knnMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, GpuMat\& trainIdx, GpuMat\& distance, GpuMat\& allDist, int k, const GpuMat\& mask = GpuMat())
.. c:function:: void knnMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, GpuMat\& trainIdx, GpuMat\& distance, GpuMat\& allDist, int k, const GpuMat\& mask = GpuMat())
Finds the k best matches for each descriptor from a query set with train descriptors. Found k (or less if not possible) matches are returned in distance increasing order. Results will be stored to GPU memory.
@ -291,7 +291,7 @@ cv::gpu::BruteForceMatcher_GPU::knnMatch
cv::gpu::BruteForceMatcher_GPU::knnMatchDownload
------------------------------------------------ ```` ```` ```` ````
.. cfunction:: void knnMatchDownload(const GpuMat\& trainIdx, const GpuMat\& distance, std::vector< std::vector<DMatch> >\& matches, bool compactResult = false)
.. c:function:: void knnMatchDownload(const GpuMat\& trainIdx, const GpuMat\& distance, std::vector< std::vector<DMatch> >\& matches, bool compactResult = false)
Downloads trainIdxand distancematrices obtained via to CPU vector with . If compactResultis true matchesvector will not contain matches for fully masked out query descriptors.
@ -301,11 +301,11 @@ cv::gpu::BruteForceMatcher_GPU::knnMatchDownload
cv::gpu::BruteForceMatcher_GPU::radiusMatch
-------------------------------------------
.. cfunction:: void radiusMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, std::vector< std::vector<DMatch> >\& matches, float maxDistance, const GpuMat\& mask = GpuMat(), bool compactResult = false)
.. c:function:: void radiusMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, std::vector< std::vector<DMatch> >\& matches, float maxDistance, const GpuMat\& mask = GpuMat(), bool compactResult = false)
Finds the best matches for each query descriptor which have distance less than given threshold. Found matches are returned in distance increasing order.
.. cfunction:: void radiusMatch(const GpuMat\& queryDescs, std::vector< std::vector<DMatch> >\& matches, float maxDistance, const std::vector<GpuMat>\& masks = std::vector<GpuMat>(), bool compactResult = false)
.. c:function:: void radiusMatch(const GpuMat\& queryDescs, std::vector< std::vector<DMatch> >\& matches, float maxDistance, const std::vector<GpuMat>\& masks = std::vector<GpuMat>(), bool compactResult = false)
This function works only on devices with Compute Capability
:math:`>=` 1.1.
@ -319,7 +319,7 @@ See also:
cv::gpu::BruteForceMatcher_GPU::radiusMatch
-------------------------------------------
.. cfunction:: void radiusMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, GpuMat\& trainIdx, GpuMat\& nMatches, GpuMat\& distance, float maxDistance, const GpuMat\& mask = GpuMat())
.. c:function:: void radiusMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, GpuMat\& trainIdx, GpuMat\& nMatches, GpuMat\& distance, float maxDistance, const GpuMat\& mask = GpuMat())
Finds the best matches for each query descriptor which have distance less than given threshold. Results will be stored to GPU memory.
@ -347,7 +347,7 @@ This function works only on devices with Compute Capability
cv::gpu::BruteForceMatcher_GPU::radiusMatchDownload
--------------------------------------------------- ```` ```` ```` ```` ````
.. cfunction:: void radiusMatchDownload(const GpuMat\& trainIdx, const GpuMat\& nMatches, const GpuMat\& distance, std::vector< std::vector<DMatch> >\& matches, bool compactResult = false)
.. c:function:: void radiusMatchDownload(const GpuMat\& trainIdx, const GpuMat\& nMatches, const GpuMat\& distance, std::vector< std::vector<DMatch> >\& matches, bool compactResult = false)
Downloads trainIdx, nMatchesand distancematrices obtained via to CPU vector with . If compactResultis true matchesvector will not contain matches for fully masked out query descriptors.

View File

@ -13,7 +13,7 @@ See also:
gpu::BaseRowFilter_GPU
----------------------
.. ctype:: gpu::BaseRowFilter_GPU
.. c:type:: gpu::BaseRowFilter_GPU
The base class for linear or non-linear filters that processes rows of 2D arrays. Such filters are used for the "horizontal" filtering passes in separable filters. ::
@ -25,7 +25,7 @@ The base class for linear or non-linear filters that processes rows of 2D arrays
virtual void operator()(const GpuMat& src, GpuMat& dst) = 0;
int ksize, anchor;
};
..
**Please note:**
This class doesn't allocate memory for destination image. Usually this class is used inside
@ -37,7 +37,7 @@ This class doesn't allocate memory for destination image. Usually this class is
gpu::BaseColumnFilter_GPU
-------------------------
.. ctype:: gpu::BaseColumnFilter_GPU
.. c:type:: gpu::BaseColumnFilter_GPU
The base class for linear or non-linear filters that processes columns of 2D arrays. Such filters are used for the "vertical" filtering passes in separable filters. ::
@ -49,7 +49,7 @@ The base class for linear or non-linear filters that processes columns of 2D arr
virtual void operator()(const GpuMat& src, GpuMat& dst) = 0;
int ksize, anchor;
};
..
**Please note:**
This class doesn't allocate memory for destination image. Usually this class is used inside
@ -61,7 +61,7 @@ This class doesn't allocate memory for destination image. Usually this class is
gpu::BaseFilter_GPU
-------------------
.. ctype:: gpu::BaseFilter_GPU
.. c:type:: gpu::BaseFilter_GPU
The base class for non-separable 2D filters. ::
@ -74,7 +74,7 @@ The base class for non-separable 2D filters. ::
Size ksize;
Point anchor;
};
..
**Please note:**
This class doesn't allocate memory for destination image. Usually this class is used inside
@ -86,7 +86,7 @@ This class doesn't allocate memory for destination image. Usually this class is
gpu::FilterEngine_GPU
---------------------
.. ctype:: gpu::FilterEngine_GPU
.. c:type:: gpu::FilterEngine_GPU
The base class for Filter Engine. ::
@ -98,7 +98,7 @@ The base class for Filter Engine. ::
virtual void apply(const GpuMat& src, GpuMat& dst,
Rect roi = Rect(0,0,-1,-1)) = 0;
};
..
The class can be used to apply an arbitrary filtering operation to an image. It contains all the necessary intermediate buffers. Pointers to the initialized ``FilterEngine_GPU`` instances are returned by various ``create*Filter_GPU`` functions, see below, and they are used inside high-level functions such as
:func:`gpu::filter2D`,:func:`gpu::erode`,:func:`gpu::Sobel` etc.
@ -124,7 +124,7 @@ By using ``FilterEngine_GPU`` instead of functions you can avoid unnecessary mem
}
// Release buffers only once
filter.release();
..
``FilterEngine_GPU`` can process a rectangular sub-region of an image. By default, if ``roi == Rect(0,0,-1,-1)``,``FilterEngine_GPU`` processes inner region of image ( ``Rect(anchor.x, anchor.y, src_size.width - ksize.width, src_size.height - ksize.height)`` ), because some filters doesn't check if indices are outside the image for better perfomace. See below which filters supports processing the whole image and which not and image type limitations.
**Please note:**
@ -138,7 +138,7 @@ See also:,,,,,,,,,,
cv::gpu::createFilter2D_GPU
---------------------------
.. cfunction:: Ptr<FilterEngine_GPU> createFilter2D_GPU( const Ptr<BaseFilter_GPU>\& filter2D, int srcType, int dstType)
.. c:function:: Ptr<FilterEngine_GPU> createFilter2D_GPU( const Ptr<BaseFilter_GPU>\& filter2D, int srcType, int dstType)
Creates non-separable filter engine with the specified filter.
@ -156,7 +156,7 @@ Usually this function is used inside high-level functions, like,.
cv::gpu::createSeparableFilter_GPU
----------------------------------
.. cfunction:: Ptr<FilterEngine_GPU> createSeparableFilter_GPU( const Ptr<BaseRowFilter_GPU>\& rowFilter, const Ptr<BaseColumnFilter_GPU>\& columnFilter, int srcType, int bufType, int dstType)
.. c:function:: Ptr<FilterEngine_GPU> createSeparableFilter_GPU( const Ptr<BaseRowFilter_GPU>\& rowFilter, const Ptr<BaseColumnFilter_GPU>\& columnFilter, int srcType, int bufType, int dstType)
Creates separable filter engine with the specified filters.
@ -178,7 +178,7 @@ Usually this function is used inside high-level functions, like
cv::gpu::getRowSumFilter_GPU
----------------------------
.. cfunction:: Ptr<BaseRowFilter_GPU> getRowSumFilter_GPU(int srcType, int sumType, int ksize, int anchor = -1)
.. c:function:: Ptr<BaseRowFilter_GPU> getRowSumFilter_GPU(int srcType, int sumType, int ksize, int anchor = -1)
Creates horizontal 1D box filter.
@ -199,7 +199,7 @@ This filter doesn't check out of border accesses, so only proper submatrix of bi
cv::gpu::getColumnSumFilter_GPU
-------------------------------
.. cfunction:: Ptr<BaseColumnFilter_GPU> getColumnSumFilter_GPU(int sumType, int dstType, int ksize, int anchor = -1)
.. c:function:: Ptr<BaseColumnFilter_GPU> getColumnSumFilter_GPU(int sumType, int dstType, int ksize, int anchor = -1)
Creates vertical 1D box filter.
@ -220,11 +220,11 @@ This filter doesn't check out of border accesses, so only proper submatrix of bi
cv::gpu::createBoxFilter_GPU
----------------------------
.. cfunction:: Ptr<FilterEngine_GPU> createBoxFilter_GPU(int srcType, int dstType, const Size\& ksize, const Point\& anchor = Point(-1,-1))
.. c:function:: Ptr<FilterEngine_GPU> createBoxFilter_GPU(int srcType, int dstType, const Size\& ksize, const Point\& anchor = Point(-1,-1))
Creates normalized 2D box filter.
.. cfunction:: Ptr<BaseFilter_GPU> getBoxFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1, -1))
.. c:function:: Ptr<BaseFilter_GPU> getBoxFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1, -1))
:param srcType: Input image type. Supports ``CV_8UC1`` and ``CV_8UC4`` .
@ -244,7 +244,7 @@ See also:
cv::gpu::boxFilter
------------------
.. cfunction:: void boxFilter(const GpuMat\& src, GpuMat\& dst, int ddepth, Size ksize, Point anchor = Point(-1,-1))
.. c:function:: void boxFilter(const GpuMat\& src, GpuMat\& dst, int ddepth, Size ksize, Point anchor = Point(-1,-1))
Smooths the image using the normalized box filter.
@ -268,7 +268,7 @@ See also:
cv::gpu::blur
-------------
.. cfunction:: void blur(const GpuMat\& src, GpuMat\& dst, Size ksize, Point anchor = Point(-1,-1))
.. c:function:: void blur(const GpuMat\& src, GpuMat\& dst, Size ksize, Point anchor = Point(-1,-1))
A synonym for normalized box filter.
@ -292,11 +292,11 @@ See also:
cv::gpu::createMorphologyFilter_GPU
-----------------------------------
.. cfunction:: Ptr<FilterEngine_GPU> createMorphologyFilter_GPU(int op, int type, const Mat\& kernel, const Point\& anchor = Point(-1,-1), int iterations = 1)
.. c:function:: Ptr<FilterEngine_GPU> createMorphologyFilter_GPU(int op, int type, const Mat\& kernel, const Point\& anchor = Point(-1,-1), int iterations = 1)
Creates 2D morphological filter.
.. cfunction:: Ptr<BaseFilter_GPU> getMorphologyFilter_GPU(int op, int type, const Mat\& kernel, const Size\& ksize, Point anchor=Point(-1,-1))
.. c:function:: Ptr<BaseFilter_GPU> getMorphologyFilter_GPU(int op, int type, const Mat\& kernel, const Size\& ksize, Point anchor=Point(-1,-1))
{Morphology operation id. Only ``MORPH_ERODE`` and ``MORPH_DILATE`` are supported.}
@ -318,7 +318,7 @@ See also:
cv::gpu::erode
--------------
.. cfunction:: void erode(const GpuMat\& src, GpuMat\& dst, const Mat\& kernel, Point anchor = Point(-1, -1), int iterations = 1)
.. c:function:: void erode(const GpuMat\& src, GpuMat\& dst, const Mat\& kernel, Point anchor = Point(-1, -1), int iterations = 1)
Erodes an image by using a specific structuring element.
@ -342,7 +342,7 @@ See also:
cv::gpu::dilate
---------------
.. cfunction:: void dilate(const GpuMat\& src, GpuMat\& dst, const Mat\& kernel, Point anchor = Point(-1, -1), int iterations = 1)
.. c:function:: void dilate(const GpuMat\& src, GpuMat\& dst, const Mat\& kernel, Point anchor = Point(-1, -1), int iterations = 1)
Dilates an image by using a specific structuring element.
@ -366,25 +366,25 @@ See also:
cv::gpu::morphologyEx
---------------------
.. cfunction:: void morphologyEx(const GpuMat\& src, GpuMat\& dst, int op, const Mat\& kernel, Point anchor = Point(-1, -1), int iterations = 1)
.. c:function:: void morphologyEx(const GpuMat\& src, GpuMat\& dst, int op, const Mat\& kernel, Point anchor = Point(-1, -1), int iterations = 1)
Applies an advanced morphological operation to image.
:param src: Source image. Supports ``CV_8UC1`` and ``CV_8UC4`` source type.
:param dst: Destination image. It will have the same size and the same type as ``src``
:param op: Type of morphological operation, one of the following:
:param op: Type of morphological operation, one of the following:
* **MORPH_OPEN** opening
* **MORPH_CLOSE** closing
* **MORPH_GRADIENT** morphological gradient
* **MORPH_TOPHAT** "top hat"
* **MORPH_BLACKHAT** "black hat"
:param kernel: Structuring element.
@ -404,11 +404,11 @@ See also:
cv::gpu::createLinearFilter_GPU
-------------------------------
.. cfunction:: Ptr<FilterEngine_GPU> createLinearFilter_GPU(int srcType, int dstType, const Mat\& kernel, const Point\& anchor = Point(-1,-1))
.. c:function:: Ptr<FilterEngine_GPU> createLinearFilter_GPU(int srcType, int dstType, const Mat\& kernel, const Point\& anchor = Point(-1,-1))
Creates the non-separable linear filter.
.. cfunction:: Ptr<BaseFilter_GPU> getLinearFilter_GPU(int srcType, int dstType, const Mat\& kernel, const Size\& ksize, Point anchor = Point(-1, -1))
.. c:function:: Ptr<BaseFilter_GPU> getLinearFilter_GPU(int srcType, int dstType, const Mat\& kernel, const Size\& ksize, Point anchor = Point(-1, -1))
:param srcType: Input image type. Supports ``CV_8UC1`` and ``CV_8UC4`` .
@ -430,7 +430,7 @@ See also:
cv::gpu::filter2D
-----------------
.. cfunction:: void filter2D(const GpuMat\& src, GpuMat\& dst, int ddepth, const Mat\& kernel, Point anchor=Point(-1,-1))
.. c:function:: void filter2D(const GpuMat\& src, GpuMat\& dst, int ddepth, const Mat\& kernel, Point anchor=Point(-1,-1))
Applies non-separable 2D linear filter to image.
@ -454,7 +454,7 @@ See also:
cv::gpu::Laplacian
------------------
.. cfunction:: void Laplacian(const GpuMat\& src, GpuMat\& dst, int ddepth, int ksize = 1, double scale = 1)
.. c:function:: void Laplacian(const GpuMat\& src, GpuMat\& dst, int ddepth, int ksize = 1, double scale = 1)
Applies Laplacian operator to image.
@ -480,7 +480,7 @@ See also:
cv::gpu::getLinearRowFilter_GPU
-------------------------------
.. cfunction:: Ptr<BaseRowFilter_GPU> getLinearRowFilter_GPU(int srcType, int bufType, const Mat\& rowKernel, int anchor = -1, int borderType = BORDER_CONSTANT)
.. c:function:: Ptr<BaseRowFilter_GPU> getLinearRowFilter_GPU(int srcType, int bufType, const Mat\& rowKernel, int anchor = -1, int borderType = BORDER_CONSTANT)
Creates primitive row filter with the specified kernel.
@ -504,7 +504,7 @@ See also:,:func:`createSeparableLinearFilter` .
cv::gpu::getLinearColumnFilter_GPU
----------------------------------
.. cfunction:: Ptr<BaseColumnFilter_GPU> getLinearColumnFilter_GPU(int bufType, int dstType, const Mat\& columnKernel, int anchor = -1, int borderType = BORDER_CONSTANT)
.. c:function:: Ptr<BaseColumnFilter_GPU> getLinearColumnFilter_GPU(int bufType, int dstType, const Mat\& columnKernel, int anchor = -1, int borderType = BORDER_CONSTANT)
Creates the primitive column filter with the specified kernel.
@ -527,7 +527,7 @@ See also:,:func:`createSeparableLinearFilter` .
cv::gpu::createSeparableLinearFilter_GPU
----------------------------------------
.. cfunction:: Ptr<FilterEngine_GPU> createSeparableLinearFilter_GPU(int srcType, int dstType, const Mat\& rowKernel, const Mat\& columnKernel, const Point\& anchor = Point(-1,-1), int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
.. c:function:: Ptr<FilterEngine_GPU> createSeparableLinearFilter_GPU(int srcType, int dstType, const Mat\& rowKernel, const Mat\& columnKernel, const Point\& anchor = Point(-1,-1), int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
Creates the separable linear filter engine.
@ -548,7 +548,7 @@ See also:,,
cv::gpu::sepFilter2D
--------------------
.. cfunction:: void sepFilter2D(const GpuMat\& src, GpuMat\& dst, int ddepth, const Mat\& kernelX, const Mat\& kernelY, Point anchor = Point(-1,-1), int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
.. c:function:: void sepFilter2D(const GpuMat\& src, GpuMat\& dst, int ddepth, const Mat\& kernelX, const Mat\& kernelY, Point anchor = Point(-1,-1), int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
Applies separable 2D linear filter to the image.
@ -572,7 +572,7 @@ See also:,:func:`sepFilter2D` .
cv::gpu::createDerivFilter_GPU
------------------------------
.. cfunction:: Ptr<FilterEngine_GPU> createDerivFilter_GPU(int srcType, int dstType, int dx, int dy, int ksize, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
.. c:function:: Ptr<FilterEngine_GPU> createDerivFilter_GPU(int srcType, int dstType, int dx, int dy, int ksize, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
Creates filter engine for the generalized Sobel operator.
@ -594,7 +594,7 @@ See also:,:func:`createDerivFilter` .
cv::gpu::Sobel
--------------
.. cfunction:: void Sobel(const GpuMat\& src, GpuMat\& dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
.. c:function:: void Sobel(const GpuMat\& src, GpuMat\& dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
Applies generalized Sobel operator to the image.
@ -620,7 +620,7 @@ See also:,:func:`Sobel` .
cv::gpu::Scharr
---------------
.. cfunction:: void Scharr(const GpuMat\& src, GpuMat\& dst, int ddepth, int dx, int dy, double scale = 1, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
.. c:function:: void Scharr(const GpuMat\& src, GpuMat\& dst, int ddepth, int dx, int dy, double scale = 1, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
Calculates the first x- or y- image derivative using Scharr operator.
@ -645,7 +645,7 @@ See also:,:func:`Scharr` .
cv::gpu::createGaussianFilter_GPU
---------------------------------
.. cfunction:: Ptr<FilterEngine_GPU> createGaussianFilter_GPU(int type, Size ksize, double sigmaX, double sigmaY = 0, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
.. c:function:: Ptr<FilterEngine_GPU> createGaussianFilter_GPU(int type, Size ksize, double sigmaX, double sigmaY = 0, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
Creates Gaussian filter engine.
@ -665,7 +665,7 @@ See also:,:func:`createGaussianFilter` .
cv::gpu::GaussianBlur
---------------------
.. cfunction:: void GaussianBlur(const GpuMat\& src, GpuMat\& dst, Size ksize, double sigmaX, double sigmaY = 0, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
.. c:function:: void GaussianBlur(const GpuMat\& src, GpuMat\& dst, Size ksize, double sigmaX, double sigmaY = 0, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1)
Smooths the image using Gaussian filter.
@ -687,7 +687,7 @@ See also:,:func:`GaussianBlur` .
cv::gpu::getMaxFilter_GPU
-------------------------
.. cfunction:: Ptr<BaseFilter_GPU> getMaxFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1,-1))
.. c:function:: Ptr<BaseFilter_GPU> getMaxFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1,-1))
Creates maximum filter.
@ -708,7 +708,7 @@ This filter doesn't check out of border accesses, so only proper submatrix of bi
cv::gpu::getMinFilter_GPU
-------------------------
.. cfunction:: Ptr<BaseFilter_GPU> getMinFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1,-1))
.. c:function:: Ptr<BaseFilter_GPU> getMinFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1,-1))
Creates minimum filter.

View File

@ -7,7 +7,10 @@ Image Processing
cv::gpu::meanShiftFiltering
---------------------------
.. cfunction:: void meanShiftFiltering(const GpuMat\& src, GpuMat\& dst, int sp, int sr, TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1))
.. c:function:: void meanShiftFiltering(const GpuMat\& src, GpuMat\& dst,
int sp, int sr,
TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER
+ TermCriteria::EPS, 5, 1))
Performs mean-shift filtering for each point of the source image. It maps each point of the source image into another point, and as the result we have new color and new position of each point.
@ -25,7 +28,10 @@ cv::gpu::meanShiftFiltering
cv::gpu::meanShiftProc
----------------------
.. cfunction:: void meanShiftProc(const GpuMat\& src, GpuMat\& dstr, GpuMat\& dstsp, int sp, int sr, TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1))
.. c:function:: void meanShiftProc(const GpuMat\& src, GpuMat\& dstr, GpuMat\& dstsp,
int sp, int sr,
TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER
+ TermCriteria::EPS, 5, 1))
Performs mean-shift procedure and stores information about processed points (i.e. their colors and positions) into two images.
@ -48,7 +54,10 @@ See also:
cv::gpu::meanShiftSegmentation
------------------------------
.. cfunction:: void meanShiftSegmentation(const GpuMat\& src, Mat\& dst, int sp, int sr, int minsize, TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1))
.. c:function:: void meanShiftSegmentation(const GpuMat\& src, Mat\& dst,
int sp, int sr, int minsize,
TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER
+ TermCriteria::EPS, 5, 1))
Performs mean-shift segmentation of the source image and eleminates small segments.
@ -68,9 +77,9 @@ cv::gpu::meanShiftSegmentation
cv::gpu::integral
-----------------
.. cfunction:: void integral(const GpuMat\& src, GpuMat\& sum)
.. c:function:: void integral(const GpuMat\& src, GpuMat\& sum)
.. cfunction:: void integral(const GpuMat\& src, GpuMat\& sum, GpuMat\& sqsum)
.. c:function:: void integral(const GpuMat\& src, GpuMat\& sum, GpuMat\& sqsum)
Computes integral image and squared integral image.
@ -87,7 +96,7 @@ See also:
cv::gpu::sqrIntegral
--------------------
.. cfunction:: void sqrIntegral(const GpuMat\& src, GpuMat\& sqsum)
.. c:function:: void sqrIntegral(const GpuMat\& src, GpuMat\& sqsum)
Computes squared integral image.
@ -99,7 +108,7 @@ cv::gpu::sqrIntegral
cv::gpu::columnSum
------------------
.. cfunction:: void columnSum(const GpuMat\& src, GpuMat\& sum)
.. c:function:: void columnSum(const GpuMat\& src, GpuMat\& sum)
Computes vertical (column) sum.
@ -111,7 +120,9 @@ cv::gpu::columnSum
cv::gpu::cornerHarris
---------------------
.. cfunction:: void cornerHarris(const GpuMat\& src, GpuMat\& dst, int blockSize, int ksize, double k, int borderType=BORDER_REFLECT101)
.. c:function:: void cornerHarris(const GpuMat\& src, GpuMat\& dst,
int blockSize, int ksize, double k,
int borderType=BORDER_REFLECT101)
Computes Harris cornerness criteria at each image pixel.
@ -134,7 +145,9 @@ See also:
cv::gpu::cornerMinEigenVal
--------------------------
.. cfunction:: void cornerMinEigenVal(const GpuMat\& src, GpuMat\& dst, int blockSize, int ksize, int borderType=BORDER_REFLECT101)
.. c:function:: void cornerMinEigenVal(const GpuMat\& src, GpuMat\& dst,
int blockSize, int ksize,
int borderType=BORDER_REFLECT101)
Computes minimum eigen value of 2x2 derivative covariation matrix at each pixel - the cornerness criteria.
@ -157,7 +170,8 @@ See also:
cv::gpu::mulSpectrums
---------------------
.. cfunction:: void mulSpectrums(const GpuMat\& a, const GpuMat\& b, GpuMat\& c, int flags, bool conjB=false)
.. c:function:: void mulSpectrums(const GpuMat\& a, const GpuMat\& b,
GpuMat\& c, int flags, bool conjB=false)
Performs per-element multiplication of two Fourier spectrums.
@ -180,7 +194,8 @@ See also:
cv::gpu::mulAndScaleSpectrums
-----------------------------
.. cfunction:: void mulAndScaleSpectrums(const GpuMat\& a, const GpuMat\& b, GpuMat\& c, int flags, float scale, bool conjB=false)
.. c:function:: void mulAndScaleSpectrums(const GpuMat\& a, const GpuMat\& b,
GpuMat\& c, int flags, float scale, bool conjB=false)
Performs per-element multiplication of two Fourier spectrums and scales the result.
@ -205,7 +220,7 @@ See also:
cv::gpu::dft
------------ ``_`` ``_``
.. cfunction:: void dft(const GpuMat\& src, GpuMat\& dst, Size dft_size, int flags=0)
.. c:function:: void dft(const GpuMat\& src, GpuMat\& dst, Size dft_size, int flags=0)
Performs a forward or inverse discrete Fourier transform (1D or 2D) of floating point matrix. Can handle real matrices (CV32FC1) and complex matrices in the interleaved format (CV32FC2).
@ -215,7 +230,7 @@ cv::gpu::dft
:param dft_size: Size of discrete Fourier transform.
:param flags: Optional flags:
:param flags: Optional flags:
* **DFT_ROWS** Transform each individual row of the source matrix.
@ -224,7 +239,7 @@ cv::gpu::dft
* **DFT_INVERSE** Inverse DFT must be perfromed for complex-complex case (real-complex and complex-real cases are respectively forward and inverse always).
* **DFT_REAL_OUTPUT** The source matrix is the result of real-complex transform, so the destination matrix must be real.
The source matrix should be continuous, otherwise reallocation and data copying will be performed. Function chooses the operation mode depending on the flags, size and channel count of the source matrix:
@ -244,9 +259,11 @@ See also:
cv::gpu::convolve
-----------------
.. cfunction:: void convolve(const GpuMat\& image, const GpuMat\& templ, GpuMat\& result, bool ccorr=false)
.. c:function:: void convolve(const GpuMat\& image, const GpuMat\& templ, GpuMat\& result,
bool ccorr=false)
.. cfunction:: void convolve(const GpuMat\& image, const GpuMat\& templ, GpuMat\& result, bool ccorr, ConvolveBuf\& buf)
.. c:function:: void convolve(const GpuMat\& image, const GpuMat\& templ, GpuMat\& result,
bool ccorr, ConvolveBuf\& buf)
Computes convolution (or cross-correlation) of two images.
@ -266,7 +283,7 @@ cv::gpu::convolve
gpu::ConvolveBuf
----------------
.. ctype:: gpu::ConvolveBuf
.. c:type:: gpu::ConvolveBuf
Memory buffer for the
:func:`gpu::convolve` function. ::
@ -281,17 +298,17 @@ Memory buffer for the
private:
// Hidden
};
..
.. index:: gpu::ConvolveBuf::ConvolveBuf
cv::gpu::ConvolveBuf::ConvolveBuf
---------------------------------
.. cfunction:: ConvolveBuf::ConvolveBuf()
.. c:function:: ConvolveBuf::ConvolveBuf()
Constructs an empty buffer which will be properly resized after first call of the convolve function.
.. cfunction:: ConvolveBuf::ConvolveBuf(Size image_size, Size templ_size)
.. c:function:: ConvolveBuf::ConvolveBuf(Size image_size, Size templ_size)
Constructs a buffer for the convolve function with respectively arguments.
@ -299,7 +316,8 @@ Constructs a buffer for the convolve function with respectively arguments.
cv::gpu::matchTemplate
----------------------
.. cfunction:: void matchTemplate(const GpuMat\& image, const GpuMat\& templ, GpuMat\& result, int method)
.. c:function:: void matchTemplate(const GpuMat\& image, const GpuMat\& templ,
GpuMat\& result, int method)
Computes a proximity map for a raster template and an image where the template is searched for.
@ -307,37 +325,24 @@ cv::gpu::matchTemplate
:param templ: Template image. Must have the same size and type as ``image`` .
:param result: Map containing comparison results ( ``CV_32FC1`` ). If ``image`` is :math:`W \times H` and ``templ`` is :math:`w \times h` then ``result`` must be :math:`(W-w+1) \times (H-h+1)` .
:param result: Map containing comparison results ( ``CV_32FC1`` ). If ``image`` is :math:`W \times H` and
``templ`` is :math:`w \times h` then ``result`` must be :math:`(W-w+1) \times (H-h+1)` .
:param method: Specifies the way which the template must be compared with the image.
Following methods are supported for the ``CV_8U`` depth images for now:
*
CV_ TM_ SQDIFF
*
CV_ TM_ SQDIFF_ NORMED
*
CV_ TM_ CCORR
*
CV_ TM_ CCORR_ NORMED
*
CV_ TM_ CCOEFF
*
CV_ TM_ CCOEFF_ NORMED
* CV_TM_SQDIFF
* CV_TM_SQDIFF_NORMED
* CV_TM_CCORR
* CV_TM_CCORR_NORMED
* CV_TM_CCOEFF
* CV_TM_CCOEFF_NORMED
Following methods are supported for the ``CV_32F`` images for now:
*
CV_ TM_ SQDIFF
*
CV_ TM_ CCORR
* CV_TM_SQDIFF
* CV_TM_CCORR
See also:
:func:`matchTemplate` .
@ -346,7 +351,7 @@ See also:
cv::gpu::remap
--------------
.. cfunction:: void remap(const GpuMat\& src, GpuMat\& dst, const GpuMat\& xmap, const GpuMat\& ymap)
.. c:function:: void remap(const GpuMat\& src, GpuMat\& dst, const GpuMat\& xmap, const GpuMat\& ymap)
Applies a generic geometrical transformation to an image.
@ -362,7 +367,7 @@ The function transforms the source image using the specified map:
.. math::
\texttt{dst} (x,y) = \texttt{src} (xmap(x,y), ymap(x,y))
\texttt{dst} (x,y) = \texttt{src} (xmap(x,y), ymap(x,y))
Values of pixels with non-integer coordinates are computed using bilinear interpolation.
@ -373,9 +378,9 @@ See also:
cv::gpu::cvtColor
-----------------
.. cfunction:: void cvtColor(const GpuMat\& src, GpuMat\& dst, int code, int dcn = 0)
.. c:function:: void cvtColor(const GpuMat\& src, GpuMat\& dst, int code, int dcn = 0)
.. cfunction:: void cvtColor(const GpuMat\& src, GpuMat\& dst, int code, int dcn, const Stream\& stream)
.. c:function:: void cvtColor(const GpuMat\& src, GpuMat\& dst, int code, int dcn, const Stream\& stream)
Converts image from one color space to another.
@ -398,9 +403,9 @@ See also:
cv::gpu::threshold
------------------
.. cfunction:: double threshold(const GpuMat\& src, GpuMat\& dst, double thresh, double maxval, int type)
.. c:function:: double threshold(const GpuMat\& src, GpuMat\& dst, double thresh, double maxval, int type)
.. cfunction:: double threshold(const GpuMat\& src, GpuMat\& dst, double thresh, double maxval, int type, const Stream\& stream)
.. c:function:: double threshold(const GpuMat\& src, GpuMat\& dst, double thresh, double maxval, int type, const Stream\& stream)
Applies a fixed-level threshold to each array element.
@ -423,7 +428,7 @@ See also:
cv::gpu::resize
---------------
.. cfunction:: void resize(const GpuMat\& src, GpuMat\& dst, Size dsize, double fx=0, double fy=0, int interpolation = INTER_LINEAR)
.. c:function:: void resize(const GpuMat\& src, GpuMat\& dst, Size dsize, double fx=0, double fy=0, int interpolation = INTER_LINEAR)
Resizes an image.
@ -431,25 +436,28 @@ cv::gpu::resize
:param dst: Destination image. It will have size ``dsize`` (when it is non-zero) or the size computed from ``src.size()`` and ``fx`` and ``fy`` . The type of ``dst`` will be the same as of ``src`` .
:param dsize: Destination image size. If it is zero, then it is computed as:
:param dsize: Destination image size. If it is zero, then it is computed as:
.. math::
\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}
\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}
Either ``dsize`` or both ``fx`` or ``fy`` must be non-zero.
:param fx: Scale factor along the horizontal axis. When 0, it is computed as
:param fx: Scale factor along the horizontal axis. When 0, it is computed as
.. math::
\texttt{(double)dsize.width/src.cols}
\texttt{(double)dsize.width/src.cols}
:param fy: Scale factor along the vertical axis. When 0, it is computed as
:param fy: Scale factor along the vertical axis. When 0, it is computed as
.. math::
\texttt{(double)dsize.height/src.rows}
\texttt{(double)dsize.height/src.rows}
:param interpolation: Interpolation method. Supports only ``INTER_NEAREST`` and ``INTER_LINEAR`` .
@ -460,7 +468,7 @@ See also:
cv::gpu::warpAffine
-------------------
.. cfunction:: void warpAffine(const GpuMat\& src, GpuMat\& dst, const Mat\& M, Size dsize, int flags = INTER_LINEAR)
.. c:function:: void warpAffine(const GpuMat\& src, GpuMat\& dst, const Mat\& M, Size dsize, int flags = INTER_LINEAR)
Applies an affine transformation to an image.
@ -481,7 +489,7 @@ See also:
cv::gpu::warpPerspective
------------------------
.. cfunction:: void warpPerspective(const GpuMat\& src, GpuMat\& dst, const Mat\& M, Size dsize, int flags = INTER_LINEAR)
.. c:function:: void warpPerspective(const GpuMat\& src, GpuMat\& dst, const Mat\& M, Size dsize, int flags = INTER_LINEAR)
Applies a perspective transformation to an image.
@ -503,7 +511,7 @@ See also:
cv::gpu::rotate
---------------
.. cfunction:: void rotate(const GpuMat\& src, GpuMat\& dst, Size dsize, double angle, double xShift = 0, double yShift = 0, int interpolation = INTER_LINEAR)
.. c:function:: void rotate(const GpuMat\& src, GpuMat\& dst, Size dsize, double angle, double xShift = 0, double yShift = 0, int interpolation = INTER_LINEAR)
Rotates an image around the origin (0,0) and then shifts it.
@ -528,7 +536,7 @@ See also:
cv::gpu::copyMakeBorder
-----------------------
.. cfunction:: void copyMakeBorder(const GpuMat\& src, GpuMat\& dst, int top, int bottom, int left, int right, const Scalar\& value = Scalar())
.. c:function:: void copyMakeBorder(const GpuMat\& src, GpuMat\& dst, int top, int bottom, int left, int right, const Scalar\& value = Scalar())
Copies 2D array to a larger destination array and pads borders with the given constant.
@ -546,7 +554,7 @@ See also:
cv::gpu::rectStdDev
-------------------
.. cfunction:: void rectStdDev(const GpuMat\& src, const GpuMat\& sqr, GpuMat\& dst, const Rect\& rect)
.. c:function:: void rectStdDev(const GpuMat\& src, const GpuMat\& sqr, GpuMat\& dst, const Rect\& rect)
Computes standard deviation of integral images.
@ -562,7 +570,7 @@ cv::gpu::rectStdDev
cv::gpu::evenLevels
-------------------
.. cfunction:: void evenLevels(GpuMat\& levels, int nLevels, int lowerLevel, int upperLevel)
.. c:function:: void evenLevels(GpuMat\& levels, int nLevels, int lowerLevel, int upperLevel)
Computes levels with even distribution.
@ -578,9 +586,9 @@ cv::gpu::evenLevels
cv::gpu::histEven
-----------------
.. cfunction:: void histEven(const GpuMat\& src, GpuMat\& hist, int histSize, int lowerLevel, int upperLevel)
.. c:function:: void histEven(const GpuMat\& src, GpuMat\& hist, int histSize, int lowerLevel, int upperLevel)
.. cfunction:: void histEven(const GpuMat\& src, GpuMat hist[4], int histSize[4], int lowerLevel[4], int upperLevel[4])
.. c:function:: void histEven(const GpuMat\& src, GpuMat hist[4], int histSize[4], int lowerLevel[4], int upperLevel[4])
Calculates histogram with evenly distributed bins.
@ -598,9 +606,9 @@ cv::gpu::histEven
cv::gpu::histRange
------------------
.. cfunction:: void histRange(const GpuMat\& src, GpuMat\& hist, const GpuMat\& levels)
.. c:function:: void histRange(const GpuMat\& src, GpuMat\& hist, const GpuMat\& levels)
.. cfunction:: void histRange(const GpuMat\& src, GpuMat hist[4], const GpuMat levels[4])
.. c:function:: void histRange(const GpuMat\& src, GpuMat hist[4], const GpuMat levels[4])
Calculates histogram with bins determined by levels array.

View File

@ -7,7 +7,7 @@ Initalization and Information
cv::gpu::getCudaEnabledDeviceCount
----------------------------------
.. cfunction:: int getCudaEnabledDeviceCount()
.. c:function:: int getCudaEnabledDeviceCount()
Returns number of CUDA-enabled devices installed. It is to be used before any other GPU functions calls. If OpenCV is compiled without GPU support this function returns 0.
@ -15,7 +15,7 @@ cv::gpu::getCudaEnabledDeviceCount
cv::gpu::setDevice
------------------
.. cfunction:: void setDevice(int device)
.. c:function:: void setDevice(int device)
Sets device and initializes it for the current thread. Call of this function can be omitted, but in this case a default device will be initialized on fist GPU usage.
@ -25,7 +25,7 @@ cv::gpu::setDevice
cv::gpu::getDevice
------------------
.. cfunction:: int getDevice()
.. c:function:: int getDevice()
Returns the current device index, which was set by {gpu::getDevice} or initialized by default.
@ -35,7 +35,7 @@ cv::gpu::getDevice
gpu::GpuFeature
---------------
.. ctype:: gpu::GpuFeature
.. c:type:: gpu::GpuFeature
GPU compute features. ::
@ -46,7 +46,7 @@ GPU compute features. ::
COMPUTE_20, COMPUTE_21,
ATOMICS, NATIVE_DOUBLE
};
..
.. index:: gpu::DeviceInfo
@ -54,7 +54,7 @@ GPU compute features. ::
gpu::DeviceInfo
---------------
.. ctype:: gpu::DeviceInfo
.. c:type:: gpu::DeviceInfo
This class provides functionality for querying the specified GPU properties. ::
@ -77,15 +77,15 @@ This class provides functionality for querying the specified GPU properties. ::
bool supports(GpuFeature feature) const;
bool isCompatible() const;
};
..
.. index:: gpu::DeviceInfo::DeviceInfo
cv::gpu::DeviceInfo::DeviceInfo
------------------------------- ``_``
.. cfunction:: DeviceInfo::DeviceInfo()
.. c:function:: DeviceInfo::DeviceInfo()
.. cfunction:: DeviceInfo::DeviceInfo(int device_id)
.. c:function:: DeviceInfo::DeviceInfo(int device_id)
Constructs DeviceInfo object for the specified device. If deviceidparameter is missed it constructs object for the current device.
@ -95,7 +95,7 @@ cv::gpu::DeviceInfo::DeviceInfo
cv::gpu::DeviceInfo::name
-------------------------
.. cfunction:: string DeviceInfo::name()
.. c:function:: string DeviceInfo::name()
Returns the device name.
@ -103,7 +103,7 @@ cv::gpu::DeviceInfo::name
cv::gpu::DeviceInfo::majorVersion
---------------------------------
.. cfunction:: int DeviceInfo::majorVersion()
.. c:function:: int DeviceInfo::majorVersion()
Returns the major compute capability version.
@ -111,7 +111,7 @@ cv::gpu::DeviceInfo::majorVersion
cv::gpu::DeviceInfo::minorVersion
---------------------------------
.. cfunction:: int DeviceInfo::minorVersion()
.. c:function:: int DeviceInfo::minorVersion()
Returns the minor compute capability version.
@ -119,7 +119,7 @@ cv::gpu::DeviceInfo::minorVersion
cv::gpu::DeviceInfo::multiProcessorCount
----------------------------------------
.. cfunction:: int DeviceInfo::multiProcessorCount()
.. c:function:: int DeviceInfo::multiProcessorCount()
Returns the number of streaming multiprocessors.
@ -127,7 +127,7 @@ cv::gpu::DeviceInfo::multiProcessorCount
cv::gpu::DeviceInfo::freeMemory
-------------------------------
.. cfunction:: size_t DeviceInfo::freeMemory()
.. c:function:: size_t DeviceInfo::freeMemory()
Returns the amount of free memory in bytes.
@ -135,7 +135,7 @@ cv::gpu::DeviceInfo::freeMemory
cv::gpu::DeviceInfo::totalMemory
--------------------------------
.. cfunction:: size_t DeviceInfo::totalMemory()
.. c:function:: size_t DeviceInfo::totalMemory()
Returns the amount of total memory in bytes.
@ -143,7 +143,7 @@ cv::gpu::DeviceInfo::totalMemory
cv::gpu::DeviceInfo::supports
-----------------------------
.. cfunction:: bool DeviceInfo::supports(GpuFeature feature)
.. c:function:: bool DeviceInfo::supports(GpuFeature feature)
Returns true if the device has the given GPU feature, otherwise false.
@ -153,7 +153,7 @@ cv::gpu::DeviceInfo::supports
cv::gpu::DeviceInfo::isCompatible
---------------------------------
.. cfunction:: bool DeviceInfo::isCompatible()
.. c:function:: bool DeviceInfo::isCompatible()
Returns true if the GPU module can be run on the specified device, otherwise false.
@ -163,32 +163,32 @@ cv::gpu::DeviceInfo::isCompatible
gpu::TargetArchs
----------------
.. ctype:: gpu::TargetArchs
.. c:type:: gpu::TargetArchs
This class provides functionality (as set of static methods) for checking which NVIDIA card architectures the GPU module was built for.
bigskip
The following method checks whether the module was built with the support of the given feature:
.. cfunction:: static bool builtWith(GpuFeature feature)
.. c:function:: static bool builtWith(GpuFeature feature)
:param feature: Feature to be checked. See .
There are a set of methods for checking whether the module contains intermediate (PTX) or binary GPU code for the given architecture(s):
.. cfunction:: static bool has(int major, int minor)
.. c:function:: static bool has(int major, int minor)
.. cfunction:: static bool hasPtx(int major, int minor)
.. c:function:: static bool hasPtx(int major, int minor)
.. cfunction:: static bool hasBin(int major, int minor)
.. c:function:: static bool hasBin(int major, int minor)
.. cfunction:: static bool hasEqualOrLessPtx(int major, int minor)
.. c:function:: static bool hasEqualOrLessPtx(int major, int minor)
.. cfunction:: static bool hasEqualOrGreater(int major, int minor)
.. c:function:: static bool hasEqualOrGreater(int major, int minor)
.. cfunction:: static bool hasEqualOrGreaterPtx(int major, int minor)
.. c:function:: static bool hasEqualOrGreaterPtx(int major, int minor)
.. cfunction:: static bool hasEqualOrGreaterBin(int major, int minor)
.. c:function:: static bool hasEqualOrGreaterBin(int major, int minor)
* **major** Major compute capability version.

View File

@ -7,7 +7,7 @@ Matrix Reductions
cv::gpu::meanStdDev
-------------------
.. cfunction:: void meanStdDev(const GpuMat\& mtx, Scalar\& mean, Scalar\& stddev)
.. c:function:: void meanStdDev(const GpuMat\& mtx, Scalar\& mean, Scalar\& stddev)
Computes mean value and standard deviation of matrix elements.
@ -24,7 +24,7 @@ See also:
cv::gpu::norm
-------------
.. cfunction:: double norm(const GpuMat\& src, int normType=NORM_L2)
.. c:function:: double norm(const GpuMat\& src, int normType=NORM_L2)
Returns norm of matrix (or of two matrices difference).
@ -32,7 +32,7 @@ cv::gpu::norm
:param normType: Norm type. ``NORM_L1`` , ``NORM_L2`` and ``NORM_INF`` are supported for now.
.. cfunction:: double norm(const GpuMat\& src, int normType, GpuMat\& buf)
.. c:function:: double norm(const GpuMat\& src, int normType, GpuMat\& buf)
* **src** Source matrix. Any matrices except 64F are supported.
@ -40,7 +40,8 @@ cv::gpu::norm
* **buf** Optional buffer to avoid extra memory allocations. It's resized automatically.
.. cfunction:: double norm(const GpuMat\& src1, const GpuMat\& src2, int normType=NORM_L2)
.. c:function:: double norm(const GpuMat\& src1, const GpuMat\& src2,
int normType=NORM_L2)
* **src1** First source matrix. ``CV_8UC1`` matrices are supported for now.
@ -56,9 +57,9 @@ See also:
cv::gpu::sum
------------
.. cfunction:: Scalar sum(const GpuMat\& src)
.. c:function:: Scalar sum(const GpuMat\& src)
.. cfunction:: Scalar sum(const GpuMat\& src, GpuMat\& buf)
.. c:function:: Scalar sum(const GpuMat\& src, GpuMat\& buf)
Returns sum of matrix elements.
@ -73,9 +74,9 @@ See also:
cv::gpu::absSum
---------------
.. cfunction:: Scalar absSum(const GpuMat\& src)
.. c:function:: Scalar absSum(const GpuMat\& src)
.. cfunction:: Scalar absSum(const GpuMat\& src, GpuMat\& buf)
.. c:function:: Scalar absSum(const GpuMat\& src, GpuMat\& buf)
Returns sum of matrix elements absolute values.
@ -87,9 +88,9 @@ cv::gpu::absSum
cv::gpu::sqrSum
---------------
.. cfunction:: Scalar sqrSum(const GpuMat\& src)
.. c:function:: Scalar sqrSum(const GpuMat\& src)
.. cfunction:: Scalar sqrSum(const GpuMat\& src, GpuMat\& buf)
.. c:function:: Scalar sqrSum(const GpuMat\& src, GpuMat\& buf)
Returns squared sum of matrix elements.
@ -101,9 +102,11 @@ cv::gpu::sqrSum
cv::gpu::minMax
---------------
.. cfunction:: void minMax(const GpuMat\& src, double* minVal, double* maxVal=0, const GpuMat\& mask=GpuMat())
.. c:function:: void minMax(const GpuMat\& src, double* minVal,
double* maxVal=0, const GpuMat\& mask=GpuMat())
.. cfunction:: void minMax(const GpuMat\& src, double* minVal, double* maxVal, const GpuMat\& mask, GpuMat\& buf)
.. c:function:: void minMax(const GpuMat\& src, double* minVal, double* maxVal,
const GpuMat\& mask, GpuMat\& buf)
Finds global minimum and maximum matrix elements and returns their values.
@ -126,9 +129,13 @@ See also:
cv::gpu::minMaxLoc
------------------
.. cfunction:: void minMaxLoc(const GpuMat\& src, double\* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, const GpuMat\& mask=GpuMat())
.. c:function:: void minMaxLoc(const GpuMat\& src, double\* minVal, double* maxVal=0,
Point* minLoc=0, Point* maxLoc=0,
const GpuMat\& mask=GpuMat())
.. cfunction:: void minMaxLoc(const GpuMat\& src, double* minVal, double* maxVal, Point* minLoc, Point* maxLoc, const GpuMat\& mask, GpuMat\& valbuf, GpuMat\& locbuf)
.. c:function:: void minMaxLoc(const GpuMat\& src, double* minVal, double* maxVal,
Point* minLoc, Point* maxLoc, const GpuMat\& mask,
GpuMat\& valbuf, GpuMat\& locbuf)
Finds global minimum and maximum matrix elements and returns their values with locations.
@ -157,9 +164,9 @@ See also:
cv::gpu::countNonZero
---------------------
.. cfunction:: int countNonZero(const GpuMat\& src)
.. c:function:: int countNonZero(const GpuMat\& src)
.. cfunction:: int countNonZero(const GpuMat\& src, GpuMat\& buf)
.. c:function:: int countNonZero(const GpuMat\& src, GpuMat\& buf)
Counts non-zero matrix elements.

View File

@ -9,7 +9,7 @@ Object Detection
gpu::HOGDescriptor
------------------
.. ctype:: gpu::HOGDescriptor
.. c:type:: gpu::HOGDescriptor
Histogram of Oriented Gradients
dalal_hog
@ -62,7 +62,7 @@ descriptor and detector. ::
private:
// Hidden
}
..
Interfaces of all methods are kept similar to CPU HOG descriptor and detector analogues as much as possible.
@ -70,7 +70,12 @@ Interfaces of all methods are kept similar to CPU HOG descriptor and detector an
cv::gpu::HOGDescriptor::HOGDescriptor
-------------------------------------
.. cfunction:: HOGDescriptor::HOGDescriptor(Size win_size=Size(64, 128), Size block_size=Size(16, 16), Size block_stride=Size(8, 8), Size cell_size=Size(8, 8), int nbins=9, double win_sigma=DEFAULT_WIN_SIGMA, double threshold_L2hys=0.2, bool gamma_correction=true, int nlevels=DEFAULT_NLEVELS)
.. c:function:: HOGDescriptor::HOGDescriptor(Size win_size=Size(64, 128),
Size block_size=Size(16, 16), Size block_stride=Size(8, 8),
Size cell_size=Size(8, 8), int nbins=9,
double win_sigma=DEFAULT_WIN_SIGMA,
double threshold_L2hys=0.2, bool gamma_correction=true,
int nlevels=DEFAULT_NLEVELS)
Creates HOG descriptor and detector.
@ -96,7 +101,7 @@ cv::gpu::HOGDescriptor::HOGDescriptor
cv::gpu::HOGDescriptor::getDescriptorSize
-----------------------------------------
.. cfunction:: size_t HOGDescriptor::getDescriptorSize() const
.. c:function:: size_t HOGDescriptor::getDescriptorSize() const
Returns number of coefficients required for the classification.
@ -104,7 +109,7 @@ cv::gpu::HOGDescriptor::getDescriptorSize
cv::gpu::HOGDescriptor::getBlockHistogramSize
---------------------------------------------
.. cfunction:: size_t HOGDescriptor::getBlockHistogramSize() const
.. c:function:: size_t HOGDescriptor::getBlockHistogramSize() const
Returns block histogram size.
@ -112,7 +117,7 @@ cv::gpu::HOGDescriptor::getBlockHistogramSize
cv::gpu::HOGDescriptor::setSVMDetector
--------------------------------------
.. cfunction:: void HOGDescriptor::setSVMDetector(const vector<float>\& detector)
.. c:function:: void HOGDescriptor::setSVMDetector(const vector<float>\& detector)
Sets coefficients for the linear SVM classifier.
@ -120,7 +125,7 @@ cv::gpu::HOGDescriptor::setSVMDetector
cv::gpu::HOGDescriptor::getDefaultPeopleDetector
------------------------------------------------
.. cfunction:: static vector<float> HOGDescriptor::getDefaultPeopleDetector()
.. c:function:: static vector<float> HOGDescriptor::getDefaultPeopleDetector()
Returns coefficients of the classifier trained for people detection (for default window size).
@ -128,7 +133,7 @@ cv::gpu::HOGDescriptor::getDefaultPeopleDetector
cv::gpu::HOGDescriptor::getPeopleDetector48x96
----------------------------------------------
.. cfunction:: static vector<float> HOGDescriptor::getPeopleDetector48x96()
.. c:function:: static vector<float> HOGDescriptor::getPeopleDetector48x96()
Returns coefficients of the classifier trained for people detection (for 48x96 windows).
@ -136,7 +141,7 @@ cv::gpu::HOGDescriptor::getPeopleDetector48x96
cv::gpu::HOGDescriptor::getPeopleDetector64x128
-----------------------------------------------
.. cfunction:: static vector<float> HOGDescriptor::getPeopleDetector64x128()
.. c:function:: static vector<float> HOGDescriptor::getPeopleDetector64x128()
Returns coefficients of the classifier trained for people detection (for 64x128 windows).
@ -144,7 +149,9 @@ cv::gpu::HOGDescriptor::getPeopleDetector64x128
cv::gpu::HOGDescriptor::detect
------------------------------
.. cfunction:: void HOGDescriptor::detect(const GpuMat\& img, vector<Point>\& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size())
.. c:function:: void HOGDescriptor::detect(const GpuMat\& img,
vector<Point>\& found_locations, double hit_threshold=0,
Size win_stride=Size(), Size padding=Size())
Perfroms object detection without multiscale window.
@ -162,7 +169,10 @@ cv::gpu::HOGDescriptor::detect
cv::gpu::HOGDescriptor::detectMultiScale
----------------------------------------
.. cfunction:: void HOGDescriptor::detectMultiScale(const GpuMat\& img, vector<Rect>\& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size(), double scale0=1.05, int group_threshold=2)
.. c:function:: void HOGDescriptor::detectMultiScale(const GpuMat\& img,
vector<Rect>\& found_locations, double hit_threshold=0,
Size win_stride=Size(), Size padding=Size(),
double scale0=1.05, int group_threshold=2)
Perfroms object detection with multiscale window.
@ -185,7 +195,9 @@ cv::gpu::HOGDescriptor::detectMultiScale
cv::gpu::HOGDescriptor::getDescriptors
--------------------------------------
.. cfunction:: void HOGDescriptor::getDescriptors(const GpuMat\& img, Size win_stride, GpuMat\& descriptors, int descr_format=DESCR_FORMAT_COL_BY_COL)
.. c:function:: void HOGDescriptor::getDescriptors(const GpuMat\& img,
Size win_stride, GpuMat\& descriptors,
int descr_format=DESCR_FORMAT_COL_BY_COL)
Returns block descriptors computed for the whole image. It's mainly used for classifier learning purposes.
@ -195,12 +207,12 @@ cv::gpu::HOGDescriptor::getDescriptors
:param descriptors: 2D array of descriptors.
:param descr_format: Descriptor storage format:
:param descr_format: Descriptor storage format:
* **DESCR_FORMAT_ROW_BY_ROW** Row-major order.
* **DESCR_FORMAT_COL_BY_COL** Column-major order.
.. index:: gpu::CascadeClassifier_GPU
@ -208,7 +220,7 @@ cv::gpu::HOGDescriptor::getDescriptors
gpu::CascadeClassifier_GPU
--------------------------
.. ctype:: gpu::CascadeClassifier_GPU
.. c:type:: gpu::CascadeClassifier_GPU
The cascade classifier class for object detection. ::
@ -234,7 +246,7 @@ The cascade classifier class for object detection. ::
Size getClassifierSize() const;
};
..
.. index:: cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU
@ -242,7 +254,7 @@ The cascade classifier class for object detection. ::
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU
-----------------------------------------------------
.. cfunction:: cv::CascadeClassifier_GPU(const string\& filename)
.. c:function:: cv::CascadeClassifier_GPU(const string\& filename)
Loads the classifier from file.
@ -254,7 +266,7 @@ cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU
cv::gpu::CascadeClassifier_GPU::empty
-------------------------------------
.. cfunction:: bool CascadeClassifier_GPU::empty() const
.. c:function:: bool CascadeClassifier_GPU::empty() const
Checks if the classifier has been loaded or not.
@ -264,7 +276,7 @@ cv::gpu::CascadeClassifier_GPU::empty
cv::gpu::CascadeClassifier_GPU::load
------------------------------------
.. cfunction:: bool CascadeClassifier_GPU::load(const string\& filename)
.. c:function:: bool CascadeClassifier_GPU::load(const string\& filename)
Loads the classifier from file. The previous content is destroyed.
@ -276,7 +288,7 @@ cv::gpu::CascadeClassifier_GPU::load
cv::gpu::CascadeClassifier_GPU::release
---------------------------------------
.. cfunction:: void CascadeClassifier_GPU::release()
.. c:function:: void CascadeClassifier_GPU::release()
Destroys loaded classifier.
@ -286,7 +298,7 @@ cv::gpu::CascadeClassifier_GPU::release
cv::gpu::CascadeClassifier_GPU::detectMultiScale
------------------------------------------------
.. cfunction:: int CascadeClassifier_GPU::detectMultiScale(const GpuMat\& image, GpuMat\& objectsBuf, double scaleFactor=1.2, int minNeighbors=4, Size minSize=Size())
.. c:function:: int CascadeClassifier_GPU::detectMultiScale(const GpuMat\& image, GpuMat\& objectsBuf, double scaleFactor=1.2, int minNeighbors=4, Size minSize=Size())
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
@ -320,7 +332,7 @@ The function returns number of detected objects, so you can retrieve them as in
cv::rectangle(image_cpu, faces[i], Scalar(255));
imshow("Faces", image_cpu);
..
See also:
:func:`CascadeClassifier::detectMultiScale` .

View File

@ -7,7 +7,7 @@ Operations on Matrices
cv::gpu::transpose
------------------
.. cfunction:: void transpose(const GpuMat\& src, GpuMat\& dst)
.. c:function:: void transpose(const GpuMat\& src, GpuMat\& dst)
Transposes a matrix.
@ -22,7 +22,7 @@ See also:
cv::gpu::flip
-------------
.. cfunction:: void flip(const GpuMat\& a, GpuMat\& b, int flipCode)
.. c:function:: void flip(const GpuMat\& a, GpuMat\& b, int flipCode)
Flips a 2D matrix around vertical, horizontal or both axes.
@ -30,14 +30,14 @@ cv::gpu::flip
:param b: Destination matrix.
:param flipCode: Specifies how to flip the source:
:param flipCode: Specifies how to flip the source:
* **0** Flip around x-axis.
* **:math:`>`0** Flip around y-axis.
* **:math:`<`0** Flip around both axes.
See also:
:func:`flip` .
@ -50,7 +50,7 @@ cv::gpu::LUT
dst(I) = lut(src(I))
.. cfunction:: void LUT(const GpuMat\& src, const Mat\& lut, GpuMat\& dst)
.. c:function:: void LUT(const GpuMat\& src, const Mat\& lut, GpuMat\& dst)
Transforms the source matrix into the destination matrix using given look-up table:
@ -67,9 +67,10 @@ See also:
cv::gpu::merge
--------------
.. cfunction:: void merge(const GpuMat* src, size_t n, GpuMat\& dst)
.. c:function:: void merge(const GpuMat* src, size_t n, GpuMat\& dst)
.. cfunction:: void merge(const GpuMat* src, size_t n, GpuMat\& dst, const Stream\& stream)
.. c:function:: void merge(const GpuMat* src, size_t n, GpuMat\& dst,
const Stream\& stream)
Makes a multi-channel matrix out of several single-channel matrices.
@ -81,9 +82,10 @@ cv::gpu::merge
:param stream: Stream for the asynchronous version.
.. cfunction:: void merge(const vector$<$GpuMat$>$\& src, GpuMat\& dst)
.. c:function:: void merge(const vector$<$GpuMat$>$\& src, GpuMat\& dst)
.. cfunction:: void merge(const vector$<$GpuMat$>$\& src, GpuMat\& dst, const Stream\& stream)
.. c:function:: void merge(const vector$<$GpuMat$>$\& src, GpuMat\& dst,
const Stream\& stream)
* **src** Vector of the source matrices.
@ -98,9 +100,9 @@ See also:
cv::gpu::split
--------------
.. cfunction:: void split(const GpuMat\& src, GpuMat* dst)
.. c:function:: void split(const GpuMat\& src, GpuMat* dst)
.. cfunction:: void split(const GpuMat\& src, GpuMat* dst, const Stream\& stream)
.. c:function:: void split(const GpuMat\& src, GpuMat* dst, const Stream\& stream)
Copies each plane of a multi-channel matrix into an array.
@ -110,9 +112,10 @@ cv::gpu::split
:param stream: Stream for the asynchronous version.
.. cfunction:: void split(const GpuMat\& src, vector$<$GpuMat$>$\& dst)
.. c:function:: void split(const GpuMat\& src, vector$<$GpuMat$>$\& dst)
.. cfunction:: void split(const GpuMat\& src, vector$<$GpuMat$>$\& dst, const Stream\& stream)
.. c:function:: void split(const GpuMat\& src, vector$<$GpuMat$>$\& dst,
const Stream\& stream)
* **src** Source matrix.
@ -127,7 +130,7 @@ See also:
cv::gpu::magnitude
------------------
.. cfunction:: void magnitude(const GpuMat\& x, GpuMat\& magnitude)
.. c:function:: void magnitude(const GpuMat\& x, GpuMat\& magnitude)
Computes magnitudes of complex matrix elements.
@ -135,9 +138,10 @@ cv::gpu::magnitude
:param magnitude: Destination matrix of float magnitudes ( ``CV_32FC1`` ).
.. cfunction:: void magnitude(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude)
.. c:function:: void magnitude(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude)
.. cfunction:: void magnitude(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, const Stream\& stream)
.. c:function:: void magnitude(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,
const Stream\& stream)
* **x** Source matrix, containing real components ( ``CV_32FC1`` ).
@ -154,7 +158,7 @@ See also:
cv::gpu::magnitudeSqr
---------------------
.. cfunction:: void magnitudeSqr(const GpuMat\& x, GpuMat\& magnitude)
.. c:function:: void magnitudeSqr(const GpuMat\& x, GpuMat\& magnitude)
Computes squared magnitudes of complex matrix elements.
@ -162,9 +166,10 @@ cv::gpu::magnitudeSqr
:param magnitude: Destination matrix of float magnitude squares ( ``CV_32FC1`` ).
.. cfunction:: void magnitudeSqr(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude)
.. c:function:: void magnitudeSqr(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude)
.. cfunction:: void magnitudeSqr(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, const Stream\& stream)
.. c:function:: void magnitudeSqr(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,
const Stream\& stream)
* **x** Source matrix, containing real components ( ``CV_32FC1`` ).
@ -178,9 +183,11 @@ cv::gpu::magnitudeSqr
cv::gpu::phase
--------------
.. cfunction:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle, bool angleInDegrees=false)
.. c:function:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle,
bool angleInDegrees=false)
.. cfunction:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle, bool angleInDegrees, const Stream\& stream)
.. c:function:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle,
bool angleInDegrees, const Stream\& stream)
Computes polar angles of complex matrix elements.
@ -201,9 +208,11 @@ See also:
cv::gpu::cartToPolar
--------------------
.. cfunction:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, GpuMat\& angle, bool angleInDegrees=false)
.. c:function:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,
GpuMat\& angle, bool angleInDegrees=false)
.. cfunction:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, GpuMat\& angle, bool angleInDegrees, const Stream\& stream)
.. c:function:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,
GpuMat\& angle, bool angleInDegrees, const Stream\& stream)
Converts Cartesian coordinates into polar.
@ -226,9 +235,12 @@ See also:
cv::gpu::polarToCart
--------------------
.. cfunction:: void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle, GpuMat\& x, GpuMat\& y, bool angleInDegrees=false)
.. c:function:: void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle,
GpuMat\& x, GpuMat\& y, bool angleInDegrees=false)
.. cfunction:: void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle, GpuMat\& x, GpuMat\& y, bool angleInDegrees, const Stream\& stream)
.. c:function:: void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle,
GpuMat\& x, GpuMat\& y, bool angleInDegrees,
const Stream\& stream)
Converts polar coordinates into Cartesian.

View File

@ -7,7 +7,7 @@ Per-element Operations.
cv::gpu::add
------------
.. cfunction:: void add(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
.. c:function:: void add(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Computes matrix-matrix or matrix-scalar sum.
@ -17,7 +17,7 @@ cv::gpu::add
:param c: Destination matrix. Will have the same size and type as ``a`` .
.. cfunction:: void add(const GpuMat\& a, const Scalar\& sc, GpuMat\& c)
.. c:function:: void add(const GpuMat\& a, const Scalar\& sc, GpuMat\& c)
* **a** Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now.
@ -32,7 +32,7 @@ See also:
cv::gpu::subtract
-----------------
.. cfunction:: void subtract(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
.. c:function:: void subtract(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Subtracts matrix from another matrix (or scalar from matrix).
@ -42,7 +42,7 @@ cv::gpu::subtract
:param c: Destination matrix. Will have the same size and type as ``a`` .
.. cfunction:: void subtract(const GpuMat\& a, const Scalar\& sc, GpuMat\& c)
.. c:function:: void subtract(const GpuMat\& a, const Scalar\& sc, GpuMat\& c)
* **a** Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now.
@ -57,7 +57,7 @@ See also:
cv::gpu::multiply
-----------------
.. cfunction:: void multiply(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
.. c:function:: void multiply(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Computes per-element product of two matrices (or of matrix and scalar).
@ -67,7 +67,7 @@ cv::gpu::multiply
:param c: Destionation matrix. Will have the same size and type as ``a`` .
.. cfunction:: void multiply(const GpuMat\& a, const Scalar\& sc, GpuMat\& c)
.. c:function:: void multiply(const GpuMat\& a, const Scalar\& sc, GpuMat\& c)
* **a** Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now.
@ -82,7 +82,7 @@ See also:
cv::gpu::divide
---------------
.. cfunction:: void divide(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
.. c:function:: void divide(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Performs per-element division of two matrices (or division of matrix by scalar).
@ -92,7 +92,7 @@ cv::gpu::divide
:param c: Destionation matrix. Will have the same size and type as ``a`` .
.. cfunction:: void divide(const GpuMat\& a, const Scalar\& sc, GpuMat\& c)
.. c:function:: void divide(const GpuMat\& a, const Scalar\& sc, GpuMat\& c)
* **a** Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now.
@ -110,7 +110,7 @@ See also:
cv::gpu::exp
------------
.. cfunction:: void exp(const GpuMat\& a, GpuMat\& b)
.. c:function:: void exp(const GpuMat\& a, GpuMat\& b)
Computes exponent of each matrix element.
@ -125,7 +125,7 @@ See also:
cv::gpu::log
------------
.. cfunction:: void log(const GpuMat\& a, GpuMat\& b)
.. c:function:: void log(const GpuMat\& a, GpuMat\& b)
Computes natural logarithm of absolute value of each matrix element.
@ -140,7 +140,7 @@ See also:
cv::gpu::absdiff
----------------
.. cfunction:: void absdiff(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
.. c:function:: void absdiff(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Computes per-element absolute difference of two matrices (or of matrix and scalar).
@ -150,7 +150,7 @@ cv::gpu::absdiff
:param c: Destionation matrix. Will have the same size and type as ``a`` .
.. cfunction:: void absdiff(const GpuMat\& a, const Scalar\& s, GpuMat\& c)
.. c:function:: void absdiff(const GpuMat\& a, const Scalar\& s, GpuMat\& c)
* **a** Source matrix. ``CV_32FC1`` matrixes are supported for now.
@ -165,7 +165,7 @@ See also:
cv::gpu::compare
----------------
.. cfunction:: void compare(const GpuMat\& a, const GpuMat\& b, GpuMat\& c, int cmpop)
.. c:function:: void compare(const GpuMat\& a, const GpuMat\& b, GpuMat\& c, int cmpop)
Compares elements of two matrices.
@ -175,15 +175,15 @@ cv::gpu::compare
:param c: Destination matrix. Will have the same size as ``a`` and be ``CV_8UC1`` type.
:param cmpop: Flag specifying the relation between the elements to be checked:
* **CMP_EQ** :math:`=`
* **CMP_GT** :math:`>`
* **CMP_GE** :math:`\ge`
* **CMP_LT** :math:`<`
* **CMP_LE** :math:`\le`
* **CMP_NE** :math:`\ne`
:param cmpop: Flag specifying the relation between the elements to be checked:
* **CMP_EQ** :math:`=`
* **CMP_GT** :math:`>`
* **CMP_GE** :math:`\ge`
* **CMP_LT** :math:`<`
* **CMP_LE** :math:`\le`
* **CMP_NE** :math:`\ne`
See also:
:func:`compare` .
@ -194,9 +194,11 @@ See also:
cv::gpu::bitwise_not
--------------------
.. cfunction:: void bitwise_not(const GpuMat\& src, GpuMat\& dst, const GpuMat\& mask=GpuMat())
.. c:function:: void bitwise_not(const GpuMat\& src, GpuMat\& dst,
const GpuMat\& mask=GpuMat())
.. cfunction:: void bitwise_not(const GpuMat\& src, GpuMat\& dst, const GpuMat\& mask, const Stream\& stream)
.. c:function:: void bitwise_not(const GpuMat\& src, GpuMat\& dst,
const GpuMat\& mask, const Stream\& stream)
Performs per-element bitwise inversion.
@ -217,9 +219,11 @@ See also:
cv::gpu::bitwise_or
-------------------
.. cfunction:: void bitwise_or(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, const GpuMat\& mask=GpuMat())
.. c:function:: void bitwise_or(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask=GpuMat())
.. cfunction:: void bitwise_or(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, const GpuMat\& mask, const Stream\& stream)
.. c:function:: void bitwise_or(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask, const Stream\& stream)
Performs per-element bitwise disjunction of two matrices.
@ -242,9 +246,11 @@ See also:
cv::gpu::bitwise_and
--------------------
.. cfunction:: void bitwise_and(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, const GpuMat\& mask=GpuMat())
.. c:function:: void bitwise_and(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask=GpuMat())
.. cfunction:: void bitwise_and(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, const GpuMat\& mask, const Stream\& stream)
.. c:function:: void bitwise_and(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask, const Stream\& stream)
Performs per-element bitwise conjunction of two matrices.
@ -267,9 +273,11 @@ See also:
cv::gpu::bitwise_xor
--------------------
.. cfunction:: void bitwise_xor(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, const GpuMat\& mask=GpuMat())
.. c:function:: void bitwise_xor(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask=GpuMat())
.. cfunction:: void bitwise_xor(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, const GpuMat\& mask, const Stream\& stream)
.. c:function:: void bitwise_xor(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask, const Stream\& stream)
Performs per-element bitwise "exclusive or" of two matrices.
@ -290,9 +298,10 @@ See also:
cv::gpu::min
------------
.. cfunction:: void min(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst)
.. c:function:: void min(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst)
.. cfunction:: void min(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, const Stream\& stream)
.. c:function:: void min(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const Stream\& stream)
Computes per-element minimum of two matrices (or of matrix and scalar).
@ -304,9 +313,10 @@ cv::gpu::min
:param stream: Stream for the asynchronous version.
.. cfunction:: void min(const GpuMat\& src1, double src2, GpuMat\& dst)
.. c:function:: void min(const GpuMat\& src1, double src2, GpuMat\& dst)
.. cfunction:: void min(const GpuMat\& src1, double src2, GpuMat\& dst, const Stream\& stream)
.. c:function:: void min(const GpuMat\& src1, double src2, GpuMat\& dst,
const Stream\& stream)
* **src1** Source matrix.
@ -323,9 +333,10 @@ See also:
cv::gpu::max
------------
.. cfunction:: void max(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst)
.. c:function:: void max(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst)
.. cfunction:: void max(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, const Stream\& stream)
.. c:function:: void max(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const Stream\& stream)
Computes per-element maximum of two matrices (or of matrix and scalar).
@ -337,9 +348,10 @@ cv::gpu::max
:param stream: Stream for the asynchronous version.
.. cfunction:: void max(const GpuMat\& src1, double src2, GpuMat\& dst)
.. c:function:: void max(const GpuMat\& src1, double src2, GpuMat\& dst)
.. cfunction:: void max(const GpuMat\& src1, double src2, GpuMat\& dst, const Stream\& stream)
.. c:function:: void max(const GpuMat\& src1, double src2, GpuMat\& dst,
const Stream\& stream)
* **src1** Source matrix.

View File

@ -1,27 +0,0 @@
*************************************
highgui. High-level GUI and Media I/O
*************************************
While OpenCV was designed for use in full-scale
applications and can be used within functionally rich UI frameworks (such as Qt, WinForms or Cocoa) or without any UI at all, sometimes there is a need to try some functionality quickly and visualize the results. This is what the HighGUI module has been designed for.
It provides easy interface to:
*
create and manipulate windows that can display images and "remember" their content (no need to handle repaint events from OS)
*
add trackbars to the windows, handle simple mouse events as well as keyboard commmands
*
read and write images to/from disk or memory.
*
read video from camera or file and write video to a file.
.. toctree::
:maxdepth: 2
highgui_user_interface
highgui_reading_and_writing_images_and_video
highgui_qt_new_functions

View File

@ -8,7 +8,7 @@ Qt new functions
This figure explains the new functionalities implemented with Qt GUI. As we can see, the new GUI provides a statusbar, a toolbar, and a control panel. The control panel can have trackbars and buttonbars attached to it.
*
To attach a trackbar, the window_ name parameter must be NULL.
To attach a trackbar, the window name parameter must be NULL.
*
To attach a buttonbar, a button must be created.
@ -56,60 +56,59 @@ The following code is an example used to generate the figure. ::
cvReleaseCapture(&video);
return 0;
}
..
.. index:: setWindowProperty
cv::setWindowProperty
setWindowProperty
---------------------
.. cfunction:: void setWindowProperty(const string\& name, int prop_id, double prop_value)
.. c:function:: void setWindowProperty(const string& name, int prop_id, double prop_value)
Change the parameters of the window dynamically.
:param name: Name of the window.
:param prop_id: Window's property to edit. The operation flags:
:param prop_id: Window's property to edit. The operation flags:
* **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( ``CV_WINDOW_NORMAL`` or ``CV_WINDOW_FULLSCREEN`` ).
* **CV_WND_PROP_AUTOSIZE** Change if the user can resize the window (texttt {CV\_WINDOW\_NORMAL} or ``CV_WINDOW_AUTOSIZE`` ).
* **CV_WND_PROP_ASPECTRATIO** Change if the image's aspect ratio is preserved (texttt {CV\_WINDOW\_FREERATIO} or ``CV_WINDOW_KEEPRATIO`` ).
:param prop_value: New value of the Window's property. The operation flags:
:param prop_value: New value of the Window's property. The operation flags:
* **CV_WINDOW_NORMAL** Change the window in normal size, or allows the user to resize the window.
* **CV_WINDOW_AUTOSIZE** The user cannot resize the window, the size is constrainted by the image displayed.
* **CV_WINDOW_FULLSCREEN** Change the window to fullscreen.
* **CV_WINDOW_FREERATIO** The image expends as much as it can (no ratio constraint)
* **CV_WINDOW_KEEPRATIO** The ration image is respected.
The function `` setWindowProperty`` allows to change the window's properties.
.. index:: getWindowProperty
cv::getWindowProperty
getWindowProperty
---------------------
.. cfunction:: void getWindowProperty(const char* name, int prop_id)
.. c:function:: void getWindowProperty(const char* name, int prop_id)
Get the parameters of the window.
:param name: Name of the window.
:param prop_id: Window's property to retrive. The operation flags:
:param prop_id: Window's property to retrive. The operation flags:
* **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( ``CV_WINDOW_NORMAL`` or ``CV_WINDOW_FULLSCREEN`` ).
* **CV_WND_PROP_AUTOSIZE** Change if the user can resize the window (texttt {CV\_WINDOW\_NORMAL} or ``CV_WINDOW_AUTOSIZE`` ).
* **CV_WND_PROP_ASPECTRATIO** Change if the image's aspect ratio is preserved (texttt {CV\_WINDOW\_FREERATIO} or ``CV_WINDOW_KEEPRATIO`` ).
See
:ref:`setWindowProperty` to know the meaning of the returned values.
@ -118,41 +117,40 @@ The function `` getWindowProperty`` return window's properties.
.. index:: fontQt
cv::fontQt
fontQt
----------
.. cfunction:: CvFont fontQt(const string\& nameFont, int pointSize = -1, Scalar color = Scalar::all(0), int weight = CV_FONT_NORMAL, int style = CV_STYLE_NORMAL, int spacing = 0)
.. c:function:: CvFont fontQt(const string& nameFont, int pointSize = -1, Scalar color = Scalar::all(0), int weight = CV_FONT_NORMAL, int style = CV_STYLE_NORMAL, int spacing = 0)
Create the font to be used to draw text on an image.
:param nameFont: Name of the font. The name should match the name of a system font (such as ``Times''). If the font is not found, a default one will be used.
:param nameFont: Name of the font. The name should match the name of a system font (such as *Times*). If the font is not found, a default one will be used.
:param pointSize: Size of the font. If not specified, equal zero or negative, the point size of the font is set to a system-dependent default value. Generally, this is 12 points.
:param color: Color of the font in BGRA -- A = 255 is fully transparent. Use the macro CV _ RGB for simplicity.
:param weight: The operation flags:
:param weight: The operation flags:
* **CV_FONT_LIGHT** Weight of 25
* **CV_FONT_NORMAL** Weight of 50
* **CV_FONT_DEMIBOLD** Weight of 63
* **CV_FONT_BOLD** Weight of 75
* **CV_FONT_BLACK** Weight of 87
You can also specify a positive integer for more control.
You can also specify a positive integer for more control.
:param style: The operation flags:
:param style: The operation flags:
* **CV_STYLE_NORMAL** Font is normal
* **CV_STYLE_ITALIC** Font is in italic
* **CV_STYLE_OBLIQUE** Font is oblique
:param spacing: Spacing between characters. Can be negative or positive
The function ``fontQt`` creates a CvFont object. This CvFont is not compatible with putText.
@ -161,13 +159,12 @@ A basic usage of this function is: ::
CvFont font = fontQt(''Times'');
addText( img1, ``Hello World !'', Point(50,50), font);
..
.. index:: addText
cv::addText
addText
-----------
.. cfunction:: void addText(const Mat\& img, const string\& text, Point location, CvFont *font)
.. c:function:: void addText(const Mat& img, const string& text, Point location, CvFont *font)
Create the font to be used to draw text on an image
@ -190,9 +187,9 @@ using a specific font
.. index:: displayOverlay
cv::displayOverlay
displayOverlay
------------------
.. cfunction:: void displayOverlay(const string\& name, const string\& text, int delay)
.. c:function:: void displayOverlay(const string& name, const string& text, int delay)
Display text on the window's image as an overlay for delay milliseconds. This is not editing the image's data. The text is display on the top of the image.
@ -208,9 +205,9 @@ The function ``displayOverlay`` aims at displaying useful information/tips on th
.. index:: displayStatusBar
cv::displayStatusBar
displayStatusBar
--------------------
.. cfunction:: void displayStatusBar(const string\& name, const string\& text, int delayms)
.. c:function:: void displayStatusBar(const string& name, const string& text, int delayms)
Display text on the window's statusbar as for delay milliseconds.
@ -226,11 +223,10 @@ The function ``displayOverlay`` aims at displaying useful information/tips on th
.. index:: createOpenGLCallback
cv::createOpenGLCallback
createOpenGLCallback
------------------------
*_*
.. cfunction:: void createOpenGLCallback( const string\& window_name, OpenGLCallback callbackOpenGL, void* userdata CV_DEFAULT(NULL), double angle CV_DEFAULT(-1), double zmin CV_DEFAULT(-1), double zmax CV_DEFAULT(-1)
.. c:function:: void createOpenGLCallback( const string& window_name, OpenGLCallback callbackOpenGL, void* userdata CV_DEFAULT(NULL), double angle CV_DEFAULT(-1), double zmin CV_DEFAULT(-1), double zmax CV_DEFAULT(-1)
Create a callback function called to draw OpenGL on top the the image display by windowname.
@ -278,15 +274,13 @@ The function ``createOpenGLCallback`` can be used to draw 3D data on the window.
glEnd();
}
}
..
.. index:: saveWindowParameters
cv::saveWindowParameters
saveWindowParameters
------------------------
*_*
.. cfunction:: void saveWindowParameters(const string\& name)
.. c:function:: void saveWindowParameters(const string& name)
Save parameters of the window windowname.
@ -297,11 +291,10 @@ The function ``saveWindowParameters`` saves size, location, flags, trackbars' v
.. index:: loadWindowParameters
cv::loadWindowParameters
loadWindowParameters
------------------------
*_*
.. cfunction:: void loadWindowParameters(const string\& name)
.. c:function:: void loadWindowParameters(const string& name)
Load parameters of the window windowname.
@ -312,11 +305,10 @@ The function ``loadWindowParameters`` load size, location, flags, trackbars' va
.. index:: createButton
cv::createButton
createButton
----------------
*_*
.. cfunction:: createButton( const string\& button_name CV_DEFAULT(NULL),ButtonCallback on_change CV_DEFAULT(NULL), void* userdata CV_DEFAULT(NULL) , int button_type CV_DEFAULT(CV_PUSH_BUTTON), int initial_button_state CV_DEFAULT(0)
.. c:function:: createButton( const string& button_name CV_DEFAULT(NULL),ButtonCallback on_change CV_DEFAULT(NULL), void* userdata CV_DEFAULT(NULL), int button_type CV_DEFAULT(CV_PUSH_BUTTON), int initial_button_state CV_DEFAULT(0))
Create a callback function called to draw OpenGL on top the the image display by windowname.
@ -329,7 +321,7 @@ cv::createButton
:param userdata: pointer passed to the callback function. *(Optional)*
The ``button_type`` parameter can be :
*(Optional -- Will be a push button by default.)
* (Optional -- Will be a push button by default.)
* **CV_PUSH_BUTTON** The button will be a push button.
@ -337,8 +329,6 @@ The ``button_type`` parameter can be :
* **CV_RADIOBOX** The button will be a radiobox button. The radiobox on the same buttonbar (same line) are exclusive; one on can be select at the time.
*
* **initial_button_state** Default state of the button. Use for checkbox and radiobox, its value could be 0 or 1. *(Optional)*
The function ``createButton`` attach a button to the control panel. Each button is added to a buttonbar on the right of the last button.
@ -351,5 +341,7 @@ Here are various example of ``createButton`` function call: ::
createButton("button3",callbackButton,&value);
createButton("button5",callbackButton1,NULL,CV_RADIOBOX);
createButton("button6",callbackButton2,NULL,CV_PUSH_BUTTON,1);
..

View File

@ -5,9 +5,9 @@ Reading and Writing Images and Video
.. index:: imdecode
cv::imdecode
imdecode
------------
.. cfunction:: Mat imdecode( const Mat\& buf, int flags )
.. c:function:: Mat imdecode( const Mat\& buf, int flags )
Reads an image from a buffer in memory.
@ -22,9 +22,9 @@ See
.. index:: imencode
cv::imencode
imencode
------------
.. cfunction:: bool imencode( const string\& ext, const Mat\& img, vector<uchar>\& buf, const vector<int>\& params=vector<int>())
.. c:function:: bool imencode( const string\& ext, const Mat\& img, vector<uchar>\& buf, const vector<int>\& params=vector<int>())
Encode an image into a memory buffer.
@ -41,9 +41,9 @@ See
.. index:: imread
cv::imread
imread
----------
.. cfunction:: Mat imread( const string\& filename, int flags=1 )
.. c:function:: Mat imread( const string\& filename, int flags=1 )
Loads an image from a file.
@ -98,9 +98,9 @@ On Linux, BSD flavors and other Unix-like open-source operating systems OpenCV l
.. index:: imwrite
cv::imwrite
imwrite
-----------
.. cfunction:: bool imwrite( const string\& filename, const Mat\& img, const vector<int>\& params=vector<int>())
.. c:function:: bool imwrite( const string\& filename, const Mat\& img, const vector<int>\& params=vector<int>())
Saves an image to a specified file.
@ -127,7 +127,7 @@ The function ``imwrite`` saves the image to the specified file. The image format
VideoCapture
------------
.. ctype:: VideoCapture
.. c:type:: VideoCapture
Class for video capturing from video files or cameras ::
@ -209,13 +209,13 @@ The class provides C++ video capturing API. Here is how the class can be used: :
.. index:: VideoCapture::VideoCapture
cv::VideoCapture::VideoCapture
VideoCapture::VideoCapture
------------------------------
.. cfunction:: VideoCapture::VideoCapture()
.. c:function:: VideoCapture::VideoCapture()
.. cfunction:: VideoCapture::VideoCapture(const string\& filename)
.. c:function:: VideoCapture::VideoCapture(const string\& filename)
.. cfunction:: VideoCapture::VideoCapture(int device)
.. c:function:: VideoCapture::VideoCapture(int device)
:param filename: TOWRITE
@ -225,9 +225,9 @@ VideoCapture constructors.
.. index:: VideoCapture::get
cv::VideoCapture::get
VideoCapture::get
---------------------
.. cfunction:: double VideoCapture::get(int property_id)
.. c:function:: double VideoCapture::get(int property_id)
:param property_id: Property identifier. Can be one of the following:
@ -273,9 +273,9 @@ Note that when querying a property which is unsupported by the backend used by t
.. index:: VideoCapture::set
cv::VideoCapture::set
VideoCapture::set
---------------------
.. cfunction:: bool VideoCapture::set(int property_id, double value)
.. c:function:: bool VideoCapture::set(int property_id, double value)
:param property_id: Property identifier. Can be one of the following:
@ -327,7 +327,7 @@ Sets a property in the VideoCapture backend.
VideoWriter
-----------
.. ctype:: VideoWriter
.. c:type:: VideoWriter
Video writer class ::

View File

@ -5,9 +5,9 @@ User Interface
.. index:: createTrackbar
cv::createTrackbar
createTrackbar
------------------
.. cfunction:: int createTrackbar( const string\& trackbarname, const string\& winname, int* value, int count, TrackbarCallback onChange CV_DEFAULT(0), void* userdata CV_DEFAULT(0))
.. c:function:: int createTrackbar( const string\& trackbarname, const string\& winname, int* value, int count, TrackbarCallback onChange CV_DEFAULT(0), void* userdata CV_DEFAULT(0))
Creates a trackbar and attaches it to the specified window
@ -41,9 +41,9 @@ By clicking on the label of each trackbar, it is possible to edit the trackbar's
.. index:: getTrackbarPos
cv::getTrackbarPos
getTrackbarPos
------------------
.. cfunction:: int getTrackbarPos( const string\& trackbarname, const string\& winname )
.. c:function:: int getTrackbarPos( const string\& trackbarname, const string\& winname )
Returns the trackbar position.
@ -61,9 +61,9 @@ qt-specific details:
.. index:: imshow
cv::imshow
imshow
----------
.. cfunction:: void imshow( const string\& winname, const Mat\& image )
.. c:function:: void imshow( const string\& winname, const Mat\& image )
Displays the image in the specified window
@ -84,9 +84,9 @@ The function ``imshow`` displays the image in the specified window. If the windo
.. index:: namedWindow
cv::namedWindow
namedWindow
---------------
.. cfunction:: void namedWindow( const string\& winname, int flags )
.. c:function:: void namedWindow( const string\& winname, int flags )
Creates a window.
@ -122,9 +122,9 @@ qt-specific details:
.. index:: setTrackbarPos
cv::setTrackbarPos
setTrackbarPos
------------------
.. cfunction:: void setTrackbarPos( const string\& trackbarname, const string\& winname, int pos )
.. c:function:: void setTrackbarPos( const string\& trackbarname, const string\& winname, int pos )
Sets the trackbar position.
@ -144,9 +144,9 @@ qt-specific details:
.. index:: waitKey
cv::waitKey
waitKey
-----------
.. cfunction:: int waitKey(int delay=0)
.. c:function:: int waitKey(int delay=0)
Waits for a pressed key.

View File

@ -5,15 +5,16 @@ Feature Detection
.. index:: Canny
cv::Canny
Canny
---------
.. cfunction:: void Canny( const Mat\& image, Mat\& edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false )
.. c:function:: void Canny( const Mat& image, Mat& edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false )
Finds edges in an image using Canny algorithm.
:param image: Single-channel 8-bit input image
:param edges: The output edge map. It will have the same size and the same type as ``image``
:param threshold1: The first threshold for the hysteresis procedure
:param threshold2: The second threshold for the hysteresis procedure
@ -27,20 +28,22 @@ http://en.wikipedia.org/wiki/Canny_edge_detector
.. index:: cornerEigenValsAndVecs
cv::cornerEigenValsAndVecs
cornerEigenValsAndVecs
--------------------------
.. cfunction:: void cornerEigenValsAndVecs( const Mat\& src, Mat\& dst, int blockSize, int apertureSize, int borderType=BORDER_DEFAULT )
.. c:function:: void cornerEigenValsAndVecs( const Mat& src, Mat& dst, int blockSize, int apertureSize, int borderType=BORDER_DEFAULT )
Calculates eigenvalues and eigenvectors of image blocks for corner detection.
:param src: Input single-channel 8-bit or floating-point image
:param dst: Image to store the results. It will have the same size as ``src`` and the type ``CV_32FC(6)``
:param blockSize: Neighborhood size (see discussion)
:param apertureSize: Aperture parameter for the :func:`Sobel` operator
:param boderType: Pixel extrapolation method; see :func:`borderInterpolate`
For every pixel
:math:`p` , the function ``cornerEigenValsAndVecs`` considers a ``blockSize`` :math:`\times` ``blockSize`` neigborhood
:math:`S(p)` . It calculates the covariation matrix of derivatives over the neighborhood as:
@ -56,28 +59,28 @@ After that it finds eigenvectors and eigenvalues of
:math:`M` and stores them into destination image in the form
:math:`(\lambda_1, \lambda_2, x_1, y_1, x_2, y_2)` where
* :math:`\lambda_1, \lambda_2` are the eigenvalues of
:math:`M` ; not sorted
* :math:`\lambda_1, \lambda_2` are the eigenvalues of :math:`M`; not sorted
* :math:`x_1, y_1` are the eigenvectors corresponding to :math:`\lambda_1`
* :math:`x_2, y_2` are the eigenvectors corresponding to :math:`\lambda_2`
* :math:`x_1, y_1` are the eigenvectors corresponding to
:math:`\lambda_1`
* :math:`x_2, y_2` are the eigenvectors corresponding to
:math:`\lambda_2`
The output of the function can be used for robust edge or corner detection.
See also:
:func:`cornerMinEigenVal`,:func:`cornerHarris`,:func:`preCornerDetect`
.. index:: cornerHarris
cv::cornerHarris
cornerHarris
----------------
.. cfunction:: void cornerHarris( const Mat\& src, Mat\& dst, int blockSize, int apertureSize, double k, int borderType=BORDER_DEFAULT )
.. c:function:: void cornerHarris( const Mat& src, Mat& dst, int blockSize, int apertureSize, double k, int borderType=BORDER_DEFAULT )
Harris edge detector.
:param src: Input single-channel 8-bit or floating-point image
:param dst: Image to store the Harris detector responses; will have type ``CV_32FC1`` and the same size as ``src``
:param blockSize: Neighborhood size (see the discussion of :func:`cornerEigenValsAndVecs` )
:param apertureSize: Aperture parameter for the :func:`Sobel` operator
@ -85,6 +88,7 @@ cv::cornerHarris
:param k: Harris detector free parameter. See the formula below
:param boderType: Pixel extrapolation method; see :func:`borderInterpolate`
The function runs the Harris edge detector on the image. Similarly to
:func:`cornerMinEigenVal` and
:func:`cornerEigenValsAndVecs` , for each pixel
@ -101,20 +105,22 @@ Corners in the image can be found as the local maxima of this response map.
.. index:: cornerMinEigenVal
cv::cornerMinEigenVal
cornerMinEigenVal
---------------------
.. cfunction:: void cornerMinEigenVal( const Mat\& src, Mat\& dst, int blockSize, int apertureSize=3, int borderType=BORDER_DEFAULT )
.. c:function:: void cornerMinEigenVal( const Mat& src, Mat& dst, int blockSize, int apertureSize=3, int borderType=BORDER_DEFAULT )
Calculates the minimal eigenvalue of gradient matrices for corner detection.
:param src: Input single-channel 8-bit or floating-point image
:param dst: Image to store the minimal eigenvalues; will have type ``CV_32FC1`` and the same size as ``src``
:param blockSize: Neighborhood size (see the discussion of :func:`cornerEigenValsAndVecs` )
:param apertureSize: Aperture parameter for the :func:`Sobel` operator
:param boderType: Pixel extrapolation method; see :func:`borderInterpolate`
The function is similar to
:func:`cornerEigenValsAndVecs` but it calculates and stores only the minimal eigenvalue of the covariation matrix of derivatives, i.e.
:math:`\min(\lambda_1, \lambda_2)` in terms of the formulae in
@ -122,9 +128,9 @@ The function is similar to
.. index:: cornerSubPix
cv::cornerSubPix
cornerSubPix
----------------
.. cfunction:: void cornerSubPix( const Mat\& image, vector<Point2f>\& corners, Size winSize, Size zeroZone, TermCriteria criteria )
.. c:function:: void cornerSubPix( const Mat& image, vector<Point2f>& corners, Size winSize, Size zeroZone, TermCriteria criteria )
Refines the corner locations.
@ -178,9 +184,9 @@ The algorithm sets the center of the neighborhood window at this new center
.. index:: goodFeaturesToTrack
cv::goodFeaturesToTrack
goodFeaturesToTrack
-----------------------
.. cfunction:: void goodFeaturesToTrack( const Mat\& image, vector<Point2f>\& corners, int maxCorners, double qualityLevel, double minDistance, const Mat\& mask=Mat(), int blockSize=3, bool useHarrisDetector=false, double k=0.04 )
.. c:function:: void goodFeaturesToTrack( const Mat& image, vector<Point2f>& corners, int maxCorners, double qualityLevel, double minDistance, const Mat& mask=Mat(), int blockSize=3, bool useHarrisDetector=false, double k=0.04 )
Determines strong corners on an image.
@ -197,18 +203,18 @@ cv::goodFeaturesToTrack
:param mask: The optional region of interest. If the image is not empty (then it needs to have the type ``CV_8UC1`` and the same size as ``image`` ), it will specify the region in which the corners are detected
:param blockSize: Size of the averaging block for computing derivative covariation matrix over each pixel neighborhood, see :func:`cornerEigenValsAndVecs`
:param useHarrisDetector: Indicates, whether to use operator or :func:`cornerMinEigenVal`
:param k: Free parameter of Harris detector
The function finds the most prominent corners in the image or in the specified image region, as described
in
Shi94
:
The function finds the most prominent corners in the image or in the specified image region, as described in Shi94:
#.
the function first calculates the corner quality measure at every source image pixel using the
:func:`cornerMinEigenVal` or
:func:`cornerHarris`
#.
then it performs non-maxima suppression (the local maxima in
:math:`3\times 3` neighborhood
@ -226,23 +232,25 @@ Shi94
:math:`pt_j` if there is a stronger corner
:math:`pt_i` (
:math:`i < j` ) such that the distance between them is less than ``minDistance``
The function can be used to initialize a point-based tracker of an object.
Note that the if the function is called with different values ``A`` and ``B`` of the parameter ``qualityLevel`` , and ``A`` > {B}, the vector of returned corners with ``qualityLevel=A`` will be the prefix of the output vector with ``qualityLevel=B`` .
See also:
:func:`cornerMinEigenVal`,:func:`cornerHarris`,:func:`calcOpticalFlowPyrLK`,:func:`estimateRigidMotion`,:func:`PlanarObjectDetector`,:func:`OneWayDescriptor`
See also: :func:`cornerMinEigenVal`, :func:`cornerHarris`, :func:`calcOpticalFlowPyrLK`, :func:`estimateRigidMotion`, :func:`PlanarObjectDetector`, :func:`OneWayDescriptor`
.. index:: HoughCircles
cv::HoughCircles
HoughCircles
----------------
.. cfunction:: void HoughCircles( Mat\& image, vector<Vec3f>\& circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0 )
.. c:function:: void HoughCircles( Mat& image, vector<Vec3f>& circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0 )
Finds circles in a grayscale image using a Hough transform.
:param image: The 8-bit, single-channel, grayscale input image
:param circles: The output vector of found circles. Each vector is encoded as 3-element floating-point vector :math:`(x, y, radius)`
:param method: Currently, the only implemented method is ``CV_HOUGH_GRADIENT`` , which is basically *21HT* , described in Yuen90 .
:param dp: The inverse ratio of the accumulator resolution to the image resolution. For example, if ``dp=1`` , the accumulator will have the same resolution as the input image, if ``dp=2`` - accumulator will have half as big width and height, etc
@ -289,7 +297,6 @@ The function finds circles in a grayscale image using some modification of Hough
imshow( "circles", img );
return 0;
}
..
Note that usually the function detects the circles' centers well, however it may fail to find the correct radii. You can assist the function by specifying the radius range ( ``minRadius`` and ``maxRadius`` ) if you know it, or you may ignore the returned radius, use only the center and find the correct radius using some additional procedure.
@ -297,9 +304,9 @@ See also:
:func:`fitEllipse`,:func:`minEnclosingCircle`
.. index:: HoughLines
cv::HoughLines
HoughLines
--------------
.. cfunction:: void HoughLines( Mat\& image, vector<Vec2f>\& lines, double rho, double theta, int threshold, double srn=0, double stn=0 )
.. c:function:: void HoughLines( Mat& image, vector<Vec2f>& lines, double rho, double theta, int threshold, double srn=0, double stn=0 )
Finds lines in a binary image using standard Hough transform.
@ -316,14 +323,15 @@ cv::HoughLines
:param srn: For the multi-scale Hough transform it is the divisor for the distance resolution ``rho`` . The coarse accumulator distance resolution will be ``rho`` and the accurate accumulator resolution will be ``rho/srn`` . If both ``srn=0`` and ``stn=0`` then the classical Hough transform is used, otherwise both these parameters should be positive.
:param stn: For the multi-scale Hough transform it is the divisor for the distance resolution ``theta``
The function implements standard or standard multi-scale Hough transform algorithm for line detection. See
:func:`HoughLinesP` for the code example.
.. index:: HoughLinesP
cv::HoughLinesP
HoughLinesP
---------------
.. cfunction:: void HoughLinesP( Mat\& image, vector<Vec4i>\& lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 )
.. c:function:: void HoughLinesP( Mat& image, vector<Vec4i>& lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 )
Finds lines segments in a binary image using probabilistic Hough transform.
@ -397,7 +405,6 @@ Matas00
waitKey(0);
return 0;
}
..
This is the sample picture the function parameters have been tuned for:
@ -409,17 +416,20 @@ And this is the output of the above program in the case of probabilistic Hough t
.. index:: preCornerDetect
cv::preCornerDetect
preCornerDetect
-------------------
.. cfunction:: void preCornerDetect( const Mat\& src, Mat\& dst, int apertureSize, int borderType=BORDER_DEFAULT )
.. c:function:: void preCornerDetect( const Mat& src, Mat& dst, int apertureSize, int borderType=BORDER_DEFAULT )
Calculates the feature map for corner detection
:param src: The source single-channel 8-bit of floating-point image
:param dst: The output image; will have type ``CV_32F`` and the same size as ``src``
:param apertureSize: Aperture size of :func:`Sobel`
:param borderType: The pixel extrapolation method; see :func:`borderInterpolate`
The function calculates the complex spatial derivative-based function of the source image
.. math::
@ -438,5 +448,5 @@ The corners can be found as local maximums of the functions, as shown below: ::
// dilation with 3x3 rectangular structuring element
dilate(corners, dilated_corners, Mat(), 1);
Mat corner_mask = corners == dilated_corners;
..

View File

@ -18,7 +18,7 @@ OpenCV let the user to specify the extrapolation method; see the function :func
BaseColumnFilter
----------------
.. ctype:: BaseColumnFilter
.. c:type:: BaseColumnFilter
Base class for filters with single-column kernels ::
@ -43,7 +43,7 @@ Base class for filters with single-column kernels ::
int anchor; // position of the anchor point,
// normally not used during the processing
};
..
The class ``BaseColumnFilter`` is the base class for filtering data using single-column kernels. The filtering does not have to be a linear operation. In general, it could be written as following:
@ -64,7 +64,7 @@ See also:
BaseFilter
----------
.. ctype:: BaseFilter
.. c:type:: BaseFilter
Base class for 2D image filters ::
@ -88,7 +88,7 @@ Base class for 2D image filters ::
Size ksize;
Point anchor;
};
..
The class ``BaseFilter`` is the base class for filtering data using 2D kernels. The filtering does not have to be a linear operation. In general, it could be written as following:
@ -111,7 +111,7 @@ See also:
BaseRowFilter
-------------
.. ctype:: BaseRowFilter
.. c:type:: BaseRowFilter
Base class for filters with single-row kernels ::
@ -129,7 +129,7 @@ Base class for filters with single-row kernels ::
int width, int cn) = 0;
int ksize, anchor;
};
..
The class ``BaseRowFilter`` is the base class for filtering data using single-row kernels. The filtering does not have to be a linear operation. In general, it could be written as following:
@ -150,7 +150,7 @@ See also:
FilterEngine
------------
.. ctype:: FilterEngine
.. c:type:: FilterEngine
Generic image filtering class ::
@ -166,7 +166,7 @@ Generic image filtering class ::
// _rowBorderType and _columnBorderType determine how the image
// will be extrapolated beyond the image boundaries.
// _borderValue is only used when _rowBorderType and/or _columnBorderType
// == cv::BORDER_CONSTANT
// == BORDER_CONSTANT
FilterEngine(const Ptr<BaseFilter>& _filter2D,
const Ptr<BaseRowFilter>& _rowFilter,
const Ptr<BaseColumnFilter>& _columnFilter,
@ -217,7 +217,7 @@ Generic image filtering class ::
Ptr<BaseRowFilter> rowFilter;
Ptr<BaseColumnFilter> columnFilter;
};
..
The class ``FilterEngine`` can be used to apply an arbitrary filtering operation to an image.
It contains all the necessary intermediate buffers, it computes extrapolated values
@ -278,7 +278,7 @@ This class makes it easier (though, maybe not very easy yet) to combine filterin
}
}
}
..
If you do not need that much control of the filtering process, you can simply use the ``FilterEngine::apply`` method. Here is how the method is actually implemented: ::
@ -310,7 +310,7 @@ If you do not need that much control of the filtering process, you can simply us
dst.data + dstOfs.y*dst.step +
dstOfs.x*dst.elemSize(), (int)dst.step );
}
..
Unlike the earlier versions of OpenCV, now the filtering operations fully support the notion of image ROI, that is, pixels outside of the ROI but inside the image can be used in the filtering operations. For example, you can take a ROI of a single pixel and filter it - that will be a filter response at that particular pixel (however, it's possible to emulate the old behavior by passing ``isolated=false`` to ``FilterEngine::start`` or ``FilterEngine::apply`` ). You can pass the ROI explicitly to ``FilterEngine::apply`` , or construct a new matrix headers: ::
@ -334,7 +334,7 @@ Unlike the earlier versions of OpenCV, now the filtering operations fully suppor
Sobel(pix_roi, dst2, dst2.type(), 1, 0, 3, 1, 0, BORDER_REFLECT_101);
printf("method1 =
..
Note on the data types. As it was mentioned in
:func:`BaseFilter` description, the specific filters can process data of any type, despite that ``Base*Filter::operator()`` only takes ``uchar`` pointers and no information about the actual types. To make it all work, the following rules are used:
@ -351,9 +351,9 @@ See also:
:func:`BaseColumnFilter`,:func:`BaseFilter`,:func:`BaseRowFilter`,:func:`createBoxFilter`,:func:`createDerivFilter`,:func:`createGaussianFilter`,:func:`createLinearFilter`,:func:`createMorphologyFilter`,:func:`createSeparableLinearFilter`
.. index:: bilateralFilter
cv::bilateralFilter
bilateralFilter
-------------------
.. cfunction:: void bilateralFilter( const Mat\& src, Mat\& dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT )
.. c:function:: void bilateralFilter( const Mat\& src, Mat\& dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT )
Applies bilateral filter to the image
@ -369,9 +369,9 @@ http://www.dai.ed.ac.uk/CVonline/LOCAL\_COPIES/MANDUCHI1/Bilateral\_Filtering.ht
.. index:: blur
cv::blur
blur
--------
.. cfunction:: void blur( const Mat\& src, Mat\& dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT )
.. c:function:: void blur( const Mat\& src, Mat\& dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT )
Smoothes image using normalized box filter
@ -397,9 +397,9 @@ See also:
.. index:: borderInterpolate
cv::borderInterpolate
borderInterpolate
---------------------
.. cfunction:: int borderInterpolate( int p, int len, int borderType )
.. c:function:: int borderInterpolate( int p, int len, int borderType )
Computes source location of extrapolated pixel
@ -411,7 +411,7 @@ The function computes and returns the coordinate of the donor pixel, correspondi
float val = img.at<float>(borderInterpolate(100, img.rows, BORDER_REFLECT_101),
borderInterpolate(-5, img.cols, BORDER_WRAP));
..
Normally, the function is not called directly; it is used inside
:func:`FilterEngine` and
@ -421,9 +421,9 @@ See also:
:func:`FilterEngine`,:func:`copyMakeBorder`
.. index:: boxFilter
cv::boxFilter
boxFilter
-------------
.. cfunction:: void boxFilter( const Mat\& src, Mat\& dst, int ddepth, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT )
.. c:function:: void boxFilter( const Mat\& src, Mat\& dst, int ddepth, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT )
Smoothes image using box filter
@ -459,9 +459,9 @@ See also:
.. index:: buildPyramid
cv::buildPyramid
buildPyramid
----------------
.. cfunction:: void buildPyramid( const Mat\& src, vector<Mat>\& dst, int maxlevel )
.. c:function:: void buildPyramid( const Mat\& src, vector<Mat>\& dst, int maxlevel )
Constructs Gaussian pyramid for an image
@ -477,9 +477,9 @@ The function constructs a vector of images and builds the gaussian pyramid by re
.. index:: copyMakeBorder
cv::copyMakeBorder
copyMakeBorder
------------------
.. cfunction:: void copyMakeBorder( const Mat\& src, Mat\& dst, int top, int bottom, int left, int right, int borderType, const Scalar\& value=Scalar() )
.. c:function:: void copyMakeBorder( const Mat\& src, Mat\& dst, int top, int bottom, int left, int right, int borderType, const Scalar\& value=Scalar() )
Forms a border around the image
@ -508,19 +508,19 @@ The function supports the mode when ``src`` is already in the middle of ``dst``
border, border, BORDER_REPLICATE);
// now do some custom filtering ...
...
..
See also:
:func:`borderInterpolate`
.. index:: createBoxFilter
cv::createBoxFilter
createBoxFilter
-------------------
.. cfunction:: Ptr<FilterEngine> createBoxFilter( int srcType, int dstType, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT)
.. c:function:: Ptr<FilterEngine> createBoxFilter( int srcType, int dstType, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT)
.. cfunction:: Ptr<BaseRowFilter> getRowSumFilter(int srcType, int sumType, int ksize, int anchor=-1)
.. c:function:: Ptr<BaseRowFilter> getRowSumFilter(int srcType, int sumType, int ksize, int anchor=-1)
.. cfunction:: Ptr<BaseColumnFilter> getColumnSumFilter(int sumType, int dstType, int ksize, int anchor=-1, double scale=1)
.. c:function:: Ptr<BaseColumnFilter> getColumnSumFilter(int sumType, int dstType, int ksize, int anchor=-1, double scale=1)
Returns box filter engine
@ -549,9 +549,9 @@ See also:
.. index:: createDerivFilter
cv::createDerivFilter
createDerivFilter
---------------------
.. cfunction:: Ptr<FilterEngine> createDerivFilter( int srcType, int dstType, int dx, int dy, int ksize, int borderType=BORDER_DEFAULT )
.. c:function:: Ptr<FilterEngine> createDerivFilter( int srcType, int dstType, int dx, int dy, int ksize, int borderType=BORDER_DEFAULT )
Returns engine for computing image derivatives
@ -576,9 +576,9 @@ See also:
.. index:: createGaussianFilter
cv::createGaussianFilter
createGaussianFilter
------------------------
.. cfunction:: Ptr<FilterEngine> createGaussianFilter( int type, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT)
.. c:function:: Ptr<FilterEngine> createGaussianFilter( int type, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT)
Returns engine for smoothing images with a Gaussian filter
@ -599,11 +599,11 @@ See also:
.. index:: createLinearFilter
cv::createLinearFilter
createLinearFilter
----------------------
.. cfunction:: Ptr<FilterEngine> createLinearFilter(int srcType, int dstType, const Mat\& kernel, Point _anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar\& borderValue=Scalar())
.. c:function:: Ptr<FilterEngine> createLinearFilter(int srcType, int dstType, const Mat\& kernel, Point _anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar\& borderValue=Scalar())
.. cfunction:: Ptr<BaseFilter> getLinearFilter(int srcType, int dstType, const Mat\& kernel, Point anchor=Point(-1,-1), double delta=0, int bits=0)
.. c:function:: Ptr<BaseFilter> getLinearFilter(int srcType, int dstType, const Mat\& kernel, Point anchor=Point(-1,-1), double delta=0, int bits=0)
Creates non-separable linear filter engine
@ -629,17 +629,17 @@ See also:
:func:`createSeparableLinearFilter`,:func:`FilterEngine`,:func:`filter2D`
.. index:: createMorphologyFilter
cv::createMorphologyFilter
createMorphologyFilter
--------------------------
.. cfunction:: Ptr<FilterEngine> createMorphologyFilter(int op, int type, const Mat\& element, Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT, int columnBorderType=-1, const Scalar\& borderValue=morphologyDefaultBorderValue())
.. c:function:: Ptr<FilterEngine> createMorphologyFilter(int op, int type, const Mat\& element, Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT, int columnBorderType=-1, const Scalar\& borderValue=morphologyDefaultBorderValue())
.. cfunction:: Ptr<BaseFilter> getMorphologyFilter(int op, int type, const Mat\& element, Point anchor=Point(-1,-1))
.. c:function:: Ptr<BaseFilter> getMorphologyFilter(int op, int type, const Mat\& element, Point anchor=Point(-1,-1))
.. cfunction:: Ptr<BaseRowFilter> getMorphologyRowFilter(int op, int type, int esize, int anchor=-1)
.. c:function:: Ptr<BaseRowFilter> getMorphologyRowFilter(int op, int type, int esize, int anchor=-1)
.. cfunction:: Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int esize, int anchor=-1)
.. c:function:: Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int esize, int anchor=-1)
.. cfunction:: static inline Scalar morphologyDefaultBorderValue(){ return Scalar::all(DBL_MAX) }
.. c:function:: static inline Scalar morphologyDefaultBorderValue(){ return Scalar::all(DBL_MAX) }
Creates engine for non-separable morphological operations
@ -665,13 +665,13 @@ See also:
:func:`erode`,:func:`dilate`,:func:`morphologyEx`,:func:`FilterEngine`
.. index:: createSeparableLinearFilter
cv::createSeparableLinearFilter
createSeparableLinearFilter
-------------------------------
.. cfunction:: Ptr<FilterEngine> createSeparableLinearFilter(int srcType, int dstType, const Mat\& rowKernel, const Mat\& columnKernel, Point anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar\& borderValue=Scalar())
.. c:function:: Ptr<FilterEngine> createSeparableLinearFilter(int srcType, int dstType, const Mat\& rowKernel, const Mat\& columnKernel, Point anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar\& borderValue=Scalar())
.. cfunction:: Ptr<BaseColumnFilter> getLinearColumnFilter(int bufType, int dstType, const Mat\& columnKernel, int anchor, int symmetryType, double delta=0, int bits=0)
.. c:function:: Ptr<BaseColumnFilter> getLinearColumnFilter(int bufType, int dstType, const Mat\& columnKernel, int anchor, int symmetryType, double delta=0, int bits=0)
.. cfunction:: Ptr<BaseRowFilter> getLinearRowFilter(int srcType, int bufType, const Mat\& rowKernel, int anchor, int symmetryType)
.. c:function:: Ptr<BaseRowFilter> getLinearRowFilter(int srcType, int bufType, const Mat\& rowKernel, int anchor, int symmetryType)
Creates engine for separable linear filter
@ -705,9 +705,9 @@ See also:
:func:`sepFilter2D`,:func:`createLinearFilter`,:func:`FilterEngine`,:func:`getKernelType`
.. index:: dilate
cv::dilate
dilate
----------
.. cfunction:: void dilate( const Mat\& src, Mat\& dst, const Mat\& element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar\& borderValue=morphologyDefaultBorderValue() )
.. c:function:: void dilate( const Mat\& src, Mat\& dst, const Mat\& element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar\& borderValue=morphologyDefaultBorderValue() )
Dilates an image by using a specific structuring element.
@ -734,9 +734,9 @@ See also:
:func:`erode`,:func:`morphologyEx`,:func:`createMorphologyFilter`
.. index:: erode
cv::erode
erode
---------
.. cfunction:: void erode( const Mat\& src, Mat\& dst, const Mat\& element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar\& borderValue=morphologyDefaultBorderValue() )
.. c:function:: void erode( const Mat\& src, Mat\& dst, const Mat\& element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar\& borderValue=morphologyDefaultBorderValue() )
Erodes an image by using a specific structuring element.
@ -763,9 +763,9 @@ See also:
:func:`dilate`,:func:`morphologyEx`,:func:`createMorphologyFilter`
.. index:: filter2D
cv::filter2D
filter2D
------------
.. cfunction:: void filter2D( const Mat\& src, Mat\& dst, int ddepth, const Mat\& kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
.. c:function:: void filter2D( const Mat\& src, Mat\& dst, int ddepth, const Mat\& kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
Convolves an image with the kernel
@ -799,9 +799,9 @@ See also:
:func:`sepFilter2D`,:func:`createLinearFilter`,:func:`dft`,:func:`matchTemplate`
.. index:: GaussianBlur
cv::GaussianBlur
GaussianBlur
----------------
.. cfunction:: void GaussianBlur( const Mat\& src, Mat\& dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )
.. c:function:: void GaussianBlur( const Mat\& src, Mat\& dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )
Smoothes image using a Gaussian filter
@ -817,9 +817,9 @@ See also:
:func:`sepFilter2D`,:func:`filter2D`,:func:`blur`,:func:`boxFilter`,:func:`bilateralFilter`,:func:`medianBlur`
.. index:: getDerivKernels
cv::getDerivKernels
getDerivKernels
-------------------
.. cfunction:: void getDerivKernels( Mat\& kx, Mat\& ky, int dx, int dy, int ksize, bool normalize=false, int ktype=CV_32F )
.. c:function:: void getDerivKernels( Mat\& kx, Mat\& ky, int dx, int dy, int ksize, bool normalize=false, int ktype=CV_32F )
Returns filter coefficients for computing spatial image derivatives
@ -843,9 +843,9 @@ The function computes and returns the filter coefficients for spatial image deri
.. index:: getGaussianKernel
cv::getGaussianKernel
getGaussianKernel
---------------------
.. cfunction:: Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F )
.. c:function:: Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F )
Returns Gaussian filter coefficients
@ -873,9 +873,9 @@ See also:
.. index:: getKernelType
cv::getKernelType
getKernelType
-----------------
.. cfunction:: int getKernelType(const Mat\& kernel, Point anchor)
.. c:function:: int getKernelType(const Mat\& kernel, Point anchor)
Returns the kernel type
@ -895,9 +895,9 @@ The function analyzes the kernel coefficients and returns the corresponding kern
* **KERNEL_INTEGER** Al the kernel coefficients are integer numbers. This flag can be combined with ``KERNEL_SYMMETRICAL`` or ``KERNEL_ASYMMETRICAL``
.. index:: getStructuringElement
cv::getStructuringElement
getStructuringElement
-------------------------
.. cfunction:: Mat getStructuringElement(int shape, Size esize, Point anchor=Point(-1,-1))
.. c:function:: Mat getStructuringElement(int shape, Size esize, Point anchor=Point(-1,-1))
Returns the structuring element of the specified size and shape for morphological operations
@ -927,9 +927,9 @@ The function constructs and returns the structuring element that can be then pas
.. index:: medianBlur
cv::medianBlur
medianBlur
--------------
.. cfunction:: void medianBlur( const Mat\& src, Mat\& dst, int ksize )
.. c:function:: void medianBlur( const Mat\& src, Mat\& dst, int ksize )
Smoothes image using median filter
@ -944,9 +944,9 @@ See also:
:func:`bilateralFilter`,:func:`blur`,:func:`boxFilter`,:func:`GaussianBlur`
.. index:: morphologyEx
cv::morphologyEx
morphologyEx
----------------
.. cfunction:: void morphologyEx( const Mat\& src, Mat\& dst, int op, const Mat\& element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar\& borderValue=morphologyDefaultBorderValue() )
.. c:function:: void morphologyEx( const Mat\& src, Mat\& dst, int op, const Mat\& element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar\& borderValue=morphologyDefaultBorderValue() )
Performs advanced morphological transformations
@ -1009,9 +1009,9 @@ See also:
:func:`dilate`,:func:`erode`,:func:`createMorphologyFilter`
.. index:: Laplacian
cv::Laplacian
Laplacian
-------------
.. cfunction:: void Laplacian( const Mat\& src, Mat\& dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
.. c:function:: void Laplacian( const Mat\& src, Mat\& dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
Calculates the Laplacian of an image
@ -1043,9 +1043,9 @@ See also:
:func:`Sobel`,:func:`Scharr`
.. index:: pyrDown
cv::pyrDown
pyrDown
-----------
.. cfunction:: void pyrDown( const Mat\& src, Mat\& dst, const Size\& dstsize=Size())
.. c:function:: void pyrDown( const Mat\& src, Mat\& dst, const Size\& dstsize=Size())
Smoothes an image and downsamples it.
@ -1069,9 +1069,9 @@ and then downsamples the image by rejecting even rows and columns.
.. index:: pyrUp
cv::pyrUp
pyrUp
---------
.. cfunction:: void pyrUp( const Mat\& src, Mat\& dst, const Size\& dstsize=Size())
.. c:function:: void pyrUp( const Mat\& src, Mat\& dst, const Size\& dstsize=Size())
Upsamples an image and then smoothes it
@ -1090,9 +1090,9 @@ The function performs the upsampling step of the Gaussian pyramid construction (
.. index:: sepFilter2D
cv::sepFilter2D
sepFilter2D
---------------
.. cfunction:: void sepFilter2D( const Mat\& src, Mat\& dst, int ddepth, const Mat\& rowKernel, const Mat\& columnKernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
.. c:function:: void sepFilter2D( const Mat\& src, Mat\& dst, int ddepth, const Mat\& rowKernel, const Mat\& columnKernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
Applies separable linear filter to an image
@ -1117,9 +1117,9 @@ See also:
.. index:: Sobel
cv::Sobel
Sobel
---------
.. cfunction:: void Sobel( const Mat\& src, Mat\& dst, int ddepth, int xorder, int yorder, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
.. c:function:: void Sobel( const Mat\& src, Mat\& dst, int ddepth, int xorder, int yorder, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
Calculates the first, second, third or mixed image derivatives using an extended Sobel operator
@ -1183,9 +1183,9 @@ See also:
:func:`Scharr`,:func:`Lapacian`,:func:`sepFilter2D`,:func:`filter2D`,:func:`GaussianBlur`
.. index:: Scharr
cv::Scharr
Scharr
----------
.. cfunction:: void Scharr( const Mat\& src, Mat\& dst, int ddepth, int xorder, int yorder, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
.. c:function:: void Scharr( const Mat\& src, Mat\& dst, int ddepth, int xorder, int yorder, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
Calculates the first x- or y- image derivative using Scharr operator

View File

@ -36,9 +36,9 @@ The actual implementations of the geometrical transformations, from the most gen
.. index:: convertMaps
cv::convertMaps
convertMaps
---------------
.. cfunction:: void convertMaps( const Mat\& map1, const Mat\& map2, Mat\& dstmap1, Mat\& dstmap2, int dstmap1type, bool nninterpolation=false )
.. c:function:: void convertMaps( const Mat\& map1, const Mat\& map2, Mat\& dstmap1, Mat\& dstmap2, int dstmap1type, bool nninterpolation=false )
Converts image transformation maps from one representation to another
@ -68,9 +68,9 @@ See also:
:func:`remap`,:func:`undisort`,:func:`initUndistortRectifyMap`
.. index:: getAffineTransform
cv::getAffineTransform
getAffineTransform
----------------------
.. cfunction:: Mat getAffineTransform( const Point2f src[], const Point2f dst[] )
.. c:function:: Mat getAffineTransform( const Point2f src[], const Point2f dst[] )
Calculates the affine transform from 3 pairs of the corresponding points
@ -97,9 +97,9 @@ See also:
:func:`warpAffine`,:func:`transform`
.. index:: getPerspectiveTransform
cv::getPerspectiveTransform
getPerspectiveTransform
---------------------------
.. cfunction:: Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] )
.. c:function:: Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] )
Calculates the perspective transform from 4 pairs of the corresponding points
@ -126,9 +126,9 @@ See also:
:func:`findHomography`,:func:`warpPerspective`,:func:`perspectiveTransform`
.. index:: getRectSubPix
cv::getRectSubPix
getRectSubPix
-----------------
.. cfunction:: void getRectSubPix( const Mat\& image, Size patchSize, Point2f center, Mat\& dst, int patchType=-1 )
.. c:function:: void getRectSubPix( const Mat\& image, Size patchSize, Point2f center, Mat\& dst, int patchType=-1 )
Retrieves the pixel rectangle from an image with sub-pixel accuracy
@ -158,9 +158,9 @@ See also:
:func:`warpAffine`,:func:`warpPerspective`
.. index:: getRotationMatrix2D
cv::getRotationMatrix2D
getRotationMatrix2D
-----------------------
.. cfunction:: Mat getRotationMatrix2D( Point2f center, double angle, double scale )
.. c:function:: Mat getRotationMatrix2D( Point2f center, double angle, double scale )
Calculates the affine matrix of 2d rotation.
@ -188,9 +188,9 @@ See also:
:func:`getAffineTransform`,:func:`warpAffine`,:func:`transform`
.. index:: invertAffineTransform
cv::invertAffineTransform
invertAffineTransform
-------------------------
.. cfunction:: void invertAffineTransform(const Mat\& M, Mat\& iM)
.. c:function:: void invertAffineTransform(const Mat\& M, Mat\& iM)
Inverts an affine transformation
@ -210,9 +210,9 @@ The result will also be a
.. index:: remap
cv::remap
remap
---------
.. cfunction:: void remap( const Mat\& src, Mat\& dst, const Mat\& map1, const Mat\& map2, int interpolation, int borderMode=BORDER_CONSTANT, const Scalar\& borderValue=Scalar())
.. c:function:: void remap( const Mat\& src, Mat\& dst, const Mat\& map1, const Mat\& map2, int interpolation, int borderMode=BORDER_CONSTANT, const Scalar\& borderValue=Scalar())
Applies a generic geometrical transformation to an image.
@ -252,9 +252,9 @@ This function can not operate in-place.
.. index:: resize
cv::resize
resize
----------
.. cfunction:: void resize( const Mat\& src, Mat\& dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR )
.. c:function:: void resize( const Mat\& src, Mat\& dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR )
Resizes an image
@ -300,28 +300,29 @@ Note that the initial ``dst`` type or size are not taken into account. Instead t
// explicitly specify dsize=dst.size(); fx and fy will be computed from that.
resize(src, dst, dst.size(), 0, 0, interpolation);
..
If you want to decimate the image by factor of 2 in each direction, you can call the function this way: ::
// specify fx and fy and let the function to compute the destination image size.
resize(src, dst, Size(), 0.5, 0.5, interpolation);
..
See also:
:func:`warpAffine`,:func:`warpPerspective`,:func:`remap` .
.. index:: warpAffine
cv::warpAffine
warpAffine
--------------
.. cfunction:: void warpAffine( const Mat\& src, Mat\& dst, const Mat\& M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar\& borderValue=Scalar())
.. c:function:: void warpAffine( const Mat\& src, Mat\& dst, const Mat\& M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar\& borderValue=Scalar())
Applies an affine transformation to an image.
:param src: Source image
:param dst: Destination image; will have size ``dsize`` and the same type as ``src``
:param M: :math:`2\times 3` transformation matrix
:param dsize: Size of the destination image
@ -346,9 +347,9 @@ See also:
:func:`warpPerspective`,:func:`resize`,:func:`remap`,:func:`getRectSubPix`,:func:`transform`
.. index:: warpPerspective
cv::warpPerspective
warpPerspective
-------------------
.. cfunction:: void warpPerspective( const Mat\& src, Mat\& dst, const Mat\& M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar\& borderValue=Scalar())
.. c:function:: void warpPerspective( const Mat\& src, Mat\& dst, const Mat\& M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar\& borderValue=Scalar())
Applies a perspective transformation to an image.

View File

@ -5,11 +5,11 @@ Histograms
.. index:: calcHist
cv::calcHist
calcHist
------------
.. cfunction:: void calcHist( const Mat* arrays, int narrays, const int* channels, const Mat\& mask, MatND\& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. c:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, const Mat\& mask, MatND\& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. cfunction:: void calcHist( const Mat* arrays, int narrays, const int* channels, const Mat\& mask, SparseMat\& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. c:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, const Mat\& mask, SparseMat\& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
Calculates histogram of a set of arrays
@ -93,15 +93,15 @@ input arrays. The sample below shows how to compute 2D Hue-Saturation histogram
imshow( "H-S Histogram", histImg );
waitKey();
}
..
.. index:: calcBackProject
cv::calcBackProject
calcBackProject
-------------------
.. cfunction:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const MatND\& hist, Mat\& backProject, const float** ranges, double scale=1, bool uniform=true )
.. c:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const MatND\& hist, Mat\& backProject, const float** ranges, double scale=1, bool uniform=true )
.. cfunction:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const SparseMat\& hist, Mat\& backProject, const float** ranges, double scale=1, bool uniform=true )
.. c:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const SparseMat\& hist, Mat\& backProject, const float** ranges, double scale=1, bool uniform=true )
Calculates the back projection of a histogram.
@ -137,11 +137,11 @@ See also:
:func:`calcHist`
.. index:: compareHist
cv::compareHist
compareHist
---------------
.. cfunction:: double compareHist( const MatND\& H1, const MatND\& H2, int method )
.. c:function:: double compareHist( const MatND\& H1, const MatND\& H2, int method )
.. cfunction:: double compareHist( const SparseMat\& H1, const SparseMat\& H2, int method )
.. c:function:: double compareHist( const SparseMat\& H1, const SparseMat\& H2, int method )
Compares two histograms
@ -201,9 +201,9 @@ While the function works well with 1-, 2-, 3-dimensional dense histograms, it ma
.. index:: equalizeHist
cv::equalizeHist
equalizeHist
----------------
.. cfunction:: void equalizeHist( const Mat\& src, Mat\& dst )
.. c:function:: void equalizeHist( const Mat\& src, Mat\& dst )
Equalizes the histogram of a grayscale image.

View File

@ -5,15 +5,16 @@ Miscellaneous Image Transformations
.. index:: adaptiveThreshold
cv::adaptiveThreshold
adaptiveThreshold
---------------------
.. cfunction:: void adaptiveThreshold( const Mat\& src, Mat\& dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C )
.. c:function:: void adaptiveThreshold( const Mat& src, Mat& dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C )
Applies an adaptive threshold to an array.
:param src: Source 8-bit single-channel image
:param dst: Destination image; will have the same size and the same type as ``src``
:param maxValue: The non-zero value assigned to the pixels for which the condition is satisfied. See the discussion
:param adaptiveMethod: Adaptive thresholding algorithm to use, ``ADAPTIVE_THRESH_MEAN_C`` or ``ADAPTIVE_THRESH_GAUSSIAN_C`` (see the discussion)
@ -59,9 +60,9 @@ See also:
:func:`threshold`,:func:`blur`,:func:`GaussianBlur`
.. index:: cvtColor
cv::cvtColor
cvtColor
------------
.. cfunction:: void cvtColor( const Mat\& src, Mat\& dst, int code, int dstCn=0 )
.. c:function:: void cvtColor( const Mat& src, Mat& dst, int code, int dstCn=0 )
Converts image from one color space to another
@ -71,6 +72,7 @@ cv::cvtColor
:param code: The color space conversion code; see the discussion
:param dstCn: The number of channels in the destination image; if the parameter is 0, the number of the channels will be derived automatically from ``src`` and the ``code``
The function converts the input image from one color
space to another. In the case of transformation to-from RGB color space the ordering of the channels should be specified explicitly (RGB or BGR).
@ -91,7 +93,6 @@ but in the non-linear cases the input RGB image should be normalized to the prop
img *= 1./255;
cvtColor(img, img, CV_BGR2Luv);
..
The function can do the following transformations:
@ -178,8 +179,7 @@ The function can do the following transformations:
Y, Cr and Cb cover the whole value range.
*
RGB
:math:`\leftrightarrow` HSV ( ``CV_BGR2HSV, CV_RGB2HSV, CV_HSV2BGR, CV_HSV2RGB`` )
RGB :math:`\leftrightarrow` HSV ( ``CV_BGR2HSV, CV_RGB2HSV, CV_HSV2BGR, CV_HSV2RGB`` )
in the case of 8-bit and 16-bit images
R, G and B are converted to floating-point format and scaled to fit the 0 to 1 range
@ -218,8 +218,7 @@ The function can do the following transformations:
H, S, V are left as is
*
RGB
:math:`\leftrightarrow` HLS ( ``CV_BGR2HLS, CV_RGB2HLS, CV_HLS2BGR, CV_HLS2RGB`` ).
RGB :math:`\leftrightarrow` HLS ( ``CV_BGR2HLS, CV_RGB2HLS, CV_HLS2BGR, CV_HLS2RGB`` ).
in the case of 8-bit and 16-bit images
R, G and B are converted to floating-point format and scaled to fit the 0 to 1 range.
@ -269,8 +268,7 @@ The function can do the following transformations:
H, S, V are left as is
*
RGB
:math:`\leftrightarrow` CIE L*a*b* ( ``CV_BGR2Lab, CV_RGB2Lab, CV_Lab2BGR, CV_Lab2RGB`` )
RGB :math:`\leftrightarrow` CIE L*a*b* ( ``CV_BGR2Lab, CV_RGB2Lab, CV_Lab2BGR, CV_Lab2RGB`` )
in the case of 8-bit and 16-bit images
R, G and B are converted to floating-point format and scaled to fit the 0 to 1 range
@ -326,8 +324,7 @@ The function can do the following transformations:
L, a, b are left as is
*
RGB
:math:`\leftrightarrow` CIE L*u*v* ( ``CV_BGR2Luv, CV_RGB2Luv, CV_Luv2BGR, CV_Luv2RGB`` )
RGB :math:`\leftrightarrow` CIE L*u*v* ( ``CV_BGR2Luv, CV_RGB2Luv, CV_Luv2BGR, CV_Luv2RGB`` )
in the case of 8-bit and 16-bit images
R, G and B are converted to floating-point format and scaled to fit 0 to 1 range
@ -376,8 +373,7 @@ The function can do the following transformations:
http://www.poynton.com/ColorFAQ.html
*
Bayer
:math:`\rightarrow` RGB ( ``CV_BayerBG2BGR, CV_BayerGB2BGR, CV_BayerRG2BGR, CV_BayerGR2BGR, CV_BayerBG2RGB, CV_BayerGB2RGB, CV_BayerRG2RGB, CV_BayerGR2RGB`` ) The Bayer pattern is widely used in CCD and CMOS cameras. It allows one to get color pictures from a single plane where R,G and B pixels (sensors of a particular component) are interleaved like this:
Bayer :math:`\rightarrow` RGB ( ``CV_BayerBG2BGR, CV_BayerGB2BGR, CV_BayerRG2BGR, CV_BayerGR2BGR, CV_BayerBG2RGB, CV_BayerGB2RGB, CV_BayerRG2RGB, CV_BayerGR2RGB`` ) The Bayer pattern is widely used in CCD and CMOS cameras. It allows one to get color pictures from a single plane where R,G and B pixels (sensors of a particular component) are interleaved like this:
.. math::
@ -395,11 +391,11 @@ The function can do the following transformations:
.. index:: distanceTransform
cv::distanceTransform
distanceTransform
---------------------
.. cfunction:: void distanceTransform( const Mat\& src, Mat\& dst, int distanceType, int maskSize )
.. c:function:: void distanceTransform( const Mat& src, Mat& dst, int distanceType, int maskSize )
.. cfunction:: void distanceTransform( const Mat\& src, Mat\& dst, Mat\& labels, int distanceType, int maskSize )
.. c:function:: void distanceTransform( const Mat& src, Mat& dst, Mat& labels, int distanceType, int maskSize )
Calculates the distance to the closest zero pixel for each pixel of the source image.
@ -438,8 +434,12 @@ gives more accurate results). For ``a``,``b`` and ``c`` OpenCV uses the values s
.. table::
============== =================== ====================== ``CV_DIST_C`` :math:`(3\times 3)` a = 1, b = 1 \
============== =================== ====================== ``CV_DIST_L1`` :math:`(3\times 3)` a = 1, b = 2 \ ``CV_DIST_L2`` :math:`(3\times 3)` a=0.955, b=1.3693 \ ``CV_DIST_L2`` :math:`(5\times 5)` a=1, b=1.4, c=2.1969 \
============== =================== ======================
``CV_DIST_C`` :math:`(3\times 3)` a = 1, b = 1 \
============== =================== ======================
``CV_DIST_L1`` :math:`(3\times 3)` a = 1, b = 2 \
``CV_DIST_L2`` :math:`(3\times 3)` a=0.955, b=1.3693 \
``CV_DIST_L2`` :math:`(5\times 5)` a=1, b=1.4, c=2.1969 \
============== =================== ======================
Typically, for a fast, coarse distance estimation ``CV_DIST_L2``,a
@ -459,11 +459,11 @@ Currently, this second variant can only use the approximate distance transform a
.. index:: floodFill
cv::floodFill
floodFill
-------------
.. cfunction:: int floodFill( Mat\& image, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. c:function:: int floodFill( Mat& image, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. cfunction:: int floodFill( Mat\& image, Mat\& mask, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. c:function:: int floodFill( Mat& image, Mat& mask, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
Fills a connected component with the given color.
@ -544,9 +544,9 @@ See also:
:func:`findContours`
.. index:: inpaint
cv::inpaint
inpaint
-----------
.. cfunction:: void inpaint( const Mat\& src, const Mat\& inpaintMask, Mat\& dst, double inpaintRadius, int flags )
.. c:function:: void inpaint( const Mat& src, const Mat& inpaintMask, Mat& dst, double inpaintRadius, int flags )
Inpaints the selected region in the image.
@ -555,6 +555,7 @@ cv::inpaint
:param inpaintMask: The inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that needs to be inpainted.
:param dst: The output image; will have the same size and the same type as ``src``
:param inpaintRadius: The radius of a circlular neighborhood of each point inpainted that is considered by the algorithm.
:param flags: The inpainting method, one of the following:
@ -569,13 +570,13 @@ for more details.
.. index:: integral
cv::integral
integral
------------
.. cfunction:: void integral( const Mat\& image, Mat\& sum, int sdepth=-1 )
.. c:function:: void integral( const Mat& image, Mat& sum, int sdepth=-1 )
.. cfunction:: void integral( const Mat\& image, Mat\& sum, Mat\& sqsum, int sdepth=-1 )
.. c:function:: void integral( const Mat& image, Mat& sum, Mat& sqsum, int sdepth=-1 )
.. cfunction:: void integral( const Mat\& image, Mat\& sum, Mat\& sqsum, Mat\& tilted, int sdepth=-1 )
.. c:function:: void integral( const Mat& image, Mat& sum, Mat& sqsum, Mat& tilted, int sdepth=-1 )
Calculates the integral of an image.
@ -586,8 +587,10 @@ cv::integral
:param sqsum: The integral image for squared pixel values, :math:`(W+1)\times (H+1)` , double precision floating-point (64f)
:param tilted: The integral for the image rotated by 45 degrees, :math:`(W+1)\times (H+1)` , the same data type as ``sum``
:param sdepth: The desired depth of the integral and the tilted integral images, ``CV_32S`` , ``CV_32F`` or ``CV_64F``
The functions ``integral`` calculate one or more integral images for the source image as following:
The functions calculate one or more integral images for the source image as following:
.. math::
@ -619,15 +622,16 @@ As a practical example, the next figure shows the calculation of the integral of
.. index:: threshold
cv::threshold
threshold
-------------
.. cfunction:: double threshold( const Mat\& src, Mat\& dst, double thresh, double maxVal, int thresholdType )
.. c:function:: double threshold( const Mat& src, Mat& dst, double thresh, double maxVal, int thresholdType )
Applies a fixed-level threshold to each array element
:param src: Source array (single-channel, 8-bit of 32-bit floating point)
:param dst: Destination array; will have the same size and the same type as ``src``
:param thresh: Threshold value
:param maxVal: Maximum value to use with ``THRESH_BINARY`` and ``THRESH_BINARY_INV`` thresholding types
@ -684,15 +688,16 @@ See also:
:func:`adaptiveThreshold`,:func:`findContours`,:func:`compare`,:func:`min`,:func:`max`
.. index:: watershed
cv::watershed
watershed
-------------
.. cfunction:: void watershed( const Mat\& image, Mat\& markers )
.. c:function:: void watershed( const Mat& image, Mat& markers )
Does marker-based image segmentation using watershed algrorithm
:param image: The input 8-bit 3-channel image.
:param markers: The input/output 32-bit single-channel image (map) of markers. It should have the same size as ``image``
The function implements one of the variants
of watershed, non-parametric marker-based segmentation algorithm,
described in
@ -722,9 +727,9 @@ See also:
:func:`findContours`
.. index:: grabCut
cv::grabCut
grabCut
-----------
.. cfunction:: void grabCut(const Mat\& image, Mat\& mask, Rect rect, Mat\& bgdModel, Mat\& fgdModel, int iterCount, int mode )
.. c:function:: void grabCut(const Mat& image, Mat& mask, Rect rect, Mat& bgdModel, Mat& fgdModel, int iterCount, int mode )
Runs GrabCut algorithm
@ -740,15 +745,16 @@ cv::grabCut
* **GC_PR_BGD** Likely a foreground pixel
:param rect: The ROI containing the segmented object. The pixels outside of the ROI are marked as "certainly a background". The parameter is only used when ``mode==GC_INIT_WITH_RECT``
:param bgdModel, fgdModel: Temporary arrays used for segmentation. Do not modify them while you are processing the same image
:param iterCount: The number of iterations the algorithm should do before returning the result. Note that the result can be refined with further calls with the ``mode==GC_INIT_WITH_MASK`` or ``mode==GC_EVAL``
:param mode: The operation mode
* **GC_INIT_WITH_RECT** The function initializes the state and the mask using the provided rectangle. After that it runs ``iterCount`` iterations of the algorithm
* **GC_INIT_WITH_MASK** The function initializes the state using the provided mask. Note that ``GC_INIT_WITH_RECT`` and ``GC_INIT_WITH_MASK`` can be combined, then all the pixels outside of the ROI are automatically initialized with ``GC_BGD``
.
* **GC_INIT_WITH_MASK** The function initializes the state using the provided mask. Note that ``GC_INIT_WITH_RECT`` and ``GC_INIT_WITH_MASK`` can be combined, then all the pixels outside of the ROI are automatically initialized with ``GC_BGD``.
* **GC_EVAL** The value means that algorithm should just resume.

View File

@ -5,9 +5,9 @@ Motion Analysis and Object Tracking
.. index:: accumulate
cv::accumulate
accumulate
--------------
.. cfunction:: void accumulate( const Mat\& src, Mat\& dst, const Mat\& mask=Mat() )
.. c:function:: void accumulate( const Mat\& src, Mat\& dst, const Mat\& mask=Mat() )
Adds image to the accumulator.
@ -31,9 +31,9 @@ See also:
:func:`accumulateSquare`,:func:`accumulateProduct`,:func:`accumulateWeighted`
.. index:: accumulateSquare
cv::accumulateSquare
accumulateSquare
--------------------
.. cfunction:: void accumulateSquare( const Mat\& src, Mat\& dst, const Mat\& mask=Mat() )
.. c:function:: void accumulateSquare( const Mat\& src, Mat\& dst, const Mat\& mask=Mat() )
Adds the square of the source image to the accumulator.
@ -55,9 +55,9 @@ See also:
:func:`accumulateSquare`,:func:`accumulateProduct`,:func:`accumulateWeighted`
.. index:: accumulateProduct
cv::accumulateProduct
accumulateProduct
---------------------
.. cfunction:: void accumulateProduct( const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat() )
.. c:function:: void accumulateProduct( const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat() )
Adds the per-element product of two input images to the accumulator.
@ -80,9 +80,9 @@ See also:
:func:`accumulate`,:func:`accumulateSquare`,:func:`accumulateWeighted`
.. index:: accumulateWeighted
cv::accumulateWeighted
accumulateWeighted
----------------------
.. cfunction:: void accumulateWeighted( const Mat\& src, Mat\& dst, double alpha, const Mat\& mask=Mat() )
.. c:function:: void accumulateWeighted( const Mat\& src, Mat\& dst, double alpha, const Mat\& mask=Mat() )
Updates the running average.

View File

@ -5,9 +5,9 @@ Object Detection
.. index:: matchTemplate
cv::matchTemplate
matchTemplate
-----------------
.. cfunction:: void matchTemplate( const Mat\& image, const Mat\& templ, Mat\& result, int method )
.. c:function:: void matchTemplate( const Mat\& image, const Mat\& templ, Mat\& result, int method )
Compares a template against overlapped image regions.

View File

@ -5,9 +5,9 @@ Structural Analysis and Shape Descriptors
.. index:: moments
cv::moments
moments
-----------
.. cfunction:: Moments moments( const Mat\& array, bool binaryImage=false )
.. c:function:: Moments moments( const Mat& array, bool binaryImage=false )
Calculates all of the moments up to the third order of a polygon or rasterized shape.
@ -29,7 +29,6 @@ where the class ``Moments`` is defined as: ::
// central normalized moments
double nu20, nu11, nu02, nu30, nu21, nu12, nu03;
};
..
:param array: A raster image (single-channel, 8-bit or floating-point 2D array) or an array
( :math:`1 \times N` or :math:`N \times 1` ) of 2D points ( ``Point`` or ``Point2f`` )
@ -77,9 +76,9 @@ See also:
:func:`contourArea`,:func:`arcLength`
.. index:: HuMoments
cv::HuMoments
HuMoments
-------------
.. cfunction:: void HuMoments( const Moments\& moments, double h[7] )
.. c:function:: void HuMoments( const Moments& moments, double h[7] )
Calculates the seven Hu invariants.
@ -104,11 +103,11 @@ See also:
:func:`matchShapes`
.. index:: findContours
cv::findContours
findContours
----------------
.. cfunction:: void findContours( const Mat\& image, vector<vector<Point> >\& contours, vector<Vec4i>\& hierarchy, int mode, int method, Point offset=Point())
.. c:function:: void findContours( const Mat& image, vector<vector<Point> >& contours, vector<Vec4i>& hierarchy, int mode, int method, Point offset=Point())
.. cfunction:: void findContours( const Mat\& image, vector<vector<Point> >\& contours, int mode, int method, Point offset=Point())
.. c:function:: void findContours( const Mat& image, vector<vector<Point> >& contours, int mode, int method, Point offset=Point())
Finds the contours in a binary image.
@ -148,9 +147,9 @@ the source ``image`` is modified by this function.
.. index:: drawContours
cv::drawContours
drawContours
----------------
.. cfunction:: void drawContours( Mat\& image, const vector<vector<Point> >\& contours, int contourIdx, const Scalar\& color, int thickness=1, int lineType=8, const vector<Vec4i>\& hierarchy=vector<Vec4i>(), int maxLevel=INT_MAX, Point offset=Point() )
.. c:function:: void drawContours( Mat& image, const vector<vector<Point> >& contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, const vector<Vec4i>& hierarchy=vector<Vec4i>(), int maxLevel=INT_MAX, Point offset=Point() )
Draws contours' outlines or filled contours.
@ -174,6 +173,7 @@ cv::drawContours
the specified contour is drawn. If 1, the function draws the contour(s) and all the nested contours. If 2, the function draws the contours, all the nested contours and all the nested into nested contours etc. This parameter is only taken into account when there is ``hierarchy`` available.
:param offset: The optional contour shift parameter. Shift all the drawn contours by the specified :math:`\texttt{offset}=(dx,dy)`
The function draws contour outlines in the image if
:math:`\texttt{thickness} \ge 0` or fills the area bounded by the contours if
:math:`\texttt{thickness}<0` . Here is the example on how to retrieve connected components from the binary image and label them ::
@ -216,15 +216,14 @@ The function draws contour outlines in the image if
imshow( "Components", dst );
waitKey(0);
}
..
.. index:: approxPolyDP
cv::approxPolyDP
approxPolyDP
----------------
.. cfunction:: void approxPolyDP( const Mat\& curve, vector<Point>\& approxCurve, double epsilon, bool closed )
.. c:function:: void approxPolyDP( const Mat& curve, vector<Point>& approxCurve, double epsilon, bool closed )
.. cfunction:: void approxPolyDP( const Mat\& curve, vector<Point2f>\& approxCurve, double epsilon, bool closed )
.. c:function:: void approxPolyDP( const Mat& curve, vector<Point2f>& approxCurve, double epsilon, bool closed )
Approximates polygonal curve(s) with the specified precision.
@ -241,9 +240,9 @@ http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
.. index:: arcLength
cv::arcLength
arcLength
-------------
.. cfunction:: double arcLength( const Mat\& curve, bool closed )
.. c:function:: double arcLength( const Mat& curve, bool closed )
Calculates a contour perimeter or a curve length.
@ -255,9 +254,9 @@ The function computes the curve length or the closed contour perimeter.
.. index:: boundingRect
cv::boundingRect
boundingRect
----------------
.. cfunction:: Rect boundingRect( const Mat\& points )
.. c:function:: Rect boundingRect( const Mat& points )
Calculates the up-right bounding rectangle of a point set.
@ -267,9 +266,9 @@ The function calculates and returns the minimal up-right bounding rectangle for
.. index:: estimateRigidTransform
cv::estimateRigidTransform
estimateRigidTransform
--------------------------
.. cfunction:: Mat estimateRigidTransform( const Mat\& srcpt, const Mat\& dstpt, bool fullAffine )
.. c:function:: Mat estimateRigidTransform( const Mat& srcpt, const Mat& dstpt, bool fullAffine )
Computes optimal affine transformation between two 2D point sets
@ -301,9 +300,9 @@ See also:
:func:`getAffineTransform`,:func:`getPerspectiveTransform`,:func:`findHomography`
.. index:: estimateAffine3D
cv::estimateAffine3D
estimateAffine3D
--------------------
.. cfunction:: int estimateAffine3D(const Mat\& srcpt, const Mat\& dstpt, Mat\& out, vector<uchar>\& outliers, double ransacThreshold = 3.0, double confidence = 0.99)
.. c:function:: int estimateAffine3D(const Mat& srcpt, const Mat& dstpt, Mat& out, vector<uchar>& outliers, double ransacThreshold = 3.0, double confidence = 0.99)
Computes optimal affine transformation between two 3D point sets
@ -322,9 +321,9 @@ The function estimates the optimal 3D affine transformation between two 3D point
.. index:: contourArea
cv::contourArea
contourArea
---------------
.. cfunction:: double contourArea( const Mat\& contour )
.. c:function:: double contourArea( const Mat& contour )
Calculates the contour area
@ -350,17 +349,16 @@ Here is a short example: ::
cout << "area0 =" << area0 << endl <<
"area1 =" << area1 << endl <<
"approx poly vertices" << approx.size() << endl;
..
.. index:: convexHull
cv::convexHull
convexHull
--------------
.. cfunction:: void convexHull( const Mat\& points, vector<int>\& hull, bool clockwise=false )
.. c:function:: void convexHull( const Mat& points, vector<int>& hull, bool clockwise=false )
.. cfunction:: void convexHull( const Mat\& points, vector<Point>\& hull, bool clockwise=false )
.. c:function:: void convexHull( const Mat& points, vector<Point>& hull, bool clockwise=false )
.. cfunction:: void convexHull( const Mat\& points, vector<Point2f>\& hull, bool clockwise=false )
.. c:function:: void convexHull( const Mat& points, vector<Point2f>& hull, bool clockwise=false )
Finds the convex hull of a point set.
@ -380,9 +378,9 @@ that has
.. index:: fitEllipse
cv::fitEllipse
fitEllipse
--------------
.. cfunction:: RotatedRect fitEllipse( const Mat\& points )
.. c:function:: RotatedRect fitEllipse( const Mat& points )
Fits an ellipse around a set of 2D points.
@ -393,22 +391,20 @@ The function calculates the ellipse that fits best
.. index:: fitLine
cv::fitLine
fitLine
-----------
.. cfunction:: void fitLine( const Mat\& points, Vec4f\& line, int distType, double param, double reps, double aeps )
.. c:function:: void fitLine( const Mat& points, Vec4f& line, int distType, double param, double reps, double aeps )
.. cfunction:: void fitLine( const Mat\& points, Vec6f\& line, int distType, double param, double reps, double aeps )
.. c:function:: void fitLine( const Mat& points, Vec6f& line, int distType, double param, double reps, double aeps )
Fits a line to a 2D or 3D point set.
:param points: The input 2D point set, represented by ``CV_32SC2`` or ``CV_32FC2`` matrix, or by ``vector<Point>`` , ``vector<Point2f>`` , ``vector<Point3i>`` or ``vector<Point3f>`` converted to the matrix by ``Mat(const vector<T>&)`` constructor
:param line: The output line parameters. In the case of a 2d fitting,
it is a vector of 4 floats ``(vx, vy,
x0, y0)`` where ``(vx, vy)`` is a normalized vector collinear to the
it is a vector of 4 floats ``(vx, vy, x0, y0)`` where ``(vx, vy)`` is a normalized vector collinear to the
line and ``(x0, y0)`` is some point on the line. in the case of a
3D fitting it is vector of 6 floats ``(vx, vy, vz, x0, y0, z0)`` where ``(vx, vy, vz)`` is a normalized vector collinear to the line
and ``(x0, y0, z0)`` is some point on the line
3D fitting it is vector of 6 floats ``(vx, vy, vz, x0, y0, z0)`` where ``(vx, vy, vz)`` is a normalized vector collinear to the line and ``(x0, y0, z0)`` is some point on the line
:param distType: The distance used by the M-estimator (see the discussion)
@ -466,9 +462,9 @@ http://en.wikipedia.org/wiki/M-estimator
.. index:: isContourConvex
cv::isContourConvex
isContourConvex
-------------------
.. cfunction:: bool isContourConvex( const Mat\& contour )
.. c:function:: bool isContourConvex( const Mat& contour )
Tests contour convexity.
@ -478,9 +474,9 @@ The function tests whether the input contour is convex or not. The contour must
.. index:: minAreaRect
cv::minAreaRect
minAreaRect
---------------
.. cfunction:: RotatedRect minAreaRect( const Mat\& points )
.. c:function:: RotatedRect minAreaRect( const Mat& points )
Finds the minimum area rotated rectangle enclosing a 2D point set.
@ -489,9 +485,9 @@ cv::minAreaRect
The function calculates and returns the minimum area bounding rectangle (possibly rotated) for the specified point set. See the OpenCV sample ``minarea.c``
.. index:: minEnclosingCircle
cv::minEnclosingCircle
minEnclosingCircle
----------------------
.. cfunction:: void minEnclosingCircle( const Mat\& points, Point2f\& center, float\& radius )
.. c:function:: void minEnclosingCircle( const Mat& points, Point2f& center, float& radius )
Finds the minimum area circle enclosing a 2D point set.
@ -504,9 +500,9 @@ cv::minEnclosingCircle
The function finds the minimal enclosing circle of a 2D point set using iterative algorithm. See the OpenCV sample ``minarea.c``
.. index:: matchShapes
cv::matchShapes
matchShapes
---------------
.. cfunction:: double matchShapes( const Mat\& object1, const Mat\& object2, int method, double parameter=0 )
.. c:function:: double matchShapes( const Mat& object1, const Mat& object2, int method, double parameter=0 )
Compares two shapes.
@ -554,9 +550,9 @@ and
.. index:: pointPolygonTest
cv::pointPolygonTest
pointPolygonTest
--------------------
.. cfunction:: double pointPolygonTest( const Mat\& contour, Point2f pt, bool measureDist )
.. c:function:: double pointPolygonTest( const Mat& contour, Point2f pt, bool measureDist )
Performs point-in-contour test.

View File

@ -83,7 +83,7 @@ training examples are recomputed at each training iteration. Examples deleted at
CvBoostParams
-------------
.. ctype:: CvBoostParams
.. c:type:: CvBoostParams
Boosting training parameters. ::
@ -109,7 +109,7 @@ The structure is derived from
CvBoostTree
-----------
.. ctype:: CvBoostTree
.. c:type:: CvBoostTree
Weak tree classifier. ::
@ -148,7 +148,7 @@ Note, that in the case of LogitBoost and Gentle AdaBoost each weak predictor is
CvBoost
-------
.. ctype:: CvBoost
.. c:type:: CvBoost
Boosted tree classifier. ::
@ -212,7 +212,7 @@ Boosted tree classifier. ::
CvBoost::train
--------------
.. cfunction:: bool CvBoost::train( const CvMat* _train_data, int _tflag, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, const CvMat* _var_type=0, const CvMat* _missing_mask=0, CvBoostParams params=CvBoostParams(), bool update=false )
.. c:function:: bool CvBoost::train( const CvMat* _train_data, int _tflag, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, const CvMat* _var_type=0, const CvMat* _missing_mask=0, CvBoostParams params=CvBoostParams(), bool update=false )
Trains a boosted tree classifier.
@ -224,7 +224,7 @@ The train method follows the common template; the last parameter ``update`` spec
CvBoost::predict
----------------
.. cfunction:: float CvBoost::predict( const CvMat* sample, const CvMat* missing=0, CvMat* weak_responses=0, CvSlice slice=CV_WHOLE_SEQ, bool raw_mode=false ) const
.. c:function:: float CvBoost::predict( const CvMat* sample, const CvMat* missing=0, CvMat* weak_responses=0, CvSlice slice=CV_WHOLE_SEQ, bool raw_mode=false ) const
Predicts a response for the input sample.
@ -236,7 +236,7 @@ The method ``CvBoost::predict`` runs the sample through the trees in the ensembl
CvBoost::prune
--------------
.. cfunction:: void CvBoost::prune( CvSlice slice )
.. c:function:: void CvBoost::prune( CvSlice slice )
Removes the specified weak classifiers.
@ -248,7 +248,7 @@ The method removes the specified weak classifiers from the sequence. Note that t
CvBoost::get_weak_predictors
----------------------------
.. cfunction:: CvSeq* CvBoost::get_weak_predictors()
.. c:function:: CvSeq* CvBoost::get_weak_predictors()
Returns the sequence of weak tree classifiers.

View File

@ -68,7 +68,7 @@ Importance of each variable is computed over all the splits on this variable in
CvDTreeSplit
------------
.. ctype:: CvDTreeSplit
.. c:type:: CvDTreeSplit
Decision tree node split. ::
@ -97,7 +97,7 @@ Decision tree node split. ::
CvDTreeNode
-----------
.. ctype:: CvDTreeNode
.. c:type:: CvDTreeNode
Decision tree node. ::
@ -127,7 +127,7 @@ Other numerous fields of ``CvDTreeNode`` are used internally at the training sta
CvDTreeParams
-------------
.. ctype:: CvDTreeParams
.. c:type:: CvDTreeParams
Decision tree training parameters. ::
@ -164,7 +164,7 @@ The structure contains all the decision tree training parameters. There is a def
CvDTreeTrainData
----------------
.. ctype:: CvDTreeTrainData
.. c:type:: CvDTreeTrainData
Decision tree training data and shared data for tree ensembles. ::
@ -289,7 +289,7 @@ There are 2 ways of using this structure. In simple cases (e.g. a standalone tre
CvDTree
-------
.. ctype:: CvDTree
.. c:type:: CvDTree
Decision tree. ::
@ -376,9 +376,9 @@ Decision tree. ::
CvDTree::train
--------------
.. cfunction:: bool CvDTree::train( const CvMat* _train_data, int _tflag, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, const CvMat* _var_type=0, const CvMat* _missing_mask=0, CvDTreeParams params=CvDTreeParams() )
.. c:function:: bool CvDTree::train( const CvMat* _train_data, int _tflag, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, const CvMat* _var_type=0, const CvMat* _missing_mask=0, CvDTreeParams params=CvDTreeParams() )
.. cfunction:: bool CvDTree::train( CvDTreeTrainData* _train_data, const CvMat* _subsample_idx )
.. c:function:: bool CvDTree::train( CvDTreeTrainData* _train_data, const CvMat* _subsample_idx )
Trains a decision tree.
@ -396,7 +396,7 @@ The second method ``train`` is mostly used for building tree ensembles. It takes
CvDTree::predict
----------------
.. cfunction:: CvDTreeNode* CvDTree::predict( const CvMat* _sample, const CvMat* _missing_data_mask=0, bool raw_mode=false ) const
.. c:function:: CvDTreeNode* CvDTree::predict( const CvMat* _sample, const CvMat* _missing_data_mask=0, bool raw_mode=false ) const
Returns the leaf node of the decision tree corresponding to the input vector.

View File

@ -88,7 +88,7 @@ already a good enough approximation).
CvEMParams
----------
.. ctype:: CvEMParams
.. c:type:: CvEMParams
Parameters of the EM algorithm. ::
@ -134,7 +134,7 @@ The structure has 2 constructors, the default one represents a rough rule-of-thu
CvEM
----
.. ctype:: CvEM
.. c:type:: CvEM
EM model. ::
@ -194,7 +194,7 @@ EM model. ::
CvEM::train
-----------
.. cfunction:: void CvEM::train( const CvMat* samples, const CvMat* sample_idx=0, CvEMParams params=CvEMParams(), CvMat* labels=0 )
.. c:function:: void CvEM::train( const CvMat* samples, const CvMat* sample_idx=0, CvEMParams params=CvEMParams(), CvMat* labels=0 )
Estimates the Gaussian mixture parameters from the sample set.

View File

@ -13,7 +13,7 @@ The algorithm caches all of the training samples, and predicts the response for
CvKNearest
----------
.. ctype:: CvKNearest
.. c:type:: CvKNearest
K Nearest Neighbors model. ::
@ -51,7 +51,7 @@ K Nearest Neighbors model. ::
CvKNearest::train
-----------------
.. cfunction:: bool CvKNearest::train( const CvMat* _train_data, const CvMat* _responses, const CvMat* _sample_idx=0, bool is_regression=false, int _max_k=32, bool _update_base=false )
.. c:function:: bool CvKNearest::train( const CvMat* _train_data, const CvMat* _responses, const CvMat* _sample_idx=0, bool is_regression=false, int _max_k=32, bool _update_base=false )
Trains the model.
@ -68,7 +68,7 @@ The parameter ``_update_base`` specifies whether the model is trained from scrat
CvKNearest::find_nearest
------------------------
.. cfunction:: float CvKNearest::find_nearest( const CvMat* _samples, int k, CvMat* results=0, const float** neighbors=0, CvMat* neighbor_responses=0, CvMat* dist=0 ) const
.. c:function:: float CvKNearest::find_nearest( const CvMat* _samples, int k, CvMat* results=0, const float** neighbors=0, CvMat* neighbor_responses=0, CvMat* dist=0 ) const
Finds the neighbors for the input vectors.

View File

@ -16,6 +16,6 @@ Most of the classification and regression algorithms are implemented as C++ clas
decision_trees
boosting
random_trees
expectation-maximization
expectation_maximization
neural_networks

View File

@ -98,7 +98,7 @@ References:
CvANN_MLP_TrainParams
---------------------
.. ctype:: CvANN_MLP_TrainParams
.. c:type:: CvANN_MLP_TrainParams
Parameters of the MLP training algorithm. ::
@ -120,6 +120,7 @@ Parameters of the MLP training algorithm. ::
// rprop parameters
double rp_dw0, rp_dw_plus, rp_dw_minus, rp_dw_min, rp_dw_max;
};
..
The structure has default constructor that initializes parameters for ``RPROP`` algorithm. There is also more advanced constructor to customize the parameters and/or choose backpropagation algorithm. Finally, the individual parameters can be adjusted after the structure is created.
@ -130,7 +131,7 @@ The structure has default constructor that initializes parameters for ``RPROP``
CvANN_MLP
---------
.. ctype:: CvANN_MLP
.. c:type:: CvANN_MLP
MLP model. ::
@ -210,6 +211,7 @@ MLP model. ::
CvANN_MLP_TrainParams params;
CvRNG rng;
};
..
Unlike many other models in ML that are constructed and trained at once, in the MLP model these steps are separated. First, a network with the specified topology is created using the non-default constructor or the method ``create`` . All the weights are set to zeros. Then the network is trained using the set of input and output vectors. The training procedure can be repeated more than once, i.e. the weights can be adjusted based on the new training data.
@ -220,7 +222,7 @@ Unlike many other models in ML that are constructed and trained at once, in the
CvANN_MLP::create
-----------------
.. cfunction:: void CvANN_MLP::create( const CvMat* _layer_sizes, int _activ_func=SIGMOID_SYM, double _f_param1=0, double _f_param2=0 )
.. c:function:: void CvANN_MLP::create( const CvMat* _layer_sizes, int _activ_func=SIGMOID_SYM, double _f_param1=0, double _f_param2=0 )
Constructs the MLP with the specified topology
@ -238,7 +240,7 @@ The method creates a MLP network with the specified topology and assigns the sam
CvANN_MLP::train
----------------
.. cfunction:: int CvANN_MLP::train( const CvMat* _inputs, const CvMat* _outputs, const CvMat* _sample_weights, const CvMat* _sample_idx=0, CvANN_MLP_TrainParams _params = CvANN_MLP_TrainParams(), int flags=0 )
.. c:function:: int CvANN_MLP::train( const CvMat* _inputs, const CvMat* _outputs, const CvMat* _sample_weights, const CvMat* _sample_idx=0, CvANN_MLP_TrainParams _params = CvANN_MLP_TrainParams(), int flags=0 )
Trains/updates MLP.

View File

@ -13,7 +13,7 @@ This is a simple classification model assuming that feature vectors from each cl
CvNormalBayesClassifier
-----------------------
.. ctype:: CvNormalBayesClassifier
.. c:type:: CvNormalBayesClassifier
Bayes classifier for normally distributed data. ::
@ -48,7 +48,7 @@ Bayes classifier for normally distributed data. ::
CvNormalBayesClassifier::train
------------------------------
.. cfunction:: bool CvNormalBayesClassifier::train( const CvMat* _train_data, const CvMat* _responses, const CvMat* _var_idx =0, const CvMat* _sample_idx=0, bool update=false )
.. c:function:: bool CvNormalBayesClassifier::train( const CvMat* _train_data, const CvMat* _responses, const CvMat* _var_idx =0, const CvMat* _sample_idx=0, bool update=false )
Trains the model.
@ -62,7 +62,7 @@ In addition, there is an ``update`` flag that identifies whether the model shoul
CvNormalBayesClassifier::predict
--------------------------------
.. cfunction:: float CvNormalBayesClassifier::predict( const CvMat* samples, CvMat* results=0 ) const
.. c:function:: float CvNormalBayesClassifier::predict( const CvMat* samples, CvMat* results=0 ) const
Predicts the response for sample(s)

View File

@ -53,7 +53,7 @@ In random trees there is no need for any accuracy estimation procedures, such as
CvRTParams
----------
.. ctype:: CvRTParams
.. c:type:: CvRTParams
Training Parameters of Random Trees. ::
@ -86,7 +86,7 @@ The set of training parameters for the forest is the superset of the training pa
CvRTrees
--------
.. ctype:: CvRTrees
.. c:type:: CvRTrees
Random Trees. ::
@ -136,7 +136,7 @@ Random Trees. ::
CvRTrees::train
---------------
.. cfunction:: bool CvRTrees::train( const CvMat* train_data, int tflag, const CvMat* responses, const CvMat* comp_idx=0, const CvMat* sample_idx=0, const CvMat* var_type=0, const CvMat* missing_mask=0, CvRTParams params=CvRTParams() )
.. c:function:: bool CvRTrees::train( const CvMat* train_data, int tflag, const CvMat* responses, const CvMat* comp_idx=0, const CvMat* sample_idx=0, const CvMat* var_type=0, const CvMat* missing_mask=0, CvRTParams params=CvRTParams() )
Trains the Random Trees model.
@ -149,7 +149,7 @@ The method ``CvRTrees::train`` is very similar to the first form of ``CvDTree::t
CvRTrees::predict
-----------------
.. cfunction:: double CvRTrees::predict( const CvMat* sample, const CvMat* missing=0 ) const
.. c:function:: double CvRTrees::predict( const CvMat* sample, const CvMat* missing=0 ) const
Predicts the output for the input sample.
@ -161,7 +161,7 @@ The input parameters of the prediction method are the same as in ``CvDTree::pred
CvRTrees::get_var_importance
----------------------------
.. cfunction:: const CvMat* CvRTrees::get_var_importance() const
.. c:function:: const CvMat* CvRTrees::get_var_importance() const
Retrieves the variable importance array.
@ -173,7 +173,7 @@ The method returns the variable importance vector, computed at the training stag
CvRTrees::get_proximity
-----------------------
.. cfunction:: float CvRTrees::get_proximity( const CvMat* sample_1, const CvMat* sample_2 ) const
.. c:function:: float CvRTrees::get_proximity( const CvMat* sample_1, const CvMat* sample_2 ) const
Retrieves the proximity measure between two training samples.

View File

@ -9,7 +9,7 @@ Statistical Models
CvStatModel
-----------
.. ctype:: CvStatModel
.. c:type:: CvStatModel
Base class for the statistical models in ML. ::
@ -48,7 +48,7 @@ In this declaration some methods are commented off. Actually, these are methods
CvStatModel::CvStatModel
------------------------
.. cfunction:: CvStatModel::CvStatModel()
.. c:function:: CvStatModel::CvStatModel()
Default constructor.
@ -60,7 +60,7 @@ Each statistical model class in ML has a default constructor without parameters.
CvStatModel::CvStatModel(...)
-----------------------------
.. cfunction:: CvStatModel::CvStatModel( const CvMat* train_data ... )
.. c:function:: CvStatModel::CvStatModel( const CvMat* train_data ... )
Training constructor.
@ -72,7 +72,7 @@ Most ML classes provide single-step construct and train constructors. This const
CvStatModel::~CvStatModel
-------------------------
.. cfunction:: CvStatModel::~CvStatModel()
.. c:function:: CvStatModel::~CvStatModel()
Virtual destructor.
@ -95,7 +95,7 @@ Normally, the destructor of each derived class does nothing, but in this instanc
CvStatModel::clear
------------------
.. cfunction:: void CvStatModel::clear()
.. c:function:: void CvStatModel::clear()
Deallocates memory and resets the model state.
@ -107,7 +107,7 @@ The method ``clear`` does the same job as the destructor; it deallocates all the
CvStatModel::save
-----------------
.. cfunction:: void CvStatModel::save( const char* filename, const char* name=0 )
.. c:function:: void CvStatModel::save( const char* filename, const char* name=0 )
Saves the model to a file.
@ -119,7 +119,7 @@ The method ``save`` stores the complete model state to the specified XML or YAML
CvStatModel::load
-----------------
.. cfunction:: void CvStatModel::load( const char* filename, const char* name=0 )
.. c:function:: void CvStatModel::load( const char* filename, const char* name=0 )
Loads the model from a file.
@ -135,7 +135,7 @@ cross{cvLoad}, here the model type must be known, because an empty model must be
CvStatModel::write
------------------
.. cfunction:: void CvStatModel::write( CvFileStorage* storage, const char* name )
.. c:function:: void CvStatModel::write( CvFileStorage* storage, const char* name )
Writes the model to file storage.
@ -147,7 +147,7 @@ The method ``write`` stores the complete model state to the file storage with th
CvStatModel::read
-----------------
.. cfunction:: void CvStatMode::read( CvFileStorage* storage, CvFileNode* node )
.. c:function:: void CvStatMode::read( CvFileStorage* storage, CvFileNode* node )
Reads the model from file storage.
@ -162,7 +162,7 @@ The previous model state is cleared by ``clear()`` .
CvStatModel::train
------------------
.. cfunction:: bool CvStatMode::train( const CvMat* train_data, [int tflag,] ..., const CvMat* responses, ..., [const CvMat* var_idx,] ..., [const CvMat* sample_idx,] ... [const CvMat* var_type,] ..., [const CvMat* missing_mask,] <misc_training_alg_params> ... )
.. c:function:: bool CvStatMode::train( const CvMat* train_data, [int tflag,] ..., const CvMat* responses, ..., [const CvMat* var_idx,] ..., [const CvMat* sample_idx,] ... [const CvMat* var_type,] ..., [const CvMat* missing_mask,] <misc_training_alg_params> ... )
Trains the model.
@ -194,7 +194,7 @@ Usually, the previous model state is cleared by ``clear()`` before running the t
CvStatModel::predict
--------------------
.. cfunction:: float CvStatMode::predict( const CvMat* sample[, <prediction_params>] ) const
.. c:function:: float CvStatMode::predict( const CvMat* sample[, <prediction_params>] ) const
Predicts the response for the sample.

View File

@ -27,7 +27,7 @@ There are a lot of good references on SVM. Here are only a few ones to start wit
CvSVM
-----
.. ctype:: CvSVM
.. c:type:: CvSVM
Support Vector Machines. ::
@ -90,7 +90,7 @@ Support Vector Machines. ::
CvSVMParams
-----------
.. ctype:: CvSVMParams
.. c:type:: CvSVMParams
SVM training parameters. ::
@ -125,7 +125,7 @@ The structure must be initialized and passed to the training method of
CvSVM::train
------------
.. cfunction:: bool CvSVM::train( const CvMat* _train_data, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, CvSVMParams _params=CvSVMParams() )
.. c:function:: bool CvSVM::train( const CvMat* _train_data, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, CvSVMParams _params=CvSVMParams() )
Trains SVM.
@ -140,7 +140,7 @@ All the other parameters are gathered in
CvSVM::train_auto
-----------------
.. cfunction:: train_auto( const CvMat* _train_data, const CvMat* _responses, const CvMat* _var_idx, const CvMat* _sample_idx, CvSVMParams params, int k_fold = 10, CvParamGrid C_grid = get_default_grid(CvSVM::C), CvParamGrid gamma_grid = get_default_grid(CvSVM::GAMMA), CvParamGrid p_grid = get_default_grid(CvSVM::P), CvParamGrid nu_grid = get_default_grid(CvSVM::NU), CvParamGrid coef_grid = get_default_grid(CvSVM::COEF), CvParamGrid degree_grid = get_default_grid(CvSVM::DEGREE) )
.. c:function:: train_auto( const CvMat* _train_data, const CvMat* _responses, const CvMat* _var_idx, const CvMat* _sample_idx, CvSVMParams params, int k_fold = 10, CvParamGrid C_grid = get_default_grid(CvSVM::C), CvParamGrid gamma_grid = get_default_grid(CvSVM::GAMMA), CvParamGrid p_grid = get_default_grid(CvSVM::P), CvParamGrid nu_grid = get_default_grid(CvSVM::NU), CvParamGrid coef_grid = get_default_grid(CvSVM::COEF), CvParamGrid degree_grid = get_default_grid(CvSVM::DEGREE) )
Trains SVM with optimal parameters.
@ -182,7 +182,7 @@ as well as for the regression
CvSVM::get_default_grid
-----------------------
.. cfunction:: CvParamGrid CvSVM::get_default_grid( int param_id )
.. c:function:: CvParamGrid CvSVM::get_default_grid( int param_id )
Generates a grid for the SVM parameters.
@ -211,7 +211,7 @@ The function generates a grid for the specified parameter of the SVM algorithm.
CvSVM::get_params
-----------------
.. cfunction:: CvSVMParams CvSVM::get_params() const
.. c:function:: CvSVMParams CvSVM::get_params() const
Returns the current SVM parameters.
@ -223,9 +223,9 @@ This function may be used to get the optimal parameters that were obtained while
CvSVM::get_support_vector*
--------------------------
.. cfunction:: int CvSVM::get_support_vector_count() const
.. c:function:: int CvSVM::get_support_vector_count() const
.. cfunction:: const float* CvSVM::get_support_vector(int i) const
.. c:function:: const float* CvSVM::get_support_vector(int i) const
Retrieves the number of support vectors and the particular vector.

View File

@ -9,7 +9,7 @@ Cascade Classification
FeatureEvaluator
----------------
.. ctype:: FeatureEvaluator
.. c:type:: FeatureEvaluator
Base class for computing feature values in cascade classifiers. ::
@ -34,9 +34,9 @@ Base class for computing feature values in cascade classifiers. ::
.. index:: FeatureEvaluator::read
cv::FeatureEvaluator::read
FeatureEvaluator::read
--------------------------
.. cfunction:: bool FeatureEvaluator::read(const FileNode\& node)
.. c:function:: bool FeatureEvaluator::read(const FileNode\& node)
Reads parameters of the features from a FileStorage node.
@ -44,25 +44,25 @@ cv::FeatureEvaluator::read
.. index:: FeatureEvaluator::clone
cv::FeatureEvaluator::clone
FeatureEvaluator::clone
---------------------------
.. cfunction:: Ptr<FeatureEvaluator> FeatureEvaluator::clone() const
.. c:function:: Ptr<FeatureEvaluator> FeatureEvaluator::clone() const
Returns a full copy of the feature evaluator.
.. index:: FeatureEvaluator::getFeatureType
cv::FeatureEvaluator::getFeatureType
FeatureEvaluator::getFeatureType
------------------------------------
.. cfunction:: int FeatureEvaluator::getFeatureType() const
.. c:function:: int FeatureEvaluator::getFeatureType() const
Returns the feature type (HAAR or LBP for now).
.. index:: FeatureEvaluator::setImage
cv::FeatureEvaluator::setImage
FeatureEvaluator::setImage
------------------------------
.. cfunction:: bool FeatureEvaluator::setImage(const Mat\& img, Size origWinSize)
.. c:function:: bool FeatureEvaluator::setImage(const Mat\& img, Size origWinSize)
Sets the image in which to compute the features.
@ -72,10 +72,10 @@ cv::FeatureEvaluator::setImage
.. index:: FeatureEvaluator::setWindow
cv::FeatureEvaluator::setWindow
FeatureEvaluator::setWindow
-------------------------------
:func:`CascadeClassifier::runAt`
.. cfunction:: bool FeatureEvaluator::setWindow(Point p)
.. c:function:: bool FeatureEvaluator::setWindow(Point p)
Sets window in the current image in which the features will be computed (called by ).
@ -83,9 +83,9 @@ cv::FeatureEvaluator::setWindow
.. index:: FeatureEvaluator::calcOrd
cv::FeatureEvaluator::calcOrd
FeatureEvaluator::calcOrd
-----------------------------
.. cfunction:: double FeatureEvaluator::calcOrd(int featureIdx) const
.. c:function:: double FeatureEvaluator::calcOrd(int featureIdx) const
Computes value of an ordered (numerical) feature.
@ -95,9 +95,9 @@ Returns computed value of ordered feature.
.. index:: FeatureEvaluator::calcCat
cv::FeatureEvaluator::calcCat
FeatureEvaluator::calcCat
-----------------------------
.. cfunction:: int FeatureEvaluator::calcCat(int featureIdx) const
.. c:function:: int FeatureEvaluator::calcCat(int featureIdx) const
Computes value of a categorical feature.
@ -107,9 +107,9 @@ Returns computed label of categorical feature, i.e. value from [0,... (number of
.. index:: FeatureEvaluator::create
cv::FeatureEvaluator::create
FeatureEvaluator::create
----------------------------
.. cfunction:: static Ptr<FeatureEvaluator> FeatureEvaluator::create(int type)
.. c:function:: static Ptr<FeatureEvaluator> FeatureEvaluator::create(int type)
Constructs feature evaluator.
@ -121,7 +121,7 @@ cv::FeatureEvaluator::create
CascadeClassifier
-----------------
.. ctype:: CascadeClassifier
.. c:type:: CascadeClassifier
The cascade classifier class for object detection. ::
@ -194,9 +194,9 @@ The cascade classifier class for object detection. ::
.. index:: CascadeClassifier::CascadeClassifier
cv::CascadeClassifier::CascadeClassifier
CascadeClassifier::CascadeClassifier
----------------------------------------
.. cfunction:: CascadeClassifier::CascadeClassifier(const string\& filename)
.. c:function:: CascadeClassifier::CascadeClassifier(const string\& filename)
Loads the classifier from file.
@ -204,17 +204,17 @@ cv::CascadeClassifier::CascadeClassifier
.. index:: CascadeClassifier::empty
cv::CascadeClassifier::empty
CascadeClassifier::empty
----------------------------
.. cfunction:: bool CascadeClassifier::empty() const
.. c:function:: bool CascadeClassifier::empty() const
Checks if the classifier has been loaded or not.
.. index:: CascadeClassifier::load
cv::CascadeClassifier::load
CascadeClassifier::load
---------------------------
.. cfunction:: bool CascadeClassifier::load(const string\& filename)
.. c:function:: bool CascadeClassifier::load(const string\& filename)
Loads the classifier from file. The previous content is destroyed.
@ -222,17 +222,17 @@ cv::CascadeClassifier::load
.. index:: CascadeClassifier::read
cv::CascadeClassifier::read
CascadeClassifier::read
---------------------------
.. cfunction:: bool CascadeClassifier::read(const FileNode\& node)
.. c:function:: bool CascadeClassifier::read(const FileNode\& node)
Reads the classifier from a FileStorage node. File may contain a new cascade classifier (trained traincascade application) only.
.. index:: CascadeClassifier::detectMultiScale
cv::CascadeClassifier::detectMultiScale
CascadeClassifier::detectMultiScale
---------------------------------------
.. cfunction:: void CascadeClassifier::detectMultiScale( const Mat\& image, vector<Rect>\& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size())
.. c:function:: void CascadeClassifier::detectMultiScale( const Mat\& image, vector<Rect>\& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size())
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
@ -250,9 +250,9 @@ cv::CascadeClassifier::detectMultiScale
.. index:: CascadeClassifier::setImage
cv::CascadeClassifier::setImage
CascadeClassifier::setImage
-------------------------------
.. cfunction:: bool CascadeClassifier::setImage( Ptr<FeatureEvaluator>\& feval, const Mat\& image )
.. c:function:: bool CascadeClassifier::setImage( Ptr<FeatureEvaluator>\& feval, const Mat\& image )
Sets the image for detection (called by detectMultiScale at each image level).
@ -262,9 +262,9 @@ cv::CascadeClassifier::setImage
.. index:: CascadeClassifier::runAt
cv::CascadeClassifier::runAt
CascadeClassifier::runAt
----------------------------
.. cfunction:: int CascadeClassifier::runAt( Ptr<FeatureEvaluator>\& feval, Point pt )
.. c:function:: int CascadeClassifier::runAt( Ptr<FeatureEvaluator>\& feval, Point pt )
Runs the detector at the specified point (the image that the detector is working with should be set by setImage).
@ -278,9 +278,9 @@ Returns:
.. index:: groupRectangles
cv::groupRectangles
groupRectangles
-------------------
.. cfunction:: void groupRectangles(vector<Rect>\& rectList, int groupThreshold, double eps=0.2)
.. c:function:: void groupRectangles(vector<Rect>\& rectList, int groupThreshold, double eps=0.2)
Groups the object candidate rectangles

View File

@ -5,9 +5,9 @@ Motion Analysis and Object Tracking
.. index:: calcOpticalFlowPyrLK
cv::calcOpticalFlowPyrLK
calcOpticalFlowPyrLK
------------------------
.. cfunction:: void calcOpticalFlowPyrLK( const Mat\& prevImg, const Mat\& nextImg, const vector<Point2f>\& prevPts, vector<Point2f>\& nextPts, vector<uchar>\& status, vector<float>\& err, Size winSize=Size(15,15), int maxLevel=3, TermCriteria criteria=TermCriteria( TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), double derivLambda=0.5, int flags=0 )
.. c:function:: void calcOpticalFlowPyrLK( const Mat\& prevImg, const Mat\& nextImg, const vector<Point2f>\& prevPts, vector<Point2f>\& nextPts, vector<uchar>\& status, vector<float>\& err, Size winSize=Size(15,15), int maxLevel=3, TermCriteria criteria=TermCriteria( TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), double derivLambda=0.5, int flags=0 )
Calculates the optical flow for a sparse feature set using the iterative Lucas-Kanade method with pyramids
@ -38,9 +38,9 @@ Bouguet00
.. index:: calcOpticalFlowFarneback
cv::calcOpticalFlowFarneback
calcOpticalFlowFarneback
----------------------------
.. cfunction:: void calcOpticalFlowFarneback( const Mat\& prevImg, const Mat\& nextImg, Mat\& flow, double pyrScale, int levels, int winsize, int iterations, int polyN, double polySigma, int flags )
.. c:function:: void calcOpticalFlowFarneback( const Mat\& prevImg, const Mat\& nextImg, Mat\& flow, double pyrScale, int levels, int winsize, int iterations, int polyN, double polySigma, int flags )
Computes dense optical flow using Gunnar Farneback's algorithm
@ -73,9 +73,9 @@ The function finds optical flow for each ``prevImg`` pixel using the alorithm so
.. index:: updateMotionHistory
cv::updateMotionHistory
updateMotionHistory
-----------------------
.. cfunction:: void updateMotionHistory( const Mat\& silhouette, Mat\& mhi, double timestamp, double duration )
.. c:function:: void updateMotionHistory( const Mat\& silhouette, Mat\& mhi, double timestamp, double duration )
Updates the motion history image by a moving silhouette.
@ -105,9 +105,9 @@ See also the OpenCV sample ``motempl.c`` that demonstrates the use of all the mo
.. index:: calcMotionGradient
cv::calcMotionGradient
calcMotionGradient
----------------------
.. cfunction:: void calcMotionGradient( const Mat\& mhi, Mat\& mask, Mat\& orientation, double delta1, double delta2, int apertureSize=3 )
.. c:function:: void calcMotionGradient( const Mat\& mhi, Mat\& mask, Mat\& orientation, double delta1, double delta2, int apertureSize=3 )
Calculates the gradient orientation of a motion history image.
@ -138,9 +138,9 @@ The function calculates the gradient orientation at each pixel
.. index:: calcGlobalOrientation
cv::calcGlobalOrientation
calcGlobalOrientation
-------------------------
.. cfunction:: double calcGlobalOrientation( const Mat\& orientation, const Mat\& mask, const Mat\& mhi, double timestamp, double duration )
.. c:function:: double calcGlobalOrientation( const Mat\& orientation, const Mat\& mask, const Mat\& mhi, double timestamp, double duration )
Calculates the global motion orientation in some selected region.
@ -158,9 +158,9 @@ weight and the motion occurred in the past has smaller weight, as recorded in ``
.. index:: CamShift
cv::CamShift
CamShift
------------
.. cfunction:: RotatedRect CamShift( const Mat\& probImage, Rect\& window, TermCriteria criteria )
.. c:function:: RotatedRect CamShift( const Mat\& probImage, Rect\& window, TermCriteria criteria )
Finds the object center, size, and orientation
@ -178,9 +178,9 @@ See the OpenCV sample ``camshiftdemo.c`` that tracks colored objects.
.. index:: meanShift
cv::meanShift
meanShift
-------------
.. cfunction:: int meanShift( const Mat\& probImage, Rect\& window, TermCriteria criteria )
.. c:function:: int meanShift( const Mat\& probImage, Rect\& window, TermCriteria criteria )
Finds the object on a back projection image.
@ -203,7 +203,7 @@ The function implements iterative object search algorithm. It takes the object b
KalmanFilter
------------
.. ctype:: KalmanFilter
.. c:type:: KalmanFilter
Kalman filter class ::