diff --git a/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst b/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst index 50b49e417..e0ba18e84 100644 --- a/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst +++ b/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst @@ -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 >\& objectPoints, const vector >\& imagePoints, Size imageSize, Mat\& cameraMatrix, Mat\& distCoeffs, vector\& rvecs, vector\& tvecs, int flags=0 ) +.. c:function:: double calibrateCamera( const vector >& objectPoints, const vector >& imagePoints, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector& rvecs, vector& 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\& lines ) +.. c:function:: void computeCorrespondEpilines( const Mat& points, int whichImage, const Mat& F, vector& 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`` + :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\& dst ) +.. c:function:: void convertPointsHomogeneous( const Mat& src, vector& dst ) -.. cfunction:: void convertPointsHomogeneous( const Mat\& src, vector\& dst ) +.. c:function:: void convertPointsHomogeneous( const Mat& src, vector& 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\& corners, int flags=CV_CALIB_CB_ADAPTIVE_THRESH+ CV_CALIB_CB_NORMALIZE_IMAGE ) +.. c:function:: bool findChessboardCorners( const Mat& image, Size patternSize, vector& 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\& centers, int flags=CALIB_CB_SYMMETRIC_GRID ) +.. c:function:: bool findCirclesGrid( const Mat& image, Size patternSize, vector& 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\& status, int method=FM_RANSAC, double param1=3., double param2=0.99 ) +.. c:function:: Mat findFundamentalMat( const Mat& points1, const Mat& points2, vector& 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\& status, int method=0, double ransacReprojThreshold=3 ) +.. c:function:: Mat findHomography( const Mat& srcPoints, const Mat& dstPoints, vector& 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 >\& objectPoints, const vector >\& imagePoints, Size imageSize, double aspectRatio=1.) +.. c:function:: Mat initCameraMatrix2D( const vector >& objectPoints, const vector >& 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\& imagePoints ) -.. cfunction:: void projectPoints( const Mat\& objectPoints, const Mat\& rvec, const Mat\& tvec, const Mat\& cameraMatrix, const Mat\& distCoeffs, vector\& 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& imagePoints ) + +.. c:function:: void projectPoints( const Mat& objectPoints, const Mat& rvec, const Mat& tvec, const Mat& cameraMatrix, const Mat& distCoeffs, vector& 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`` ) , 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`` ) @@ -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 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 >\& objectPoints, const vector >\& imagePoints1, const vector >\& 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 >& objectPoints, const vector >& imagePoints1, const vector >& 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\& dst, const Mat\& cameraMatrix, const Mat\& distCoeffs, const Mat\& R=Mat(), const Mat\& P=Mat()) +.. c:function:: void undistortPoints( const Mat& src, vector& 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). diff --git a/modules/core/doc/basic_structures.rst b/modules/core/doc/basic_structures.rst index e32f7d1b2..7c2adb8c0 100644 --- a/modules/core/doc/basic_structures.rst +++ b/modules/core/doc/basic_structures.rst @@ -31,7 +31,6 @@ Template "traits" class for other OpenCV primitive data types :: type = CV_MAKETYPE(depth, channels) }; }; -.. The template class ``DataType`` is descriptive class for OpenCV primitive data types and other types that comply with the following definition. A primitive OpenCV data type is one of ``unsigned char, bool, signed char, unsigned short, signed short, int, float, double`` or a tuple of values of one of these types, where all the values in the tuple have the same type. If you are familiar with OpenCV :ref:`CvMat` 's type notation, CV_8U ... CV_32FC3, CV_64FC2 etc., then a primitive type can be defined as a type for which you can give a unique identifier in a form ``CV_{U|S|F}C`` . A universal OpenCV structure able to store a single instance of such primitive data type is @@ -59,7 +58,6 @@ The class ``DataType`` is basically used to provide some description of such pri type=CV_MAKETYPE(depth, channels) }; }; ... -.. The main purpose of the classes is to convert compile-time type information to OpenCV-compatible data type identifier, for example: :: @@ -69,7 +67,7 @@ The main purpose of the classes is to convert compile-time type information to O Mat B = Mat_ >(3, 3); // the statement below will print 6, 2 /* i.e. depth == CV_64F, channels == 2 */ cout << B.depth() << ", " << B.channels() << endl; -.. + that is, such traits are used to tell OpenCV which data type you are working with, even if such a type is not native to OpenCV (the matrix ``B`` intialization above compiles because OpenCV defines the proper specialized template class ``DataType >`` ). Also, this mechanism is useful (and used in OpenCV this way) for generic algorithms implementations. @@ -105,7 +103,6 @@ Template class for 2D points :: _Tp x, y; }; -.. The class represents a 2D point, specified by its coordinates :math:`x` and @@ -123,7 +120,6 @@ operation on each of the coordinates. Besides the class members listed in the de double value = norm(pt); // L2 norm pt1 == pt2; pt1 != pt2; -.. For user convenience, the following type aliases are defined: :: @@ -131,14 +127,13 @@ For user convenience, the following type aliases are defined: :: typedef Point2i Point; typedef Point_ Point2f; typedef Point_ Point2d; -.. Here is a short example: :: Point2f a(0.3f, 0.f), b(0.f, 0.4f); Point pt = (a + b)*10.f; cout << pt.x << ", " << pt.y << endl; -.. + Point3\_ -------- @@ -166,7 +161,7 @@ Template class for 3D points :: _Tp x, y, z; }; -.. + The class represents a 3D point, specified by its coordinates :math:`x`,:math:`y` and @@ -178,7 +173,7 @@ The following type aliases are available: :: typedef Point3_ Point3i; typedef Point3_ Point3f; typedef Point3_ Point3d; -.. + Size\_ ------ @@ -207,7 +202,7 @@ Template class for specfying image or rectangle size. :: _Tp width, height; }; -.. + The class ``Size_`` is similar to ``Point_`` , except that the two members are called ``width`` and ``height`` instead of ``x`` and ``y`` . The structure can be converted to and from the old OpenCV structures :ref:`CvSize` and @@ -218,7 +213,7 @@ OpenCV defines the following type aliases: :: typedef Size_ Size2i; typedef Size2i Size; typedef Size_ Size2f; -.. + Rect\_ ------ @@ -260,7 +255,7 @@ Template class for 2D rectangles :: _Tp x, y, width, height; }; -.. + The rectangle is described by the coordinates of the top-left corner (which is the default interpretation of ``Rect_::x`` and ``Rect_::y`` in OpenCV; though, in your algorithms you may count ``x`` and ``y`` from the bottom-left corner), the rectangle width and height. @@ -279,7 +274,7 @@ And virtually every loop over an image { // ... } -.. + In addition to the class members, the following operations on rectangles are implemented: @@ -307,12 +302,12 @@ Example. Here is how the partial ordering on rectangles can be established (rect { return (r1 & r2) == r1; } -.. + For user convenience, the following type alias is available: :: typedef Rect_ Rect; -.. + RotatedRect ----------- @@ -339,7 +334,7 @@ Possibly rotated rectangle :: // rotation angle in degrees float angle; }; -.. + The class ``RotatedRect`` replaces the old :ref:`CvBox2D` and fully compatible with it. @@ -371,7 +366,7 @@ Termination criteria for iterative algorithms :: int maxCount; double epsilon; }; -.. + The class ``TermCriteria`` replaces the old :ref:`CvTermCriteria` and fully compatible with it. @@ -411,7 +406,7 @@ Template class for small matrices :: ... typedef Matx Matx66f; typedef Matx Matx66d; -.. + The class represents small matrices, which type and size are known at compile time. If you need more flexible type, use :ref:`Mat` . The elements of a matrix ``M`` are accessible using ``M(i,j)`` notation, and most of the common matrix operations (see also @@ -422,7 +417,7 @@ The class represents small matrices, which type and size are known at compile ti 4, 5, 6, 7, 8, 9); cout << sum(Mat(m*m.t())) << endl; -.. + Vec --- @@ -495,7 +490,7 @@ Scalar\_ }; typedef Scalar_ Scalar; -.. + The template class ``Scalar_`` and it's double-precision instantiation ``Scalar`` represent 4-element vector. Being derived from ``Vec<_Tp, 4>`` , they can be used as typical 4-element vectors, but in addition they can be converted to/from ``CvScalar`` . The type ``Scalar`` is widely used in OpenCV for passing pixel values and it is a drop-in replacement for :ref:`CvScalar` that was used for the same purpose in the earlier versions of OpenCV. @@ -518,7 +513,7 @@ Specifies a continuous subsequence (a.k.a. slice) of a sequence. :: int start, end; }; -.. + The class is used to specify a row or column span in a matrix ( :ref:`Mat` ), and for many other purposes. ``Range(a,b)`` is basically the same as ``a:b`` in Matlab or ``a..b`` in Python. As in Python, ``start`` is inclusive left boundary of the range, and ``end`` is exclusive right boundary of the range. Such a half-opened interval is usually denoted as @@ -535,7 +530,7 @@ The static method ``Range::all()`` returns some special variable that means "the // process [r.start, r.end) } } -.. + Ptr --- @@ -582,7 +577,7 @@ A template class for smart reference-counting pointers :: // the associated reference counter int* refcount; }; -.. + The class ``Ptr<_Tp>`` is a template class that wraps pointers of the corresponding type. It is similar to ``shared_ptr`` that is a part of Boost library ( http://www.boost.org/doc/libs/1_40_0/libs/smart_ptr/shared_ptr.htm @@ -620,7 +615,7 @@ However, if the object is deallocated in a different way, then the specialized m fprintf(f, ....); ... // the file will be closed automatically by the Ptr destructor. -.. + **Note** : The reference increment/decrement operations are implemented as atomic operations, and therefore it is normally safe to use the classes in multi-threaded applications. The same is true for @@ -658,7 +653,7 @@ OpenCV C++ n-dimensional dense array class. :: // other members ... }; -.. + The class ``Mat`` represents an n-dimensional dense numerical single-channel or multi-channel array. It can be used to store real or complex-valued vectors and matrices, grayscale or color images, voxel volumes, vector fields, point clouds, tensors, histograms (though, very high-dimensional histograms may be better stored in a ``SparseMat`` ). The data layout of array :math:`M` is defined by the array ``M.step[]`` , so that the address of element @@ -691,7 +686,7 @@ There are many different ways to create ``Mat`` object. Here are the some popula :: // make 7x7 complex matrix filled with 1+3j. - cv::Mat M(7,7,CV_32FC2,Scalar(1,3)); + Mat M(7,7,CV_32FC2,Scalar(1,3)); // and now turn M to 100x60 15-channel 8-bit matrix. // The old content will be deallocated M.create(100,60,CV_8UC(15)); @@ -708,7 +703,7 @@ There are many different ways to create ``Mat`` object. Here are the some popula // create 100x100x100 8-bit array int sz[] = {100, 100, 100}; - cv::Mat bigCube(3, sz, CV_8U, Scalar::all(0)); + Mat bigCube(3, sz, CV_8U, Scalar::all(0)); .. @@ -738,9 +733,9 @@ There are many different ways to create ``Mat`` object. Here are the some popula M.col(7).copyTo(M1); // create new 320x240 image - cv::Mat img(Size(320,240),CV_8UC3); + Mat img(Size(320,240),CV_8UC3); // select a roi - cv::Mat roi(img, Rect(10,10,100,100)); + Mat roi(img, Rect(10,10,100,100)); // fill the ROI with (0,255,0) (which is green in RGB space); // the original 320x240 image will be modified roi = Scalar(0,255,0); @@ -781,8 +776,8 @@ There are many different ways to create ``Mat`` object. Here are the some popula void process_video_frame(const unsigned char* pixels, int width, int height, int step) { - cv::Mat img(height, width, CV_8UC3, pixels, step); - cv::GaussianBlur(img, img, cv::Size(7,7), 1.5, 1.5); + Mat img(height, width, CV_8UC3, pixels, step); + GaussianBlur(img, img, Size(7,7), 1.5, 1.5); } .. @@ -793,7 +788,7 @@ There are many different ways to create ``Mat`` object. Here are the some popula :: double m[3][3] = {{a, b, c}, {d, e, f}, {g, h, i}}; - cv::Mat M = cv::Mat(3, 3, CV_64F, m).inv(); + Mat M = Mat(3, 3, CV_64F, m).inv(); .. @@ -812,8 +807,8 @@ There are many different ways to create ``Mat`` object. Here are the some popula :: IplImage* img = cvLoadImage("greatwave.jpg", 1); - Mat mtx(img); // convert IplImage* -> cv::Mat - CvMat oldmat = mtx; // convert cv::Mat -> CvMat + Mat mtx(img); // convert IplImage* -> Mat + CvMat oldmat = mtx; // convert Mat -> CvMat CV_Assert(oldmat.cols == img->width && oldmat.rows == img->height && oldmat.data.ptr == (uchar*)img->imageData && oldmat.step == img->widthStep); @@ -848,7 +843,7 @@ The next important thing to learn about the array class is element access. Earli :math:`M_{ij}` of 2-dimensional array as: :: M.at(i,j) += 1.f; -.. + assuming that M is double-precision floating-point array. There are several variants of the method ``at`` for different number of dimensions. @@ -863,7 +858,7 @@ If you need to process a whole row of a 2d array, the most efficient way is to g for(int j = 0; j < M.cols; j++) sum += std::max(Mi[j], 0.); } -.. + Some operations, like the above one, do not actually depend on the array shape, they just process elements of an array one by one (or elements from multiple arrays that have the same coordinates, e.g. array addition). Such operations are called element-wise and it makes sense to check whether all the input/output arrays are continuous, i.e. have no gaps in the end of each row, and if yes, process them as a single long row: :: @@ -881,7 +876,7 @@ Some operations, like the above one, do not actually depend on the array shape, for(int j = 0; j < cols; j++) sum += std::max(Mi[j], 0.); } -.. + in the case of continuous matrix the outer loop body will be executed just once, so the overhead will be smaller, which will be especially noticeable in the case of small matrices. @@ -892,7 +887,7 @@ Finally, there are STL-style iterators that are smart enough to skip gaps betwee MatConstIterator_ it = M.begin(), it_end = M.end(); for(; it != it_end; ++it) sum += std::max(*it, 0.); -.. + The matrix iterators are random-access iterators, so they can be passed to any STL algorithm, including ``std::sort()`` . @@ -956,47 +951,47 @@ Below is the formal description of the ``Mat`` methods. .. index:: Mat::Mat -cv::Mat::Mat +Mat::Mat ------------ -.. cfunction:: (1) Mat::Mat() +.. c:function:: (1) Mat::Mat() -.. cfunction:: (2) Mat::Mat(int rows, int cols, int type) +.. c:function:: (2) Mat::Mat(int rows, int cols, int type) -.. cfunction:: (3) Mat::Mat(Size size, int type) +.. c:function:: (3) Mat::Mat(Size size, int type) -.. cfunction:: (4) Mat::Mat(int rows, int cols, int type, const Scalar\& s) +.. c:function:: (4) Mat::Mat(int rows, int cols, int type, const Scalar\& s) -.. cfunction:: (5) Mat::Mat(Size size, int type, const Scalar\& s) +.. c:function:: (5) Mat::Mat(Size size, int type, const Scalar\& s) -.. cfunction:: (6) Mat::Mat(const Mat\& m) +.. c:function:: (6) Mat::Mat(const Mat\& m) -.. cfunction:: (7) Mat::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP) +.. c:function:: (7) Mat::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP) -.. cfunction:: (8) Mat::Mat(Size size, int type, void* data, size_t step=AUTO_STEP) +.. c:function:: (8) Mat::Mat(Size size, int type, void* data, size_t step=AUTO_STEP) -.. cfunction:: (9) Mat::Mat(const Mat\& m, const Range\& rowRange, const Range\& colRange) +.. c:function:: (9) Mat::Mat(const Mat\& m, const Range\& rowRange, const Range\& colRange) -.. cfunction:: (10) Mat::Mat(const Mat\& m, const Rect\& roi) +.. c:function:: (10) Mat::Mat(const Mat\& m, const Rect\& roi) -.. cfunction:: (11) Mat::Mat(const CvMat* m, bool copyData=false) +.. c:function:: (11) Mat::Mat(const CvMat* m, bool copyData=false) -.. cfunction:: (12) Mat::Mat(const IplImage* img, bool copyData=false) +.. c:function:: (12) Mat::Mat(const IplImage* img, bool copyData=false) -.. cfunction:: (13) template explicit Mat::Mat(const Vec\& vec, bool copyData=true) +.. c:function:: (13) template explicit Mat::Mat(const Vec\& vec, bool copyData=true) -.. cfunction:: (14) template explicit Mat::Mat(const Matx\& vec, bool copyData=true) +.. c:function:: (14) template explicit Mat::Mat(const Matx\& vec, bool copyData=true) -.. cfunction:: (15) template explicit Mat::Mat(const vector\& vec, bool copyData=false) +.. c:function:: (15) template explicit Mat::Mat(const vector\& vec, bool copyData=false) -.. cfunction:: (16) Mat::Mat(const MatExpr\& expr) +.. c:function:: (16) Mat::Mat(const MatExpr\& expr) -.. cfunction:: (17) Mat::Mat(int ndims, const int* sizes, int type) +.. c:function:: (17) Mat::Mat(int ndims, const int* sizes, int type) -.. cfunction:: (18) Mat::Mat(int ndims, const int* sizes, int type, const Scalar\& s) +.. c:function:: (18) Mat::Mat(int ndims, const int* sizes, int type, const Scalar\& s) -.. cfunction:: (19) Mat::Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0) +.. c:function:: (19) Mat::Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0) -.. cfunction:: (20) Mat::Mat(const Mat\& m, const Range* ranges) +.. c:function:: (20) Mat::Mat(const Mat\& m, const Range* ranges) Various array constructors @@ -1016,7 +1011,7 @@ cv::Mat::Mat :param data: Pointer to the user data. Matrix constructors that take ``data`` and ``step`` parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, i.e. no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, user should take care of it. - :param step: The ``data`` buddy. This optional parameter specifies the number of bytes that each matrix row occupies. The value should include the padding bytes in the end of each row, if any. If the parameter is missing (set to ``cv::AUTO_STEP`` ), no padding is assumed and the actual step is calculated as ``cols*elemSize()`` , see :ref:`Mat::elemSize` (). + :param step: The ``data`` buddy. This optional parameter specifies the number of bytes that each matrix row occupies. The value should include the padding bytes in the end of each row, if any. If the parameter is missing (set to ``AUTO_STEP`` ), no padding is assumed and the actual step is calculated as ``cols*elemSize()`` , see :ref:`Mat::elemSize` (). :param steps: The array of ``ndims-1`` steps in the case of multi-dimensional array (the last step is always set to the element size). If not specified, the matrix is assumed to be continuous. @@ -1044,9 +1039,9 @@ These are various constructors that form a matrix. As noticed in the .. index:: Mat::Mat -cv::Mat::Mat +Mat::Mat ------------ -.. cfunction:: Mat::\textasciitilde Mat() +.. c:function:: Mat::\textasciitilde Mat() Matrix destructor @@ -1055,19 +1050,19 @@ The matrix destructor calls .. index:: Mat::operator = -cv::Mat::operator = +Mat::operator = ------------------- -.. cfunction:: Mat\& Mat::operator = (const Mat\& m) +.. c:function:: Mat\& Mat::operator = (const Mat\& m) -.. cfunction:: Mat\& Mat::operator = (const MatExpr_Base\& expr) +.. c:function:: Mat\& Mat::operator = (const MatExpr_Base\& expr) -.. cfunction:: Mat\& operator = (const Scalar\& s) +.. c:function:: Mat\& operator = (const Scalar\& s) Matrix assignment operators :param m: The assigned, right-hand-side matrix. Matrix assignment is O(1) operation, that is, no data is copied. Instead, the data is shared and the reference counter, if any, is incremented. Before assigning new data, the old data is dereferenced via :ref:`Mat::release` . - :param expr: The assigned matrix expression object. As opposite to the first form of assignment operation, the second form can reuse already allocated matrix if it has the right size and type to fit the matrix expression result. It is automatically handled by the real function that the matrix expressions is expanded to. For example, ``C=A+B`` is expanded to ``cv::add(A, B, C)`` , and :func:`add` will take care of automatic ``C`` reallocation. + :param expr: The assigned matrix expression object. As opposite to the first form of assignment operation, the second form can reuse already allocated matrix if it has the right size and type to fit the matrix expression result. It is automatically handled by the real function that the matrix expressions is expanded to. For example, ``C=A+B`` is expanded to ``add(A, B, C)`` , and :func:`add` will take care of automatic ``C`` reallocation. :param s: The scalar, assigned to each matrix element. The matrix size or type is not changed. @@ -1075,9 +1070,9 @@ These are the available assignment operators, and they all are very different, s .. index:: Mat::operator MatExpr -cv::Mat::operator MatExpr +Mat::operator MatExpr ------------------------- -.. cfunction:: Mat::operator MatExpr_() const +.. c:function:: Mat::operator MatExpr_() const Mat-to-MatExpr cast operator @@ -1086,9 +1081,9 @@ The cast operator should not be called explicitly. It is used internally by the .. index:: Mat::row -cv::Mat::row +Mat::row ------------ -.. cfunction:: Mat Mat::row(int i) const +.. c:function:: Mat Mat::row(int i) const Makes a matrix header for the specified matrix row @@ -1100,7 +1095,7 @@ The method makes a new header for the specified matrix row and returns it. This { A.row(i) += A.row(j)*alpha; } -.. + **Important note** . In the current implementation the following code will not work as expected: :: @@ -1108,7 +1103,7 @@ The method makes a new header for the specified matrix row and returns it. This Mat A; ... A.row(i) = A.row(j); // will not work -.. + This is because ``A.row(i)`` forms a temporary header, which is further assigned another header. Remember, each of these operations is O(1), i.e. no data is copied. Thus, the above assignment will have absolutely no effect, while you may have expected j-th row being copied to i-th row. To achieve that, you should either turn this simple assignment into an expression, or use :ref:`Mat::copyTo` method: :: @@ -1120,13 +1115,13 @@ This is because ``A.row(i)`` forms a temporary header, which is further assigned // this is a bit longer, but the recommended method. Mat Ai = A.row(i); M.row(j).copyTo(Ai); -.. + .. index:: Mat::col -cv::Mat::col +Mat::col ------------ -.. cfunction:: Mat Mat::col(int j) const +.. c:function:: Mat Mat::col(int j) const Makes a matrix header for the specified matrix column @@ -1137,11 +1132,11 @@ The method makes a new header for the specified matrix column and returns it. Th .. index:: Mat::rowRange -cv::Mat::rowRange +Mat::rowRange ----------------- -.. cfunction:: Mat Mat::rowRange(int startrow, int endrow) const +.. c:function:: Mat Mat::rowRange(int startrow, int endrow) const -.. cfunction:: Mat Mat::rowRange(const Range\& r) const +.. c:function:: Mat Mat::rowRange(const Range\& r) const Makes a matrix header for the specified row span @@ -1157,11 +1152,11 @@ The method makes a new header for the specified row span of the matrix. Similarl .. index:: Mat::colRange -cv::Mat::colRange +Mat::colRange ----------------- -.. cfunction:: Mat Mat::colRange(int startcol, int endcol) const +.. c:function:: Mat Mat::colRange(int startcol, int endcol) const -.. cfunction:: Mat Mat::colRange(const Range\& r) const +.. c:function:: Mat Mat::colRange(const Range\& r) const Makes a matrix header for the specified row span @@ -1177,9 +1172,9 @@ The method makes a new header for the specified column span of the matrix. Simil .. index:: Mat::diag -cv::Mat::diag +Mat::diag ------------- -.. cfunction:: Mat Mat::diag(int d) const static Mat Mat::diag(const Mat\& matD) +.. c:function:: Mat Mat::diag(int d) const static Mat Mat::diag(const Mat\& matD) Extracts diagonal from a matrix, or creates a diagonal matrix. @@ -1199,9 +1194,9 @@ The method makes a new header for the specified matrix diagonal. The new matrix .. index:: Mat::clone -cv::Mat::clone +Mat::clone -------------- -.. cfunction:: Mat Mat::clone() const +.. c:function:: Mat Mat::clone() const Creates full copy of the array and the underlying data. @@ -1209,9 +1204,9 @@ The method creates full copy of the array. The original ``step[]`` are not taken .. index:: Mat::copyTo -cv::Mat::copyTo +Mat::copyTo --------------- -.. cfunction:: void Mat::copyTo( Mat\& m ) const void Mat::copyTo( Mat\& m, const Mat\& mask ) const +.. c:function:: void Mat::copyTo( Mat\& m ) const void Mat::copyTo( Mat\& m, const Mat\& mask ) const Copies the matrix to another one. @@ -1222,7 +1217,7 @@ cv::Mat::copyTo The method copies the matrix data to another matrix. Before copying the data, the method invokes :: m.create(this->size(), this->type); -.. + so that the destination matrix is reallocated if needed. While ``m.copyTo(m);`` will work as expected, i.e. will have no effect, the function does not handle the case of a partial overlap between the source and the destination matrices. @@ -1230,9 +1225,9 @@ When the operation mask is specified, and the ``Mat::create`` call shown above r .. index:: Mat::convertTo -cv::Mat::convertTo +Mat::convertTo ------------------ -.. cfunction:: void Mat::convertTo( Mat\& m, int rtype, double alpha=1, double beta=0 ) const +.. c:function:: void Mat::convertTo( Mat\& m, int rtype, double alpha=1, double beta=0 ) const Converts array to another datatype with optional scaling. @@ -1252,9 +1247,9 @@ The method converts source pixel values to the target datatype. ``saturate_cast< .. index:: Mat::assignTo -cv::Mat::assignTo +Mat::assignTo ----------------- -.. cfunction:: void Mat::assignTo( Mat\& m, int type=-1 ) const +.. c:function:: void Mat::assignTo( Mat\& m, int type=-1 ) const Functional form of convertTo @@ -1267,9 +1262,9 @@ This is internal-use method called by the .. index:: Mat::setTo -cv::Mat::setTo +Mat::setTo -------------- -.. cfunction:: Mat\& Mat::setTo(const Scalar\& s, const Mat\& mask=Mat()) +.. c:function:: Mat\& Mat::setTo(const Scalar\& s, const Mat\& mask=Mat()) Sets all or some of the array elements to the specified value. @@ -1279,9 +1274,9 @@ cv::Mat::setTo .. index:: Mat::reshape -cv::Mat::reshape +Mat::reshape ---------------- -.. cfunction:: Mat Mat::reshape(int cn, int rows=0) const +.. c:function:: Mat Mat::reshape(int cn, int rows=0) const Changes the 2D matrix's shape and/or the number of channels without copying the data. @@ -1301,7 +1296,7 @@ The method makes a new matrix header for ``*this`` elements. The new matrix may Here is some small example. Assuming, there is a set of 3D points that are stored as STL vector, and you want to represent the points as ``3xN`` matrix. Here is how it can be done: :: - std::vector vec; + std::vector vec; ... Mat pointMat = Mat(vec). // convert vector to Mat, O(1) operation @@ -1309,13 +1304,13 @@ Here is some small example. Assuming, there is a set of 3D points that are store // Also, an O(1) operation t(); // finally, transpose the Nx3 matrix. // This involves copying of all the elements -.. + .. index:: Mat::t -cv::Mat::t +Mat::t ---------- -.. cfunction:: MatExpr Mat::t() const +.. c:function:: MatExpr Mat::t() const Transposes the matrix @@ -1324,13 +1319,13 @@ It does not perform the actual transposition, but returns a temporary "matrix tr Mat A1 = A + Mat::eye(A.size(), A.type)*lambda; Mat C = A1.t()*A1; // compute (A + lambda*I)^t * (A + lamda*I) -.. + .. index:: Mat::inv -cv::Mat::inv +Mat::inv ------------ -.. cfunction:: MatExpr Mat::inv(int method=DECOMP_LU) const +.. c:function:: MatExpr Mat::inv(int method=DECOMP_LU) const Inverses the matrix @@ -1346,11 +1341,11 @@ The method performs matrix inversion by means of matrix expressions, i.e. a temp .. index:: Mat::mul -cv::Mat::mul +Mat::mul ------------ -.. cfunction:: MatExpr Mat::mul(const Mat\& m, double scale=1) const +.. c:function:: MatExpr Mat::mul(const Mat\& m, double scale=1) const -.. cfunction:: MatExpr Mat::mul(const MatExpr\& m, double scale=1) const +.. c:function:: MatExpr Mat::mul(const MatExpr\& m, double scale=1) const Performs element-wise multiplication or division of the two matrices @@ -1363,13 +1358,13 @@ The method returns a temporary object encoding per-element array multiplication, Here is a example: :: Mat C = A.mul(5/B); // equivalent to divide(A, B, C, 5) -.. + .. index:: Mat::cross -cv::Mat::cross +Mat::cross -------------- -.. cfunction:: Mat Mat::cross(const Mat\& m) const +.. c:function:: Mat Mat::cross(const Mat\& m) const Computes cross-product of two 3-element vectors @@ -1379,9 +1374,9 @@ The method computes cross-product of the two 3-element vectors. The vectors must .. index:: Mat::dot -cv::Mat::dot +Mat::dot ------------ -.. cfunction:: double Mat::dot(const Mat\& m) const +.. c:function:: double Mat::dot(const Mat\& m) const Computes dot-product of two vectors @@ -1391,9 +1386,9 @@ The method computes dot-product of the two matrices. If the matrices are not sin .. index:: Mat::zeros -cv::Mat::zeros +Mat::zeros -------------- -.. cfunction:: static MatExpr Mat::zeros(int rows, int cols, int type) static MatExpr Mat::zeros(Size size, int type) static MatExpr Mat::zeros(int ndims, const int* sizes, int type) +.. c:function:: static MatExpr Mat::zeros(int rows, int cols, int type) static MatExpr Mat::zeros(Size size, int type) static MatExpr Mat::zeros(int ndims, const int* sizes, int type) Returns zero array of the specified size and type @@ -1411,15 +1406,15 @@ The method returns Matlab-style zero array initializer. It can be used to quickl Mat A; A = Mat::zeros(3, 3, CV_32F); -.. + Note that in the above sample a new matrix will be allocated only if ``A`` is not 3x3 floating-point matrix, otherwise the existing matrix ``A`` will be filled with 0's. .. index:: Mat::ones -cv::Mat::ones +Mat::ones ------------- -.. cfunction:: static MatExpr Mat::ones(int rows, int cols, int type) static MatExpr Mat::ones(Size size, int type) static MatExpr Mat::ones(int ndims, const int* sizes, int type) +.. c:function:: static MatExpr Mat::ones(int rows, int cols, int type) static MatExpr Mat::ones(Size size, int type) static MatExpr Mat::ones(int ndims, const int* sizes, int type) Returns array of all 1's of the specified size and type @@ -1437,15 +1432,15 @@ The method returns Matlab-style ones' array initializer, similarly to :func:`Mat::zeros` . Note that using this method you can initialize an array with arbitrary value, using the following Matlab idiom: :: Mat A = Mat::ones(100, 100, CV_8U)*3; // make 100x100 matrix filled with 3. -.. + The above operation will not form 100x100 matrix of ones and then multiply it by 3. Instead, it will just remember the scale factor (3 in this case) and use it when actually invoking the matrix initializer. .. index:: Mat::eye -cv::Mat::eye +Mat::eye ------------ -.. cfunction:: static MatExpr Mat::eye(int rows, int cols, int type) static MatExpr Mat::eye(Size size, int type) +.. c:function:: static MatExpr Mat::eye(int rows, int cols, int type) static MatExpr Mat::eye(Size size, int type) Returns identity matrix of the specified size and type @@ -1460,13 +1455,13 @@ The method returns Matlab-style identity matrix initializer, similarly to // make a 4x4 diagonal matrix with 0.1's on the diagonal. Mat A = Mat::eye(4, 4, CV_32F)*0.1; -.. + .. index:: Mat::create -cv::Mat::create +Mat::create --------------- -.. cfunction:: void Mat::create(int rows, int cols, int type) void Mat::create(Size size, int type) void Mat::create(int ndims, const int* sizes, int type) +.. c:function:: void Mat::create(int rows, int cols, int type) void Mat::create(Size size, int type) void Mat::create(int ndims, const int* sizes, int type) Allocates new array data if needed. @@ -1502,7 +1497,7 @@ Such a scheme makes the memory management robust and efficient at the same time, ... Mat gray(color.rows, color.cols, color.depth()); cvtColor(color, gray, CV_BGR2GRAY); -.. + you can simply write: :: @@ -1510,15 +1505,15 @@ you can simply write: :: ... Mat gray; cvtColor(color, gray, CV_BGR2GRAY); -.. + because ``cvtColor`` , as well as most of OpenCV functions, calls Mat::create() for the output array internally. .. index:: Mat::addref -cv::Mat::addref +Mat::addref --------------- -.. cfunction:: void Mat::addref() +.. c:function:: void Mat::addref() Increments the reference counter @@ -1527,9 +1522,9 @@ The method increments the reference counter, associated with the matrix data. If .. index:: Mat::release -cv::Mat::release +Mat::release ---------------- -.. cfunction:: void Mat::release() +.. c:function:: void Mat::release() Decrements the reference counter and deallocates the matrix if needed @@ -1540,9 +1535,9 @@ This method can be called manually to force the matrix data deallocation. But si .. index:: Mat::resize -cv::Mat::resize +Mat::resize --------------- -.. cfunction:: void Mat::resize( size_t sz ) const +.. c:function:: void Mat::resize( size_t sz ) const Changes the number of matrix rows @@ -1556,7 +1551,7 @@ The method changes the number of matrix rows. If the matrix is reallocated, the Mat::push_back -------------- -.. cfunction:: template void Mat::push_back(const T\& elem) template void Mat::push_back(const Mat_\& elem) +.. c:function:: template void Mat::push_back(const T\& elem) template void Mat::push_back(const Mat_\& elem) Adds elements to the bottom of the matrix @@ -1570,7 +1565,7 @@ The methods add one or more elements to the bottom of the matrix. They emulate t Mat::pop_back ------------- -.. cfunction:: template void Mat::pop_back(size_t nelems=1) +.. c:function:: template void Mat::pop_back(size_t nelems=1) Removes elements from the bottom of the matrix. @@ -1580,9 +1575,9 @@ The method removes one or more rows from the bottom of the matrix. .. index:: Mat::locateROI -cv::Mat::locateROI +Mat::locateROI ------------------ -.. cfunction:: void Mat::locateROI( Size\& wholeSize, Point\& ofs ) const +.. c:function:: void Mat::locateROI( Size\& wholeSize, Point\& ofs ) const Locates matrix header within a parent matrix @@ -1595,9 +1590,9 @@ After you extracted a submatrix from a matrix using .. index:: Mat::adjustROI -cv::Mat::adjustROI +Mat::adjustROI ------------------ -.. cfunction:: Mat\& Mat::adjustROI( int dtop, int dbottom, int dleft, int dright ) +.. c:function:: Mat\& Mat::adjustROI( int dtop, int dbottom, int dleft, int dright ) Adjust submatrix size and position within the parent matrix @@ -1613,7 +1608,7 @@ The method is complimentary to the :func:`Mat::locateROI` . Indeed, the typical use of these functions is to determine the submatrix position within the parent matrix and then shift the position somehow. Typically it can be needed for filtering operations, when pixels outside of the ROI should be taken into account. When all the method's parameters are positive, it means that the ROI needs to grow in all directions by the specified amount, i.e. :: A.adjustROI(2, 2, 2, 2); -.. + increases the matrix size by 4 elements in each direction and shifts it by 2 elements to the left and 2 elements up, which brings in all the necessary pixels for the filtering with 5x5 kernel. @@ -1627,11 +1622,11 @@ See also .. index:: Mat::operator() -cv::Mat::operator() +Mat::operator() ------------------- -.. cfunction:: Mat Mat::operator()( Range rowRange, Range colRange ) const +.. c:function:: Mat Mat::operator()( Range rowRange, Range colRange ) const -.. cfunction:: Mat Mat::operator()( const Rect\& roi ) const Mat Mat::operator()( const Ranges* ranges ) const +.. c:function:: Mat Mat::operator()( const Rect\& roi ) const Mat Mat::operator()( const Ranges* ranges ) const Extracts a rectangular submatrix @@ -1645,9 +1640,9 @@ The operators make a new header for the specified sub-array of ``*this`` . They .. index:: Mat::operator CvMat -cv::Mat::operator CvMat +Mat::operator CvMat ----------------------- -.. cfunction:: Mat::operator CvMat() const +.. c:function:: Mat::operator CvMat() const Creates CvMat header for the matrix @@ -1658,15 +1653,15 @@ The operator makes CvMat header for the matrix without copying the underlying da CvMat cvimg = img; mycvOldFunc( &cvimg, ...); -.. + where ``mycvOldFunc`` is some function written to work with OpenCV 1.x data structures. .. index:: Mat::operator IplImage -cv::Mat::operator IplImage +Mat::operator IplImage -------------------------- -.. cfunction:: Mat::operator IplImage() const +.. c:function:: Mat::operator IplImage() const Creates IplImage header for the matrix @@ -1674,9 +1669,9 @@ The operator makes IplImage header for the matrix without copying the underlying .. index:: Mat::total -cv::Mat::total +Mat::total -------------- -.. cfunction:: size_t Mat::total() const +.. c:function:: size_t Mat::total() const Returns the total number of array elements. @@ -1684,9 +1679,9 @@ The method returns the number of array elements (e.g. number of pixels if the ar .. index:: Mat::isContinuous -cv::Mat::isContinuous +Mat::isContinuous --------------------- -.. cfunction:: bool Mat::isContinuous() const +.. c:function:: bool Mat::isContinuous() const Reports whether the matrix is continuous or not @@ -1702,7 +1697,7 @@ The continuity flag is stored as a bit in ``Mat::flags`` field, and is computed //return (m.flags & Mat::CONTINUOUS_FLAG) != 0; return m.rows == 1 || m.step == m.cols*m.elemSize(); } -.. + The method is used in a quite a few of OpenCV functions, and you are welcome to use it as well. The point is that element-wise operations (such as arithmetic and logical operations, math functions, alpha blending, color space transformations etc.) do not depend on the image geometry, and thus, if all the input and all the output arrays are continuous, the functions can process them as very long single-row vectors. Here is the example of how alpha-blending function can be implemented. :: @@ -1746,7 +1741,7 @@ The method is used in a quite a few of OpenCV functions, and you are welcome to } } } -.. + This trick, while being very simple, can boost performance of a simple element-operation by 10-20 percents, especially if the image is rather small and the operation is quite simple. @@ -1756,9 +1751,9 @@ Also, note that we use another OpenCV idiom in this function - we call .. index:: Mat::elemSize -cv::Mat::elemSize +Mat::elemSize ----------------- -.. cfunction:: size_t Mat::elemSize() const +.. c:function:: size_t Mat::elemSize() const Returns matrix element size in bytes @@ -1766,9 +1761,9 @@ The method returns the matrix element size in bytes. For example, if the matrix .. index:: Mat::elemSize1 -cv::Mat::elemSize1 +Mat::elemSize1 ------------------ -.. cfunction:: size_t Mat::elemSize1() const +.. c:function:: size_t Mat::elemSize1() const Returns size of each matrix element channel in bytes @@ -1776,9 +1771,9 @@ The method returns the matrix element channel size in bytes, that is, it ignores .. index:: Mat::type -cv::Mat::type +Mat::type ------------- -.. cfunction:: int Mat::type() const +.. c:function:: int Mat::type() const Returns matrix element type @@ -1786,9 +1781,9 @@ The method returns the matrix element type, an id, compatible with the ``CvMat`` .. index:: Mat::depth -cv::Mat::depth +Mat::depth -------------- -.. cfunction:: int Mat::depth() const +.. c:function:: int Mat::depth() const Returns matrix element depth @@ -1810,9 +1805,9 @@ The method returns the matrix element depth id, i.e. the type of each individual .. index:: Mat::channels -cv::Mat::channels +Mat::channels ----------------- -.. cfunction:: int Mat::channels() const +.. c:function:: int Mat::channels() const Returns matrix element depth @@ -1820,9 +1815,9 @@ The method returns the number of matrix channels. .. index:: Mat::step1 -cv::Mat::step1 +Mat::step1 -------------- -.. cfunction:: size_t Mat::step1() const +.. c:function:: size_t Mat::step1() const Returns normalized step @@ -1831,9 +1826,9 @@ The method returns the matrix step, divided by .. index:: Mat::size -cv::Mat::size +Mat::size ------------- -.. cfunction:: Size Mat::size() const +.. c:function:: Size Mat::size() const Returns the matrix size @@ -1841,9 +1836,9 @@ The method returns the matrix size: ``Size(cols, rows)`` . .. index:: Mat::empty -cv::Mat::empty +Mat::empty -------------- -.. cfunction:: bool Mat::empty() const +.. c:function:: bool Mat::empty() const Returns true if the array has no elemens @@ -1851,15 +1846,15 @@ The method returns true if ``Mat::total()`` is 0 or if ``Mat::data`` is NULL. Be .. index:: Mat::ptr -cv::Mat::ptr +Mat::ptr ------------ -.. cfunction:: uchar* Mat::ptr(int i=0) +.. c:function:: uchar* Mat::ptr(int i=0) -.. cfunction:: const uchar* Mat::ptr(int i=0) const +.. c:function:: const uchar* Mat::ptr(int i=0) const -.. cfunction:: template _Tp* Mat::ptr(int i=0) +.. c:function:: template _Tp* Mat::ptr(int i=0) -.. cfunction:: template const _Tp* Mat::ptr(int i=0) const +.. c:function:: template const _Tp* Mat::ptr(int i=0) const Return pointer to the specified matrix row @@ -1870,27 +1865,27 @@ The methods return ``uchar*`` or typed pointer to the specified matrix row. See .. index:: Mat::at -cv::Mat::at +Mat::at ----------- -.. cfunction:: template T\& Mat::at(int i) const +.. c:function:: template T\& Mat::at(int i) const -.. cfunction:: template const T\& Mat::at(int i) const +.. c:function:: template const T\& Mat::at(int i) const -.. cfunction:: template T\& Mat::at(int i, int j) +.. c:function:: template T\& Mat::at(int i, int j) -.. cfunction:: template const T\& Mat::at(int i, int j) const +.. c:function:: template const T\& Mat::at(int i, int j) const -.. cfunction:: template T\& Mat::at(Point pt) +.. c:function:: template T\& Mat::at(Point pt) -.. cfunction:: template const T\& Mat::at(Point pt) const +.. c:function:: template const T\& Mat::at(Point pt) const -.. cfunction:: template T\& Mat::at(int i, int j, int k) +.. c:function:: template T\& Mat::at(int i, int j, int k) -.. cfunction:: template const T\& Mat::at(int i, int j, int k) const +.. c:function:: template const T\& Mat::at(int i, int j, int k) const -.. cfunction:: template T\& Mat::at(const int* idx) +.. c:function:: template T\& Mat::at(const int* idx) -.. cfunction:: template const T\& Mat::at(const int* idx) const +.. c:function:: template const T\& Mat::at(const int* idx) const Return reference to the specified array element @@ -1908,13 +1903,13 @@ Here is an example of initialization of a Hilbert matrix: :: for(int i = 0; i < H.rows; i++) for(int j = 0; j < H.cols; j++) H.at(i,j)=1./(i+j+1); -.. + .. index:: Mat::begin -cv::Mat::begin +Mat::begin -------------- -.. cfunction:: template MatIterator_<_Tp> Mat::begin() template MatConstIterator_<_Tp> Mat::begin() const +.. c:function:: template MatIterator_<_Tp> Mat::begin() template MatConstIterator_<_Tp> Mat::begin() const Return the matrix iterator, set to the first matrix element @@ -1948,13 +1943,13 @@ The methods return the matrix read-only or read-write iterators. The use of matr saturate_cast((1 - (1-alpha)*(1-beta))*alpha_scale)); } } -.. + .. index:: Mat::end -cv::Mat::end +Mat::end ------------ -.. cfunction:: template MatIterator_<_Tp> Mat::end() template MatConstIterator_<_Tp> Mat::end() const +.. c:function:: template MatIterator_<_Tp> Mat::end() template MatConstIterator_<_Tp> Mat::end() const Return the matrix iterator, set to the after-last matrix element @@ -1973,7 +1968,7 @@ Template matrix class derived from // and // no new extra fields }; -.. + The class ``Mat_<_Tp>`` is a "thin" template wrapper on top of ``Mat`` class. It does not have any extra data fields, nor it or ``Mat`` have any virtual methods and thus references or pointers to these two classes can be freely converted one to another. But do it with care, e.g.: :: @@ -1983,7 +1978,7 @@ The class ``Mat_<_Tp>`` is a "thin" template wrapper on top of ``Mat`` class. It Mat_& M1 = (Mat_&)M; // the program will likely crash at the statement below M1(99,99) = 1.f; -.. + While ``Mat`` is sufficient in most cases, ``Mat_`` can be more convenient if you use a lot of element access operations and if you know matrix type at compile time. Note that ``Mat::at<_Tp>(int y, int x)`` and ``Mat_<_Tp>::operator ()(int y, int x)`` do absolutely the same and run at the same speed, but the latter is certainly shorter: :: @@ -1994,7 +1989,7 @@ While ``Mat`` is sufficient in most cases, ``Mat_`` can be more convenient if yo Mat E, V; eigen(M,E,V); cout << E.at(0,0)/E.at(M.rows-1,0); -.. + *How to use ``Mat_`` for multi-channel images/matrices?* This is simple - just pass ``Vec`` as ``Mat_`` parameter: :: @@ -2008,7 +2003,7 @@ This is simple - just pass ``Vec`` as ``Mat_`` parameter: :: for(int i = 0; i < img.rows; i++) for(int j = 0; j < img.cols; j++) img(i,j)[2] ^= (uchar)(i ^ j); -.. + NAryMatIterator --------------- @@ -2033,7 +2028,7 @@ n-ary multi-dimensional array iterator :: ... int nplanes; // the total number of planes }; -.. + The class is used for implementation of unary, binary and, generally, n-ary element-wise operations on multi-dimensional arrays. Some of the arguments of n-ary function may be continuous arrays, some may be not. It is possible to use conventional :ref:`MatIterator` 's for each array, but it can be a big overhead to increment all of the iterators after each small operations. That's where ``NAryMatIterator`` can be used. Using it, you can iterate though several matrices simultaneously as long as they have the same geometry (dimensionality and all the dimension sizes are the same). On each iteration ``it.planes[0]``,``it.planes[1]`` , ... will be the slices of the corresponding matrices. @@ -2078,7 +2073,7 @@ Here is an example of how you can compute a normalized and thresholded 3D color for(int p = 0; p < it.nplanes; p++, ++it) it.planes[0] *= s; } -.. + SparseMat --------- @@ -2277,7 +2272,7 @@ Sparse n-dimensional array. :: // pointer to the sparse matrix header Hdr* hdr; }; -.. + The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Such a sparse array can store elements of any type that :ref:`Mat` can store. "Sparse" means that only non-zero elements are stored (though, as a result of operations on a sparse matrix, some of its stored elements can actually become 0. It's up to the user to detect such elements and delete them using ``SparseMat::erase`` ). The non-zero elements are stored in a hash table that grows when it's filled enough, so that the search time is O(1) in average (regardless of whether element is there or not). Elements can be accessed using the following methods: @@ -2423,5 +2418,5 @@ It simplifies notation of some operations, and that's it. :: SparseMat_ M(3, sz); ... M.ref(1, 2, 3) = M(4, 5, 6) + M(7, 8, 9); -.. + diff --git a/modules/core/doc/clustering.rst b/modules/core/doc/clustering.rst index ad658462c..aff2fa9ed 100644 --- a/modules/core/doc/clustering.rst +++ b/modules/core/doc/clustering.rst @@ -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 int +.. c:function:: template int -.. cfunction:: partition( const vector<_Tp>\& vec, vector\& labels, _EqPredicate predicate=_EqPredicate()) +.. c:function:: partition( const vector<_Tp>\& vec, vector\& labels, _EqPredicate predicate=_EqPredicate()) Splits an element set into equivalency classes. diff --git a/modules/core/doc/drawing_functions.rst b/modules/core/doc/drawing_functions.rst index 0b473eb68..c3c5a557e 100644 --- a/modules/core/doc/drawing_functions.rst +++ b/modules/core/doc/drawing_functions.rst @@ -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\& pts ) +.. c:function:: void ellipse2Poly( Point center, Size axes, int angle, int startAngle, int endAngle, int delta, vector& 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 diff --git a/modules/core/doc/operations_on_arrays.rst b/modules/core/doc/operations_on_arrays.rst index 3f78f3b5a..c1fdeb161 100644 --- a/modules/core/doc/operations_on_arrays.rst +++ b/modules/core/doc/operations_on_arrays.rst @@ -5,11 +5,11 @@ Operations on Arrays .. index:: abs -cv::abs +abs ------- -.. cfunction:: MatExpr<...> abs(const Mat\& src) +.. c:function:: MatExpr<...> abs(const Mat\& src) -.. cfunction:: MatExpr<...> abs(const MatExpr<...>\& src) +.. c:function:: MatExpr<...> abs(const MatExpr<...>\& src) Computes absolute value of each matrix element @@ -27,13 +27,13 @@ See also: :ref:`Matrix Expressions`,:func:`absdiff`, .. index:: absdiff -cv::absdiff +absdiff ----------- -.. cfunction:: void absdiff(const Mat\& src1, const Mat\& src2, Mat\& dst) -.. cfunction:: void absdiff(const Mat\& src1, const Scalar\& sc, Mat\& dst) -.. cfunction:: void absdiff(const MatND\& src1, const MatND\& src2, MatND\& dst) -.. cfunction:: void absdiff(const MatND\& src1, const Scalar\& sc, MatND\& dst) +.. c:function:: void absdiff(const Mat\& src1, const Mat\& src2, Mat\& dst) +.. c:function:: void absdiff(const Mat\& src1, const Scalar\& sc, Mat\& dst) +.. c:function:: void absdiff(const MatND\& src1, const MatND\& src2, MatND\& dst) +.. c:function:: void absdiff(const MatND\& src1, const Scalar\& sc, MatND\& dst) Computes per-element absolute difference between 2 arrays or between array and a scalar. @@ -56,19 +56,19 @@ in the case of multi-channel arrays each channel is processed independently. See also: :func:`abs` .. index:: add -cv::add +add ------- -.. cfunction:: void add(const Mat\& src1, const Mat\& src2, Mat\& dst) +.. c:function:: void add(const Mat\& src1, const Mat\& src2, Mat\& dst) -.. cfunction:: void add(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask) +.. c:function:: void add(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask) -.. cfunction:: void add(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) +.. c:function:: void add(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) -.. cfunction:: void add(const MatND\& src1, const MatND\& src2, MatND\& dst) +.. c:function:: void add(const MatND\& src1, const MatND\& src2, MatND\& dst) -.. cfunction:: void add(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask) +.. c:function:: void add(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask) -.. cfunction:: void add(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) +.. c:function:: void add(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) Computes the per-element sum of two arrays or an array and a scalar. @@ -101,7 +101,7 @@ The first function in the above list can be replaced with matrix expressions: :: dst = src1 + src2; dst += src1; // equivalent to add(dst, src1, dst); -.. + in the case of multi-channel arrays each channel is processed independently. @@ -110,11 +110,11 @@ See also: .. index:: addWeighted -cv::addWeighted +addWeighted --------------- -.. cfunction:: void addWeighted(const Mat\& src1, double alpha, const Mat\& src2, double beta, double gamma, Mat\& dst) +.. c:function:: void addWeighted(const Mat\& src1, double alpha, const Mat\& src2, double beta, double gamma, Mat\& dst) -.. cfunction:: void addWeighted(const MatND\& src1, double alpha, const MatND\& src2, double beta, double gamma, MatND\& dst) +.. c:function:: void addWeighted(const MatND\& src1, double alpha, const MatND\& src2, double beta, double gamma, MatND\& dst) Computes the weighted sum of two arrays. @@ -137,7 +137,7 @@ where ``I`` is multi-dimensional index of array elements. The first function can be replaced with a matrix expression: :: dst = src1*alpha + src2*beta + gamma; -.. + In the case of multi-channel arrays each channel is processed independently. @@ -150,13 +150,13 @@ See also: bitwise_and ----------- -.. cfunction:: void bitwise_and(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat()) +.. c:function:: void bitwise_and(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat()) -.. cfunction:: void bitwise_and(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) +.. c:function:: void bitwise_and(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) -.. cfunction:: void bitwise_and(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask=MatND()) +.. c:function:: void bitwise_and(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask=MatND()) -.. cfunction:: void bitwise_and(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) +.. c:function:: void bitwise_and(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) Calculates per-element bit-wise conjunction of two arrays and an array and a scalar. @@ -193,17 +193,17 @@ See also:,, bitwise_not ----------- -.. cfunction:: void bitwise_not(const Mat\& src, Mat\& dst) +.. c:function:: void bitwise_not(const Mat\& src, Mat\& dst) -.. cfunction:: void bitwise_not(const MatND\& src, MatND\& dst) +.. c:function:: void bitwise_not(const MatND\& src, MatND\& dst) Inverts every bit of array :param src1: The source array - :param dst: The destination array; it is reallocated to be of the same size and - the same type as ``src`` ; see ``Mat::create`` :param mask: The optional operation mask, 8-bit single channel array; - specifies elements of the destination array to be changed + :param dst: The destination array; it is reallocated to be of the same size and the same type as ``src`` ; see ``Mat::create`` + + :param mask: The optional operation mask, 8-bit single channel array; specifies elements of the destination array to be changed The functions ``bitwise_not`` compute per-element bit-wise inversion of the source array: @@ -213,21 +213,19 @@ The functions ``bitwise_not`` compute per-element bit-wise inversion of the sour In the case of floating-point source array its machine-specific bit representation (usually IEEE754-compliant) is used for the operation. in the case of multi-channel arrays each channel is processed independently. -See also:,, - .. index:: bitwise_or .. _bitwise_or: bitwise_or ---------- -.. cfunction:: void bitwise_or(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat()) +.. c:function:: void bitwise_or(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat()) -.. cfunction:: void bitwise_or(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) +.. c:function:: void bitwise_or(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) -.. cfunction:: void bitwise_or(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask=MatND()) +.. c:function:: void bitwise_or(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask=MatND()) -.. cfunction:: void bitwise_or(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) +.. c:function:: void bitwise_or(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) Calculates per-element bit-wise disjunction of two arrays and an array and a scalar. @@ -265,13 +263,13 @@ See also:,, bitwise_xor ----------- -.. cfunction:: void bitwise_xor(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat()) +.. c:function:: void bitwise_xor(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat()) -.. cfunction:: void bitwise_xor(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) +.. c:function:: void bitwise_xor(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) -.. cfunction:: void bitwise_xor(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask=MatND()) +.. c:function:: void bitwise_xor(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask=MatND()) -.. cfunction:: void bitwise_xor(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) +.. c:function:: void bitwise_xor(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) Calculates per-element bit-wise "exclusive or" operation on two arrays and an array and a scalar. @@ -305,11 +303,11 @@ See also:,, .. index:: calcCovarMatrix -cv::calcCovarMatrix +calcCovarMatrix ------------------- -.. cfunction:: void calcCovarMatrix( const Mat* samples, int nsamples, Mat\& covar, Mat\& mean, int flags, int ctype=CV_64F) +.. c:function:: void calcCovarMatrix( const Mat* samples, int nsamples, Mat\& covar, Mat\& mean, int flags, int ctype=CV_64F) -.. cfunction:: void calcCovarMatrix( const Mat\& samples, Mat\& covar, Mat\& mean, int flags, int ctype=CV_64F) +.. c:function:: void calcCovarMatrix( const Mat\& samples, Mat\& covar, Mat\& mean, int flags, int ctype=CV_64F) Calculates covariation matrix of a set of vectors @@ -359,9 +357,9 @@ and, optionally, the mean vector of the set of input vectors. See also: :func:`PCA`,:func:`mulTransposed`,:func:`Mahalanobis` .. index:: cartToPolar -cv::cartToPolar +cartToPolar --------------- -.. cfunction:: void cartToPolar(const Mat\& x, const Mat\& y, Mat\& magnitude, Mat\& angle, bool angleInDegrees=false) +.. c:function:: void cartToPolar(const Mat\& x, const Mat\& y, Mat\& magnitude, Mat\& angle, bool angleInDegrees=false) Calculates the magnitude and angle of 2d vectors. @@ -383,11 +381,11 @@ The angles are calculated with .. index:: checkRange -cv::checkRange +checkRange -------------- -.. cfunction:: bool checkRange(const Mat\& src, bool quiet=true, Point* pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX) +.. c:function:: bool checkRange(const Mat\& src, bool quiet=true, Point* pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX) -.. cfunction:: bool checkRange(const MatND\& src, bool quiet=true, int* pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX) +.. c:function:: bool checkRange(const MatND\& src, bool quiet=true, int* pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX) Checks every element of an input array for invalid values. @@ -410,15 +408,15 @@ If some values are out of range, position of the first outlier is stored in ``po .. index:: compare -cv::compare +compare ----------- -.. cfunction:: void compare(const Mat\& src1, const Mat\& src2, Mat\& dst, int cmpop) +.. c:function:: void compare(const Mat\& src1, const Mat\& src2, Mat\& dst, int cmpop) -.. cfunction:: void compare(const Mat\& src1, double value, Mat\& dst, int cmpop) +.. c:function:: void compare(const Mat\& src1, double value, Mat\& dst, int cmpop) -.. cfunction:: void compare(const MatND\& src1, const MatND\& src2, MatND\& dst, int cmpop) +.. c:function:: void compare(const MatND\& src1, const MatND\& src2, MatND\& dst, int cmpop) -.. cfunction:: void compare(const MatND\& src1, double value, MatND\& dst, int cmpop) +.. c:function:: void compare(const MatND\& src1, double value, MatND\& dst, int cmpop) Performs per-element comparison of two arrays or an array and scalar value. @@ -435,14 +433,14 @@ cv::compare Mat dst1 = src1 >= src2; Mat dst2 = src1 < 8; ... -.. + See also: :func:`checkRange`,:func:`min`,:func:`max`,:func:`threshold`,:ref:`Matrix Expressions` .. index:: completeSymm -cv::completeSymm +completeSymm ---------------- -.. cfunction:: void completeSymm(Mat\& mtx, bool lowerToUpper=false) +.. c:function:: void completeSymm(Mat\& mtx, bool lowerToUpper=false) Copies the lower or the upper half of a square matrix to another half. @@ -459,9 +457,9 @@ The function ``completeSymm`` copies the lower half of a square matrix to its an :math:`i < j` if ``lowerToUpper=true`` See also: :func:`flip`,:func:`transpose` .. index:: convertScaleAbs -cv::convertScaleAbs +convertScaleAbs ------------------- -.. cfunction:: void convertScaleAbs(const Mat\& src, Mat\& dst, double alpha=1, double beta=0) +.. c:function:: void convertScaleAbs(const Mat\& src, Mat\& dst, double alpha=1, double beta=0) Scales, computes absolute values and converts the result to 8-bit. @@ -487,16 +485,16 @@ in the case of multi-channel arrays the function processes each channel independ B = abs(B); // Mat_ B = abs(A*5+3) will also do the job, // but it will allocate a temporary matrix -.. + See also: :func:`Mat::convertTo`,:func:`abs` .. index:: countNonZero -cv::countNonZero +countNonZero ---------------- -.. cfunction:: int countNonZero( const Mat\& mtx ) +.. c:function:: int countNonZero( const Mat\& mtx ) -.. cfunction:: int countNonZero( const MatND\& mtx ) +.. c:function:: int countNonZero( const MatND\& mtx ) Counts non-zero array elements. @@ -511,9 +509,9 @@ The function ``cvCountNonZero`` returns the number of non-zero elements in mtx: See also: :func:`mean`,:func:`meanStdDev`,:func:`norm`,:func:`minMaxLoc`,:func:`calcCovarMatrix` .. index:: cubeRoot -cv::cubeRoot +cubeRoot ------------ -.. cfunction:: float cubeRoot(float val) +.. c:function:: float cubeRoot(float val) Computes cube root of the argument @@ -529,11 +527,11 @@ The accuracy approaches the maximum possible accuracy for single-precision data. .. index:: cvarrToMat -cv::cvarrToMat +cvarrToMat -------------- -.. cfunction:: Mat cvarrToMat(const CvArr* src, bool copyData=false, bool allowND=true, int coiMode=0) +.. c:function:: Mat cvarrToMat(const CvArr* src, bool copyData=false, bool allowND=true, int coiMode=0) - Converts CvMat, IplImage or CvMatND to cv::Mat. + Converts CvMat, IplImage or CvMatND to Mat. :param src: The source ``CvMat`` , ``IplImage`` or ``CvMatND`` :param copyData: When it is false (default value), no data is copied, only the new header is created. In this case the original array should not be deallocated while the new matrix header is used. The the parameter is true, all the data is copied, then user may deallocate the original array right after the conversion @@ -570,7 +568,7 @@ When ``copyData=false`` , the conversion is done really fast (in O(1) time) and // note, that you will need to use "&" // to pass C & C1 to OpenCV functions, e.g: printf(" -.. + Normally, the function is used to convert an old-style 2D array ( :ref:`CvMat` or @@ -592,9 +590,9 @@ The last parameter, ``coiMode`` , specifies how to react on an image with COI se See also: :func:`cvGetImage`,:func:`cvGetMat`,:func:`cvGetMatND`,:func:`extractImageCOI`,:func:`insertImageCOI`,:func:`mixChannels` .. index:: dct -cv::dct +dct ------- -.. cfunction:: void dct(const Mat\& src, Mat\& dst, int flags=0) +.. c:function:: void dct(const Mat\& src, Mat\& dst, int flags=0) Performs a forward or inverse discrete cosine transform of 1D or 2D array @@ -664,21 +662,21 @@ The function chooses the mode of operation by looking at the flags and size of t otherwise it performs 2D transform. **Important note** -: currently cv::dct supports even-size arrays (2, 4, 6 ...). For data analysis and approximation you can pad the array when necessary. +: currently dct supports even-size arrays (2, 4, 6 ...). For data analysis and approximation you can pad the array when necessary. Also, the function's performance depends very much, and not monotonically, on the array size, see :func:`getOptimalDFTSize` . In the current implementation DCT of a vector of size ``N`` is computed via DFT of a vector of size ``N/2`` , thus the optimal DCT size :math:`\texttt{N}^*\geq\texttt{N}` can be computed as: :: size_t getOptimalDCTSize(size_t N) { return 2*getOptimalDFTSize((N+1)/2); } -.. + See also: :func:`dft`,:func:`getOptimalDFTSize`,:func:`idct` .. index:: dft -cv::dft +dft ------- -.. cfunction:: void dft(const Mat\& src, Mat\& dst, int flags=0, int nonzeroRows=0) +.. c:function:: void dft(const Mat\& src, Mat\& dst, int flags=0, int nonzeroRows=0) Performs a forward or inverse Discrete Fourier transform of 1D or 2D floating-point array. @@ -803,7 +801,7 @@ Here is the sample on how to compute DFT-based convolution of two 2D real arrays // all the temporary buffers will be deallocated automatically } -.. + What can be optimized in the above sample? @@ -835,15 +833,15 @@ All of the above improvements have been implemented in See also: :func:`dct`,:func:`getOptimalDFTSize`,:func:`mulSpectrums`,:func:`filter2D`,:func:`matchTemplate`,:func:`flip`,:func:`cartToPolar`,:func:`magnitude`,:func:`phase` .. index:: divide -cv::divide +divide ---------- -.. cfunction:: void divide(const Mat\& src1, const Mat\& src2, Mat\& dst, double scale=1) +.. c:function:: void divide(const Mat\& src1, const Mat\& src2, Mat\& dst, double scale=1) -.. cfunction:: void divide(double scale, const Mat\& src2, Mat\& dst) +.. c:function:: void divide(double scale, const Mat\& src2, Mat\& dst) -.. cfunction:: void divide(const MatND\& src1, const MatND\& src2, MatND\& dst, double scale=1) +.. c:function:: void divide(const MatND\& src1, const MatND\& src2, MatND\& dst, double scale=1) -.. cfunction:: void divide(double scale, const MatND\& src2, MatND\& dst) +.. c:function:: void divide(double scale, const MatND\& src2, MatND\& dst) Performs per-element division of two arrays or a scalar by an array. @@ -868,9 +866,9 @@ The result will have the same type as ``src1`` . When ``src2(I)=0``,``dst(I)=0`` See also: :func:`multiply`,:func:`add`,:func:`subtract`,:ref:`Matrix Expressions` .. index:: determinant -cv::determinant +determinant --------------- -.. cfunction:: double determinant(const Mat\& mtx) +.. c:function:: double determinant(const Mat\& mtx) Returns determinant of a square floating-point matrix. @@ -887,11 +885,11 @@ For symmetric positive-determined matrices, it is also possible to compute See also: :func:`SVD`,:func:`trace`,:func:`invert`,:func:`solve`,:ref:`Matrix Expressions` .. index:: eigen -cv::eigen +eigen --------- -.. cfunction:: bool eigen(const Mat\& src, Mat\& eigenvalues, int lowindex=-1, int highindex=-1) +.. c:function:: bool eigen(const Mat\& src, Mat\& eigenvalues, int lowindex=-1, int highindex=-1) -.. cfunction:: bool eigen(const Mat\& src, Mat\& eigenvalues, Mat\& eigenvectors, int lowindex=-1,int highindex=-1) +.. c:function:: bool eigen(const Mat\& src, Mat\& eigenvalues, Mat\& eigenvectors, int lowindex=-1,int highindex=-1) Computes eigenvalues and eigenvectors of a symmetric matrix. @@ -908,7 +906,7 @@ cv::eigen The functions ``eigen`` compute just eigenvalues, or eigenvalues and eigenvectors of symmetric matrix ``src`` : :: src*eigenvectors(i,:)' = eigenvalues(i)*eigenvectors(i,:)' (in MATLAB notation) -.. + If either low- or highindex is supplied the other is required, too. Indexing is 0-based. Example: To calculate the largest eigenvector/-value set @@ -921,11 +919,11 @@ first highindex - lowindex + 1 rows. See also: :func:`SVD`,:func:`completeSymm`,:func:`PCA` .. index:: exp -cv::exp +exp ------- -.. cfunction:: void exp(const Mat\& src, Mat\& dst) +.. c:function:: void exp(const Mat\& src, Mat\& dst) -.. cfunction:: void exp(const MatND\& src, MatND\& dst) +.. c:function:: void exp(const MatND\& src, MatND\& dst) Calculates the exponent of every array element. @@ -945,9 +943,9 @@ The maximum relative error is about See also: :func:`log`,:func:`cartToPolar`,:func:`polarToCart`,:func:`phase`,:func:`pow`,:func:`sqrt`,:func:`magnitude` .. index:: extractImageCOI -cv::extractImageCOI +extractImageCOI ------------------- -.. cfunction:: void extractImageCOI(const CvArr* src, Mat\& dst, int coi=-1) +.. c:function:: void extractImageCOI(const CvArr* src, Mat\& dst, int coi=-1) Extract the selected image channel @@ -961,9 +959,9 @@ To extract a channel from a new-style matrix, use :func:`split` See also: :func:`mixChannels`,:func:`split`,:func:`merge`,:func:`cvarrToMat`,:func:`cvSetImageCOI`,:func:`cvGetImageCOI` .. index:: fastAtan2 -cv::fastAtan2 +fastAtan2 ------------- -.. cfunction:: float fastAtan2(float y, float x) +.. c:function:: float fastAtan2(float y, float x) Calculates the angle of a 2D vector in degrees @@ -979,9 +977,9 @@ measured in degrees and varies from .. index:: flip -cv::flip +flip -------- -.. cfunction:: void flip(const Mat\& src, Mat\& dst, int flipCode) +.. c:function:: void flip(const Mat\& src, Mat\& dst, int flipCode) Flips a 2D array around vertical, horizontal or both axes. @@ -1020,9 +1018,9 @@ The example scenarios of function use are: See also: :func:`transpose`,:func:`repeat`,:func:`completeSymm` .. index:: gemm -cv::gemm +gemm -------- -.. cfunction:: void gemm(const Mat\& src1, const Mat\& src2, double alpha, const Mat\& src3, double beta, Mat\& dst, int flags=0) +.. c:function:: void gemm(const Mat\& src1, const Mat\& src2, double alpha, const Mat\& src3, double beta, Mat\& dst, int flags=0) Performs generalized matrix multiplication. @@ -1044,20 +1042,20 @@ For example, ``gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T)`` c The function can be replaced with a matrix expression, e.g. the above call can be replaced with: :: dst = alpha*src1.t()*src2 + beta*src3.t(); -.. + See also: :func:`mulTransposed`,:func:`transform`,:ref:`Matrix Expressions` .. index:: getConvertElem -cv::getConvertElem +getConvertElem ------------------ -.. cfunction:: ConvertData getConvertElem(int fromType, int toType) +.. c:function:: ConvertData getConvertElem(int fromType, int toType) -.. cfunction:: ConvertScaleData getConvertScaleElem(int fromType, int toType) +.. c:function:: ConvertScaleData getConvertScaleElem(int fromType, int toType) -.. cfunction:: typedef void (*ConvertData)(const void* from, void* to, int cn) +.. c:function:: typedef void (*ConvertData)(const void* from, void* to, int cn) -.. cfunction:: typedef void (*ConvertScaleData)(const void* from, void* to, int cn, double alpha, double beta) +.. c:function:: typedef void (*ConvertScaleData)(const void* from, void* to, int cn, double alpha, double beta) Returns conversion function for a single pixel @@ -1080,9 +1078,9 @@ The functions ``getConvertElem`` and ``getConvertScaleElem`` return pointers to See also: :func:`Mat::convertTo`,:func:`MatND::convertTo`,:func:`SparseMat::convertTo` .. index:: getOptimalDFTSize -cv::getOptimalDFTSize +getOptimalDFTSize --------------------- -.. cfunction:: int getOptimalDFTSize(int vecsize) +.. c:function:: int getOptimalDFTSize(int vecsize) Returns optimal DFT size for a given vector size. @@ -1103,9 +1101,9 @@ While the function cannot be used directly to estimate the optimal vector size f See also: :func:`dft`,:func:`dct`,:func:`idft`,:func:`idct`,:func:`mulSpectrums` .. index:: idct -cv::idct +idct -------- -.. cfunction:: void idct(const Mat\& src, Mat\& dst, int flags=0) +.. c:function:: void idct(const Mat\& src, Mat\& dst, int flags=0) Computes inverse Discrete Cosine Transform of a 1D or 2D array @@ -1118,9 +1116,9 @@ See See also: :func:`dct`,:func:`dft`,:func:`idft`,:func:`getOptimalDFTSize` .. index:: idft -cv::idft +idft -------- -.. cfunction:: void idft(const Mat\& src, Mat\& dst, int flags=0, int outputRows=0) +.. c:function:: void idft(const Mat\& src, Mat\& dst, int flags=0, int outputRows=0) Computes inverse Discrete Fourier Transform of a 1D or 2D array @@ -1137,15 +1135,15 @@ Thus, you should pass ``DFT_SCALE`` to one of ``dft`` or ``idft`` explicitly to See also: :func:`dft`,:func:`dct`,:func:`idct`,:func:`mulSpectrums`,:func:`getOptimalDFTSize` .. index:: inRange -cv::inRange +inRange ----------- -.. cfunction:: void inRange(const Mat\& src, const Mat\& lowerb, const Mat\& upperb, Mat\& dst) +.. c:function:: void inRange(const Mat\& src, const Mat\& lowerb, const Mat\& upperb, Mat\& dst) -.. cfunction:: void inRange(const Mat\& src, const Scalar\& lowerb, const Scalar\& upperb, Mat\& dst) +.. c:function:: void inRange(const Mat\& src, const Scalar\& lowerb, const Scalar\& upperb, Mat\& dst) -.. cfunction:: void inRange(const MatND\& src, const MatND\& lowerb, const MatND\& upperb, MatND\& dst) +.. c:function:: void inRange(const MatND\& src, const MatND\& lowerb, const MatND\& upperb, MatND\& dst) -.. cfunction:: void inRange(const MatND\& src, const Scalar\& lowerb, const Scalar\& upperb, MatND\& dst) +.. c:function:: void inRange(const MatND\& src, const Scalar\& lowerb, const Scalar\& upperb, MatND\& dst) Checks if array elements lie between the elements of two other arrays. @@ -1169,9 +1167,9 @@ for two-channel arrays and so forth. ``dst`` (I) is set to 255 (all ``1`` -bits) .. index:: invert -cv::invert +invert ---------- -.. cfunction:: double invert(const Mat\& src, Mat\& dst, int method=DECOMP_LU) +.. c:function:: double invert(const Mat\& src, Mat\& dst, int method=DECOMP_LU) Finds the inverse or pseudo-inverse of a matrix @@ -1198,11 +1196,11 @@ Similarly to ``DECOMP_LU`` , the method ``DECOMP_CHOLESKY`` works only with non- See also: :func:`solve`,:func:`SVD` .. index:: log -cv::log +log ------- -.. cfunction:: void log(const Mat\& src, Mat\& dst) +.. c:function:: void log(const Mat\& src, Mat\& dst) -.. cfunction:: void log(const MatND\& src, MatND\& dst) +.. c:function:: void log(const MatND\& src, MatND\& dst) Calculates the natural logarithm of every array element. @@ -1223,9 +1221,9 @@ The maximum relative error is about See also: :func:`exp`,:func:`cartToPolar`,:func:`polarToCart`,:func:`phase`,:func:`pow`,:func:`sqrt`,:func:`magnitude` .. index:: LUT -cv::LUT +LUT ------- -.. cfunction:: void LUT(const Mat\& src, const Mat\& lut, Mat\& dst) +.. c:function:: void LUT(const Mat\& src, const Mat\& lut, Mat\& dst) Performs a look-up table transform of an array. @@ -1248,9 +1246,9 @@ where See also: :func:`convertScaleAbs`,``Mat::convertTo`` .. index:: magnitude -cv::magnitude +magnitude ------------- -.. cfunction:: void magnitude(const Mat\& x, const Mat\& y, Mat\& magnitude) +.. c:function:: void magnitude(const Mat\& x, const Mat\& y, Mat\& magnitude) Calculates magnitude of 2D vectors. @@ -1265,9 +1263,9 @@ cv::magnitude See also: :func:`cartToPolar`,:func:`polarToCart`,:func:`phase`,:func:`sqrt` .. index:: Mahalanobis -cv::Mahalanobis +Mahalanobis --------------- -.. cfunction:: double Mahalanobis(const Mat\& vec1, const Mat\& vec2, const Mat\& icovar) +.. c:function:: double Mahalanobis(const Mat\& vec1, const Mat\& vec2, const Mat\& icovar) Calculates the Mahalanobis distance between two vectors. @@ -1289,21 +1287,21 @@ The covariance matrix may be calculated using the .. index:: max -cv::max +max ------- -.. cfunction:: Mat_Expr<...> max(const Mat\& src1, const Mat\& src2) +.. c:function:: Mat_Expr<...> max(const Mat\& src1, const Mat\& src2) -.. cfunction:: Mat_Expr<...> max(const Mat\& src1, double value) +.. c:function:: Mat_Expr<...> max(const Mat\& src1, double value) -.. cfunction:: Mat_Expr<...> max(double value, const Mat\& src1) +.. c:function:: Mat_Expr<...> max(double value, const Mat\& src1) -.. cfunction:: void max(const Mat\& src1, const Mat\& src2, Mat\& dst) +.. c:function:: void max(const Mat\& src1, const Mat\& src2, Mat\& dst) -.. cfunction:: void max(const Mat\& src1, double value, Mat\& dst) +.. c:function:: void max(const Mat\& src1, double value, Mat\& dst) -.. cfunction:: void max(const MatND\& src1, const MatND\& src2, MatND\& dst) +.. c:function:: void max(const MatND\& src1, const MatND\& src2, MatND\& dst) -.. cfunction:: void max(const MatND\& src1, double value, MatND\& dst) +.. c:function:: void max(const MatND\& src1, double value, MatND\& dst) Calculates per-element maximum of two arrays or array and a scalar @@ -1331,15 +1329,15 @@ The first 3 variants of the function listed above are actually a part of See also: :func:`min`,:func:`compare`,:func:`inRange`,:func:`minMaxLoc`,:ref:`Matrix Expressions` .. index:: mean -cv::mean +mean -------- -.. cfunction:: Scalar mean(const Mat\& mtx) +.. c:function:: Scalar mean(const Mat\& mtx) -.. cfunction:: Scalar mean(const Mat\& mtx, const Mat\& mask) +.. c:function:: Scalar mean(const Mat\& mtx, const Mat\& mask) -.. cfunction:: Scalar mean(const MatND\& mtx) +.. c:function:: Scalar mean(const MatND\& mtx) -.. cfunction:: Scalar mean(const MatND\& mtx, const MatND\& mask) +.. c:function:: Scalar mean(const MatND\& mtx, const MatND\& mask) Calculates average (mean) of array elements @@ -1358,11 +1356,11 @@ When all the mask elements are 0's, the functions return ``Scalar::all(0)`` . See also: :func:`countNonZero`,:func:`meanStdDev`,:func:`norm`,:func:`minMaxLoc` .. index:: meanStdDev -cv::meanStdDev +meanStdDev -------------- -.. cfunction:: void meanStdDev(const Mat\& mtx, Scalar\& mean, Scalar\& stddev, const Mat\& mask=Mat()) +.. c:function:: void meanStdDev(const Mat\& mtx, Scalar\& mean, Scalar\& stddev, const Mat\& mask=Mat()) -.. cfunction:: void meanStdDev(const MatND\& mtx, Scalar\& mean, Scalar\& stddev, const MatND\& mask=MatND()) +.. c:function:: void meanStdDev(const MatND\& mtx, Scalar\& mean, Scalar\& stddev, const MatND\& mask=MatND()) Calculates mean and standard deviation of array elements @@ -1389,15 +1387,15 @@ Note that the computed standard deviation is only the diagonal of the complete n See also: :func:`countNonZero`,:func:`mean`,:func:`norm`,:func:`minMaxLoc`,:func:`calcCovarMatrix` .. index:: merge -cv::merge +merge --------- -.. cfunction:: void merge(const Mat* mv, size_t count, Mat\& dst) +.. c:function:: void merge(const Mat* mv, size_t count, Mat\& dst) -.. cfunction:: void merge(const vector\& mv, Mat\& dst) +.. c:function:: void merge(const vector\& mv, Mat\& dst) -.. cfunction:: void merge(const MatND* mv, size_t count, MatND\& dst) +.. c:function:: void merge(const MatND* mv, size_t count, MatND\& dst) -.. cfunction:: void merge(const vector\& mv, MatND\& dst) +.. c:function:: void merge(const vector\& mv, MatND\& dst) Composes a multi-channel array from several single-channel arrays. @@ -1418,21 +1416,21 @@ The function :func:`mixChannels` See also: :func:`mixChannels`,:func:`split`,:func:`reshape` .. index:: min -cv::min +min ------- -.. cfunction:: Mat_Expr<...> min(const Mat\& src1, const Mat\& src2) +.. c:function:: Mat_Expr<...> min(const Mat\& src1, const Mat\& src2) -.. cfunction:: Mat_Expr<...> min(const Mat\& src1, double value) +.. c:function:: Mat_Expr<...> min(const Mat\& src1, double value) -.. cfunction:: Mat_Expr<...> min(double value, const Mat\& src1) +.. c:function:: Mat_Expr<...> min(double value, const Mat\& src1) -.. cfunction:: void min(const Mat\& src1, const Mat\& src2, Mat\& dst) +.. c:function:: void min(const Mat\& src1, const Mat\& src2, Mat\& dst) -.. cfunction:: void min(const Mat\& src1, double value, Mat\& dst) +.. c:function:: void min(const Mat\& src1, double value, Mat\& dst) -.. cfunction:: void min(const MatND\& src1, const MatND\& src2, MatND\& dst) +.. c:function:: void min(const MatND\& src1, const MatND\& src2, MatND\& dst) -.. cfunction:: void min(const MatND\& src1, double value, MatND\& dst) +.. c:function:: void min(const MatND\& src1, double value, MatND\& dst) Calculates per-element minimum of two arrays or array and a scalar @@ -1460,13 +1458,13 @@ The first 3 variants of the function listed above are actually a part of See also: :func:`max`,:func:`compare`,:func:`inRange`,:func:`minMaxLoc`,:ref:`Matrix Expressions` .. index:: minMaxLoc -cv::minMaxLoc +minMaxLoc ------------- -.. cfunction:: void minMaxLoc(const Mat\& src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, const Mat\& mask=Mat()) +.. c:function:: void minMaxLoc(const Mat\& src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, const Mat\& mask=Mat()) -.. cfunction:: void minMaxLoc(const MatND\& src, double* minVal, double* maxVal, int* minIdx=0, int* maxIdx=0, const MatND\& mask=MatND()) +.. c:function:: void minMaxLoc(const MatND\& src, double* minVal, double* maxVal, int* minIdx=0, int* maxIdx=0, const MatND\& mask=MatND()) -.. cfunction:: void minMaxLoc(const SparseMat\& src, double* minVal, double* maxVal, int* minIdx=0, int* maxIdx=0) +.. c:function:: void minMaxLoc(const SparseMat\& src, double* minVal, double* maxVal, int* minIdx=0, int* maxIdx=0) Finds global minimum and maximum in a whole array or sub-array @@ -1503,15 +1501,15 @@ See also: .. index:: mixChannels -cv::mixChannels +mixChannels --------------- -.. cfunction:: void mixChannels(const Mat* srcv, int nsrc, Mat* dstv, int ndst, const int* fromTo, size_t npairs) +.. c:function:: void mixChannels(const Mat* srcv, int nsrc, Mat* dstv, int ndst, const int* fromTo, size_t npairs) -.. cfunction:: void mixChannels(const MatND* srcv, int nsrc, MatND* dstv, int ndst, const int* fromTo, size_t npairs) +.. c:function:: void mixChannels(const MatND* srcv, int nsrc, MatND* dstv, int ndst, const int* fromTo, size_t npairs) -.. cfunction:: void mixChannels(const vector\& srcv, vector\& dstv, const int* fromTo, int npairs) +.. c:function:: void mixChannels(const vector\& srcv, vector\& dstv, const int* fromTo, int npairs) -.. cfunction:: void mixChannels(const vector\& srcv, vector\& dstv, const int* fromTo, int npairs) +.. c:function:: void mixChannels(const vector\& srcv, vector\& dstv, const int* fromTo, int npairs) Copies specified channels from input arrays to the specified channels of output arrays @@ -1541,7 +1539,7 @@ BGR (i.e. with R and B channels swapped) and separate alpha channel image: :: // rgba[2] -> bgr[0], rgba[3] -> alpha[0] int from_to[] = { 0,2, 1,1, 2,0, 3,3 }; mixChannels( &rgba, 1, out, 2, from_to, 4 ); -.. + Note that, unlike many other new-style C++ functions in OpenCV (see the introduction section and :func:`Mat::create` ), ``mixChannels`` requires the destination arrays be pre-allocated before calling the function. @@ -1549,9 +1547,9 @@ Note that, unlike many other new-style C++ functions in OpenCV (see the introduc See also: :func:`split`,:func:`merge`,:func:`cvtColor` .. index:: mulSpectrums -cv::mulSpectrums +mulSpectrums ---------------- -.. cfunction:: void mulSpectrums(const Mat\& src1, const Mat\& src2, Mat\& dst, int flags, bool conj=false) +.. c:function:: void mulSpectrums(const Mat\& src1, const Mat\& src2, Mat\& dst, int flags, bool conj=false) Performs per-element multiplication of two Fourier spectrums. @@ -1570,11 +1568,11 @@ The function, together with .. index:: multiply -cv::multiply +multiply ------------ -.. cfunction:: void multiply(const Mat\& src1, const Mat\& src2, Mat\& dst, double scale=1) +.. c:function:: void multiply(const Mat\& src1, const Mat\& src2, Mat\& dst, double scale=1) -.. cfunction:: void multiply(const MatND\& src1, const MatND\& src2, MatND\& dst, double scale=1) +.. c:function:: void multiply(const MatND\& src1, const MatND\& src2, MatND\& dst, double scale=1) Calculates the per-element scaled product of two arrays @@ -1598,9 +1596,9 @@ If you are looking for a matrix product, not per-element product, see See also: :func:`add`,:func:`substract`,:func:`divide`,:ref:`Matrix Expressions`,:func:`scaleAdd`,:func:`addWeighted`,:func:`accumulate`,:func:`accumulateProduct`,:func:`accumulateSquare`,:func:`Mat::convertTo` .. index:: mulTransposed -cv::mulTransposed +mulTransposed ----------------- -.. cfunction:: void mulTransposed( const Mat\& src, Mat\& dst, bool aTa, const Mat\& delta=Mat(), double scale=1, int rtype=-1 ) +.. c:function:: void mulTransposed( const Mat\& src, Mat\& dst, bool aTa, const Mat\& delta=Mat(), double scale=1, int rtype=-1 ) Calculates the product of a matrix and its transposition. @@ -1633,21 +1631,21 @@ otherwise. The function is used to compute covariance matrix and with zero delta See also: :func:`calcCovarMatrix`,:func:`gemm`,:func:`repeat`,:func:`reduce` .. index:: norm -cv::norm +norm -------- -.. cfunction:: double norm(const Mat\& src1, int normType=NORM_L2) +.. c:function:: double norm(const Mat\& src1, int normType=NORM_L2) -.. cfunction:: double norm(const Mat\& src1, const Mat\& src2, int normType=NORM_L2) +.. c:function:: double norm(const Mat\& src1, const Mat\& src2, int normType=NORM_L2) -.. cfunction:: double norm(const Mat\& src1, int normType, const Mat\& mask) +.. c:function:: double norm(const Mat\& src1, int normType, const Mat\& mask) -.. cfunction:: double norm(const Mat\& src1, const Mat\& src2, int normType, const Mat\& mask) +.. c:function:: double norm(const Mat\& src1, const Mat\& src2, int normType, const Mat\& mask) -.. cfunction:: double norm(const MatND\& src1, int normType=NORM_L2, const MatND\& mask=MatND()) +.. c:function:: double norm(const MatND\& src1, int normType=NORM_L2, const MatND\& mask=MatND()) -.. cfunction:: double norm(const MatND\& src1, const MatND\& src2, int normType=NORM_L2, const MatND\& mask=MatND()) +.. c:function:: double norm(const MatND\& src1, const MatND\& src2, int normType=NORM_L2, const MatND\& mask=MatND()) -.. cfunction:: double norm( const SparseMat\& src, int normType ) +.. c:function:: double norm( const SparseMat\& src, int normType ) Calculates absolute array norm, absolute difference norm, or relative difference norm. @@ -1689,13 +1687,13 @@ A multiple-channel source arrays are treated as a single-channel, that is, the r .. index:: normalize -cv::normalize +normalize ------------- -.. cfunction:: void normalize( const Mat\& src, Mat\& dst, double alpha=1, double beta=0, int normType=NORM_L2, int rtype=-1, const Mat\& mask=Mat()) +.. c:function:: void normalize( const Mat\& src, Mat\& dst, double alpha=1, double beta=0, int normType=NORM_L2, int rtype=-1, const Mat\& mask=Mat()) -.. cfunction:: void normalize( const MatND\& src, MatND\& dst, double alpha=1, double beta=0, int normType=NORM_L2, int rtype=-1, const MatND\& mask=MatND()) +.. c:function:: void normalize( const MatND\& src, MatND\& dst, double alpha=1, double beta=0, int normType=NORM_L2, int rtype=-1, const MatND\& mask=MatND()) -.. cfunction:: void normalize( const SparseMat\& src, SparseMat\& dst, double alpha, int normType ) +.. c:function:: void normalize( const SparseMat\& src, SparseMat\& dst, double alpha, int normType ) Normalizes array's norm or the range @@ -1738,7 +1736,7 @@ See also: PCA --- -.. ctype:: PCA +.. c:type:: PCA Class for Principal Component Analysis :: @@ -1766,7 +1764,7 @@ Class for Principal Component Analysis :: // or added to the reconstructed vector Mat mean; }; -.. + The class ``PCA`` is used to compute the special basis for a set of vectors. The basis will consist of eigenvectors of the covariance matrix computed from the input set of vectors. And also the class ``PCA`` can transform vectors to/from the new coordinate space, defined by the basis. Usually, in this new coordinate system each vector from the original set (and any linear combination of such vectors) can be quite accurately approximated by taking just the first few its components, corresponding to the eigenvectors of the largest eigenvalues of the covariance matrix. Geometrically it means that we compute projection of the vector to a subspace formed by a few eigenvectors corresponding to the dominant eigenvalues of the covariation matrix. And usually such a projection is very close to the original vector. That is, we can represent the original vector from a high-dimensional space with a much shorter vector consisting of the projected vector's coordinates in the subspace. Such a transformation is also known as Karhunen-Loeve Transform, or KLT. See http://en.wikipedia.org/wiki/Principal\_component\_analysis @@ -1805,16 +1803,16 @@ The following sample is the function that takes two matrices. The first one stor } return pca; } -.. + See also: :func:`calcCovarMatrix`,:func:`mulTransposed`,:func:`SVD`,:func:`dft`,:func:`dct` .. index:: PCA::PCA -cv::PCA::PCA +PCA::PCA ------------ -.. cfunction:: PCA::PCA() +.. c:function:: PCA::PCA() -.. cfunction:: PCA::PCA(const Mat\& data, const Mat\& mean, int flags, int maxComponents=0) +.. c:function:: PCA::PCA(const Mat\& data, const Mat\& mean, int flags, int maxComponents=0) PCA constructors @@ -1835,9 +1833,9 @@ The default constructor initializes empty PCA structure. The second constructor .. index:: PCA::operator () -cv::PCA::operator () +PCA::operator () -------------------- -.. cfunction:: PCA\& PCA::operator()(const Mat\& data, const Mat\& mean, int flags, int maxComponents=0) +.. c:function:: PCA\& PCA::operator()(const Mat\& data, const Mat\& mean, int flags, int maxComponents=0) Performs Principal Component Analysis of the supplied dataset. @@ -1859,11 +1857,11 @@ The computed eigenvalues are sorted from the largest to the smallest and the cor .. index:: PCA::project -cv::PCA::project +PCA::project ---------------- -.. cfunction:: Mat PCA::project(const Mat\& vec) const +.. c:function:: Mat PCA::project(const Mat\& vec) const -.. cfunction:: void PCA::project(const Mat\& vec, Mat\& result) const +.. c:function:: void PCA::project(const Mat\& vec, Mat\& result) const Project vector(s) to the principal component subspace @@ -1875,11 +1873,11 @@ The methods project one or more vectors to the principal component subspace, whe .. index:: PCA::backProject -cv::PCA::backProject +PCA::backProject -------------------- -.. cfunction:: Mat PCA::backProject(const Mat\& vec) const +.. c:function:: Mat PCA::backProject(const Mat\& vec) const -.. cfunction:: void PCA::backProject(const Mat\& vec, Mat\& result) const +.. c:function:: void PCA::backProject(const Mat\& vec, Mat\& result) const Reconstruct vectors from their PC projections. @@ -1892,9 +1890,9 @@ The methods are inverse operations to .. index:: perspectiveTransform -cv::perspectiveTransform +perspectiveTransform ------------------------ -.. cfunction:: void perspectiveTransform(const Mat\& src, Mat\& dst, const Mat\& mtx ) +.. c:function:: void perspectiveTransform(const Mat\& src, Mat\& dst, const Mat\& mtx ) Performs perspective matrix transformation of vectors. @@ -1930,9 +1928,9 @@ Note that the function transforms a sparse set of 2D or 3D vectors. If you want See also: :func:`transform`,:func:`warpPerspective`,:func:`getPerspectiveTransform`,:func:`findHomography` .. index:: phase -cv::phase +phase --------- -.. cfunction:: void phase(const Mat\& x, const Mat\& y, Mat\& angle, bool angleInDegrees=false) +.. c:function:: void phase(const Mat\& x, const Mat\& y, Mat\& angle, bool angleInDegrees=false) Calculates the rotation angle of 2d vectors @@ -1954,9 +1952,9 @@ See also: .. index:: polarToCart -cv::polarToCart +polarToCart --------------- -.. cfunction:: void polarToCart(const Mat\& magnitude, const Mat\& angle, Mat\& x, Mat\& y, bool angleInDegrees=false) +.. c:function:: void polarToCart(const Mat\& magnitude, const Mat\& angle, Mat\& x, Mat\& y, bool angleInDegrees=false) Computes x and y coordinates of 2D vectors from their magnitude and angle. @@ -1976,11 +1974,11 @@ The relative accuracy of the estimated coordinates is See also: :func:`cartToPolar`,:func:`magnitude`,:func:`phase`,:func:`exp`,:func:`log`,:func:`pow`,:func:`sqrt` .. index:: pow -cv::pow +pow ------- -.. cfunction:: void pow(const Mat\& src, double p, Mat\& dst) +.. c:function:: void pow(const Mat\& src, double p, Mat\& dst) -.. cfunction:: void pow(const MatND\& src, double p, MatND\& dst) +.. c:function:: void pow(const MatND\& src, double p, MatND\& dst) Raises every array element to a power. @@ -1999,7 +1997,7 @@ That is, for a non-integer power exponent the absolute values of input array ele Mat mask = src < 0; pow(src, 1./5, dst); subtract(Scalar::all(0), dst, dst, mask); -.. + For some values of ``p`` , such as integer values, 0.5, and -0.5, specialized faster algorithms are used. @@ -2048,7 +2046,7 @@ Random number generator class. :: // internal state of the RNG (could change in the future) uint64 state; }; -.. + The class ``RNG`` implements random number generator. It encapsulates the RNG state (currently, a 64-bit integer) and has methods to return scalar random values and to fill arrays with random values. Currently it supports uniform and Gaussian (normal) distributions. The generator uses Multiply-With-Carry algorithm, introduced by G. Marsaglia ( http://en.wikipedia.org/wiki/Multiply-with-carry @@ -2058,11 +2056,11 @@ http://en.wikipedia.org/wiki/Ziggurat_algorithm .. index:: RNG::RNG -cv::RNG::RNG +RNG::RNG ------------ -.. cfunction:: RNG::RNG() +.. c:function:: RNG::RNG() -.. cfunction:: RNG::RNG(uint64 state) +.. c:function:: RNG::RNG(uint64 state) RNG constructors @@ -2072,9 +2070,9 @@ These are the RNG constructors. The first form sets the state to some pre-define .. index:: RNG::next -cv::RNG::next +RNG::next ------------- -.. cfunction:: unsigned RNG::next() +.. c:function:: unsigned RNG::next() Returns the next random number @@ -2082,9 +2080,9 @@ The method updates the state using MWC algorithm and returns the next 32-bit ran .. index:: RNG::operator T -cv::RNG::operator T +RNG::operator T ------------------- -.. cfunction:: RNG::operator uchar() RNG::operator schar() RNG::operator ushort() RNG::operator short() RNG::operator unsigned() RNG::operator int() RNG::operator float() RNG::operator double() +.. c:function:: RNG::operator uchar() RNG::operator schar() RNG::operator ushort() RNG::operator short() RNG::operator unsigned() RNG::operator int() RNG::operator float() RNG::operator double() Returns the next random number of the specified type @@ -2092,11 +2090,11 @@ Each of the methods updates the state using MWC algorithm and returns the next r .. index:: RNG::operator () -cv::RNG::operator () +RNG::operator () -------------------- -.. cfunction:: unsigned RNG::operator ()() +.. c:function:: unsigned RNG::operator ()() -.. cfunction:: unsigned RNG::operator ()(unsigned N) +.. c:function:: unsigned RNG::operator ()(unsigned N) Returns the next random number @@ -2107,13 +2105,13 @@ The methods transforms the state using MWC algorithm and returns the next random .. index:: RNG::uniform -cv::RNG::uniform +RNG::uniform ---------------- -.. cfunction:: int RNG::uniform(int a, int b) +.. c:function:: int RNG::uniform(int a, int b) -.. cfunction:: float RNG::uniform(float a, float b) +.. c:function:: float RNG::uniform(float a, float b) -.. cfunction:: double RNG::uniform(double a, double b) +.. c:function:: double RNG::uniform(double a, double b) Returns the next random number sampled from the uniform distribution @@ -2123,7 +2121,7 @@ cv::RNG::uniform The methods transforms the state using MWC algorithm and returns the next uniformly-distributed random number of the specified type, deduced from the input parameter type, from the range ``[a, b)`` . There is one nuance, illustrated by the following sample: :: - cv::RNG rng; + RNG rng; // will always produce 0 double a = rng.uniform(0, 1); @@ -2140,15 +2138,15 @@ The methods transforms the state using MWC algorithm and returns the next unifor // will likely cause compiler error because of ambiguity: // RNG::uniform(0, (int)0.999999)? or RNG::uniform((double)0, 0.99999)? double d = rng.uniform(0, 0.999999); -.. + That is, the compiler does not take into account type of the variable that you assign the result of ``RNG::uniform`` to, the only thing that matters to it is the type of ``a`` and ``b`` parameters. So if you want a floating-point random number, but the range boundaries are integer numbers, either put dots in the end, if they are constants, or use explicit type cast operators, as in ``a1`` initialization above. .. index:: RNG::gaussian -cv::RNG::gaussian +RNG::gaussian ----------------- -.. cfunction:: double RNG::gaussian(double sigma) +.. c:function:: double RNG::gaussian(double sigma) Returns the next random number sampled from the Gaussian distribution @@ -2158,11 +2156,11 @@ The methods transforms the state using MWC algorithm and returns the next random .. index:: RNG::fill -cv::RNG::fill +RNG::fill ------------- -.. cfunction:: void RNG::fill( Mat\& mat, int distType, const Scalar\& a, const Scalar\& b ) +.. c:function:: void RNG::fill( Mat\& mat, int distType, const Scalar\& a, const Scalar\& b ) -.. cfunction:: void RNG::fill( MatND\& mat, int distType, const Scalar\& a, const Scalar\& b ) +.. c:function:: void RNG::fill( MatND\& mat, int distType, const Scalar\& a, const Scalar\& b ) Fill arrays with random numbers @@ -2178,11 +2176,11 @@ Each of the methods fills the matrix with the random values from the specified d .. index:: randu -cv::randu +randu --------- -.. cfunction:: template _Tp randu() +.. c:function:: template _Tp randu() -.. cfunction:: void randu(Mat\& mtx, const Scalar\& low, const Scalar\& high) +.. c:function:: void randu(Mat\& mtx, const Scalar\& low, const Scalar\& high) Generates a single uniformly-distributed random number or array of random numbers @@ -2206,9 +2204,9 @@ See also: .. index:: randn -cv::randn +randn --------- -.. cfunction:: void randn(Mat\& mtx, const Scalar\& mean, const Scalar\& stddev) +.. c:function:: void randn(Mat\& mtx, const Scalar\& mean, const Scalar\& stddev) Fills array with normally distributed random numbers @@ -2224,9 +2222,9 @@ is applied to the generated numbers (i.e. the values are clipped) See also: :func:`RNG`,:func:`randu` .. index:: randShuffle -cv::randShuffle +randShuffle --------------- -.. cfunction:: void randShuffle(Mat\& mtx, double iterFactor=1., RNG* rng=0) +.. c:function:: void randShuffle(Mat\& mtx, double iterFactor=1., RNG* rng=0) Shuffles the array elements randomly @@ -2239,9 +2237,9 @@ cv::randShuffle The function ``randShuffle`` shuffles the specified 1D array by randomly choosing pairs of elements and swapping them. The number of such swap operations will be ``mtx.rows*mtx.cols*iterFactor`` See also: :func:`RNG`,:func:`sort` .. index:: reduce -cv::reduce +reduce ---------- -.. cfunction:: void reduce(const Mat\& mtx, Mat\& vec, int dim, int reduceOp, int dtype=-1) +.. c:function:: void reduce(const Mat\& mtx, Mat\& vec, int dim, int reduceOp, int dtype=-1) Reduces a matrix to a vector @@ -2266,11 +2264,11 @@ cv::reduce See also: :func:`repeat` .. index:: repeat -cv::repeat +repeat ---------- -.. cfunction:: void repeat(const Mat\& src, int ny, int nx, Mat\& dst) +.. c:function:: void repeat(const Mat\& src, int ny, int nx, Mat\& dst) -.. cfunction:: Mat repeat(const Mat\& src, int ny, int nx) +.. c:function:: Mat repeat(const Mat\& src, int ny, int nx) Fill the destination array with repeated copies of the source array. @@ -2295,21 +2293,21 @@ The second variant of the function is more convenient to use with saturate_cast ------------- -.. cfunction:: template inline _Tp saturate_cast(unsigned char v) +.. c:function:: template inline _Tp saturate_cast(unsigned char v) -.. cfunction:: template inline _Tp saturate_cast(signed char v) +.. c:function:: template inline _Tp saturate_cast(signed char v) -.. cfunction:: template inline _Tp saturate_cast(unsigned short v) +.. c:function:: template inline _Tp saturate_cast(unsigned short v) -.. cfunction:: template inline _Tp saturate_cast(signed short v) +.. c:function:: template inline _Tp saturate_cast(signed short v) -.. cfunction:: template inline _Tp saturate_cast(int v) +.. c:function:: template inline _Tp saturate_cast(int v) -.. cfunction:: template inline _Tp saturate_cast(unsigned int v) +.. c:function:: template inline _Tp saturate_cast(unsigned int v) -.. cfunction:: template inline _Tp saturate_cast(float v) +.. c:function:: template inline _Tp saturate_cast(float v) -.. cfunction:: template inline _Tp saturate_cast(double v) +.. c:function:: template inline _Tp saturate_cast(double v) Template function for accurate conversion from one primitive type to another @@ -2319,7 +2317,7 @@ The functions ``saturate_cast`` resembles the standard C++ cast operations, such uchar a = saturate_cast(-100); // a = 0 (UCHAR_MIN) short b = saturate_cast(33333.33333); // b = 32767 (SHRT_MAX) -.. + Such clipping is done when the target type is ``unsigned char, signed char, unsigned short or signed short`` - for 32-bit integers no clipping is done. @@ -2330,11 +2328,11 @@ This operation is used in most simple or complex image processing functions in O See also: :func:`add`,:func:`subtract`,:func:`multiply`,:func:`divide`,:func:`Mat::convertTo` .. index:: scaleAdd -cv::scaleAdd +scaleAdd ------------ -.. cfunction:: void scaleAdd(const Mat\& src1, double scale, const Mat\& src2, Mat\& dst) +.. c:function:: void scaleAdd(const Mat\& src1, double scale, const Mat\& src2, Mat\& dst) -.. cfunction:: void scaleAdd(const MatND\& src1, double scale, const MatND\& src2, MatND\& dst) +.. c:function:: void scaleAdd(const MatND\& src1, double scale, const MatND\& src2, MatND\& dst) Calculates the sum of a scaled array and another array. @@ -2354,14 +2352,14 @@ The function can also be emulated with a matrix expression, for example: :: Mat A(3, 3, CV_64F); ... A.row(0) = A.row(1)*2 + A.row(2); -.. + See also: :func:`add`,:func:`addWeighted`,:func:`subtract`,:func:`Mat::dot`,:func:`Mat::convertTo`,:ref:`Matrix Expressions` .. index:: setIdentity -cv::setIdentity +setIdentity --------------- -.. cfunction:: void setIdentity(Mat\& dst, const Scalar\& value=Scalar(1)) +.. c:function:: void setIdentity(Mat\& dst, const Scalar\& value=Scalar(1)) Initializes a scaled identity matrix @@ -2380,15 +2378,15 @@ The function can also be emulated using the matrix initializers and the matrix e Mat A = Mat::eye(4, 3, CV_32F)*5; // A will be set to [[5, 0, 0], [0, 5, 0], [0, 0, 5], [0, 0, 0]] -.. + See also: :func:`Mat::zeros`,:func:`Mat::ones`,:ref:`Matrix Expressions`,:func:`Mat::setTo`,:func:`Mat::operator=`, .. index:: solve -cv::solve +solve --------- -.. cfunction:: bool solve(const Mat\& src1, const Mat\& src2, Mat\& dst, int flags=DECOMP_LU) +.. c:function:: bool solve(const Mat\& src1, const Mat\& src2, Mat\& dst, int flags=DECOMP_LU) Solves one or more linear systems or least-squares problems. @@ -2426,9 +2424,9 @@ Note that if you want to find unity-norm solution of an under-defined singular s See also: :func:`invert`,:func:`SVD`,:func:`eigen` .. index:: solveCubic -cv::solveCubic +solveCubic -------------- -.. cfunction:: void solveCubic(const Mat\& coeffs, Mat\& roots) +.. c:function:: void solveCubic(const Mat\& coeffs, Mat\& roots) Finds the real roots of a cubic equation. @@ -2454,9 +2452,9 @@ The roots are stored to ``roots`` array. .. index:: solvePoly -cv::solvePoly +solvePoly ------------- -.. cfunction:: void solvePoly(const Mat\& coeffs, Mat\& roots, int maxIters=20, int fig=100) +.. c:function:: void solvePoly(const Mat\& coeffs, Mat\& roots, int maxIters=20, int fig=100) Finds the real or complex roots of a polynomial equation @@ -2476,9 +2474,9 @@ The function ``solvePoly`` finds real and complex roots of a polynomial equation .. index:: sort -cv::sort +sort -------- -.. cfunction:: void sort(const Mat\& src, Mat\& dst, int flags) +.. c:function:: void sort(const Mat\& src, Mat\& dst, int flags) Sorts each row or each column of a matrix @@ -2499,9 +2497,9 @@ The function ``sort`` sorts each matrix row or each matrix column in ascending o See also: :func:`sortIdx`,:func:`randShuffle` .. index:: sortIdx -cv::sortIdx +sortIdx ----------- -.. cfunction:: void sortIdx(const Mat\& src, Mat\& dst, int flags) +.. c:function:: void sortIdx(const Mat\& src, Mat\& dst, int flags) Sorts each row or each column of a matrix @@ -2524,20 +2522,20 @@ The function ``sortIdx`` sorts each matrix row or each matrix column in ascendin // B will probably contain // (because of equal elements in A some permutations are possible): // [[1, 2, 0], [0, 2, 1], [0, 1, 2]] -.. + See also: :func:`sort`,:func:`randShuffle` .. index:: split -cv::split +split --------- -.. cfunction:: void split(const Mat\& mtx, Mat* mv) +.. c:function:: void split(const Mat\& mtx, Mat* mv) -.. cfunction:: void split(const Mat\& mtx, vector\& mv) +.. c:function:: void split(const Mat\& mtx, vector\& mv) -.. cfunction:: void split(const MatND\& mtx, MatND* mv) +.. c:function:: void split(const MatND\& mtx, MatND* mv) -.. cfunction:: void split(const MatND\& mtx, vector\& mv) +.. c:function:: void split(const MatND\& mtx, vector\& mv) Divides multi-channel array into several single-channel arrays @@ -2555,11 +2553,11 @@ If you need to extract a single-channel or do some other sophisticated channel p :func:`mixChannels` See also: :func:`merge`,:func:`mixChannels`,:func:`cvtColor` .. index:: sqrt -cv::sqrt +sqrt -------- -.. cfunction:: void sqrt(const Mat\& src, Mat\& dst) +.. c:function:: void sqrt(const Mat\& src, Mat\& dst) -.. cfunction:: void sqrt(const MatND\& src, MatND\& dst) +.. c:function:: void sqrt(const MatND\& src, MatND\& dst) Calculates square root of array elements @@ -2570,23 +2568,23 @@ cv::sqrt See also: :func:`pow`,:func:`magnitude` .. index:: subtract -cv::subtract +subtract ------------ -.. cfunction:: void subtract(const Mat\& src1, const Mat\& src2, Mat\& dst) +.. c:function:: void subtract(const Mat\& src1, const Mat\& src2, Mat\& dst) -.. cfunction:: void subtract(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask) +.. c:function:: void subtract(const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask) -.. cfunction:: void subtract(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) +.. c:function:: void subtract(const Mat\& src1, const Scalar\& sc, Mat\& dst, const Mat\& mask=Mat()) -.. cfunction:: void subtract(const Scalar\& sc, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat()) +.. c:function:: void subtract(const Scalar\& sc, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat()) -.. cfunction:: void subtract(const MatND\& src1, const MatND\& src2, MatND\& dst) +.. c:function:: void subtract(const MatND\& src1, const MatND\& src2, MatND\& dst) -.. cfunction:: void subtract(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask) +.. c:function:: void subtract(const MatND\& src1, const MatND\& src2, MatND\& dst, const MatND\& mask) -.. cfunction:: void subtract(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) +.. c:function:: void subtract(const MatND\& src1, const Scalar\& sc, MatND\& dst, const MatND\& mask=MatND()) -.. cfunction:: void subtract(const Scalar\& sc, const MatND\& src2, MatND\& dst, const MatND\& mask=MatND()) +.. c:function:: void subtract(const Scalar\& sc, const MatND\& src2, MatND\& dst, const MatND\& mask=MatND()) Calculates per-element difference between two arrays or array and a scalar @@ -2626,7 +2624,7 @@ The first function in the above list can be replaced with matrix expressions: :: dst = src1 - src2; dst -= src2; // equivalent to subtract(dst, src2, dst); -.. + See also: :func:`add`,:func:`addWeighted`,:func:`scaleAdd`,:func:`convertScale`,:ref:`Matrix Expressions`,. @@ -2637,7 +2635,7 @@ See also: SVD --- -.. ctype:: SVD +.. c:type:: SVD Class for computing Singular Value Decomposition :: @@ -2664,7 +2662,7 @@ Class for computing Singular Value Decomposition :: Mat w; // vector of singular values Mat vt; // the right orthogonal matrix }; -.. + The class ``SVD`` is used to compute Singular Value Decomposition of a floating-point matrix and then use it to solve least-square problems, under-determined linear systems, invert matrices, compute condition numbers etc. For a bit faster operation you can pass ``flags=SVD::MODIFY_A|...`` to modify the decomposed matrix when it is not necessarily to preserve it. If you want to compute condition number of a matrix or absolute value of its determinant - you do not need ``u`` and ``vt`` , so you can pass ``flags=SVD::NO_UV|...`` . Another flag ``FULL_UV`` indicates that full-size ``u`` and ``vt`` must be computed, which is not necessary most of the time. @@ -2672,11 +2670,11 @@ For a bit faster operation you can pass ``flags=SVD::MODIFY_A|...`` to modify th See also: :func:`invert`,:func:`solve`,:func:`eigen`,:func:`determinant` .. index:: SVD::SVD -cv::SVD::SVD +SVD::SVD ------------ -.. cfunction:: SVD::SVD() +.. c:function:: SVD::SVD() -.. cfunction:: SVD::SVD( const Mat\& A, int flags=0 ) +.. c:function:: SVD::SVD( const Mat\& A, int flags=0 ) SVD constructors @@ -2695,9 +2693,9 @@ The first constructor initializes empty ``SVD`` structure. The second constructo .. index:: SVD::operator () -cv::SVD::operator () +SVD::operator () -------------------- -.. cfunction:: SVD\& SVD::operator ()( const Mat\& A, int flags=0 ) +.. c:function:: SVD\& SVD::operator ()( const Mat\& A, int flags=0 ) Performs SVD of a matrix @@ -2716,9 +2714,9 @@ The operator performs singular value decomposition of the supplied matrix. The ` .. index:: SVD::solveZ -cv::SVD::solveZ +SVD::solveZ --------------- -.. cfunction:: static void SVD::solveZ( const Mat\& A, Mat\& x ) +.. c:function:: static void SVD::solveZ( const Mat\& A, Mat\& x ) Solves under-determined singular linear system @@ -2737,9 +2735,9 @@ of the under-determined system .. index:: SVD::backSubst -cv::SVD::backSubst +SVD::backSubst ------------------ -.. cfunction:: void SVD::backSubst( const Mat\& rhs, Mat\& x ) const +.. c:function:: void SVD::backSubst( const Mat\& rhs, Mat\& x ) const Performs singular value back substitution @@ -2752,15 +2750,15 @@ The method computes back substitution for the specified right-hand side: \texttt{x} = \texttt{vt} ^T \cdot diag( \texttt{w} )^{-1} \cdot \texttt{u} ^T \cdot \texttt{rhs} \sim \texttt{A} ^{-1} \cdot \texttt{rhs} Using this technique you can either get a very accurate solution of convenient linear system, or the best (in the least-squares terms) pseudo-solution of an overdetermined linear system. Note that explicit SVD with the further back substitution only makes sense if you need to solve many linear systems with the same left-hand side (e.g. ``A`` ). If all you need is to solve a single system (possibly with multiple ``rhs`` immediately available), simply call -:func:`solve` add pass ``cv::DECOMP_SVD`` there - it will do absolutely the same thing. +:func:`solve` add pass ``DECOMP_SVD`` there - it will do absolutely the same thing. .. index:: sum -cv::sum +sum ------- -.. cfunction:: Scalar sum(const Mat\& mtx) +.. c:function:: Scalar sum(const Mat\& mtx) -.. cfunction:: Scalar sum(const MatND\& mtx) +.. c:function:: Scalar sum(const MatND\& mtx) Calculates sum of array elements @@ -2771,9 +2769,9 @@ The functions ``sum`` calculate and return the sum of array elements, independen See also: :func:`countNonZero`,:func:`mean`,:func:`meanStdDev`,:func:`norm`,:func:`minMaxLoc`,:func:`reduce` .. index:: theRNG -cv::theRNG +theRNG ---------- -.. cfunction:: RNG\& theRNG() +.. c:function:: RNG\& theRNG() Returns the default random number generator @@ -2784,9 +2782,9 @@ The function ``theRNG`` returns the default random number generator. For each th See also: :func:`RNG`,:func:`randu`,:func:`randn` .. index:: trace -cv::trace +trace --------- -.. cfunction:: Scalar trace(const Mat\& mtx) +.. c:function:: Scalar trace(const Mat\& mtx) Returns the trace of a matrix @@ -2800,9 +2798,9 @@ The function ``trace`` returns the sum of the diagonal elements of the matrix `` .. index:: transform -cv::transform +transform ------------- -.. cfunction:: void transform(const Mat\& src, Mat\& dst, const Mat\& mtx ) +.. c:function:: void transform(const Mat\& src, Mat\& dst, const Mat\& mtx ) Performs matrix transformation of every array element. @@ -2837,9 +2835,9 @@ points, arbitrary linear color space transformation (such as various kinds of RG See also: :func:`perspectiveTransform`,:func:`getAffineTransform`,:func:`estimateRigidTransform`,:func:`warpAffine`,:func:`warpPerspective` .. index:: transpose -cv::transpose +transpose ------------- -.. cfunction:: void transpose(const Mat\& src, Mat\& dst) +.. c:function:: void transpose(const Mat\& src, Mat\& dst) Transposes a matrix diff --git a/modules/core/doc/utility_and_system_functions_and_macros.rst b/modules/core/doc/utility_and_system_functions_and_macros.rst index c57223d92..802b80a4e 100644 --- a/modules/core/doc/utility_and_system_functions_and_macros.rst +++ b/modules/core/doc/utility_and_system_functions_and_macros.rst @@ -5,9 +5,9 @@ Utility and System Functions and Macros .. index:: alignPtr -cv::alignPtr +alignPtr ------------ -.. cfunction:: template _Tp* alignPtr(_Tp* ptr, int n=sizeof(_Tp)) +.. c:function:: template _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 _Tp* allocate(size_t n) +.. c:function:: template _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 void deallocate(_Tp* ptr, size_t n) +.. c:function:: template 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 diff --git a/modules/core/doc/xml_yaml_persistence.rst b/modules/core/doc/xml_yaml_persistence.rst index 60ea36d09..cf4fd6fdf 100644 --- a/modules/core/doc/xml_yaml_persistence.rst +++ b/modules/core/doc/xml_yaml_persistence.rst @@ -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 :: diff --git a/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst b/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst index f8e9fbc40..2fd4db49a 100644 --- a/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst +++ b/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst @@ -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\& keypoints, Mat\& descriptors ) const +.. c:function:: void DescriptorExtractor::compute( const Mat\& image, vector\& 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\& images, vector >\& keypoints, vector\& descriptors ) const +.. c:function:: void DescriptorExtractor::compute( const vector\& images, vector >\& keypoints, vector\& 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::create( const string\& descriptorExtractorType ) +.. c:function:: Ptr 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.'' diff --git a/modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst b/modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst index 53e865bd6..f7d6c04a7 100644 --- a/modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst +++ b/modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst @@ -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\& descriptors ) +.. c:function:: void add( const vector\& 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\& getTrainDescriptors() const +.. c:function:: const vector\& 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\& matches, const Mat\& mask=Mat() ) const +.. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector\& 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(i,j)is non-zero. -.. cfunction:: void DescriptorMatcher::match( const Mat\& queryDescriptors, vector\& matches, const vector\& masks=vector() ) +.. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, vector\& matches, const vector\& masks=vector() ) :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 >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const +.. c:function:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector >\& 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 >\& matches, int k, const vector\& masks=vector(), bool compactResult=false ) +.. c:function:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, vector >\& matches, int k, const vector\& masks=vector(), 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 >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const +.. c:function:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector >\& 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 >\& matches, float maxDistance, const vector\& masks=vector(), bool compactResult=false ) +.. c:function:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, vector >\& matches, float maxDistance, const vector\& masks=vector(), 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::clone( bool emptyTrainData ) const +.. c:function:: Ptr \\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::create( const string\& descriptorMatcherType ) +.. c:function:: Ptr 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`` . Class of support FlannBasedMatcher ----------------- -.. ctype:: FlannBasedMatcher +.. c:type:: FlannBasedMatcher Flann based descriptor matcher. This matcher trains :func:`flann::Index` on diff --git a/modules/features2d/doc/common_interfaces_of_feature_detectors.rst b/modules/features2d/doc/common_interfaces_of_feature_detectors.rst index 95497d37c..ecc206ae4 100644 --- a/modules/features2d/doc/common_interfaces_of_feature_detectors.rst +++ b/modules/features2d/doc/common_interfaces_of_feature_detectors.rst @@ -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\& keypoints, const Mat\& mask=Mat() ) const +.. c:function:: void FeatureDetector::detect( const Mat\& image, vector\& 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\& images, vector >\& keypoints, const vector\& masks=vector() ) const +.. c:function:: void FeatureDetector::detect( const vector\& images, vector >\& keypoints, const vector\& masks=vector() ) 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::create( const string\& detectorType ) +.. c:function:: Ptr 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\& adjaster, int min_features, int max_features, int max_iters ) +.. c:function:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr\& 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 diff --git a/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst b/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst index 90053d6bc..9f268b392 100644 --- a/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst +++ b/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst @@ -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\& images, vector >\& keypoints ) +.. c:function:: void GenericDescriptorMatcher::add( const vector\& images, vector >\& 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\& GenericDescriptorMatcher::getTrainImages() const +.. c:function:: const vector\& GenericDescriptorMatcher::getTrainImages() const Returns train image collection. .. index:: GenericDescriptorMatcher::getTrainKeypoints -cv::GenericDescriptorMatcher::getTrainKeypoints +GenericDescriptorMatcher::getTrainKeypoints ----------------------------------------------- -.. cfunction:: const vector >\& GenericDescriptorMatcher::getTrainKeypoints() const +.. c:function:: const vector >\& 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\& queryKeypoints, const Mat\& trainImage, vector\& trainKeypoints ) const +.. c:function:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector\& queryKeypoints, const Mat\& trainImage, vector\& 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\& queryKeypoints ) +.. c:function:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector\& 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\& queryKeypoints, const Mat\& trainImage, vector\& trainKeypoints, vector\& matches, const Mat\& mask=Mat() ) const +.. c:function:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector\& queryKeypoints, const Mat\& trainImage, vector\& trainKeypoints, vector\& 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\& queryKeypoints, vector\& matches, const vector\& masks=vector() ) +.. c:function:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector\& queryKeypoints, vector\& matches, const vector\& masks=vector() ) :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\& queryKeypoints, const Mat\& trainImage, vector\& trainKeypoints, vector >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const +.. c:function:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector\& queryKeypoints, const Mat\& trainImage, vector\& trainKeypoints, vector >\& 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\& queryKeypoints, vector >\& matches, int k, const vector\& masks=vector(), bool compactResult=false ) +.. c:function:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector\& queryKeypoints, vector >\& matches, int k, const vector\& masks=vector(), 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\& queryKeypoints, const Mat\& trainImage, vector\& trainKeypoints, vector >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const +.. c:function:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector\& queryKeypoints, const Mat\& trainImage, vector\& trainKeypoints, vector >\& 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\& queryKeypoints, vector >\& matches, float maxDistance, const vector\& masks=vector(), bool compactResult=false ) +.. c:function:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector\& queryKeypoints, vector >\& matches, float maxDistance, const vector\& masks=vector(), 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::clone( bool emptyTrainData ) const +.. c:function:: Ptr\\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. :: diff --git a/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst b/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst index a1561ecb2..7d18ad427 100644 --- a/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst +++ b/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst @@ -5,14 +5,14 @@ Drawing Function of Keypoints and Matches .. index:: drawMatches -cv::drawMatches +drawMatches --------------- -.. cfunction:: void drawMatches( const Mat\& img1, const vector\& keypoints1, const Mat\& img2, const vector\& keypoints2, const vector\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector\& matchesMask=vector(), int flags=DrawMatchesFlags::DEFAULT ) +.. c:function:: void drawMatches( const Mat\& img1, const vector\& keypoints1, const Mat\& img2, const vector\& keypoints2, const vector\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector\& matchesMask=vector(), 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\& keypoints1, const Mat\& img2, const vector\& keypoints2, const vector >\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector>\& matchesMask= vector >(), int flags=DrawMatchesFlags::DEFAULT ) +.. c:function:: void drawMatches( const Mat\& img1, const vector\& keypoints1, const Mat\& img2, const vector\& keypoints2, const vector >\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector>\& matchesMask= vector >(), 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\& keypoints, Mat\& outImg, const Scalar\& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT ) +.. c:function:: void drawKeypoints( const Mat\& image, const vector\& keypoints, Mat\& outImg, const Scalar\& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT ) Draw keypoints. diff --git a/modules/features2d/doc/feature_detection_and_description.rst b/modules/features2d/doc/feature_detection_and_description.rst index 330f74797..66775ff19 100644 --- a/modules/features2d/doc/feature_detection_and_description.rst +++ b/modules/features2d/doc/feature_detection_and_description.rst @@ -5,9 +5,9 @@ Feature detection and description .. index:: FAST -cv::FAST +FAST -------- -.. cfunction:: void FAST( const Mat\& image, vector\& keypoints, int threshold, bool nonmaxSupression=true ) +.. c:function:: void FAST( const Mat& image, vector& 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 >& 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& 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& 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 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 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 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 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 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 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 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 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 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 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 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 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 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 base_set; + RTreeClassifier detector; + int patch_width = PATCH_SIZE; + iint patch_height = PATCH_SIZE; + vector 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); } -.. +.. diff --git a/modules/features2d/doc/object_categorization.rst b/modules/features2d/doc/object_categorization.rst index e8fd6de73..ec5267f01 100644 --- a/modules/features2d/doc/object_categorization.rst +++ b/modules/features2d/doc/object_categorization.rst @@ -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\& BOWTrainer::getDescriptors() const +.. c:function:: const vector\& BOWTrainer::getDescriptors() const Returns training set of descriptors. .. index:: BOWTrainer::descripotorsCount -cv::BOWTrainer::descripotorsCount +BOWTrainer::descripotorsCount --------------------------------- -.. cfunction:: const vector\& BOWTrainer::descripotorsCount() const +.. c:function:: const vector\& 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\& dextractor, const Ptr\& dmatcher ) +.. c:function:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor( const Ptr\& dextractor, const Ptr\& 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\& keypoints, Mat\& imgDescriptor, vector >* pointIdxsOfClusters=0, Mat* descriptors=0 ) +.. c:function:: void BOWImgDescriptorExtractor::compute( const Mat\& image, vector\& keypoints, Mat\& imgDescriptor, vector >* 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. diff --git a/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst b/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst index 95f44c96f..bc3bd173a 100644 --- a/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst +++ b/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst @@ -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. diff --git a/modules/gpu/doc/data_structures.rst b/modules/gpu/doc/data_structures.rst index c91fc4afb..ce1e4fdee 100644 --- a/modules/gpu/doc/data_structures.rst +++ b/modules/gpu/doc/data_structures.rst @@ -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) diff --git a/modules/gpu/doc/feature_detection_and_description.rst b/modules/gpu/doc/feature_detection_and_description.rst index 24bd54405..2cde7fdf9 100644 --- a/modules/gpu/doc/feature_detection_and_description.rst +++ b/modules/gpu/doc/feature_detection_and_description.rst @@ -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 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\& matches, const GpuMat\& mask = GpuMat()) +.. c:function:: void match(const GpuMat\& queryDescs, const GpuMat\& trainDescs, std::vector\& matches, const GpuMat\& mask = GpuMat()) -.. cfunction:: void match(const GpuMat\& queryDescs, std::vector\& matches, const std::vector\& masks = std::vector()) +.. c:function:: void match(const GpuMat\& queryDescs, std::vector\& matches, const std::vector\& masks = std::vector()) 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\& masks = std::vector()) +.. c:function:: void makeGpuCollection(GpuMat\& trainCollection, GpuMat\& maskCollection, const vector\& masks = std::vector()) 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\& matches) +.. c:function:: void matchDownload(const GpuMat\& trainIdx, const GpuMat\& distance, std::vector\& matches) -.. cfunction:: void matchDownload(const GpuMat\& trainIdx, GpuMat\& imgIdx, const GpuMat\& distance, std::vector\& matches) +.. c:function:: void matchDownload(const GpuMat\& trainIdx, GpuMat\& imgIdx, const GpuMat\& distance, std::vector\& 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 >\& matches, int k, const GpuMat\& mask = GpuMat(), bool compactResult = false) +.. c:function:: void knnMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, std::vector< std::vector >\& 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 >\& matches, int k, const std::vector\& masks = std::vector(), bool compactResult = false ) +.. c:function:: void knnMatch(const GpuMat\& queryDescs, std::vector< std::vector >\& matches, int k, const std::vector\& masks = std::vector(), 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 >\& matches, bool compactResult = false) +.. c:function:: void knnMatchDownload(const GpuMat\& trainIdx, const GpuMat\& distance, std::vector< std::vector >\& 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 >\& matches, float maxDistance, const GpuMat\& mask = GpuMat(), bool compactResult = false) +.. c:function:: void radiusMatch(const GpuMat\& queryDescs, const GpuMat\& trainDescs, std::vector< std::vector >\& 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 >\& matches, float maxDistance, const std::vector\& masks = std::vector(), bool compactResult = false) +.. c:function:: void radiusMatch(const GpuMat\& queryDescs, std::vector< std::vector >\& matches, float maxDistance, const std::vector\& masks = std::vector(), 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 >\& matches, bool compactResult = false) +.. c:function:: void radiusMatchDownload(const GpuMat\& trainIdx, const GpuMat\& nMatches, const GpuMat\& distance, std::vector< std::vector >\& 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. diff --git a/modules/gpu/doc/image_filtering.rst b/modules/gpu/doc/image_filtering.rst index e73125993..1f4172dcd 100644 --- a/modules/gpu/doc/image_filtering.rst +++ b/modules/gpu/doc/image_filtering.rst @@ -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 createFilter2D_GPU( const Ptr\& filter2D, int srcType, int dstType) +.. c:function:: Ptr createFilter2D_GPU( const Ptr\& 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 createSeparableFilter_GPU( const Ptr\& rowFilter, const Ptr\& columnFilter, int srcType, int bufType, int dstType) +.. c:function:: Ptr createSeparableFilter_GPU( const Ptr\& rowFilter, const Ptr\& 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 getRowSumFilter_GPU(int srcType, int sumType, int ksize, int anchor = -1) +.. c:function:: Ptr 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 getColumnSumFilter_GPU(int sumType, int dstType, int ksize, int anchor = -1) +.. c:function:: Ptr 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 createBoxFilter_GPU(int srcType, int dstType, const Size\& ksize, const Point\& anchor = Point(-1,-1)) +.. c:function:: Ptr createBoxFilter_GPU(int srcType, int dstType, const Size\& ksize, const Point\& anchor = Point(-1,-1)) Creates normalized 2D box filter. -.. cfunction:: Ptr getBoxFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1, -1)) +.. c:function:: Ptr 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 createMorphologyFilter_GPU(int op, int type, const Mat\& kernel, const Point\& anchor = Point(-1,-1), int iterations = 1) +.. c:function:: Ptr createMorphologyFilter_GPU(int op, int type, const Mat\& kernel, const Point\& anchor = Point(-1,-1), int iterations = 1) Creates 2D morphological filter. -.. cfunction:: Ptr getMorphologyFilter_GPU(int op, int type, const Mat\& kernel, const Size\& ksize, Point anchor=Point(-1,-1)) +.. c:function:: Ptr 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 createLinearFilter_GPU(int srcType, int dstType, const Mat\& kernel, const Point\& anchor = Point(-1,-1)) +.. c:function:: Ptr createLinearFilter_GPU(int srcType, int dstType, const Mat\& kernel, const Point\& anchor = Point(-1,-1)) Creates the non-separable linear filter. -.. cfunction:: Ptr getLinearFilter_GPU(int srcType, int dstType, const Mat\& kernel, const Size\& ksize, Point anchor = Point(-1, -1)) +.. c:function:: Ptr 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 getLinearRowFilter_GPU(int srcType, int bufType, const Mat\& rowKernel, int anchor = -1, int borderType = BORDER_CONSTANT) +.. c:function:: Ptr 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 getLinearColumnFilter_GPU(int bufType, int dstType, const Mat\& columnKernel, int anchor = -1, int borderType = BORDER_CONSTANT) +.. c:function:: Ptr 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 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 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 createDerivFilter_GPU(int srcType, int dstType, int dx, int dy, int ksize, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1) +.. c:function:: Ptr 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 createGaussianFilter_GPU(int type, Size ksize, double sigmaX, double sigmaY = 0, int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1) +.. c:function:: Ptr 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 getMaxFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1,-1)) +.. c:function:: Ptr 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 getMinFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1,-1)) +.. c:function:: Ptr getMinFilter_GPU(int srcType, int dstType, const Size\& ksize, Point anchor = Point(-1,-1)) Creates minimum filter. diff --git a/modules/gpu/doc/image_processing.rst b/modules/gpu/doc/image_processing.rst index 83914ce71..c6ecf3848 100644 --- a/modules/gpu/doc/image_processing.rst +++ b/modules/gpu/doc/image_processing.rst @@ -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. diff --git a/modules/gpu/doc/initalization_and_information.rst b/modules/gpu/doc/initalization_and_information.rst index 445993ce7..0fbd01dc7 100644 --- a/modules/gpu/doc/initalization_and_information.rst +++ b/modules/gpu/doc/initalization_and_information.rst @@ -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. diff --git a/modules/gpu/doc/matrix_reductions.rst b/modules/gpu/doc/matrix_reductions.rst index 72d03dda7..5520c65f1 100644 --- a/modules/gpu/doc/matrix_reductions.rst +++ b/modules/gpu/doc/matrix_reductions.rst @@ -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. diff --git a/modules/gpu/doc/object_detection.rst b/modules/gpu/doc/object_detection.rst index 16ea98921..f482aad67 100644 --- a/modules/gpu/doc/object_detection.rst +++ b/modules/gpu/doc/object_detection.rst @@ -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\& detector) +.. c:function:: void HOGDescriptor::setSVMDetector(const vector\& detector) Sets coefficients for the linear SVM classifier. @@ -120,7 +125,7 @@ cv::gpu::HOGDescriptor::setSVMDetector cv::gpu::HOGDescriptor::getDefaultPeopleDetector ------------------------------------------------ -.. cfunction:: static vector HOGDescriptor::getDefaultPeopleDetector() +.. c:function:: static vector 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 HOGDescriptor::getPeopleDetector48x96() +.. c:function:: static vector 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 HOGDescriptor::getPeopleDetector64x128() +.. c:function:: static vector 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\& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size()) +.. c:function:: void HOGDescriptor::detect(const GpuMat\& img, + vector\& 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\& 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\& 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` . diff --git a/modules/gpu/doc/operations_on_matrices.rst b/modules/gpu/doc/operations_on_matrices.rst index 92ad47943..0a5a9ab8d 100644 --- a/modules/gpu/doc/operations_on_matrices.rst +++ b/modules/gpu/doc/operations_on_matrices.rst @@ -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. diff --git a/modules/gpu/doc/per_element_operations..rst b/modules/gpu/doc/per_element_operations..rst index d6d483cce..9f77dce49 100644 --- a/modules/gpu/doc/per_element_operations..rst +++ b/modules/gpu/doc/per_element_operations..rst @@ -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. diff --git a/modules/highgui/doc/highgui__high-level_gui_and_media_i_o.rst b/modules/highgui/doc/highgui__high-level_gui_and_media_i_o.rst deleted file mode 100644 index a746eeb9c..000000000 --- a/modules/highgui/doc/highgui__high-level_gui_and_media_i_o.rst +++ /dev/null @@ -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 diff --git a/modules/highgui/doc/qt_new_functions.rst b/modules/highgui/doc/qt_new_functions.rst index 3242ba22b..9796ba447 100644 --- a/modules/highgui/doc/qt_new_functions.rst +++ b/modules/highgui/doc/qt_new_functions.rst @@ -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); + .. + diff --git a/modules/highgui/doc/reading_and_writing_images_and_video.rst b/modules/highgui/doc/reading_and_writing_images_and_video.rst index e1bfe8f7f..b5831359c 100644 --- a/modules/highgui/doc/reading_and_writing_images_and_video.rst +++ b/modules/highgui/doc/reading_and_writing_images_and_video.rst @@ -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\& buf, const vector\& params=vector()) +.. c:function:: bool imencode( const string\& ext, const Mat\& img, vector\& buf, const vector\& params=vector()) 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\& params=vector()) +.. c:function:: bool imwrite( const string\& filename, const Mat\& img, const vector\& params=vector()) 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 :: diff --git a/modules/highgui/doc/user_interface.rst b/modules/highgui/doc/user_interface.rst index 23b41386e..79b03a00d 100644 --- a/modules/highgui/doc/user_interface.rst +++ b/modules/highgui/doc/user_interface.rst @@ -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. diff --git a/modules/imgproc/doc/feature_detection.rst b/modules/imgproc/doc/feature_detection.rst index 2f0df62f3..6ac867c73 100644 --- a/modules/imgproc/doc/feature_detection.rst +++ b/modules/imgproc/doc/feature_detection.rst @@ -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\& corners, Size winSize, Size zeroZone, TermCriteria criteria ) +.. c:function:: void cornerSubPix( const Mat& image, vector& 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\& 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& 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\& 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& 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\& lines, double rho, double theta, int threshold, double srn=0, double stn=0 ) +.. c:function:: void HoughLines( Mat& image, vector& 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\& lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 ) +.. c:function:: void HoughLinesP( Mat& image, vector& 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; -.. + diff --git a/modules/imgproc/doc/filtering.rst b/modules/imgproc/doc/filtering.rst index b41ade50e..e4a518dc8 100644 --- a/modules/imgproc/doc/filtering.rst +++ b/modules/imgproc/doc/filtering.rst @@ -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& _filter2D, const Ptr& _rowFilter, const Ptr& _columnFilter, @@ -217,7 +217,7 @@ Generic image filtering class :: Ptr rowFilter; Ptr 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(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\& dst, int maxlevel ) +.. c:function:: void buildPyramid( const Mat\& src, vector\& 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 createBoxFilter( int srcType, int dstType, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT) +.. c:function:: Ptr createBoxFilter( int srcType, int dstType, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT) -.. cfunction:: Ptr getRowSumFilter(int srcType, int sumType, int ksize, int anchor=-1) +.. c:function:: Ptr getRowSumFilter(int srcType, int sumType, int ksize, int anchor=-1) -.. cfunction:: Ptr getColumnSumFilter(int sumType, int dstType, int ksize, int anchor=-1, double scale=1) +.. c:function:: Ptr 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 createDerivFilter( int srcType, int dstType, int dx, int dy, int ksize, int borderType=BORDER_DEFAULT ) +.. c:function:: Ptr 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 createGaussianFilter( int type, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT) +.. c:function:: Ptr 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 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 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 getLinearFilter(int srcType, int dstType, const Mat\& kernel, Point anchor=Point(-1,-1), double delta=0, int bits=0) +.. c:function:: Ptr 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 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 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 getMorphologyFilter(int op, int type, const Mat\& element, Point anchor=Point(-1,-1)) +.. c:function:: Ptr getMorphologyFilter(int op, int type, const Mat\& element, Point anchor=Point(-1,-1)) -.. cfunction:: Ptr getMorphologyRowFilter(int op, int type, int esize, int anchor=-1) +.. c:function:: Ptr getMorphologyRowFilter(int op, int type, int esize, int anchor=-1) -.. cfunction:: Ptr getMorphologyColumnFilter(int op, int type, int esize, int anchor=-1) +.. c:function:: Ptr 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 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 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 getLinearColumnFilter(int bufType, int dstType, const Mat\& columnKernel, int anchor, int symmetryType, double delta=0, int bits=0) +.. c:function:: Ptr getLinearColumnFilter(int bufType, int dstType, const Mat\& columnKernel, int anchor, int symmetryType, double delta=0, int bits=0) -.. cfunction:: Ptr getLinearRowFilter(int srcType, int bufType, const Mat\& rowKernel, int anchor, int symmetryType) +.. c:function:: Ptr 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 diff --git a/modules/imgproc/doc/geometric_transformations.rst b/modules/imgproc/doc/geometric_transformations.rst index 0b1c55da8..1d3ee26c3 100644 --- a/modules/imgproc/doc/geometric_transformations.rst +++ b/modules/imgproc/doc/geometric_transformations.rst @@ -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. diff --git a/modules/imgproc/doc/histograms.rst b/modules/imgproc/doc/histograms.rst index 065901583..400030f1f 100644 --- a/modules/imgproc/doc/histograms.rst +++ b/modules/imgproc/doc/histograms.rst @@ -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. diff --git a/modules/imgproc/doc/miscellaneous_transformations.rst b/modules/imgproc/doc/miscellaneous_transformations.rst index b5b6cacf0..629a0964a 100644 --- a/modules/imgproc/doc/miscellaneous_transformations.rst +++ b/modules/imgproc/doc/miscellaneous_transformations.rst @@ -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. diff --git a/modules/imgproc/doc/motion_analysis_and_object_tracking.rst b/modules/imgproc/doc/motion_analysis_and_object_tracking.rst index d120106a6..a4688e90e 100644 --- a/modules/imgproc/doc/motion_analysis_and_object_tracking.rst +++ b/modules/imgproc/doc/motion_analysis_and_object_tracking.rst @@ -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. diff --git a/modules/imgproc/doc/object_detection.rst b/modules/imgproc/doc/object_detection.rst index 9aafbd7d8..3739b8af8 100644 --- a/modules/imgproc/doc/object_detection.rst +++ b/modules/imgproc/doc/object_detection.rst @@ -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. diff --git a/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst b/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst index d27600cd1..645525647 100644 --- a/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst +++ b/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst @@ -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 >\& contours, vector\& hierarchy, int mode, int method, Point offset=Point()) +.. c:function:: void findContours( const Mat& image, vector >& contours, vector& hierarchy, int mode, int method, Point offset=Point()) -.. cfunction:: void findContours( const Mat\& image, vector >\& contours, int mode, int method, Point offset=Point()) +.. c:function:: void findContours( const Mat& image, vector >& 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 >\& contours, int contourIdx, const Scalar\& color, int thickness=1, int lineType=8, const vector\& hierarchy=vector(), int maxLevel=INT_MAX, Point offset=Point() ) +.. c:function:: void drawContours( Mat& image, const vector >& contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, const vector& hierarchy=vector(), 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\& approxCurve, double epsilon, bool closed ) +.. c:function:: void approxPolyDP( const Mat& curve, vector& approxCurve, double epsilon, bool closed ) -.. cfunction:: void approxPolyDP( const Mat\& curve, vector\& approxCurve, double epsilon, bool closed ) +.. c:function:: void approxPolyDP( const Mat& curve, vector& 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\& outliers, double ransacThreshold = 3.0, double confidence = 0.99) +.. c:function:: int estimateAffine3D(const Mat& srcpt, const Mat& dstpt, Mat& out, vector& 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\& hull, bool clockwise=false ) +.. c:function:: void convexHull( const Mat& points, vector& hull, bool clockwise=false ) -.. cfunction:: void convexHull( const Mat\& points, vector\& hull, bool clockwise=false ) +.. c:function:: void convexHull( const Mat& points, vector& hull, bool clockwise=false ) -.. cfunction:: void convexHull( const Mat\& points, vector\& hull, bool clockwise=false ) +.. c:function:: void convexHull( const Mat& points, vector& 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`` , ``vector`` , ``vector`` or ``vector`` converted to the matrix by ``Mat(const vector&)`` 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. diff --git a/modules/ml/doc/boosting.rst b/modules/ml/doc/boosting.rst index dd9dd07cc..5fcfe9ae5 100644 --- a/modules/ml/doc/boosting.rst +++ b/modules/ml/doc/boosting.rst @@ -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. diff --git a/modules/ml/doc/decision_trees.rst b/modules/ml/doc/decision_trees.rst index 312e2a501..34e7e450d 100644 --- a/modules/ml/doc/decision_trees.rst +++ b/modules/ml/doc/decision_trees.rst @@ -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. diff --git a/modules/ml/doc/expectation_maximization.rst b/modules/ml/doc/expectation_maximization.rst index 23078d72a..43022d6ed 100644 --- a/modules/ml/doc/expectation_maximization.rst +++ b/modules/ml/doc/expectation_maximization.rst @@ -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. diff --git a/modules/ml/doc/k_nearest_neighbors.rst b/modules/ml/doc/k_nearest_neighbors.rst index df7d88c36..5a72b8965 100644 --- a/modules/ml/doc/k_nearest_neighbors.rst +++ b/modules/ml/doc/k_nearest_neighbors.rst @@ -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. diff --git a/modules/ml/doc/ml.rst b/modules/ml/doc/ml.rst index 7d987a018..644858dc8 100644 --- a/modules/ml/doc/ml.rst +++ b/modules/ml/doc/ml.rst @@ -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 diff --git a/modules/ml/doc/neural_networks.rst b/modules/ml/doc/neural_networks.rst index f2cc265da..7e890ee9d 100644 --- a/modules/ml/doc/neural_networks.rst +++ b/modules/ml/doc/neural_networks.rst @@ -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. diff --git a/modules/ml/doc/normal_bayes_classifier.rst b/modules/ml/doc/normal_bayes_classifier.rst index fda1a0c9b..3572054a8 100644 --- a/modules/ml/doc/normal_bayes_classifier.rst +++ b/modules/ml/doc/normal_bayes_classifier.rst @@ -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) diff --git a/modules/ml/doc/random_trees.rst b/modules/ml/doc/random_trees.rst index f25d6a1f8..01399876a 100644 --- a/modules/ml/doc/random_trees.rst +++ b/modules/ml/doc/random_trees.rst @@ -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. diff --git a/modules/ml/doc/statistical_models.rst b/modules/ml/doc/statistical_models.rst index 361cd49e9..d57d4c537 100644 --- a/modules/ml/doc/statistical_models.rst +++ b/modules/ml/doc/statistical_models.rst @@ -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,] ... ) +.. 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,] ... ) 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[, ] ) const +.. c:function:: float CvStatMode::predict( const CvMat* sample[, ] ) const Predicts the response for the sample. diff --git a/modules/ml/doc/support_vector_machines.rst b/modules/ml/doc/support_vector_machines.rst index 8491e5107..f5ec5608f 100644 --- a/modules/ml/doc/support_vector_machines.rst +++ b/modules/ml/doc/support_vector_machines.rst @@ -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. diff --git a/modules/objdetect/doc/cascade_classification.rst b/modules/objdetect/doc/cascade_classification.rst index e5982cd1b..e7e8adc8f 100644 --- a/modules/objdetect/doc/cascade_classification.rst +++ b/modules/objdetect/doc/cascade_classification.rst @@ -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::clone() const +.. c:function:: Ptr 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::create(int type) +.. c:function:: static Ptr 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\& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size()) +.. c:function:: void CascadeClassifier::detectMultiScale( const Mat\& image, vector\& 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\& feval, const Mat\& image ) +.. c:function:: bool CascadeClassifier::setImage( Ptr\& 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\& feval, Point pt ) +.. c:function:: int CascadeClassifier::runAt( Ptr\& 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\& rectList, int groupThreshold, double eps=0.2) +.. c:function:: void groupRectangles(vector\& rectList, int groupThreshold, double eps=0.2) Groups the object candidate rectangles diff --git a/modules/video/doc/motion_analysis_and_object_tracking.rst b/modules/video/doc/motion_analysis_and_object_tracking.rst index 036cacdc7..ac35f0795 100644 --- a/modules/video/doc/motion_analysis_and_object_tracking.rst +++ b/modules/video/doc/motion_analysis_and_object_tracking.rst @@ -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\& prevPts, vector\& nextPts, vector\& status, vector\& 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\& prevPts, vector\& nextPts, vector\& status, vector\& 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 ::