Commit c21cf06c authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

integrated most of the new Python stuff into the reference manual

parent 4bf7000c
...@@ -112,6 +112,8 @@ calibrateCamera ...@@ -112,6 +112,8 @@ calibrateCamera
Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern. Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
.. ocv:pyfunction:: cv2.calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs[, rvecs[, tvecs[, flags]]]) -> retval, cameraMatrix, distCoeffs, rvecs, tvecs
:param objectPoints: Vector of vectors of calibration pattern points in the calibration pattern coordinate space. The outer vector contains as many elements as the number of the pattern views. If the same calibration pattern is shown in each view and it is fully visible, all the vectors will be the same. Although, it is possible to use partially occluded patterns, or even different patterns in different views. Then, the vectors will be different. The points are 3D, but since they are in a pattern coordinate system, then, if the rig is planar, it may make sense to put the model to a XY coordinate plane so that Z-coordinate of each input object point is 0. :param objectPoints: Vector of vectors of calibration pattern points in the calibration pattern coordinate space. The outer vector contains as many elements as the number of the pattern views. If the same calibration pattern is shown in each view and it is fully visible, all the vectors will be the same. Although, it is possible to use partially occluded patterns, or even different patterns in different views. Then, the vectors will be different. The points are 3D, but since they are in a pattern coordinate system, then, if the rig is planar, it may make sense to put the model to a XY coordinate plane so that Z-coordinate of each input object point is 0.
:param imagePoints: Vector of vectors of the projections of calibration pattern points. ``imagePoints.size()`` and ``objectPoints.size()`` and ``imagePoints[i].size()`` must be equal to ``objectPoints[i].size()`` for each ``i``. :param imagePoints: Vector of vectors of the projections of calibration pattern points. ``imagePoints.size()`` and ``objectPoints.size()`` and ``imagePoints[i].size()`` must be equal to ``objectPoints[i].size()`` for each ``i``.
...@@ -191,6 +193,8 @@ calibrationMatrixValues ...@@ -191,6 +193,8 @@ calibrationMatrixValues
Computes useful camera characteristics from the camera matrix. Computes useful camera characteristics from the camera matrix.
.. ocv:pyfunction:: cv2.calibrationMatrixValues(cameraMatrix, imageSize, apertureWidth, apertureHeight) -> fovx, fovy, focalLength, principalPoint, aspectRatio
:param cameraMatrix: Input camera matrix that can be estimated by :ref:`calibrateCamera` or :ref:`stereoCalibrate` . :param cameraMatrix: Input camera matrix that can be estimated by :ref:`calibrateCamera` or :ref:`stereoCalibrate` .
:param imageSize: Input image size in pixels. :param imageSize: Input image size in pixels.
...@@ -220,6 +224,8 @@ composeRT ...@@ -220,6 +224,8 @@ composeRT
Combines two rotation-and-shift transformations. Combines two rotation-and-shift transformations.
.. ocv:pyfunction:: cv2.composeRT(rvec1, tvec1, rvec2, tvec2[, rvec3[, tvec3[, dr3dr1[, dr3dt1[, dr3dr2[, dr3dt2[, dt3dr1[, dt3dt1[, dt3dr2[, dt3dt2]]]]]]]]]]) -> rvec3, tvec3, dr3dr1, dr3dt1, dr3dr2, dr3dt2, dt3dr1, dt3dt1, dt3dr2, dt3dt2
:param rvec1: First rotation vector. :param rvec1: First rotation vector.
:param tvec1: First translation vector. :param tvec1: First translation vector.
...@@ -255,7 +261,7 @@ computeCorrespondEpilines ...@@ -255,7 +261,7 @@ computeCorrespondEpilines
For points in an image of a stereo pair, computes the corresponding epilines in the other image. For points in an image of a stereo pair, computes the corresponding epilines in the other image.
.. ocv:cfunction:: void cvComputeCorrespondEpilines( const CvMat* points, int whichImage, const CvMat* F, CvMat* lines) .. ocv:cfunction:: void cvComputeCorrespondEpilines( const CvMat* points, int whichImage, const CvMat* F, CvMat* lines)
.. ocv:pyoldfunction:: ComputeCorrespondEpilines(points, whichImage, F, lines) -> None .. ocv:pyoldfunction:: cv.ComputeCorrespondEpilines(points, whichImage, F, lines) -> None
:param points: Input points. :math:`N \times 1` or :math:`1 \times N` matrix of type ``CV_32FC2`` or ``vector<Point2f>`` . :param points: Input points. :math:`N \times 1` or :math:`1 \times N` matrix of type ``CV_32FC2`` or ``vector<Point2f>`` .
...@@ -299,6 +305,8 @@ convertPointsToHomogeneous ...@@ -299,6 +305,8 @@ convertPointsToHomogeneous
Converts points from Euclidean to homogeneous space. Converts points from Euclidean to homogeneous space.
.. ocv:pyfunction:: cv2.convertPointsToHomogeneous(src[, dst]) -> dst
:param src: Input vector of ``N``-dimensional points. :param src: Input vector of ``N``-dimensional points.
:param dst: Output vector of ``N+1``-dimensional points. :param dst: Output vector of ``N+1``-dimensional points.
...@@ -314,6 +322,8 @@ convertPointsFromHomogeneous ...@@ -314,6 +322,8 @@ convertPointsFromHomogeneous
Converts points from homogeneous to Euclidean space. Converts points from homogeneous to Euclidean space.
.. ocv:pyfunction:: cv2.convertPointsFromHomogeneous(src[, dst]) -> dst
:param src: Input vector of ``N``-dimensional points. :param src: Input vector of ``N``-dimensional points.
:param dst: Output vector of ``N-1``-dimensional points. :param dst: Output vector of ``N-1``-dimensional points.
...@@ -329,8 +339,10 @@ convertPointsHomogeneous ...@@ -329,8 +339,10 @@ convertPointsHomogeneous
Converts points to/from homogeneous coordinates. Converts points to/from homogeneous coordinates.
.. ocv:pyfunction:: cv2.convertPointsHomogeneous(src[, dst]) -> dst
.. ocv:cfunction:: void cvConvertPointsHomogeneous( const CvMat* src, CvMat* dst ) .. ocv:cfunction:: void cvConvertPointsHomogeneous( const CvMat* src, CvMat* dst )
.. ocv:pyoldfunction:: ConvertPointsHomogeneous( src, dst ) -> None .. ocv:pyoldfunction:: cv.ConvertPointsHomogeneous( src, dst ) -> None
:param src: Input array or vector of 2D, 3D, or 4D points. :param src: Input array or vector of 2D, 3D, or 4D points.
...@@ -350,8 +362,10 @@ decomposeProjectionMatrix ...@@ -350,8 +362,10 @@ decomposeProjectionMatrix
Decomposes a projection matrix into a rotation matrix and a camera matrix. Decomposes a projection matrix into a rotation matrix and a camera matrix.
.. ocv:pyfunction:: cv2.decomposeProjectionMatrix(projMatrix[, cameraMatrix[, rotMatrix[, transVect[, rotMatrixX[, rotMatrixY[, rotMatrixZ[, eulerAngles]]]]]]]) -> cameraMatrix, rotMatrix, transVect, rotMatrixX, rotMatrixY, rotMatrixZ, eulerAngles
.. ocv:cfunction:: void cvDecomposeProjectionMatrix( const CvMat *projMatrix, CvMat *cameraMatrix, CvMat *rotMatrix, CvMat *transVect, CvMat *rotMatrX=NULL, CvMat *rotMatrY=NULL, CvMat *rotMatrZ=NULL, CvPoint3D64f *eulerAngles=NULL) .. ocv:cfunction:: void cvDecomposeProjectionMatrix( const CvMat *projMatrix, CvMat *cameraMatrix, CvMat *rotMatrix, CvMat *transVect, CvMat *rotMatrX=NULL, CvMat *rotMatrY=NULL, CvMat *rotMatrZ=NULL, CvPoint3D64f *eulerAngles=NULL)
.. ocv:pyoldfunction:: DecomposeProjectionMatrix(projMatrix, cameraMatrix, rotMatrix, transVect, rotMatrX=None, rotMatrY=None, rotMatrZ=None) -> eulerAngles .. ocv:pyoldfunction:: cv.DecomposeProjectionMatrix(projMatrix, cameraMatrix, rotMatrix, transVect, rotMatrX=None, rotMatrY=None, rotMatrZ=None) -> eulerAngles
:param projMatrix: 3x4 input projection matrix P. :param projMatrix: 3x4 input projection matrix P.
...@@ -384,8 +398,10 @@ drawChessboardCorners ...@@ -384,8 +398,10 @@ drawChessboardCorners
Renders the detected chessboard corners. Renders the detected chessboard corners.
.. ocv:pyfunction:: cv2.drawChessboardCorners(image, patternSize, corners, patternWasFound) -> None
.. ocv:cfunction:: void cvDrawChessboardCorners( CvArr* image, CvSize patternSize, CvPoint2D32f* corners, int count, int patternWasFound ) .. ocv:cfunction:: void cvDrawChessboardCorners( CvArr* image, CvSize patternSize, CvPoint2D32f* corners, int count, int patternWasFound )
.. ocv:pyoldfunction:: DrawChessboardCorners(image, patternSize, corners, patternWasFound)-> None .. ocv:pyoldfunction:: cv.DrawChessboardCorners(image, patternSize, corners, patternWasFound)-> None
:param image: Destination image. It must be an 8-bit color image. :param image: Destination image. It must be an 8-bit color image.
...@@ -405,8 +421,10 @@ findChessboardCorners ...@@ -405,8 +421,10 @@ findChessboardCorners
Finds the positions of internal corners of the chessboard. Finds the positions of internal corners of the chessboard.
.. ocv:pyfunction:: cv2.findChessboardCorners(image, patternSize[, corners[, flags]]) -> retval, corners
.. ocv:cfunction:: int cvFindChessboardCorners( const void* image, CvSize patternSize, CvPoint2D32f* corners, int* cornerCount=NULL, int flags=CV_CALIB_CB_ADAPTIVE_THRESH ) .. ocv:cfunction:: int cvFindChessboardCorners( const void* image, CvSize patternSize, CvPoint2D32f* corners, int* cornerCount=NULL, int flags=CV_CALIB_CB_ADAPTIVE_THRESH )
.. ocv:pyoldfunction:: FindChessboardCorners(image, patternSize, flags=CV_CALIB_CB_ADAPTIVE_THRESH) -> corners .. ocv:pyoldfunction:: cv.FindChessboardCorners(image, patternSize, flags=CV_CALIB_CB_ADAPTIVE_THRESH) -> corners
:param image: Source chessboard view. It must be an 8-bit grayscale or color image. :param image: Source chessboard view. It must be an 8-bit grayscale or color image.
...@@ -505,6 +523,8 @@ solvePnP ...@@ -505,6 +523,8 @@ solvePnP
Finds an object pose from 3D-2D point correspondences. Finds an object pose from 3D-2D point correspondences.
.. ocv:pyfunction:: cv2.solvePnP(objectPoints, imagePoints, cameraMatrix, distCoeffs[, rvec[, tvec[, useExtrinsicGuess]]]) -> rvec, tvec
:param objectPoints: Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points. ``vector<Point3f>`` can be also passed here. :param objectPoints: Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points. ``vector<Point3f>`` can be also passed here.
:param imagePoints: Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, where N is the number of points. ``vector<Point2f>`` can be also passed here. :param imagePoints: Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, where N is the number of points. ``vector<Point2f>`` can be also passed here.
...@@ -531,6 +551,8 @@ solvePnPRansac ...@@ -531,6 +551,8 @@ solvePnPRansac
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme. Finds an object pose from 3D-2D point correspondences using the RANSAC scheme.
.. ocv:pyfunction:: cv2.solvePnPRansac(objectPoints, imagePoints, cameraMatrix, distCoeffs[, rvec[, tvec[, useExtrinsicGuess[, iterationsCount[, reprojectionError[, minInliersCount[, inliers]]]]]]]) -> rvec, tvec, inliers
:param objectPoints: Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points. ``vector<Point3f>`` can be also passed here. :param objectPoints: Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points. ``vector<Point3f>`` can be also passed here.
:param imagePoints: Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, where N is the number of points. ``vector<Point2f>`` can be also passed here. :param imagePoints: Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, where N is the number of points. ``vector<Point2f>`` can be also passed here.
...@@ -564,8 +586,10 @@ findFundamentalMat ...@@ -564,8 +586,10 @@ findFundamentalMat
Calculates a fundamental matrix from the corresponding points in two images. Calculates a fundamental matrix from the corresponding points in two images.
.. ocv:pyfunction:: cv2.findFundamentalMat(points1, points2[, method[, param1[, param2[, mask]]]]) -> retval, mask
.. ocv:cfunction:: int cvFindFundamentalMat( const CvMat* points1, const CvMat* points2, CvMat* fundamentalMatrix, int method=CV_FM_RANSAC, double param1=1., double param2=0.99, CvMat* status=NULL) .. ocv:cfunction:: int cvFindFundamentalMat( const CvMat* points1, const CvMat* points2, CvMat* fundamentalMatrix, int method=CV_FM_RANSAC, double param1=1., double param2=0.99, CvMat* status=NULL)
.. ocv:pyoldfunction:: FindFundamentalMat(points1, points2, fundamentalMatrix, method=CV_FM_RANSAC, param1=1., param2=0.99, status=None) -> None .. ocv:pyoldfunction:: cv.FindFundamentalMat(points1, points2, fundamentalMatrix, method=CV_FM_RANSAC, param1=1., param2=0.99, status=None) -> None
:param points1: Array of ``N`` points from the first image. The point coordinates should be floating-point (single or double precision). :param points1: Array of ``N`` points from the first image. The point coordinates should be floating-point (single or double precision).
...@@ -627,8 +651,10 @@ findHomography ...@@ -627,8 +651,10 @@ findHomography
Finds a perspective transformation between two planes. Finds a perspective transformation between two planes.
.. ocv:pyfunction:: cv2.findHomography(srcPoints, dstPoints[, method[, ransacReprojThreshold[, mask]]]) -> retval, mask
.. ocv:cfunction:: void cvFindHomography( const CvMat* srcPoints, const CvMat* dstPoints, CvMat* H int method=0, double ransacReprojThreshold=3, CvMat* status=NULL) .. ocv:cfunction:: void cvFindHomography( const CvMat* srcPoints, const CvMat* dstPoints, CvMat* H int method=0, double ransacReprojThreshold=3, CvMat* status=NULL)
.. ocv:pyoldfunction:: FindHomography(srcPoints, dstPoints, H, method, ransacReprojThreshold=3.0, status=None)-> None .. ocv:pyoldfunction:: cv.FindHomography(srcPoints, dstPoints, H, method, ransacReprojThreshold=3.0, status=None)-> None
:param srcPoints: Coordinates of the points in the original plane, a matrix of the type ``CV_32FC2`` or ``vector<Point2f>`` . :param srcPoints: Coordinates of the points in the original plane, a matrix of the type ``CV_32FC2`` or ``vector<Point2f>`` .
...@@ -707,6 +733,9 @@ estimateAffine3D ...@@ -707,6 +733,9 @@ estimateAffine3D
Computes an optimal affine transformation between two 3D point sets. Computes an optimal affine transformation between two 3D point sets.
.. ocv:pyfunction:: cv2.estimateAffine3D(_from, _to[, _out[, _inliers[, param1[, param2]]]]) -> retval, _out, _inliers
.. ocv:pyfunction:: cv2.estimateAffine3D(from, to[, dst[, outliers[, param1[, param2]]]]) -> retval, dst, outliers
:param srcpt: First input 3D point set. :param srcpt: First input 3D point set.
:param dstpt: Second input 3D point set. :param dstpt: Second input 3D point set.
...@@ -730,8 +759,10 @@ getOptimalNewCameraMatrix ...@@ -730,8 +759,10 @@ getOptimalNewCameraMatrix
Returns the new camera matrix based on the free scaling parameter. Returns the new camera matrix based on the free scaling parameter.
.. ocv:pyfunction:: cv2.getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha[, newImgSize]) -> retval, validPixROI
.. ocv:cfunction:: void cvGetOptimalNewCameraMatrix( const CvMat* cameraMatrix, const CvMat* distCoeffs, CvSize imageSize, double alpha, CvMat* newCameraMatrix, CvSize newImageSize=cvSize(0, 0), CvRect* validPixROI=0 ) .. ocv:cfunction:: void cvGetOptimalNewCameraMatrix( const CvMat* cameraMatrix, const CvMat* distCoeffs, CvSize imageSize, double alpha, CvMat* newCameraMatrix, CvSize newImageSize=cvSize(0, 0), CvRect* validPixROI=0 )
.. ocv:pyoldfunction:: GetOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha, newCameraMatrix, newImageSize=(0, 0), validPixROI=0) -> None .. ocv:pyoldfunction:: cv.GetOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha, newCameraMatrix, newImageSize=(0, 0), validPixROI=0) -> None
:param cameraMatrix: Input camera matrix. :param cameraMatrix: Input camera matrix.
...@@ -760,6 +791,8 @@ initCameraMatrix2D ...@@ -760,6 +791,8 @@ initCameraMatrix2D
Finds an initial camera matrix from 3D-2D point correspondences. Finds an initial camera matrix from 3D-2D point correspondences.
.. ocv:pyfunction:: cv2.initCameraMatrix2D(objectPoints, imagePoints, imageSize[, aspectRatio]) -> retval
:param objectPoints: Vector belonging vectors of the calibration pattern points in the calibration pattern coordinate space. See :ocv:func:`calibrateCamera` for details. :param objectPoints: Vector belonging vectors of the calibration pattern points in the calibration pattern coordinate space. See :ocv:func:`calibrateCamera` for details.
:param imagePoints: Vector belonging to vectors of the projections of the calibration pattern points. :param imagePoints: Vector belonging to vectors of the projections of the calibration pattern points.
...@@ -780,6 +813,8 @@ matMulDeriv ...@@ -780,6 +813,8 @@ matMulDeriv
Computes partial derivatives of the matrix product for each multiplied matrix. Computes partial derivatives of the matrix product for each multiplied matrix.
.. ocv:pyfunction:: cv2.matMulDeriv(A, B[, dABdA[, dABdB]]) -> dABdA, dABdB
:param A: First multiplied matrix. :param A: First multiplied matrix.
:param B: Second multiplied matrix. :param B: Second multiplied matrix.
...@@ -801,6 +836,8 @@ projectPoints ...@@ -801,6 +836,8 @@ projectPoints
Projects 3D points to an image plane. Projects 3D points to an image plane.
.. ocv:pyfunction:: cv2.projectPoints(objectPoints, rvec, tvec, cameraMatrix, distCoeffs[, imagePoints[, jacobian[, aspectRatio]]]) -> imagePoints, jacobian
:param objectPoints: Array of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel (or ``vector<Point3f>`` ), where N is the number of points in the view. :param objectPoints: Array of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel (or ``vector<Point3f>`` ), where N is the number of points in the view.
:param rvec: Rotation vector. See :ocv:func:`Rodrigues` for details. :param rvec: Rotation vector. See :ocv:func:`Rodrigues` for details.
...@@ -841,8 +878,10 @@ reprojectImageTo3D ...@@ -841,8 +878,10 @@ reprojectImageTo3D
Reprojects a disparity image to 3D space. Reprojects a disparity image to 3D space.
.. ocv:pyfunction:: cv2.reprojectImageTo3D(disparity, Q[, _3dImage[, handleMissingValues[, ddepth]]]) -> _3dImage
.. ocv:cfunction:: void cvReprojectImageTo3D( const CvArr* disparity, CvArr* _3dImage, const CvMat* Q, int handleMissingValues=0) .. ocv:cfunction:: void cvReprojectImageTo3D( const CvArr* disparity, CvArr* _3dImage, const CvMat* Q, int handleMissingValues=0)
.. ocv:pyoldfunction:: ReprojectImageTo3D(disparity, _3dImage, Q, handleMissingValues=0) -> None .. ocv:pyoldfunction:: cv.ReprojectImageTo3D(disparity, _3dImage, Q, handleMissingValues=0) -> None
:param disparity: Input single-channel 16-bit signed or 32-bit floating-point disparity image. :param disparity: Input single-channel 16-bit signed or 32-bit floating-point disparity image.
...@@ -874,8 +913,10 @@ RQDecomp3x3 ...@@ -874,8 +913,10 @@ RQDecomp3x3
Computes an RQ decomposition of 3x3 matrices. Computes an RQ decomposition of 3x3 matrices.
.. ocv:pyfunction:: cv2.RQDecomp3x3(src[, mtxR[, mtxQ[, Qx[, Qy[, Qz]]]]]) -> retval, mtxR, mtxQ, Qx, Qy, Qz
.. ocv:cfunction:: void cvRQDecomp3x3( const CvMat *M, CvMat *R, CvMat *Q, CvMat *Qx=NULL, CvMat *Qy=NULL, CvMat *Qz=NULL, CvPoint3D64f *eulerAngles=NULL) .. ocv:cfunction:: void cvRQDecomp3x3( const CvMat *M, CvMat *R, CvMat *Q, CvMat *Qx=NULL, CvMat *Qy=NULL, CvMat *Qz=NULL, CvPoint3D64f *eulerAngles=NULL)
.. ocv:pyoldfunction:: RQDecomp3x3(M, R, Q, Qx=None, Qy=None, Qz=None) -> eulerAngles .. ocv:pyoldfunction:: cv.RQDecomp3x3(M, R, Q, Qx=None, Qy=None, Qz=None) -> eulerAngles
:param M: 3x3 input matrix. :param M: 3x3 input matrix.
...@@ -904,6 +945,8 @@ Rodrigues ...@@ -904,6 +945,8 @@ Rodrigues
Converts a rotation matrix to a rotation vector or vice versa. Converts a rotation matrix to a rotation vector or vice versa.
.. ocv:pyfunction:: cv2.Rodrigues(src[, dst[, jacobian]]) -> dst, jacobian
:param src: Input rotation vector (3x1 or 1x3) or rotation matrix (3x3). :param src: Input rotation vector (3x1 or 1x3) or rotation matrix (3x3).
:param dst: Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively. :param dst: Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively.
...@@ -1086,8 +1129,10 @@ stereoCalibrate ...@@ -1086,8 +1129,10 @@ stereoCalibrate
Calibrates the stereo camera. Calibrates the stereo camera.
.. ocv:pyfunction:: cv2.stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize[, R[, T[, E[, F[, criteria[, flags]]]]]]) -> retval, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, R, T, E, F
.. ocv:cfunction:: double cvStereoCalibrate( const CvMat* objectPoints, const CvMat* imagePoints1, const CvMat* imagePoints2, const CvMat* pointCounts, CvMat* cameraMatrix1, CvMat* distCoeffs1, CvMat* cameraMatrix2, CvMat* distCoeffs2, CvSize imageSize, CvMat* R, CvMat* T, CvMat* E=0, CvMat* F=0, CvTermCriteria termCrit=cvTermCriteria( CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 30, 1e-6), int flags=CV_CALIB_FIX_INTRINSIC ) .. ocv:cfunction:: double cvStereoCalibrate( const CvMat* objectPoints, const CvMat* imagePoints1, const CvMat* imagePoints2, const CvMat* pointCounts, CvMat* cameraMatrix1, CvMat* distCoeffs1, CvMat* cameraMatrix2, CvMat* distCoeffs2, CvSize imageSize, CvMat* R, CvMat* T, CvMat* E=0, CvMat* F=0, CvTermCriteria termCrit=cvTermCriteria( CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 30, 1e-6), int flags=CV_CALIB_FIX_INTRINSIC )
.. ocv:pyoldfunction:: StereoCalibrate( objectPoints, imagePoints1, imagePoints2, pointCounts, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E=None, F=None, termCrit=(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 30, 1e-6), flags=CV_CALIB_FIX_INTRINSIC)-> None .. ocv:pyoldfunction:: cv.StereoCalibrate( objectPoints, imagePoints1, imagePoints2, pointCounts, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E=None, F=None, termCrit=(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 30, 1e-6), flags=CV_CALIB_FIX_INTRINSIC)-> None
:param objectPoints: Vector belonging to vectors of the calibration pattern points. :param objectPoints: Vector belonging to vectors of the calibration pattern points.
...@@ -1177,7 +1222,7 @@ stereoRectify ...@@ -1177,7 +1222,7 @@ stereoRectify
Computes rectification transforms for each head of a calibrated stereo camera. Computes rectification transforms for each head of a calibrated stereo camera.
.. ocv:cfunction:: void cvStereoRectify( const CvMat* cameraMatrix1, const CvMat* cameraMatrix2, const CvMat* distCoeffs1, const CvMat* distCoeffs2, CvSize imageSize, const CvMat* R, const CvMat* T, CvMat* R1, CvMat* R2, CvMat* P1, CvMat* P2, CvMat* Q=0, int flags=CV_CALIB_ZERO_DISPARITY, double alpha=-1, CvSize newImageSize=cvSize(0, 0), CvRect* roi1=0, CvRect* roi2=0) .. ocv:cfunction:: void cvStereoRectify( const CvMat* cameraMatrix1, const CvMat* cameraMatrix2, const CvMat* distCoeffs1, const CvMat* distCoeffs2, CvSize imageSize, const CvMat* R, const CvMat* T, CvMat* R1, CvMat* R2, CvMat* P1, CvMat* P2, CvMat* Q=0, int flags=CV_CALIB_ZERO_DISPARITY, double alpha=-1, CvSize newImageSize=cvSize(0, 0), CvRect* roi1=0, CvRect* roi2=0)
.. ocv:pyoldfunction:: StereoRectify( cameraMatrix1, cameraMatrix2, distCoeffs1, distCoeffs2, imageSize, R, T, R1, R2, P1, P2, Q=None, flags=CV_CALIB_ZERO_DISPARITY, alpha=-1, newImageSize=(0, 0))-> (roi1, roi2) .. ocv:pyoldfunction:: cv.StereoRectify( cameraMatrix1, cameraMatrix2, distCoeffs1, distCoeffs2, imageSize, R, T, R1, R2, P1, P2, Q=None, flags=CV_CALIB_ZERO_DISPARITY, alpha=-1, newImageSize=(0, 0))-> (roi1, roi2)
:param cameraMatrix1: First camera matrix. :param cameraMatrix1: First camera matrix.
...@@ -1256,8 +1301,10 @@ stereoRectifyUncalibrated ...@@ -1256,8 +1301,10 @@ stereoRectifyUncalibrated
Computes a rectification transform for an uncalibrated stereo camera. Computes a rectification transform for an uncalibrated stereo camera.
.. ocv:pyfunction:: cv2.stereoRectifyUncalibrated(points1, points2, F, imgSize[, H1[, H2[, threshold]]]) -> retval, H1, H2
.. ocv:cfunction:: void cvStereoRectifyUncalibrated( const CvMat* points1, const CvMat* points2, const CvMat* F, CvSize imageSize, CvMat* H1, CvMat* H2, double threshold=5 ) .. ocv:cfunction:: void cvStereoRectifyUncalibrated( const CvMat* points1, const CvMat* points2, const CvMat* F, CvSize imageSize, CvMat* H1, CvMat* H2, double threshold=5 )
.. ocv:pyoldfunction:: StereoRectifyUncalibrated(points1, points2, F, imageSize, H1, H2, threshold=5)-> None .. ocv:pyoldfunction:: cv.StereoRectifyUncalibrated(points1, points2, F, imageSize, H1, H2, threshold=5)-> None
:param points1, points2: Two arrays of corresponding 2D points. The same formats as in :ref:`findFundamentalMat` are supported. :param points1, points2: Two arrays of corresponding 2D points. The same formats as in :ref:`findFundamentalMat` are supported.
......
...@@ -9,6 +9,8 @@ Finds centers of clusters and groups input samples around the clusters. ...@@ -9,6 +9,8 @@ Finds centers of clusters and groups input samples around the clusters.
.. ocv:function:: double kmeans( InputArray samples, int clusterCount, InputOutputArray labels, TermCriteria termcrit, int attempts, int flags, OutputArray centers=noArray() ) .. ocv:function:: double kmeans( InputArray samples, int clusterCount, InputOutputArray labels, TermCriteria termcrit, int attempts, int flags, OutputArray centers=noArray() )
.. ocv:pyfunction:: cv2.kmeans(data, K, criteria, attempts, flags[, bestLabels[, centers]]) -> retval, bestLabels, centers
:param samples: Floating-point matrix of input samples, one row per sample. :param samples: Floating-point matrix of input samples, one row per sample.
:param clusterCount: Number of clusters to split the set by. :param clusterCount: Number of clusters to split the set by.
......
...@@ -32,8 +32,10 @@ Draws a circle. ...@@ -32,8 +32,10 @@ Draws a circle.
.. ocv:function:: void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness=1, int lineType=8, int shift=0) .. ocv:function:: void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
.. ocv:pyfunction:: cv2.circle(img, center, radius, color[, thickness[, lineType[, shift]]]) -> None
.. ocv:cfunction:: void cvCircle( CvArr* img, CvPoint center, int radius, CvScalar color, int thickness=1, int lineType=8, int shift=0 ) .. ocv:cfunction:: void cvCircle( CvArr* img, CvPoint center, int radius, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: Circle(img, center, radius, color, thickness=1, lineType=8, shift=0)-> None .. ocv:pyoldfunction:: cv.Circle(img, center, radius, color, thickness=1, lineType=8, shift=0)-> None
:param img: Image where the circle is drawn. :param img: Image where the circle is drawn.
...@@ -59,8 +61,10 @@ Clips the line against the image rectangle. ...@@ -59,8 +61,10 @@ Clips the line against the image rectangle.
.. ocv:function:: bool clipLine(Rect imgRect, Point& pt1, Point& pt2) .. ocv:function:: bool clipLine(Rect imgRect, Point& pt1, Point& pt2)
.. ocv:pyfunction:: cv2.clipLine(imgRect, pt1, pt2) -> retval, pt1, pt2
.. ocv:cfunction:: int cvClipLine( CvSize imgSize, CvPoint* pt1, CvPoint* pt2 ) .. ocv:cfunction:: int cvClipLine( CvSize imgSize, CvPoint* pt1, CvPoint* pt2 )
.. ocv:pyoldfunction:: ClipLine(imgSize, pt1, pt2) -> (clippedPt1, clippedPt2) .. ocv:pyoldfunction:: cv.ClipLine(imgSize, pt1, pt2) -> (clippedPt1, clippedPt2)
:param imgSize: Image size. The image rectangle is ``Rect(0, 0, imgSize.width, imgSize.height)`` . :param imgSize: Image size. The image rectangle is ``Rect(0, 0, imgSize.width, imgSize.height)`` .
...@@ -81,8 +85,11 @@ Draws a simple or thick elliptic arc or fills an ellipse sector. ...@@ -81,8 +85,11 @@ Draws a simple or thick elliptic arc or fills an ellipse sector.
.. ocv:function:: void ellipse(Mat& img, const RotatedRect& box, const Scalar& color, int thickness=1, int lineType=8) .. ocv:function:: void ellipse(Mat& img, const RotatedRect& box, const Scalar& color, int thickness=1, int lineType=8)
.. ocv:pyfunction:: cv2.ellipse(img, center, axes, angle, startAngle, endAngle, color[, thickness[, lineType[, shift]]]) -> None
.. ocv:pyfunction:: cv2.ellipse(img, box, color[, thickness[, lineType]]) -> None
.. ocv:cfunction:: void cvEllipse( CvArr* img, CvPoint center, CvSize axes, double angle, double startAngle, double endAngle, CvScalar color, int thickness=1, int lineType=8, int shift=0 ) .. ocv:cfunction:: void cvEllipse( CvArr* img, CvPoint center, CvSize axes, double angle, double startAngle, double endAngle, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: Ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness=1, lineType=8, shift=0)-> None .. ocv:pyoldfunction:: cv.Ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness=1, lineType=8, shift=0)-> None
:param img: Image. :param img: Image.
...@@ -122,6 +129,8 @@ Approximates an elliptic arc with a polyline. ...@@ -122,6 +129,8 @@ Approximates an elliptic arc with a polyline.
.. ocv:function:: void ellipse2Poly( Point center, Size axes, int angle, int startAngle, int endAngle, int delta, vector<Point>& pts ) .. ocv:function:: void ellipse2Poly( Point center, Size axes, int angle, int startAngle, int endAngle, int delta, vector<Point>& pts )
.. ocv:pyfunction:: cv2.ellipse2Poly(center, axes, angle, arcStart, arcEnd, delta) -> pts
:param center: Center of the arc. :param center: Center of the arc.
:param axes: Half-sizes of the arc. See the :ocv:func:`ellipse` for details. :param axes: Half-sizes of the arc. See the :ocv:func:`ellipse` for details.
...@@ -147,8 +156,10 @@ Fills a convex polygon. ...@@ -147,8 +156,10 @@ Fills a convex polygon.
.. ocv:function:: void fillConvexPoly(Mat& img, const Point* pts, int npts, const Scalar& color, int lineType=8, int shift=0) .. ocv:function:: void fillConvexPoly(Mat& img, const Point* pts, int npts, const Scalar& color, int lineType=8, int shift=0)
.. ocv:pyfunction:: cv2.fillConvexPoly(img, points, color[, lineType[, shift]]) -> None
.. ocv:cfunction:: void cvFillConvexPoly( CvArr* img, CvPoint* pts, int npts, CvScalar color, int lineType=8, int shift=0 ) .. ocv:cfunction:: void cvFillConvexPoly( CvArr* img, CvPoint* pts, int npts, CvScalar color, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: FillConvexPoly(img, pn, color, lineType=8, shift=0)-> None .. ocv:pyoldfunction:: cv.FillConvexPoly(img, pn, color, lineType=8, shift=0)-> None
:param img: Image. :param img: Image.
...@@ -174,8 +185,10 @@ Fills the area bounded by one or more polygons. ...@@ -174,8 +185,10 @@ Fills the area bounded by one or more polygons.
.. ocv: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() ) .. ocv: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() )
.. ocv:pyfunction:: cv2.fillPoly(img, pts, color[, lineType[, shift[, offset]]]) -> None
.. ocv:cfunction:: void cvFillPoly( CvArr* img, CvPoint** pts, int* npts, int contours, CvScalar color, int lineType=8, int shift=0 ) .. ocv:cfunction:: void cvFillPoly( CvArr* img, CvPoint** pts, int* npts, int contours, CvScalar color, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: FillPoly(img, polys, color, lineType=8, shift=0)-> None .. ocv:pyoldfunction:: cv.FillPoly(img, polys, color, lineType=8, shift=0)-> None
:param img: Image. :param img: Image.
...@@ -202,8 +215,10 @@ Calculates the width and height of a text string. ...@@ -202,8 +215,10 @@ Calculates the width and height of a text string.
.. ocv:function:: Size getTextSize(const string& text, int fontFace, double fontScale, int thickness, int* baseLine) .. ocv:function:: Size getTextSize(const string& text, int fontFace, double fontScale, int thickness, int* baseLine)
.. ocv:pyfunction:: cv2.getTextSize(text, fontFace, fontScale, thickness) -> retval, baseLine
.. ocv:cfunction:: void cvGetTextSize( const char* textString, const CvFont* font, CvSize* textSize, int* baseline ) .. ocv:cfunction:: void cvGetTextSize( const char* textString, const CvFont* font, CvSize* textSize, int* baseline )
.. ocv:pyoldfunction:: GetTextSize(textString, font)-> (textSize, baseline) .. ocv:pyoldfunction:: cv.GetTextSize(textString, font)-> (textSize, baseline)
:param text: Input text string. :param text: Input text string.
...@@ -256,8 +271,10 @@ Draws a line segment connecting two points. ...@@ -256,8 +271,10 @@ Draws a line segment connecting two points.
.. ocv:function:: void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0) .. ocv:function:: void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
.. ocv:pyfunction:: cv2.line(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) -> None
.. ocv:cfunction:: void cvLine( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int lineType=8, int shift=0 ) .. ocv:cfunction:: void cvLine( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: Line(img, pt1, pt2, color, thickness=1, lineType=8, shift=0)-> None .. ocv:pyoldfunction:: cv.Line(img, pt1, pt2, color, thickness=1, lineType=8, shift=0)-> None
:param img: Image. :param img: Image.
...@@ -335,8 +352,10 @@ Draws a simple, thick, or filled up-right rectangle. ...@@ -335,8 +352,10 @@ Draws a simple, thick, or filled up-right rectangle.
.. ocv:function:: void rectangle(Mat& img, Rect r, const Scalar& color, int thickness=1, int lineType=8, int shift=0) .. ocv:function:: void rectangle(Mat& img, Rect r, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
.. ocv:pyfunction:: cv2.rectangle(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) -> None
.. ocv:cfunction:: void cvRectangle( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int lineType=8, int shift=0 ) .. ocv:cfunction:: void cvRectangle( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: Rectangle(img, pt1, pt2, color, thickness=1, lineType=8, shift=0)-> None .. ocv:pyoldfunction:: cv.Rectangle(img, pt1, pt2, color, thickness=1, lineType=8, shift=0)-> None
:param img: Image. :param img: Image.
...@@ -364,6 +383,8 @@ Draws several polygonal curves. ...@@ -364,6 +383,8 @@ Draws several polygonal curves.
.. ocv: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 ) .. ocv: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 )
.. ocv:pyfunction:: cv2.polylines(img, pts, isClosed, color[, thickness[, lineType[, shift]]]) -> None
:param img: Image. :param img: Image.
:param pts: Array of polygonal curves. :param pts: Array of polygonal curves.
...@@ -392,8 +413,10 @@ Draws a text string. ...@@ -392,8 +413,10 @@ Draws a text string.
.. ocv: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 ) .. ocv: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 )
.. ocv:pyfunction:: cv2.putText(img, text, org, fontFace, fontScale, color[, thickness[, linetype[, bottomLeftOrigin]]]) -> None
.. ocv:cfunction:: void cvPutText( CvArr* img, const char* text, CvPoint org, const CvFont* font, CvScalar color ) .. ocv:cfunction:: void cvPutText( CvArr* img, const char* text, CvPoint org, const CvFont* font, CvScalar color )
.. ocv:pyoldfunction:: PutText(img, text, org, font, color)-> None .. ocv:pyoldfunction:: cv.PutText(img, text, org, font, color)-> None
:param img: Image. :param img: Image.
......
...@@ -18,7 +18,7 @@ Computes an absolute value of each matrix element. ...@@ -18,7 +18,7 @@ Computes an absolute value of each matrix element.
* ``C = abs(A)`` is equivalent to ``absdiff(A, Scalar::all(0), C)`` * ``C = abs(A)`` is equivalent to ``absdiff(A, Scalar::all(0), C)``
* ``C = Mat_<Vec<uchar,n> >(abs(A*alpha + beta))`` is equivalent to ``convertScaleAbs(A, C, alpha, beta)`` * ``C = Mat_<Vec<uchar,n> >(abs(A*alpha + beta))`` is equivalent to :ocv:funcx:`convertScaleAbs`(A, C, alpha, beta)`
The output matrix has the same size and the same type as the input one except for the last case, where ``C`` is ``depth=CV_8U`` . The output matrix has the same size and the same type as the input one except for the last case, where ``C`` is ``depth=CV_8U`` .
...@@ -30,16 +30,13 @@ absdiff ...@@ -30,16 +30,13 @@ absdiff
Computes the per-element absolute difference between two arrays or between an array and a scalar. Computes the per-element absolute difference between two arrays or between an array and a scalar.
.. ocv:function:: void absdiff(InputArray src1, InputArray src2, OutputArray dst) .. ocv:function:: void absdiff(InputArray src1, InputArray src2, OutputArray dst)
.. ocv:pyfunction:: cv2.absdiff(src1, src2, [dst=None]) -> dst
.. ocv:pyoldfunction:: cv.AbsDiff(src1, src2, dst) -> None .. ocv:pyfunction:: cv2.absdiff(src1, src2[, dst]) -> dst
.. ocv:pyoldfunction:: cv.AbsDiffS(src1, src2, dst) -> None
.. ocv:cfunction:: void cvAbsDiff(const CvArr* src1, const CvArr* src2, CvArr* dst)
.. ocv:cfunction:: void cvAbsDiffS(const CvArr* src1, CvScalar src2, CvArr* dst)
.. ocv:cfunction:: void cvAbsDiff(const CvArr* src1, const CvArr* src2, CvArr* dst) .. ocv:cfunction:: void cvAbsDiff(const CvArr* src1, const CvArr* src2, CvArr* dst)
.. ocv:cfunction:: void cvAbsDiffS(const CvArr* src, CvArr* dst, CvScalar value) .. ocv:cfunction:: void cvAbsDiffS(const CvArr* src, CvArr* dst, CvScalar value)
.. ocv:pyoldfunction:: AbsDiff(src1, src2, dst)-> None .. ocv:pyoldfunction:: cv.AbsDiff(src1, src2, dst)-> None
.. ocv:pyoldfunction:: AbsDiffS(src, dst, value)-> None .. ocv:pyoldfunction:: cv.AbsDiffS(src, dst, value)-> None
:param src1: First input array or a scalar. :param src1: First input array or a scalar.
...@@ -82,12 +79,13 @@ add ...@@ -82,12 +79,13 @@ add
Computes the per-element sum of two arrays or an array and a scalar. Computes the per-element sum of two arrays or an array and a scalar.
.. ocv:function:: void add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1) .. ocv:function:: void add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
.. ocv:pyfunction:: cv2.add(src1, src2 [, dst=None [, mask=None [, dtype=-1]]]) -> dst
.. ocv:pyfunction:: cv2.add(src1, src2[, dst[, mask[, dtype]]]) -> dst
.. ocv:cfunction:: void cvAdd(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL) .. ocv:cfunction:: void cvAdd(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL)
.. ocv:cfunction:: void cvAddS(const CvArr* src, CvScalar value, CvArr* dst, const CvArr* mask=NULL) .. ocv:cfunction:: void cvAddS(const CvArr* src, CvScalar value, CvArr* dst, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: Add(src1, src2, dst, mask=None)-> None .. ocv:pyoldfunction:: cv.Add(src1, src2, dst, mask=None)-> None
.. ocv:pyoldfunction:: AddS(src, value, dst, mask=None)-> None .. ocv:pyoldfunction:: cv.AddS(src, value, dst, mask=None)-> None
:param src1: First source array or a scalar. :param src1: First source array or a scalar.
...@@ -136,7 +134,7 @@ The input arrays and the destination array can all have the same or different de ...@@ -136,7 +134,7 @@ The input arrays and the destination array can all have the same or different de
:ocv:func:`subtract`, :ocv:func:`subtract`,
:ocv:func:`addWeighted`, :ocv:func:`addWeighted`,
:ocv:func:`scaleAdd`, :ocv:func:`scaleAdd`,
:ocv:func:`convertScale`, :ocv:func:`Mat::convertTo`,
:ref:`MatrixExpressions` :ref:`MatrixExpressions`
...@@ -147,8 +145,10 @@ Computes the weighted sum of two arrays. ...@@ -147,8 +145,10 @@ Computes the weighted sum of two arrays.
.. ocv:function:: void addWeighted(InputArray src1, double alpha, InputArray src2, double beta, double gamma, OutputArray dst, int dtype=-1) .. ocv:function:: void addWeighted(InputArray src1, double alpha, InputArray src2, double beta, double gamma, OutputArray dst, int dtype=-1)
.. ocv:pyfunction:: cv2.addWeighted(src1, alpha, src2, beta, gamma[, dst[, dtype]]) -> dst
.. ocv:cfunction:: void cvAddWeighted(const CvArr* src1, double alpha, const CvArr* src2, double beta, double gamma, CvArr* dst) .. ocv:cfunction:: void cvAddWeighted(const CvArr* src1, double alpha, const CvArr* src2, double beta, double gamma, CvArr* dst)
.. ocv:pyoldfunction:: AddWeighted(src1, alpha, src2, beta, gamma, dst)-> None .. ocv:pyoldfunction:: cv.AddWeighted(src1, alpha, src2, beta, gamma, dst)-> None
:param src1: First source array. :param src1: First source array.
...@@ -182,7 +182,7 @@ The function can be replaced with a matrix expression: :: ...@@ -182,7 +182,7 @@ The function can be replaced with a matrix expression: ::
:ocv:func:`add`, :ocv:func:`add`,
:ocv:func:`subtract`, :ocv:func:`subtract`,
:ocv:func:`scaleAdd`, :ocv:func:`scaleAdd`,
:ocv:func:`convertScale`, :ocv:func:`Mat::convertTo`,
:ref:`MatrixExpressions` :ref:`MatrixExpressions`
...@@ -193,10 +193,12 @@ Calculates the per-element bit-wise conjunction of two arrays or an array and a ...@@ -193,10 +193,12 @@ Calculates the per-element bit-wise conjunction of two arrays or an array and a
.. ocv:function:: void bitwise_and(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray()) .. ocv:function:: void bitwise_and(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
.. ocv:pyfunction:: cv2.bitwise_and(src1, src2[, dst[, mask]]) -> dst
.. ocv:cfunction:: void cvAnd(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL) .. ocv:cfunction:: void cvAnd(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL)
.. ocv:cfunction:: void cvAndS(const CvArr* src, CvScalar value, CvArr* dst, const CvArr* mask=NULL) .. ocv:cfunction:: void cvAndS(const CvArr* src, CvScalar value, CvArr* dst, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: And(src1, src2, dst, mask=None)-> None .. ocv:pyoldfunction:: cv.And(src1, src2, dst, mask=None)-> None
.. ocv:pyoldfunction:: AndS(src, value, dst, mask=None)-> None .. ocv:pyoldfunction:: cv.AndS(src, value, dst, mask=None)-> None
:param src1: First source array or a scalar. :param src1: First source array or a scalar.
...@@ -240,8 +242,10 @@ Inverts every bit of an array. ...@@ -240,8 +242,10 @@ Inverts every bit of an array.
.. ocv:function:: void bitwise_not(InputArray src, OutputArray dst, InputArray mask=noArray()) .. ocv:function:: void bitwise_not(InputArray src, OutputArray dst, InputArray mask=noArray())
.. ocv:pyfunction:: cv2.bitwise_not(src[, dst[, mask]]) -> dst
.. ocv:cfunction:: void cvNot(const CvArr* src, CvArr* dst) .. ocv:cfunction:: void cvNot(const CvArr* src, CvArr* dst)
.. ocv:pyoldfunction:: Not(src, dst)-> None .. ocv:pyoldfunction:: cv.Not(src, dst)-> None
:param src: Source array. :param src: Source array.
...@@ -265,10 +269,12 @@ Calculates the per-element bit-wise disjunction of two arrays or an array and a ...@@ -265,10 +269,12 @@ Calculates the per-element bit-wise disjunction of two arrays or an array and a
.. ocv:function:: void bitwise_or(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray()) .. ocv:function:: void bitwise_or(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
.. ocv:pyfunction:: cv2.bitwise_or(src1, src2[, dst[, mask]]) -> dst
.. ocv:cfunction:: void cvOr(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL) .. ocv:cfunction:: void cvOr(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL)
.. ocv:cfunction:: void cvOrS(const CvArr* src, CvScalar value, CvArr* dst, const CvArr* mask=NULL) .. ocv:cfunction:: void cvOrS(const CvArr* src, CvScalar value, CvArr* dst, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: Or(src1, src2, dst, mask=None)-> None .. ocv:pyoldfunction:: cv.Or(src1, src2, dst, mask=None)-> None
.. ocv:pyoldfunction:: OrS(src, value, dst, mask=None)-> None .. ocv:pyoldfunction:: cv.OrS(src, value, dst, mask=None)-> None
:param src1: First source array or a scalar. :param src1: First source array or a scalar.
...@@ -311,10 +317,12 @@ Calculates the per-element bit-wise "exclusive or" operation on two arrays or an ...@@ -311,10 +317,12 @@ Calculates the per-element bit-wise "exclusive or" operation on two arrays or an
.. ocv:function:: void bitwise_xor(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray()) .. ocv:function:: void bitwise_xor(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
.. ocv:pyfunction:: cv2.bitwise_xor(src1, src2[, dst[, mask]]) -> dst
.. ocv:cfunction:: void cvXor(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL) .. ocv:cfunction:: void cvXor(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL)
.. ocv:cfunction:: void cvXorS(const CvArr* src, CvScalar value, CvArr* dst, const CvArr* mask=NULL) .. ocv:cfunction:: void cvXorS(const CvArr* src, CvScalar value, CvArr* dst, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: Xor(src1, src2, dst, mask=None)-> None .. ocv:pyoldfunction:: cv.Xor(src1, src2, dst, mask=None)-> None
.. ocv:pyoldfunction:: XorS(src, value, dst, mask=None)-> None .. ocv:pyoldfunction:: cv.XorS(src, value, dst, mask=None)-> None
:param src1: First source array or a scalar. :param src1: First source array or a scalar.
...@@ -359,8 +367,10 @@ Calculates the covariance matrix of a set of vectors. ...@@ -359,8 +367,10 @@ Calculates the covariance matrix of a set of vectors.
.. ocv:function:: void calcCovarMatrix( InputArray samples, OutputArray covar, OutputArray mean, int flags, int ctype=CV_64F) .. ocv:function:: void calcCovarMatrix( InputArray samples, OutputArray covar, OutputArray mean, int flags, int ctype=CV_64F)
.. ocv:pyfunction:: cv2.calcCovarMatrix(samples, flags[, covar[, mean[, ctype]]]) -> covar, mean
.. ocv:cfunction:: void cvCalcCovarMatrix( const CvArr** vects, int count, CvArr* covMat, CvArr* avg, int flags) .. ocv:cfunction:: void cvCalcCovarMatrix( const CvArr** vects, int count, CvArr* covMat, CvArr* avg, int flags)
.. ocv:pyoldfunction:: CalcCovarMatrix(vects, covMat, avg, flags)-> None .. ocv:pyoldfunction:: cv.CalcCovarMatrix(vects, covMat, avg, flags)-> None
:param samples: Samples stored either as separate matrices or as rows/columns of a single matrix. :param samples: Samples stored either as separate matrices or as rows/columns of a single matrix.
...@@ -412,8 +422,10 @@ Calculates the magnitude and angle of 2D vectors. ...@@ -412,8 +422,10 @@ Calculates the magnitude and angle of 2D vectors.
.. ocv:function:: void cartToPolar(InputArray x, InputArray y, OutputArray magnitude, OutputArray angle, bool angleInDegrees=false) .. ocv:function:: void cartToPolar(InputArray x, InputArray y, OutputArray magnitude, OutputArray angle, bool angleInDegrees=false)
.. ocv:pyfunction:: cv2.cartToPolar(x, y[, magnitude[, angle[, angleInDegrees]]]) -> magnitude, angle
.. ocv:cfunction:: void cvCartToPolar( const CvArr* x, const CvArr* y, CvArr* magnitude, CvArr* angle=NULL, int angleInDegrees=0) .. ocv:cfunction:: void cvCartToPolar( const CvArr* x, const CvArr* y, CvArr* magnitude, CvArr* angle=NULL, int angleInDegrees=0)
.. ocv:pyoldfunction:: CartToPolar(x, y, magnitude, angle=None, angleInDegrees=0)-> None .. ocv:pyoldfunction:: cv.CartToPolar(x, y, magnitude, angle=None, angleInDegrees=0)-> None
:param x: Array of x-coordinates. This must be a single-precision or double-precision floating-point array. :param x: Array of x-coordinates. This must be a single-precision or double-precision floating-point array.
...@@ -441,6 +453,8 @@ Checks every element of an input array for invalid values. ...@@ -441,6 +453,8 @@ Checks every element of an input array for invalid values.
.. ocv:function:: bool checkRange(InputArray src, bool quiet=true, Point* pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX) .. ocv:function:: bool checkRange(InputArray src, bool quiet=true, Point* pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX)
.. ocv:pyfunction:: cv2.checkRange(a[, quiet[, minVal[, maxVal]]]) -> retval, pt
:param src: Array to check. :param src: Array to check.
:param quiet: Flag indicating whether the functions quietly return false when the array elements are out of range or they throw an exception. :param quiet: Flag indicating whether the functions quietly return false when the array elements are out of range or they throw an exception.
...@@ -464,6 +478,8 @@ Performs the per-element comparison of two arrays or an array and scalar value. ...@@ -464,6 +478,8 @@ Performs the per-element comparison of two arrays or an array and scalar value.
.. ocv:function:: void compare(InputArray src1, InputArray src2, OutputArray dst, int cmpop) .. ocv:function:: void compare(InputArray src1, InputArray src2, OutputArray dst, int cmpop)
.. ocv:pyfunction:: cv2.compare(src1, src2, cmpop[, dst]) -> dst
:param src1: First source array or a scalar. :param src1: First source array or a scalar.
:param src2: Second source array or a scalar. :param src2: Second source array or a scalar.
...@@ -487,21 +503,21 @@ The function compares: ...@@ -487,21 +503,21 @@ The function compares:
.. math:: .. math::
\texttt{dst} (I) = \texttt{src1} (I) \,cmpop\, \texttt{src2} (I) \texttt{dst} (I) = \texttt{src1} (I) \,\texttt{cmpop}\, \texttt{src2} (I)
* *
Elements of ``src1`` with a scalar ``src2` when ``src2`` is constructed from ``Scalar`` or has a single element: Elements of ``src1`` with a scalar ``src2` when ``src2`` is constructed from ``Scalar`` or has a single element:
.. math:: .. math::
\texttt{dst} (I) = \texttt{src1}(I) \,cmpop\, \texttt{src2} \texttt{dst} (I) = \texttt{src1}(I) \,\texttt{cmpop}\, \texttt{src2}
* *
``src1`` with elements of ``src2`` when ``src1`` is constructed from ``Scalar`` or has a single element: ``src1`` with elements of ``src2`` when ``src1`` is constructed from ``Scalar`` or has a single element:
.. math:: .. math::
\texttt{dst} (I) = \texttt{src1} \,cmpop\, \texttt{src2} (I) \texttt{dst} (I) = \texttt{src1} \,\texttt{cmpop}\, \texttt{src2} (I)
When the comparison result is true, the corresponding element of destination array is set to 255. When the comparison result is true, the corresponding element of destination array is set to 255.
...@@ -528,6 +544,8 @@ Copies the lower or the upper half of a square matrix to another half. ...@@ -528,6 +544,8 @@ Copies the lower or the upper half of a square matrix to another half.
.. ocv:function:: void completeSymm(InputOutputArray mtx, bool lowerToUpper=false) .. ocv:function:: void completeSymm(InputOutputArray mtx, bool lowerToUpper=false)
.. ocv:pyfunction:: cv2.completeSymm(mtx[, lowerToUpper]) -> None
:param mtx: Input-output floating-point square matrix. :param mtx: Input-output floating-point square matrix.
:param lowerToUpper: Operation flag. If it is true, the lower half is copied to the upper half. Otherwise, the upper half is copied to the lower half. :param lowerToUpper: Operation flag. If it is true, the lower half is copied to the upper half. Otherwise, the upper half is copied to the lower half.
...@@ -555,8 +573,10 @@ Scales, computes absolute values, and converts the result to 8-bit. ...@@ -555,8 +573,10 @@ Scales, computes absolute values, and converts the result to 8-bit.
.. ocv:function:: void convertScaleAbs(InputArray src, OutputArray dst, double alpha=1, double beta=0) .. ocv:function:: void convertScaleAbs(InputArray src, OutputArray dst, double alpha=1, double beta=0)
.. ocv:pyfunction:: cv2.convertScaleAbs(src[, dst[, alpha[, beta]]]) -> dst
.. ocv:cfunction:: void cvConvertScaleAbs(const CvArr* src, CvArr* dst, double scale=1, double shift=0) .. ocv:cfunction:: void cvConvertScaleAbs(const CvArr* src, CvArr* dst, double scale=1, double shift=0)
.. ocv:pyoldfunction:: ConvertScaleAbs(src, dst, scale=1.0, shift=0.0)-> None .. ocv:pyoldfunction:: cv.ConvertScaleAbs(src, dst, scale=1.0, shift=0.0)-> None
:param src: Source array. :param src: Source array.
...@@ -596,8 +616,10 @@ Counts non-zero array elements. ...@@ -596,8 +616,10 @@ Counts non-zero array elements.
.. ocv:function:: int countNonZero( InputArray mtx ) .. ocv:function:: int countNonZero( InputArray mtx )
.. ocv:pyfunction:: cv2.countNonZero(src) -> retval
.. ocv:cfunction:: int cvCountNonZero(const CvArr* arr) .. ocv:cfunction:: int cvCountNonZero(const CvArr* arr)
.. ocv:pyoldfunction:: CountNonZero(arr)-> int .. ocv:pyoldfunction:: cv.CountNonZero(arr)-> int
:param mtx: Single-channel array. :param mtx: Single-channel array.
...@@ -623,6 +645,8 @@ Computes the cube root of an argument. ...@@ -623,6 +645,8 @@ Computes the cube root of an argument.
.. ocv:function:: float cubeRoot(float val) .. ocv:function:: float cubeRoot(float val)
.. ocv:pyfunction:: cv2.cubeRoot(val) -> retval
:param val: A function argument. :param val: A function argument.
The function ``cubeRoot`` computes :math:`\sqrt[3]{\texttt{val}}`. Negative arguments are handled correctly. NaN and Inf are not handled. The accuracy approaches the maximum possible accuracy for single-precision data. The function ``cubeRoot`` computes :math:`\sqrt[3]{\texttt{val}}`. Negative arguments are handled correctly. NaN and Inf are not handled. The accuracy approaches the maximum possible accuracy for single-precision data.
...@@ -699,8 +723,10 @@ Performs a forward or inverse discrete Cosine transform of 1D or 2D array. ...@@ -699,8 +723,10 @@ Performs a forward or inverse discrete Cosine transform of 1D or 2D array.
.. ocv:function:: void dct(InputArray src, OutputArray dst, int flags=0) .. ocv:function:: void dct(InputArray src, OutputArray dst, int flags=0)
.. ocv:pyfunction:: cv2.dct(src[, dst[, flags]]) -> dst
.. ocv:cfunction:: void cvDCT(const CvArr* src, CvArr* dst, int flags) .. ocv:cfunction:: void cvDCT(const CvArr* src, CvArr* dst, int flags)
.. ocv:pyoldfunction:: DCT(src, dst, flags)-> None .. ocv:pyoldfunction:: cv.DCT(src, dst, flags)-> None
:param src: Source floating-point array. :param src: Source floating-point array.
...@@ -791,8 +817,10 @@ Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating- ...@@ -791,8 +817,10 @@ Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-
.. ocv:function:: void dft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0) .. ocv:function:: void dft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0)
.. ocv:pyfunction:: cv2.dft(src[, dst[, flags[, nonzeroRows]]]) -> dst
.. ocv:cfunction:: void cvDFT(const CvArr* src, CvArr* dst, int flags, int nonzeroRows=0) .. ocv:cfunction:: void cvDFT(const CvArr* src, CvArr* dst, int flags, int nonzeroRows=0)
.. ocv:pyoldfunction:: DFT(src, dst, flags, nonzeroRows=0)-> None .. ocv:pyoldfunction:: cv.DFT(src, dst, flags, nonzeroRows=0)-> None
:param src: Source array that could be real or complex. :param src: Source array that could be real or complex.
...@@ -944,6 +972,9 @@ Performs per-element division of two arrays or a scalar by an array. ...@@ -944,6 +972,9 @@ Performs per-element division of two arrays or a scalar by an array.
.. ocv:function:: void divide(double scale, InputArray src2, OutputArray dst, int dtype=-1) .. ocv:function:: void divide(double scale, InputArray src2, OutputArray dst, int dtype=-1)
.. ocv:pyfunction:: cv2.divide(src1, src2[, dst[, scale[, dtype]]]) -> dst
.. ocv:pyfunction:: cv2.divide(scale, src2[, dst[, dtype]]) -> dst
:param src1: First source array. :param src1: First source array.
:param src2: Second source array of the same size and type as ``src1`` . :param src2: Second source array of the same size and type as ``src1`` .
...@@ -983,6 +1014,8 @@ Returns the determinant of a square floating-point matrix. ...@@ -983,6 +1014,8 @@ Returns the determinant of a square floating-point matrix.
.. ocv:function:: double determinant(InputArray mtx) .. ocv:function:: double determinant(InputArray mtx)
.. ocv:pyfunction:: cv2.determinant(mtx) -> retval
:param mtx: Input matrix that must have ``CV_32FC1`` or ``CV_64FC1`` type and square size. :param mtx: Input matrix that must have ``CV_32FC1`` or ``CV_64FC1`` type and square size.
The function ``determinant`` computes and returns the determinant of the specified matrix. For small matrices ( ``mtx.cols=mtx.rows<=3`` ), The function ``determinant`` computes and returns the determinant of the specified matrix. For small matrices ( ``mtx.cols=mtx.rows<=3`` ),
...@@ -1009,6 +1042,8 @@ eigen ...@@ -1009,6 +1042,8 @@ eigen
Computes eigenvalues and eigenvectors of a symmetric matrix. Computes eigenvalues and eigenvectors of a symmetric matrix.
.. ocv:pyfunction:: cv2.eigen(src, computeEigenvectors[, eigenvalues[, eigenvectors[, lowindex[, highindex]]]]) -> retval, eigenvalues, eigenvectors
:param src: Input matrix that must have ``CV_32FC1`` or ``CV_64FC1`` type, square size and be symmetrical (``src`` :sup:`T` == ``src``). :param src: Input matrix that must have ``CV_32FC1`` or ``CV_64FC1`` type, square size and be symmetrical (``src`` :sup:`T` == ``src``).
:param eigenvalues: Output vector of eigenvalues of the same type as ``src`` . The eigenvalues are stored in the descending order. :param eigenvalues: Output vector of eigenvalues of the same type as ``src`` . The eigenvalues are stored in the descending order.
...@@ -1033,8 +1068,10 @@ Calculates the exponent of every array element. ...@@ -1033,8 +1068,10 @@ Calculates the exponent of every array element.
.. ocv:function:: void exp(InputArray src, OutputArray dst) .. ocv:function:: void exp(InputArray src, OutputArray dst)
.. ocv:pyfunction:: cv2.exp(src[, dst]) -> dst
.. ocv:cfunction:: void cvExp(const CvArr* src, CvArr* dst) .. ocv:cfunction:: void cvExp(const CvArr* src, CvArr* dst)
.. ocv:pyoldfunction:: Exp(src, dst)-> None .. ocv:pyoldfunction:: cv.Exp(src, dst)-> None
:param src: Source array. :param src: Source array.
...@@ -1044,7 +1081,7 @@ The function ``exp`` calculates the exponent of every element of the input array ...@@ -1044,7 +1081,7 @@ The function ``exp`` calculates the exponent of every element of the input array
.. math:: .. math::
\texttt{dst} [I] = e^{ \texttt{src} }(I) \texttt{dst} [I] = e^{ src(I) }
The maximum relative error is about ``7e-6`` for single-precision input and less than ``1e-10`` for double-precision input. Currently, the function converts denormalized values to zeros on output. Special values (NaN, Inf) are not handled. The maximum relative error is about ``7e-6`` for single-precision input and less than ``1e-10`` for double-precision input. Currently, the function converts denormalized values to zeros on output. Special values (NaN, Inf) are not handled.
...@@ -1070,7 +1107,7 @@ To extract a channel from a new-style matrix, use ...@@ -1070,7 +1107,7 @@ To extract a channel from a new-style matrix, use
:ocv:func:`mixChannels` or :ocv:func:`mixChannels` or
:ocv:func:`split` . :ocv:func:`split` .
.. seealso:: :ocv:func:`mixChannels` , :ocv:func:`split` , :ocv:func:`merge` , :ocv:func:`cvarrToMat` , :ocv:func:`cvSetImageCOI` , :ocv:func:`cvGetImageCOI` .. seealso:: :ocv:func:`mixChannels` , :ocv:func:`split` , :ocv:func:`merge` , :ocv:func:`cvarrToMat` , :ocv:cfunc:`cvSetImageCOI` , :ocv:cfunc:`cvGetImageCOI`
...@@ -1080,6 +1117,8 @@ Calculates the angle of a 2D vector in degrees. ...@@ -1080,6 +1117,8 @@ Calculates the angle of a 2D vector in degrees.
.. ocv:function:: float fastAtan2(float y, float x) .. ocv:function:: float fastAtan2(float y, float x)
.. ocv:pyfunction:: cv2.fastAtan2(y, x) -> retval
:param x: x-coordinate of the vector. :param x: x-coordinate of the vector.
:param y: y-coordinate of the vector. :param y: y-coordinate of the vector.
...@@ -1094,8 +1133,10 @@ Flips a 2D array around vertical, horizontal, or both axes. ...@@ -1094,8 +1133,10 @@ Flips a 2D array around vertical, horizontal, or both axes.
.. ocv:function:: void flip(InputArray src, OutputArray dst, int flipCode) .. ocv:function:: void flip(InputArray src, OutputArray dst, int flipCode)
.. ocv:pyfunction:: cv2.flip(src, flipCode[, dst]) -> dst
.. ocv:cfunction:: void cvFlip(const CvArr* src, CvArr* dst=NULL, int flipMode=0) .. ocv:cfunction:: void cvFlip(const CvArr* src, CvArr* dst=NULL, int flipMode=0)
.. ocv:pyoldfunction:: Flip(src, dst=None, flipMode=0)-> None .. ocv:pyoldfunction:: cv.Flip(src, dst=None, flipMode=0)-> None
:param src: Source array. :param src: Source array.
...@@ -1107,9 +1148,14 @@ The function ``flip`` flips the array in one of three different ways (row and co ...@@ -1107,9 +1148,14 @@ The function ``flip`` flips the array in one of three different ways (row and co
.. math:: .. math::
\texttt{dst} _{ij} = \forkthree{\texttt{src}_{\texttt{src.rows}-i-1,j} }{if \texttt{flipCode} = 0} \texttt{dst} _{ij} =
{ \texttt{src} _{i, \texttt{src.cols} -j-1}}{if \texttt{flipCode} > 0} \left\{
{ \texttt{src} _{ \texttt{src.rows} -i-1, \texttt{src.cols} -j-1}}{if \texttt{flipCode} < 0} \begin{array}{l l}
\texttt{src} _{\texttt{src.rows}-i-1,j} & if\; \texttt{flipCode} = 0 \\
\texttt{src} _{i, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} > 0 \\
\texttt{src} _{ \texttt{src.rows} -i-1, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} < 0 \\
\end{array}
\right.
The example scenarios of using the function are the following: The example scenarios of using the function are the following:
...@@ -1135,8 +1181,10 @@ Performs generalized matrix multiplication. ...@@ -1135,8 +1181,10 @@ Performs generalized matrix multiplication.
.. ocv:function:: void gemm(InputArray src1, InputArray src2, double alpha, InputArray src3, double beta, OutputArray dst, int flags=0) .. ocv:function:: void gemm(InputArray src1, InputArray src2, double alpha, InputArray src3, double beta, OutputArray dst, int flags=0)
.. ocv:pyfunction:: cv2.gemm(src1, src2, alpha, src3, gamma[, dst[, flags]]) -> dst
.. ocv:cfunction:: void cvGEMM( const CvArr* src1, const CvArr* src2, double alpha, const CvArr* src3, double beta, CvArr* dst, int tABC=0) .. ocv:cfunction:: void cvGEMM( const CvArr* src1, const CvArr* src2, double alpha, const CvArr* src3, double beta, CvArr* dst, int tABC=0)
.. ocv:pyoldfunction:: GEMM(src1, src2, alphs, src3, beta, dst, tABC=0)-> None .. ocv:pyoldfunction:: cv.GEMM(src1, src2, alphs, src3, beta, dst, tABC=0)-> None
:param src1: First multiplied input matrix that should have ``CV_32FC1`` , ``CV_64FC1`` , ``CV_32FC2`` , or ``CV_64FC2`` type. :param src1: First multiplied input matrix that should have ``CV_32FC1`` , ``CV_64FC1`` , ``CV_32FC2`` , or ``CV_64FC2`` type.
...@@ -1211,8 +1259,10 @@ Returns the optimal DFT size for a given vector size. ...@@ -1211,8 +1259,10 @@ Returns the optimal DFT size for a given vector size.
.. ocv:function:: int getOptimalDFTSize(int vecsize) .. ocv:function:: int getOptimalDFTSize(int vecsize)
.. ocv:pyfunction:: cv2.getOptimalDFTSize(vecsize) -> retval
.. ocv:cfunction:: int cvGetOptimalDFTSize(int size0) .. ocv:cfunction:: int cvGetOptimalDFTSize(int size0)
.. ocv:pyoldfunction:: GetOptimalDFTSize(size0)-> int .. ocv:pyoldfunction:: cv.GetOptimalDFTSize(size0)-> int
:param vecsize: Vector size. :param vecsize: Vector size.
...@@ -1235,6 +1285,8 @@ Computes the inverse Discrete Cosine Transform of a 1D or 2D array. ...@@ -1235,6 +1285,8 @@ Computes the inverse Discrete Cosine Transform of a 1D or 2D array.
.. ocv:function:: void idct(InputArray src, OutputArray dst, int flags=0) .. ocv:function:: void idct(InputArray src, OutputArray dst, int flags=0)
.. ocv:pyfunction:: cv2.idct(src[, dst[, flags]]) -> dst
:param src: Source floating-point single-channel array. :param src: Source floating-point single-channel array.
:param dst: Destination array of the same size and type as ``src`` . :param dst: Destination array of the same size and type as ``src`` .
...@@ -1258,6 +1310,8 @@ Computes the inverse Discrete Fourier Transform of a 1D or 2D array. ...@@ -1258,6 +1310,8 @@ Computes the inverse Discrete Fourier Transform of a 1D or 2D array.
.. ocv:function:: void idft(InputArray src, OutputArray dst, int flags=0, int outputRows=0) .. ocv:function:: void idft(InputArray src, OutputArray dst, int flags=0, int outputRows=0)
.. ocv:pyfunction:: cv2.idft(src[, dst[, flags[, nonzeroRows]]]) -> dst
:param src: Source floating-point real or complex array. :param src: Source floating-point real or complex array.
:param dst: Destination array whose size and type depend on the ``flags`` . :param dst: Destination array whose size and type depend on the ``flags`` .
...@@ -1288,10 +1342,12 @@ Checks if array elements lie between the elements of two other arrays. ...@@ -1288,10 +1342,12 @@ Checks if array elements lie between the elements of two other arrays.
.. ocv:function:: void inRange(InputArray src, InputArray lowerb, InputArray upperb, OutputArray dst) .. ocv:function:: void inRange(InputArray src, InputArray lowerb, InputArray upperb, OutputArray dst)
.. ocv:pyfunction:: cv2.inRange(src, lowerb, upperb[, dst]) -> dst
.. ocv:cfunction:: void cvInRange(const CvArr* src, const CvArr* lower, const CvArr* upper, CvArr* dst) .. ocv:cfunction:: void cvInRange(const CvArr* src, const CvArr* lower, const CvArr* upper, CvArr* dst)
.. ocv:cfunction:: void cvInRangeS(const CvArr* src, CvScalar lower, CvScalar upper, CvArr* dst) .. ocv:cfunction:: void cvInRangeS(const CvArr* src, CvScalar lower, CvScalar upper, CvArr* dst)
.. ocv:pyoldfunction:: InRange(src, lower, upper, dst)-> None .. ocv:pyoldfunction:: cv.InRange(src, lower, upper, dst)-> None
.. ocv:pyoldfunction:: InRangeS(src, lower, upper, dst)-> None .. ocv:pyoldfunction:: cv.InRangeS(src, lower, upper, dst)-> None
:param src: First source array. :param src: First source array.
...@@ -1303,34 +1359,35 @@ Checks if array elements lie between the elements of two other arrays. ...@@ -1303,34 +1359,35 @@ Checks if array elements lie between the elements of two other arrays.
The function checks the range as follows: The function checks the range as follows:
* For every element of the input array: * For every element of a single-channel input array:
.. math:: .. math::
\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 < \texttt{upperb} (I)_0 \texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 < \texttt{upperb} (I)_0
* For single-channel arrays: * For two-channel arrays:
.. math:: .. math::
\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 < \texttt{upperb} (I)_0 \land \texttt{lowerb} (I)_1 \leq \texttt{src} (I)_1 < \texttt{upperb} (I)_1 \texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 < \texttt{upperb} (I)_0 \land \texttt{lowerb} (I)_1 \leq \texttt{src} (I)_1 < \texttt{upperb} (I)_1
* For two-channel arrays and so forth. * and so forth.
``dst`` (I) is set to 255 (all ``1`` -bits) if ``src`` (I) is within the specified range and 0 otherwise. That is, ``dst`` (I) is set to 255 (all ``1`` -bits) if ``src`` (I) is within the specified 1D, 2D, 3D, ... box and 0 otherwise.
When the lower and/or upper bounary parameters are scalars, the indexes ``(I)`` at ``lowerb`` and ``upperb`` in the above formulas should be omitted. When the lower and/or upper bounary parameters are scalars, the indexes ``(I)`` at ``lowerb`` and ``upperb`` in the above formulas should be omitted.
invert invert
------ ------
Finds the inverse or pseudo-inverse of a matrix. Finds the inverse or pseudo-inverse of a matrix.
.. ocv:function:: double invert(InputArray src, OutputArray dst, int method=DECOMP_LU) .. ocv:function:: double invert(InputArray src, OutputArray dst, int method=DECOMP_LU)
.. ocv:pyfunction:: cv2.invert(src[, dst[, flags]]) -> retval, dst
.. ocv:cfunction:: double cvInvert(const CvArr* src, CvArr* dst, int method=CV_LU) .. ocv:cfunction:: double cvInvert(const CvArr* src, CvArr* dst, int method=CV_LU)
.. ocv:pyoldfunction:: Invert(src, dst, method=CV_LU)-> double .. ocv:pyoldfunction:: cv.Invert(src, dst, method=CV_LU)-> double
:param src: Source floating-point ``M x N`` matrix. :param src: Source floating-point ``M x N`` matrix.
...@@ -1366,8 +1423,10 @@ Calculates the natural logarithm of every array element. ...@@ -1366,8 +1423,10 @@ Calculates the natural logarithm of every array element.
.. ocv:function:: void log(InputArray src, OutputArray dst) .. ocv:function:: void log(InputArray src, OutputArray dst)
.. ocv:pyfunction:: cv2.log(src[, dst]) -> dst
.. ocv:cfunction:: void cvLog(const CvArr* src, CvArr* dst) .. ocv:cfunction:: void cvLog(const CvArr* src, CvArr* dst)
.. ocv:pyoldfunction:: Log(src, dst)-> None .. ocv:pyoldfunction:: cv.Log(src, dst)-> None
:param src: Source array. :param src: Source array.
...@@ -1400,8 +1459,10 @@ Performs a look-up table transform of an array. ...@@ -1400,8 +1459,10 @@ Performs a look-up table transform of an array.
.. ocv:function:: void LUT(InputArray src, InputArray lut, OutputArray dst) .. ocv:function:: void LUT(InputArray src, InputArray lut, OutputArray dst)
.. ocv:pyfunction:: cv2.LUT(src, lut[, dst[, interpolation]]) -> dst
.. ocv:cfunction:: void cvLUT(const CvArr* src, CvArr* dst, const CvArr* lut) .. ocv:cfunction:: void cvLUT(const CvArr* src, CvArr* dst, const CvArr* lut)
.. ocv:pyoldfunction:: LUT(src, dst, lut)-> None .. ocv:pyoldfunction:: cv.LUT(src, dst, lut)-> None
:param src: Source array of 8-bit elements. :param src: Source array of 8-bit elements.
...@@ -1434,6 +1495,8 @@ Calculates the magnitude of 2D vectors. ...@@ -1434,6 +1495,8 @@ Calculates the magnitude of 2D vectors.
.. ocv:function:: void magnitude(InputArray x, InputArray y, OutputArray magnitude) .. ocv:function:: void magnitude(InputArray x, InputArray y, OutputArray magnitude)
.. ocv:pyfunction:: cv2.magnitude(x, y[, magnitude]) -> magnitude
:param x: Floating-point array of x-coordinates of the vectors. :param x: Floating-point array of x-coordinates of the vectors.
:param y: Floating-point array of y-coordinates of the vectors. It must have the same size as ``x`` . :param y: Floating-point array of y-coordinates of the vectors. It must have the same size as ``x`` .
...@@ -1461,6 +1524,8 @@ Calculates the Mahalanobis distance between two vectors. ...@@ -1461,6 +1524,8 @@ Calculates the Mahalanobis distance between two vectors.
.. ocv:function:: double Mahalanobis(InputArray vec1, InputArray vec2, InputArray icovar) .. ocv:function:: double Mahalanobis(InputArray vec1, InputArray vec2, InputArray icovar)
.. ocv:pyfunction:: cv2.Mahalanobis(v1, v2, icovar) -> retval
.. ocv:cfunction:: double cvMahalanobis( const CvArr* vec1, const CvArr* vec2, CvArr* mat) .. ocv:cfunction:: double cvMahalanobis( const CvArr* vec1, const CvArr* vec2, CvArr* mat)
:param vec1: First 1D source vector. :param vec1: First 1D source vector.
...@@ -1497,10 +1562,12 @@ Calculates per-element maximum of two arrays or an array and a scalar. ...@@ -1497,10 +1562,12 @@ Calculates per-element maximum of two arrays or an array and a scalar.
.. ocv:function:: void max(const Mat& src1, double value, Mat& dst) .. ocv:function:: void max(const Mat& src1, double value, Mat& dst)
.. ocv:pyfunction:: cv2.max(src1, src2[, dst]) -> dst
.. ocv:cfunction:: void cvMax(const CvArr* src1, const CvArr* src2, CvArr* dst) .. ocv:cfunction:: void cvMax(const CvArr* src1, const CvArr* src2, CvArr* dst)
.. ocv:cfunction:: void cvMaxS(const CvArr* src, double value, CvArr* dst) .. ocv:cfunction:: void cvMaxS(const CvArr* src, double value, CvArr* dst)
.. ocv:pyoldfunction:: Max(src1, src2, dst)-> None .. ocv:pyoldfunction:: cv.Max(src1, src2, dst)-> None
.. ocv:pyoldfunction:: MaxS(src, value, dst)-> None .. ocv:pyoldfunction:: cv.MaxS(src, value, dst)-> None
:param src1: First source array. :param src1: First source array.
...@@ -1542,6 +1609,8 @@ Calculates an average (mean) of array elements. ...@@ -1542,6 +1609,8 @@ Calculates an average (mean) of array elements.
.. ocv:function:: Scalar mean(InputArray mtx, InputArray mask=noArray()) .. ocv:function:: Scalar mean(InputArray mtx, InputArray mask=noArray())
.. ocv:pyfunction:: cv2.mean(src[, mask]) -> retval
:param mtx: Source array that should have from 1 to 4 channels so that the result can be stored in :ocv:func:`Scalar` . :param mtx: Source array that should have from 1 to 4 channels so that the result can be stored in :ocv:func:`Scalar` .
:param mask: Optional operation mask. :param mask: Optional operation mask.
...@@ -1569,6 +1638,8 @@ Calculates a mean and standard deviation of array elements. ...@@ -1569,6 +1638,8 @@ Calculates a mean and standard deviation of array elements.
.. ocv:function:: void meanStdDev(InputArray mtx, OutputArray mean, OutputArray stddev, InputArray mask=noArray()) .. ocv:function:: void meanStdDev(InputArray mtx, OutputArray mean, OutputArray stddev, InputArray mask=noArray())
.. ocv:pyfunction:: cv2.meanStdDev(src[, mean[, stddev[, mask]]]) -> mean, stddev
:param mtx: Source array that should have from 1 to 4 channels so that the results can be stored in :ocv:func:`Scalar` 's. :param mtx: Source array that should have from 1 to 4 channels so that the results can be stored in :ocv:func:`Scalar` 's.
:param mean: Output parameter: computed mean value. :param mean: Output parameter: computed mean value.
...@@ -1605,8 +1676,10 @@ Composes a multi-channel array from several single-channel arrays. ...@@ -1605,8 +1676,10 @@ Composes a multi-channel array from several single-channel arrays.
.. ocv:function:: void merge(const vector<Mat>& mv, OutputArray dst) .. ocv:function:: void merge(const vector<Mat>& mv, OutputArray dst)
.. ocv:pyfunction:: cv2.merge(mv[, dst]) -> dst
.. ocv:cfunction:: void cvMerge(const CvArr* src0, const CvArr* src1, const CvArr* src2, const CvArr* src3, CvArr* dst) .. ocv:cfunction:: void cvMerge(const CvArr* src0, const CvArr* src1, const CvArr* src2, const CvArr* src3, CvArr* dst)
.. ocv:pyoldfunction:: Merge(src0, src1, src2, src3, dst)-> None .. ocv:pyoldfunction:: cv.Merge(src0, src1, src2, src3, dst)-> None
:param mv: Source array or vector of matrices to be merged. All the matrices in ``mv`` must have the same size and the same depth. :param mv: Source array or vector of matrices to be merged. All the matrices in ``mv`` must have the same size and the same depth.
...@@ -1624,7 +1697,7 @@ The function ...@@ -1624,7 +1697,7 @@ The function
:ocv:func:`mixChannels`, :ocv:func:`mixChannels`,
:ocv:func:`split`, :ocv:func:`split`,
:ocv:func:`reshape` :ocv:func:`Mat::reshape`
...@@ -1644,10 +1717,12 @@ Calculates per-element minimum of two arrays or array and a scalar. ...@@ -1644,10 +1717,12 @@ Calculates per-element minimum of two arrays or array and a scalar.
.. ocv:function:: void min(const Mat& src1, double value, Mat& dst) .. ocv:function:: void min(const Mat& src1, double value, Mat& dst)
.. ocv:pyfunction:: cv2.min(src1, src2[, dst]) -> dst
.. ocv:cfunction:: void cvMin(const CvArr* src1, const CvArr* src2, CvArr* dst) .. ocv:cfunction:: void cvMin(const CvArr* src1, const CvArr* src2, CvArr* dst)
.. ocv:cfunction:: void cvMinS(const CvArr* src, double value, CvArr* dst) .. ocv:cfunction:: void cvMinS(const CvArr* src, double value, CvArr* dst)
.. ocv:pyoldfunction:: Min(src1, src2, dst)-> None .. ocv:pyoldfunction:: cv.Min(src1, src2, dst)-> None
.. ocv:pyoldfunction:: MinS(src, value, dst)-> None .. ocv:pyoldfunction:: cv.MinS(src, value, dst)-> None
:param src1: First source array. :param src1: First source array.
...@@ -1692,8 +1767,10 @@ Finds the global minimum and maximum in a whole array or sub-array. ...@@ -1692,8 +1767,10 @@ Finds the global minimum and maximum in a whole array or sub-array.
.. ocv:function:: void minMaxLoc(const SparseMat& src, double* minVal, double* maxVal, int* minIdx=0, int* maxIdx=0) .. ocv:function:: void minMaxLoc(const SparseMat& src, double* minVal, double* maxVal, int* minIdx=0, int* maxIdx=0)
.. ocv:pyfunction:: cv2.minMaxLoc(src[, mask]) -> minVal, maxVal, minLoc, maxLoc
.. ocv:cfunction:: void cvMinMaxLoc(const CvArr* arr, double* minVal, double* maxVal, CvPoint* minLoc=NULL, CvPoint* maxLoc=NULL, const CvArr* mask=NULL) .. ocv:cfunction:: void cvMinMaxLoc(const CvArr* arr, double* minVal, double* maxVal, CvPoint* minLoc=NULL, CvPoint* maxLoc=NULL, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: MinMaxLoc(arr, mask=None)-> (minVal, maxVal, minLoc, maxLoc) .. ocv:pyoldfunction:: cv.MinMaxLoc(arr, mask=None)-> (minVal, maxVal, minLoc, maxLoc)
:param src: Source single-channel array. :param src: Source single-channel array.
...@@ -1743,8 +1820,10 @@ Copies specified channels from input arrays to the specified channels of output ...@@ -1743,8 +1820,10 @@ Copies specified channels from input arrays to the specified channels of output
.. ocv:function:: void mixChannels(const vector<Mat>& srcv, vector<Mat>& dstv, const int* fromTo, int npairs) .. ocv:function:: void mixChannels(const vector<Mat>& srcv, vector<Mat>& dstv, const int* fromTo, int npairs)
.. ocv:pyfunction:: cv2.mixChannels(src, dst, fromTo) -> None
.. ocv:cfunction:: void cvMixChannels(const CvArr** src, int srcCount, CvArr** dst, int dstCount, const int* fromTo, int pairCount) .. ocv:cfunction:: void cvMixChannels(const CvArr** src, int srcCount, CvArr** dst, int dstCount, const int* fromTo, int pairCount)
.. ocv:pyoldfunction:: MixChannels(src, dst, fromTo) -> None .. ocv:pyoldfunction:: cv.MixChannels(src, dst, fromTo) -> None
:param srcv: Input array or vector of matrices. All the matrices must have the same size and the same depth. :param srcv: Input array or vector of matrices. All the matrices must have the same size and the same depth.
...@@ -1793,8 +1872,10 @@ Performs the per-element multiplication of two Fourier spectrums. ...@@ -1793,8 +1872,10 @@ Performs the per-element multiplication of two Fourier spectrums.
.. ocv:function:: void mulSpectrums(InputArray src1, InputArray src2, OutputArray dst, int flags, bool conj=false) .. ocv:function:: void mulSpectrums(InputArray src1, InputArray src2, OutputArray dst, int flags, bool conj=false)
.. ocv:pyfunction:: cv2.mulSpectrums(a, b, flags[, c[, conjB]]) -> c
.. ocv:cfunction:: void cvMulSpectrums( const CvArr* src1, const CvArr* src2, CvArr* dst, int flags) .. ocv:cfunction:: void cvMulSpectrums( const CvArr* src1, const CvArr* src2, CvArr* dst, int flags)
.. ocv:pyoldfunction:: MulSpectrums(src1, src2, dst, flags)-> None .. ocv:pyoldfunction:: cv.MulSpectrums(src1, src2, dst, flags)-> None
:param src1: First source array. :param src1: First source array.
...@@ -1821,6 +1902,8 @@ Calculates the per-element scaled product of two arrays. ...@@ -1821,6 +1902,8 @@ Calculates the per-element scaled product of two arrays.
.. ocv:function:: void multiply(InputArray src1, InputArray src2, OutputArray dst, double scale=1) .. ocv:function:: void multiply(InputArray src1, InputArray src2, OutputArray dst, double scale=1)
.. ocv:pyfunction:: cv2.multiply(src1, src2[, dst[, scale[, dtype]]]) -> dst
:param src1: First source array. :param src1: First source array.
:param src2: Second source array of the same size and the same type as ``src1`` . :param src2: Second source array of the same size and the same type as ``src1`` .
...@@ -1863,8 +1946,10 @@ Calculates the product of a matrix and its transposition. ...@@ -1863,8 +1946,10 @@ Calculates the product of a matrix and its transposition.
.. ocv:function:: void mulTransposed(InputArray src, OutputArray dst, bool aTa, InputArray delta=noArray(), double scale=1, int rtype=-1) .. ocv:function:: void mulTransposed(InputArray src, OutputArray dst, bool aTa, InputArray delta=noArray(), double scale=1, int rtype=-1)
.. ocv:pyfunction:: cv2.mulTransposed(src, aTa[, dst[, delta[, scale[, dtype]]]]) -> dst
.. ocv:cfunction:: void cvMulTransposed(const CvArr* src, CvArr* dst, int order, const CvArr* delta=NULL, double scale=1.0) .. ocv:cfunction:: void cvMulTransposed(const CvArr* src, CvArr* dst, int order, const CvArr* delta=NULL, double scale=1.0)
.. ocv:pyoldfunction:: MulTransposed(src, dst, order, delta=None, scale)-> None .. ocv:pyoldfunction:: cv.MulTransposed(src, dst, order, delta=None, scale)-> None
:param src: Source single-channel matrix. Note that unlike :ocv:func:`gemm`, the function can multiply not only floating-point matrices. :param src: Source single-channel matrix. Note that unlike :ocv:func:`gemm`, the function can multiply not only floating-point matrices.
...@@ -1911,8 +1996,11 @@ Calculates an absolute array norm, an absolute difference norm, or a relative di ...@@ -1911,8 +1996,11 @@ Calculates an absolute array norm, an absolute difference norm, or a relative di
.. ocv:function:: double norm( const SparseMat& src, int normType ) .. ocv:function:: double norm( const SparseMat& src, int normType )
.. ocv:pyfunction:: cv2.norm(src1[, normType[, mask]]) -> retval
.. ocv:pyfunction:: cv2.norm(src1, src2[, normType[, mask]]) -> retval
.. ocv:cfunction:: double cvNorm(const CvArr* arr1, const CvArr* arr2=NULL, int normType=CV_L2, const CvArr* mask=NULL) .. ocv:cfunction:: double cvNorm(const CvArr* arr1, const CvArr* arr2=NULL, int normType=CV_L2, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: Norm(arr1, arr2, normType=CV_L2, mask=None)-> double .. ocv:pyoldfunction:: cv.Norm(arr1, arr2, normType=CV_L2, mask=None)-> double
:param src1: First source array. :param src1: First source array.
...@@ -1962,6 +2050,8 @@ Normalizes the norm or value range of an array. ...@@ -1962,6 +2050,8 @@ Normalizes the norm or value range of an array.
.. ocv:function:: void normalize(const SparseMat& src, SparseMat& dst, double alpha, int normType) .. ocv:function:: void normalize(const SparseMat& src, SparseMat& dst, double alpha, int normType)
.. ocv:pyfunction:: cv2.normalize(src[, dst[, alpha[, beta[, norm_type[, dtype[, mask]]]]]]) -> dst
:param src: Source array. :param src: Source array.
:param dst: Destination array of the same size as ``src`` . :param dst: Destination array of the same size as ``src`` .
...@@ -2148,8 +2238,10 @@ Performs the perspective matrix transformation of vectors. ...@@ -2148,8 +2238,10 @@ Performs the perspective matrix transformation of vectors.
.. ocv:function:: void perspectiveTransform(InputArray src, OutputArray dst, InputArray mtx) .. ocv:function:: void perspectiveTransform(InputArray src, OutputArray dst, InputArray mtx)
.. ocv:pyfunction:: cv2.perspectiveTransform(src, m[, dst]) -> dst
.. ocv:cfunction:: void cvPerspectiveTransform(const CvArr* src, CvArr* dst, const CvMat* mat) .. ocv:cfunction:: void cvPerspectiveTransform(const CvArr* src, CvArr* dst, const CvMat* mat)
.. ocv:pyoldfunction:: PerspectiveTransform(src, dst, mat)-> None .. ocv:pyoldfunction:: cv.PerspectiveTransform(src, dst, mat)-> None
:param src: Source two-channel or three-channel floating-point array. Each element is a 2D/3D vector to be transformed. :param src: Source two-channel or three-channel floating-point array. Each element is a 2D/3D vector to be transformed.
...@@ -2194,6 +2286,8 @@ Calculates the rotation angle of 2D vectors. ...@@ -2194,6 +2286,8 @@ Calculates the rotation angle of 2D vectors.
.. ocv:function:: void phase(InputArray x, InputArray y, OutputArray angle, bool angleInDegrees=false) .. ocv:function:: void phase(InputArray x, InputArray y, OutputArray angle, bool angleInDegrees=false)
.. ocv:pyfunction:: cv2.phase(x, y[, angle[, angleInDegrees]]) -> angle
:param x: Source floating-point array of x-coordinates of 2D vectors. :param x: Source floating-point array of x-coordinates of 2D vectors.
:param y: Source array of y-coordinates of 2D vectors. It must have the same size and the same type as ``x`` . :param y: Source array of y-coordinates of 2D vectors. It must have the same size and the same type as ``x`` .
...@@ -2217,8 +2311,10 @@ Computes x and y coordinates of 2D vectors from their magnitude and angle. ...@@ -2217,8 +2311,10 @@ Computes x and y coordinates of 2D vectors from their magnitude and angle.
.. ocv:function:: void polarToCart(InputArray magnitude, InputArray angle, OutputArray x, OutputArray y, bool angleInDegrees=false) .. ocv:function:: void polarToCart(InputArray magnitude, InputArray angle, OutputArray x, OutputArray y, bool angleInDegrees=false)
.. ocv:pyfunction:: cv2.polarToCart(magnitude, angle[, x[, y[, angleInDegrees]]]) -> x, y
.. ocv:cfunction:: void cvPolarToCart( const CvArr* magnitude, const CvArr* angle, CvArr* x, CvArr* y, int angleInDegrees=0) .. ocv:cfunction:: void cvPolarToCart( const CvArr* magnitude, const CvArr* angle, CvArr* x, CvArr* y, int angleInDegrees=0)
.. ocv:pyoldfunction:: PolarToCart(magnitude, angle, x, y, angleInDegrees=0)-> None .. ocv:pyoldfunction:: cv.PolarToCart(magnitude, angle, x, y, angleInDegrees=0)-> None
:param magnitude: Source floating-point array of magnitudes of 2D vectors. It can be an empty matrix ( ``=Mat()`` ). In this case, the function assumes that all the magnitudes are =1. If it is not empty, it must have the same size and type as ``angle`` . :param magnitude: Source floating-point array of magnitudes of 2D vectors. It can be an empty matrix ( ``=Mat()`` ). In this case, the function assumes that all the magnitudes are =1. If it is not empty, it must have the same size and type as ``angle`` .
...@@ -2256,8 +2352,10 @@ Raises every array element to a power. ...@@ -2256,8 +2352,10 @@ Raises every array element to a power.
.. ocv:function:: void pow(InputArray src, double p, OutputArray dst) .. ocv:function:: void pow(InputArray src, double p, OutputArray dst)
.. ocv:pyfunction:: cv2.pow(src, power[, dst]) -> dst
.. ocv:cfunction:: void cvPow( const CvArr* src, CvArr* dst, double power) .. ocv:cfunction:: void cvPow( const CvArr* src, CvArr* dst, double power)
.. ocv:pyoldfunction:: Pow(src, dst, power)-> None .. ocv:pyoldfunction:: cv.Pow(src, dst, power)-> None
:param src: Source array. :param src: Source array.
...@@ -2441,6 +2539,8 @@ Generates a single uniformly-distributed random number or an array of random num ...@@ -2441,6 +2539,8 @@ Generates a single uniformly-distributed random number or an array of random num
.. ocv:function:: void randu(InputOutputArray mtx, InputArray low, InputArray high) .. ocv:function:: void randu(InputOutputArray mtx, InputArray low, InputArray high)
.. ocv:pyfunction:: cv2.randu(dst, low, high) -> None
:param mtx: Output array of random numbers. The array must be pre-allocated. :param mtx: Output array of random numbers. The array must be pre-allocated.
:param low: Inclusive lower boundary of the generated random numbers. :param low: Inclusive lower boundary of the generated random numbers.
...@@ -2470,6 +2570,8 @@ Fills the array with normally distributed random numbers. ...@@ -2470,6 +2570,8 @@ Fills the array with normally distributed random numbers.
.. ocv:function:: void randn(InputOutputArray mtx, InputArray mean, InputArray stddev) .. ocv:function:: void randn(InputOutputArray mtx, InputArray mean, InputArray stddev)
.. ocv:pyfunction:: cv2.randn(dst, mean, stddev) -> None
:param mtx: Output array of random numbers. The array must be pre-allocated and have 1 to 4 channels. :param mtx: Output array of random numbers. The array must be pre-allocated and have 1 to 4 channels.
:param mean: Mean value (expectation) of the generated random numbers. :param mean: Mean value (expectation) of the generated random numbers.
...@@ -2491,6 +2593,8 @@ Shuffles the array elements randomly. ...@@ -2491,6 +2593,8 @@ Shuffles the array elements randomly.
.. ocv:function:: void randShuffle(InputOutputArray mtx, double iterFactor=1., RNG* rng=0) .. ocv:function:: void randShuffle(InputOutputArray mtx, double iterFactor=1., RNG* rng=0)
.. ocv:pyfunction:: cv2.randShuffle(src[, dst[, iterFactor]]) -> dst
:param mtx: Input/output numerical 1D array. :param mtx: Input/output numerical 1D array.
:param iterFactor: Scale factor that determines the number of random swap operations. See the details below. :param iterFactor: Scale factor that determines the number of random swap operations. See the details below.
...@@ -2512,8 +2616,10 @@ Reduces a matrix to a vector. ...@@ -2512,8 +2616,10 @@ Reduces a matrix to a vector.
.. ocv:function:: void reduce(InputArray mtx, OutputArray vec, int dim, int reduceOp, int dtype=-1) .. ocv:function:: void reduce(InputArray mtx, OutputArray vec, int dim, int reduceOp, int dtype=-1)
.. ocv:pyfunction:: cv2.reduce(src, dim, rtype[, dst[, dtype]]) -> dst
.. ocv:cfunction:: void cvReduce(const CvArr* src, CvArr* dst, int dim=-1, int op=CV_REDUCE_SUM) .. ocv:cfunction:: void cvReduce(const CvArr* src, CvArr* dst, int dim=-1, int op=CV_REDUCE_SUM)
.. ocv:pyoldfunction:: Reduce(src, dst, dim=-1, op=CV_REDUCE_SUM)-> None .. ocv:pyoldfunction:: cv.Reduce(src, dst, dim=-1, op=CV_REDUCE_SUM)-> None
:param mtx: Source 2D matrix. :param mtx: Source 2D matrix.
...@@ -2547,8 +2653,10 @@ Fills the destination array with repeated copies of the source array. ...@@ -2547,8 +2653,10 @@ Fills the destination array with repeated copies of the source array.
.. ocv:function:: Mat repeat(InputArray src, int ny, int nx) .. ocv:function:: Mat repeat(InputArray src, int ny, int nx)
.. ocv:pyfunction:: cv2.repeat(src, ny, nx[, dst]) -> dst
.. ocv:cfunction:: void cvRepeat(const CvArr* src, CvArr* dst) .. ocv:cfunction:: void cvRepeat(const CvArr* src, CvArr* dst)
.. ocv:pyoldfunction:: Repeat(src, dst)-> None .. ocv:pyoldfunction:: cv.Repeat(src, dst)-> None
:param src: Source array to replicate. :param src: Source array to replicate.
...@@ -2563,7 +2671,7 @@ The functions ...@@ -2563,7 +2671,7 @@ The functions
.. math:: .. math::
\texttt{dst} _{ij}= \texttt{src} _{i \mod \texttt{src.rows} , \; j \mod \texttt{src.cols} } \texttt{dst} _{ij}= \texttt{src} _{i\mod src.rows, \; j\mod src.cols }
The second variant of the function is more convenient to use with The second variant of the function is more convenient to use with
:ref:`MatrixExpressions` . :ref:`MatrixExpressions` .
...@@ -2610,8 +2718,10 @@ Calculates the sum of a scaled array and another array. ...@@ -2610,8 +2718,10 @@ Calculates the sum of a scaled array and another array.
.. ocv:function:: void scaleAdd(InputArray src1, double scale, InputArray src2, OutputArray dst) .. ocv:function:: void scaleAdd(InputArray src1, double scale, InputArray src2, OutputArray dst)
.. ocv:pyfunction:: cv2.scaleAdd(src1, alpha, src2[, dst]) -> dst
.. ocv:cfunction:: void cvScaleAdd(const CvArr* src1, CvScalar scale, const CvArr* src2, CvArr* dst) .. ocv:cfunction:: void cvScaleAdd(const CvArr* src1, CvScalar scale, const CvArr* src2, CvArr* dst)
.. ocv:pyoldfunction:: ScaleAdd(src1, scale, src2, dst)-> None .. ocv:pyoldfunction:: cv.ScaleAdd(src1, scale, src2, dst)-> None
:param src1: First source array. :param src1: First source array.
...@@ -2651,8 +2761,10 @@ Initializes a scaled identity matrix. ...@@ -2651,8 +2761,10 @@ Initializes a scaled identity matrix.
.. ocv:function:: void setIdentity(InputOutputArray dst, const Scalar& value=Scalar(1)) .. ocv:function:: void setIdentity(InputOutputArray dst, const Scalar& value=Scalar(1))
.. ocv:pyfunction:: cv2.setIdentity(mtx[, s]) -> None
.. ocv:cfunction:: void cvSetIdentity(CvArr* mat, CvScalar value=cvRealScalar(1)) .. ocv:cfunction:: void cvSetIdentity(CvArr* mat, CvScalar value=cvRealScalar(1))
.. ocv:pyoldfunction:: SetIdentity(mat, value=1)-> None .. ocv:pyoldfunction:: cv.SetIdentity(mat, value=1)-> None
:param dst: Matrix to initialize (not necessarily square). :param dst: Matrix to initialize (not necessarily square).
...@@ -2687,8 +2799,10 @@ Solves one or more linear systems or least-squares problems. ...@@ -2687,8 +2799,10 @@ Solves one or more linear systems or least-squares problems.
.. ocv:function:: bool solve(InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU) .. ocv:function:: bool solve(InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU)
.. ocv:pyfunction:: cv2.solve(src1, src2[, dst[, flags]]) -> retval, dst
.. ocv:cfunction:: int cvSolve(const CvArr* src1, const CvArr* src2, CvArr* dst, int method=CV_LU) .. ocv:cfunction:: int cvSolve(const CvArr* src1, const CvArr* src2, CvArr* dst, int method=CV_LU)
.. ocv:pyoldfunction:: Solve(A, B, X, method=CV_LU)-> None .. ocv:pyoldfunction:: cv.Solve(A, B, X, method=CV_LU)-> None
:param src1: Input matrix on the left-hand side of the system. :param src1: Input matrix on the left-hand side of the system.
...@@ -2735,8 +2849,10 @@ Finds the real roots of a cubic equation. ...@@ -2735,8 +2849,10 @@ Finds the real roots of a cubic equation.
.. ocv:function:: void solveCubic(InputArray coeffs, OutputArray roots) .. ocv:function:: void solveCubic(InputArray coeffs, OutputArray roots)
.. ocv:pyfunction:: cv2.solveCubic(coeffs[, roots]) -> retval, roots
.. ocv:cfunction:: void cvSolveCubic(const CvArr* coeffs, CvArr* roots) .. ocv:cfunction:: void cvSolveCubic(const CvArr* coeffs, CvArr* roots)
.. ocv:pyoldfunction:: SolveCubic(coeffs, roots)-> None .. ocv:pyoldfunction:: cv.SolveCubic(coeffs, roots)-> None
:param coeffs: Equation coefficients, an array of 3 or 4 elements. :param coeffs: Equation coefficients, an array of 3 or 4 elements.
...@@ -2766,6 +2882,8 @@ Finds the real or complex roots of a polynomial equation. ...@@ -2766,6 +2882,8 @@ Finds the real or complex roots of a polynomial equation.
.. ocv:function:: void solvePoly(InputArray coeffs, OutputArray roots, int maxIters=300) .. ocv:function:: void solvePoly(InputArray coeffs, OutputArray roots, int maxIters=300)
.. ocv:pyfunction:: cv2.solvePoly(coeffs[, roots[, maxIters]]) -> retval, roots
:param coeffs: Array of polynomial coefficients. :param coeffs: Array of polynomial coefficients.
:param roots: Destination (complex) array of roots. :param roots: Destination (complex) array of roots.
...@@ -2786,6 +2904,8 @@ Sorts each row or each column of a matrix. ...@@ -2786,6 +2904,8 @@ Sorts each row or each column of a matrix.
.. ocv:function:: void sort(InputArray src, OutputArray dst, int flags) .. ocv:function:: void sort(InputArray src, OutputArray dst, int flags)
.. ocv:pyfunction:: cv2.sort(src, flags[, dst]) -> dst
:param src: Source single-channel array. :param src: Source single-channel array.
:param dst: Destination array of the same size and type as ``src`` . :param dst: Destination array of the same size and type as ``src`` .
...@@ -2815,6 +2935,8 @@ Sorts each row or each column of a matrix. ...@@ -2815,6 +2935,8 @@ Sorts each row or each column of a matrix.
.. ocv:function:: void sortIdx(InputArray src, OutputArray dst, int flags) .. ocv:function:: void sortIdx(InputArray src, OutputArray dst, int flags)
.. ocv:pyfunction:: cv2.sortIdx(src, flags[, dst]) -> dst
:param src: Source single-channel array. :param src: Source single-channel array.
:param dst: Destination integer array of the same size as ``src`` . :param dst: Destination integer array of the same size as ``src`` .
...@@ -2853,8 +2975,10 @@ Divides a multi-channel array into several single-channel arrays. ...@@ -2853,8 +2975,10 @@ Divides a multi-channel array into several single-channel arrays.
.. ocv:function:: void split(const Mat& mtx, vector<Mat>& mv) .. ocv:function:: void split(const Mat& mtx, vector<Mat>& mv)
.. ocv:pyfunction:: cv2.split(m, mv) -> None
.. ocv:cfunction:: void cvSplit(const CvArr* src, CvArr* dst0, CvArr* dst1, CvArr* dst2, CvArr* dst3) .. ocv:cfunction:: void cvSplit(const CvArr* src, CvArr* dst0, CvArr* dst1, CvArr* dst2, CvArr* dst3)
.. ocv:pyoldfunction:: Split(src, dst0, dst1, dst2, dst3)-> None .. ocv:pyoldfunction:: cv.Split(src, dst0, dst1, dst2, dst3)-> None
:param mtx: Source multi-channel array. :param mtx: Source multi-channel array.
...@@ -2883,8 +3007,10 @@ Calculates a quare root of array elements. ...@@ -2883,8 +3007,10 @@ Calculates a quare root of array elements.
.. ocv:function:: void sqrt(InputArray src, OutputArray dst) .. ocv:function:: void sqrt(InputArray src, OutputArray dst)
.. ocv:pyfunction:: cv2.sqrt(src[, dst]) -> dst
.. ocv:cfunction:: float cvSqrt(float value) .. ocv:cfunction:: float cvSqrt(float value)
.. ocv:pyoldfunction:: Sqrt(value)-> float .. ocv:pyoldfunction:: cv.Sqrt(value)-> float
:param src: Source floating-point array. :param src: Source floating-point array.
...@@ -2905,6 +3031,8 @@ Calculates the per-element difference between two arrays or array and a scalar. ...@@ -2905,6 +3031,8 @@ Calculates the per-element difference between two arrays or array and a scalar.
.. ocv:function:: void subtract(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1) .. ocv:function:: void subtract(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
.. ocv:pyfunction:: cv2.subtract(src1, src2[, dst[, mask[, dtype]]]) -> dst
:param src1: First source array or a scalar. :param src1: First source array or a scalar.
:param src2: Second source array or a scalar. :param src2: Second source array or a scalar.
...@@ -2952,7 +3080,7 @@ The input arrays and the destination array can all have the same or different de ...@@ -2952,7 +3080,7 @@ The input arrays and the destination array can all have the same or different de
:ocv:func:`add`, :ocv:func:`add`,
:ocv:func:`addWeighted`, :ocv:func:`addWeighted`,
:ocv:func:`scaleAdd`, :ocv:func:`scaleAdd`,
:ocv:func:`convertScale`, :ocv:func:`Mat::convertTo`,
:ref:`MatrixExpressions` :ref:`MatrixExpressions`
...@@ -3066,7 +3194,7 @@ Calculates the sum of array elements. ...@@ -3066,7 +3194,7 @@ Calculates the sum of array elements.
.. ocv:function:: Scalar sum(InputArray mtx) .. ocv:function:: Scalar sum(InputArray mtx)
.. ocv:cfunction:: CvScalar cvSum(const CvArr* arr) .. ocv:cfunction:: CvScalar cvSum(const CvArr* arr)
.. ocv:pyoldfunction:: Sum(arr)-> CvScalar .. ocv:pyoldfunction:: cv.Sum(arr)-> CvScalar
:param mtx: Source array that must have from 1 to 4 channels. :param mtx: Source array that must have from 1 to 4 channels.
...@@ -3107,8 +3235,10 @@ Returns the trace of a matrix. ...@@ -3107,8 +3235,10 @@ Returns the trace of a matrix.
.. ocv:function:: Scalar trace(InputArray mtx) .. ocv:function:: Scalar trace(InputArray mtx)
.. ocv:pyfunction:: cv2.trace(mtx) -> retval
.. ocv:cfunction:: CvScalar cvTrace(const CvArr* mat) .. ocv:cfunction:: CvScalar cvTrace(const CvArr* mat)
.. ocv:pyoldfunction:: Trace(mat)-> CvScalar .. ocv:pyoldfunction:: cv.Trace(mat)-> CvScalar
:param mtx: Source matrix. :param mtx: Source matrix.
...@@ -3126,8 +3256,10 @@ Performs the matrix transformation of every array element. ...@@ -3126,8 +3256,10 @@ Performs the matrix transformation of every array element.
.. ocv:function:: void transform(InputArray src, OutputArray dst, InputArray mtx ) .. ocv:function:: void transform(InputArray src, OutputArray dst, InputArray mtx )
.. ocv:pyfunction:: cv2.transform(src, m[, dst]) -> dst
.. ocv:cfunction:: void cvTransform(const CvArr* src, CvArr* dst, const CvMat* transmat, const CvMat* shiftvec=NULL) .. ocv:cfunction:: void cvTransform(const CvArr* src, CvArr* dst, const CvMat* transmat, const CvMat* shiftvec=NULL)
.. ocv:pyoldfunction:: Transform(src, dst, transmat, shiftvec=None)-> None .. ocv:pyoldfunction:: cv.Transform(src, dst, transmat, shiftvec=None)-> None
:param src: Source array that must have as many channels (1 to 4) as ``mtx.cols`` or ``mtx.cols-1``. :param src: Source array that must have as many channels (1 to 4) as ``mtx.cols`` or ``mtx.cols-1``.
...@@ -3173,8 +3305,10 @@ Transposes a matrix. ...@@ -3173,8 +3305,10 @@ Transposes a matrix.
.. ocv:function:: void transpose(InputArray src, OutputArray dst) .. ocv:function:: void transpose(InputArray src, OutputArray dst)
.. ocv:pyfunction:: cv2.transpose(src[, dst]) -> dst
.. ocv:cfunction:: void cvTranspose(const CvArr* src, CvArr* dst) .. ocv:cfunction:: void cvTranspose(const CvArr* src, CvArr* dst)
.. ocv:pyoldfunction:: Transpose(src, dst)-> None .. ocv:pyoldfunction:: cv.Transpose(src, dst)-> None
:param src: Source array. :param src: Source array.
......
...@@ -213,6 +213,8 @@ Returns the number of ticks. ...@@ -213,6 +213,8 @@ Returns the number of ticks.
.. ocv:function:: int64 getTickCount() .. ocv:function:: int64 getTickCount()
.. ocv:pyfunction:: cv2.getTickCount() -> retval
The function returns the number of ticks after the certain event (for example, when the machine was turned on). The function returns the number of ticks after the certain event (for example, when the machine was turned on).
It can be used to initialize It can be used to initialize
:ocv:func:`RNG` or to measure a function execution time by reading the tick count before and after the function call. See also the tick frequency. :ocv:func:`RNG` or to measure a function execution time by reading the tick count before and after the function call. See also the tick frequency.
...@@ -225,6 +227,8 @@ Returns the number of ticks per second. ...@@ -225,6 +227,8 @@ Returns the number of ticks per second.
.. ocv:function:: double getTickFrequency() .. ocv:function:: double getTickFrequency()
.. ocv:pyfunction:: cv2.getTickFrequency() -> retval
The function returns the number of ticks per second. The function returns the number of ticks per second.
That is, the following code computes the execution time in seconds: :: That is, the following code computes the execution time in seconds: ::
...@@ -240,6 +244,8 @@ Returns the number of CPU ticks. ...@@ -240,6 +244,8 @@ Returns the number of CPU ticks.
.. ocv:function:: int64 getCPUTickCount() .. ocv:function:: int64 getCPUTickCount()
.. ocv:pyfunction:: cv2.getCPUTickCount() -> retval
The function returns the current number of CPU ticks on some architectures (such as x86, x64, PowerPC). On other platforms the function is equivalent to ``getTickCount``. It can also be used for very accurate time measurements, as well as for RNG initialization. Note that in case of multi-CPU systems a thread, from which ``getCPUTickCount`` is called, can be suspended and resumed at another CPU with its own counter. So, theoretically (and practically) the subsequent calls to the function do not necessary return the monotonously increasing values. Also, since a modern CPU varies the CPU frequency depending on the load, the number of CPU clocks spent in some code cannot be directly converted to time units. Therefore, ``getTickCount`` is generally a preferable solution for measuring execution time. The function returns the current number of CPU ticks on some architectures (such as x86, x64, PowerPC). On other platforms the function is equivalent to ``getTickCount``. It can also be used for very accurate time measurements, as well as for RNG initialization. Note that in case of multi-CPU systems a thread, from which ``getCPUTickCount`` is called, can be suspended and resumed at another CPU with its own counter. So, theoretically (and practically) the subsequent calls to the function do not necessary return the monotonously increasing values. Also, since a modern CPU varies the CPU frequency depending on the load, the number of CPU clocks spent in some code cannot be directly converted to time units. Therefore, ``getTickCount`` is generally a preferable solution for measuring execution time.
...@@ -266,6 +272,8 @@ Enables or disables the optimized code. ...@@ -266,6 +272,8 @@ Enables or disables the optimized code.
.. ocv:function:: void setUseOptimized(bool onoff) .. ocv:function:: void setUseOptimized(bool onoff)
.. ocv:pyfunction:: cv2.setUseOptimized(onoff) -> None
:param onoff: The boolean flag specifying whether the optimized code should be used (``onoff=true``) or not (``onoff=false``). :param onoff: The boolean flag specifying whether the optimized code should be used (``onoff=true``) or not (``onoff=false``).
The function can be used to dynamically turn on and off optimized code (code that uses SSE2, AVX, and other instructions on the platforms that support it). It sets a global flag that is further checked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only safe to call the function on the very top level in your application where you can be sure that no other OpenCV function is currently executed. The function can be used to dynamically turn on and off optimized code (code that uses SSE2, AVX, and other instructions on the platforms that support it). It sets a global flag that is further checked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only safe to call the function on the very top level in your application where you can be sure that no other OpenCV function is currently executed.
...@@ -278,4 +286,6 @@ Returns the status of optimized code usage. ...@@ -278,4 +286,6 @@ Returns the status of optimized code usage.
.. ocv:function:: bool useOptimized() .. ocv:function:: bool useOptimized()
.. ocv:pyfunction:: cv2.useOptimized() -> retval
The function returns ``true`` if the optimized code is enabled. Otherwise, it returns ``false``. The function returns ``true`` if the optimized code is enabled. Otherwise, it returns ``false``.
...@@ -63,6 +63,8 @@ Changes parameters of a window dynamically. ...@@ -63,6 +63,8 @@ Changes parameters of a window dynamically.
.. ocv:function:: void setWindowProperty(const string& name, int prop_id, double prop_value) .. ocv:function:: void setWindowProperty(const string& name, int prop_id, double prop_value)
.. ocv:pyfunction:: cv2.setWindowProperty(winname, prop_id, prop_value) -> None
.. ocv:cfunction:: void cvSetWindowProperty(const char* name, int propId, double propValue) .. ocv:cfunction:: void cvSetWindowProperty(const char* name, int propId, double propValue)
:param name: Name of the window. :param name: Name of the window.
...@@ -97,6 +99,8 @@ Provides parameters of a window. ...@@ -97,6 +99,8 @@ Provides parameters of a window.
.. ocv:function:: void getWindowProperty(const string& name, int prop_id) .. ocv:function:: void getWindowProperty(const string& name, int prop_id)
.. ocv:pyfunction:: cv2.getWindowProperty(winname, prop_id) -> retval
.. ocv:cfunction:: void cvGetWindowProperty(const char* name, int propId) .. ocv:cfunction:: void cvGetWindowProperty(const char* name, int propId)
:param name: Name of the window. :param name: Name of the window.
......
...@@ -9,6 +9,8 @@ Reads an image from a buffer in memory. ...@@ -9,6 +9,8 @@ Reads an image from a buffer in memory.
.. ocv:function:: Mat imdecode( InputArray buf, int flags ) .. ocv:function:: Mat imdecode( InputArray buf, int flags )
.. ocv:pyfunction:: cv2.imdecode(buf, flags) -> retval
:param buf: Input array of vector of bytes. :param buf: Input array of vector of bytes.
:param flags: The same flags as in :ocv:func:`imread` . :param flags: The same flags as in :ocv:func:`imread` .
...@@ -25,6 +27,8 @@ Encodes an image into a memory buffer. ...@@ -25,6 +27,8 @@ Encodes an image into a memory buffer.
.. ocv:function:: bool imencode( const string& ext, InputArray img, vector<uchar>& buf, const vector<int>& params=vector<int>()) .. ocv:function:: bool imencode( const string& ext, InputArray img, vector<uchar>& buf, const vector<int>& params=vector<int>())
.. ocv:pyfunction:: cv2.imencode(ext, img, buf[, params]) -> retval
:param ext: File extension that defines the output format. :param ext: File extension that defines the output format.
:param img: Image to be written. :param img: Image to be written.
...@@ -43,6 +47,8 @@ Loads an image from a file. ...@@ -43,6 +47,8 @@ Loads an image from a file.
.. ocv:function:: Mat imread( const string& filename, int flags=1 ) .. ocv:function:: Mat imread( const string& filename, int flags=1 )
.. ocv:pyfunction:: cv2.imread(filename[, flags]) -> retval
:param filename: Name of file to be loaded. :param filename: Name of file to be loaded.
:param flags: Flags specifying the color type of a loaded image: :param flags: Flags specifying the color type of a loaded image:
...@@ -83,6 +89,8 @@ Saves an image to a specified file. ...@@ -83,6 +89,8 @@ Saves an image to a specified file.
.. ocv:function:: bool imwrite( const string& filename, InputArray img, const vector<int>& params=vector<int>()) .. ocv:function:: bool imwrite( const string& filename, InputArray img, const vector<int>& params=vector<int>())
.. ocv:pyfunction:: cv2.imwrite(filename, img[, params]) -> retval
:param filename: Name of the file. :param filename: Name of the file.
:param img: Image to be saved. :param img: Image to be saved.
...@@ -203,6 +211,8 @@ Returns the specified ``VideoCapture`` property ...@@ -203,6 +211,8 @@ Returns the specified ``VideoCapture`` property
.. ocv:function:: double VideoCapture::get(int property_id) .. ocv:function:: double VideoCapture::get(int property_id)
.. ocv:pyfunction:: cv2.VideoCapture.get(propId) -> retval
:param property_id: Property identifier. It can be one of the following: :param property_id: Property identifier. It can be one of the following:
* **CV_CAP_PROP_POS_MSEC** Current position of the video file in milliseconds or video capture timestamp. * **CV_CAP_PROP_POS_MSEC** Current position of the video file in milliseconds or video capture timestamp.
...@@ -252,6 +262,8 @@ Sets a property in the ``VideoCapture``. ...@@ -252,6 +262,8 @@ Sets a property in the ``VideoCapture``.
.. ocv:function:: bool VideoCapture::set(int property_id, double value) .. ocv:function:: bool VideoCapture::set(int property_id, double value)
.. ocv:pyfunction:: cv2.VideoCapture.set(propId, value) -> retval
:param property_id: Property identifier. It can be one of the following: :param property_id: Property identifier. It can be one of the following:
* **CV_CAP_PROP_POS_MSEC** Current position of the video file in milliseconds. * **CV_CAP_PROP_POS_MSEC** Current position of the video file in milliseconds.
......
...@@ -10,7 +10,7 @@ Creates a trackbar and attaches it to the specified window. ...@@ -10,7 +10,7 @@ Creates a trackbar and attaches it to the specified window.
.. ocv:function:: int createTrackbar( const string& trackbarname, const string& winname, int* value, int count, TrackbarCallback onChange=0, void* userdata=0) .. ocv:function:: int createTrackbar( const string& trackbarname, const string& winname, int* value, int count, TrackbarCallback onChange=0, void* userdata=0)
.. ocv:cfunction:: int cvCreateTrackbar( const char* trackbarName, const char* windowName, int* value, int count, CvTrackbarCallback onChange ) .. ocv:cfunction:: int cvCreateTrackbar( const char* trackbarName, const char* windowName, int* value, int count, CvTrackbarCallback onChange )
.. ocv:pyoldfunction:: CreateTrackbar(trackbarName, windowName, value, count, onChange) -> None .. ocv:pyoldfunction:: cv.CreateTrackbar(trackbarName, windowName, value, count, onChange) -> None
:param trackbarname: Name of the created trackbar. :param trackbarname: Name of the created trackbar.
...@@ -38,8 +38,10 @@ Returns the trackbar position. ...@@ -38,8 +38,10 @@ Returns the trackbar position.
.. ocv:function:: int getTrackbarPos( const string& trackbarname, const string& winname ) .. ocv:function:: int getTrackbarPos( const string& trackbarname, const string& winname )
.. ocv:pyfunction:: cv2.getTrackbarPos(trackbarname, winname) -> retval
.. ocv:cfunction:: int cvGetTrackbarPos( const char* trackbarName, const char* windowName ) .. ocv:cfunction:: int cvGetTrackbarPos( const char* trackbarName, const char* windowName )
.. ocv:pyoldfunction:: GetTrackbarPos(trackbarName, windowName)-> None .. ocv:pyoldfunction:: cv.GetTrackbarPos(trackbarName, windowName)-> None
:param trackbarname: Name of the trackbar. :param trackbarname: Name of the trackbar.
...@@ -57,6 +59,8 @@ Displays an image in the specified window. ...@@ -57,6 +59,8 @@ Displays an image in the specified window.
.. ocv:function:: void imshow( const string& winname, InputArray image ) .. ocv:function:: void imshow( const string& winname, InputArray image )
.. ocv:pyfunction:: cv2.imshow(winname, mat) -> None
:param winname: Name of the window. :param winname: Name of the window.
:param image: Image to be shown. :param image: Image to be shown.
...@@ -76,8 +80,10 @@ Creates a window. ...@@ -76,8 +80,10 @@ Creates a window.
.. ocv:function:: void namedWindow( const string& winname, int flags ) .. ocv:function:: void namedWindow( const string& winname, int flags )
.. ocv:pyfunction:: cv2.namedWindow(winname[, flags]) -> None
.. ocv:cfunction:: int cvNamedWindow( const char* name, int flags ) .. ocv:cfunction:: int cvNamedWindow( const char* name, int flags )
.. ocv:pyoldfunction:: NamedWindow(name, flags=CV_WINDOW_AUTOSIZE)-> None .. ocv:pyoldfunction:: cv.NamedWindow(name, flags=CV_WINDOW_AUTOSIZE)-> None
:param name: Name of the window in the window caption that may be used as a window identifier. :param name: Name of the window in the window caption that may be used as a window identifier.
...@@ -107,8 +113,10 @@ Destroys a window. ...@@ -107,8 +113,10 @@ Destroys a window.
.. ocv:function:: void destroyWindow( const string &winname ) .. ocv:function:: void destroyWindow( const string &winname )
.. ocv:pyfunction:: cv2.destroyWindow(winname) -> None
.. ocv:cfunction:: void cvDestroyWindow( const char* name ) .. ocv:cfunction:: void cvDestroyWindow( const char* name )
.. ocv:pyoldfunction:: DestroyWindow(name)-> None .. ocv:pyoldfunction:: cv.DestroyWindow(name)-> None
:param winname: Name of the window to be destroyed. :param winname: Name of the window to be destroyed.
...@@ -121,6 +129,8 @@ Destroys all of the HighGUI windows. ...@@ -121,6 +129,8 @@ Destroys all of the HighGUI windows.
.. ocv:function:: void destroyAllWindows() .. ocv:function:: void destroyAllWindows()
.. ocv:pyfunction:: cv2.destroyAllWindows() -> None
The function ``destroyAllWindows`` destroys all of the opened HighGUI windows. The function ``destroyAllWindows`` destroys all of the opened HighGUI windows.
...@@ -130,8 +140,10 @@ Sets the trackbar position. ...@@ -130,8 +140,10 @@ Sets the trackbar position.
.. ocv:function:: void setTrackbarPos( const string& trackbarname, const string& winname, int pos ) .. ocv:function:: void setTrackbarPos( const string& trackbarname, const string& winname, int pos )
.. ocv:pyfunction:: cv2.setTrackbarPos(trackbarname, winname, pos) -> None
.. ocv:cfunction:: void cvSetTrackbarPos( const char* trackbarName, const char* windowName, int pos ) .. ocv:cfunction:: void cvSetTrackbarPos( const char* trackbarName, const char* windowName, int pos )
.. ocv:pyoldfunction:: SetTrackbarPos(trackbarName, windowName, pos)-> None .. ocv:pyoldfunction:: cv.SetTrackbarPos(trackbarName, windowName, pos)-> None
:param trackbarname: Name of the trackbar. :param trackbarname: Name of the trackbar.
...@@ -151,8 +163,10 @@ Waits for a pressed key. ...@@ -151,8 +163,10 @@ Waits for a pressed key.
.. ocv:function:: int waitKey(int delay=0) .. ocv:function:: int waitKey(int delay=0)
.. ocv:pyfunction:: cv2.waitKey([, delay]) -> retval
.. ocv:cfunction:: int cvWaitKey( int delay=0 ) .. ocv:cfunction:: int cvWaitKey( int delay=0 )
.. ocv:pyoldfunction:: WaitKey(delay=0)-> int .. ocv:pyoldfunction:: cv.WaitKey(delay=0)-> int
:param delay: Delay in milliseconds. 0 is the special value that means "forever". :param delay: Delay in milliseconds. 0 is the special value that means "forever".
......
...@@ -11,8 +11,10 @@ Finds edges in an image using the Canny algorithm. ...@@ -11,8 +11,10 @@ Finds edges in an image using the Canny algorithm.
.. ocv:function:: void Canny( InputArray image, OutputArray edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false ) .. ocv:function:: void Canny( InputArray image, OutputArray edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false )
.. ocv:pyfunction:: cv2.Canny(image, threshold1, threshold2[, edges[, apertureSize[, L2gradient]]]) -> edges
.. ocv:cfunction:: void cvCanny( const CvArr* image, CvArr* edges, double threshold1, double threshold2, int apertureSize=3 ) .. ocv:cfunction:: void cvCanny( const CvArr* image, CvArr* edges, double threshold1, double threshold2, int apertureSize=3 )
.. ocv:pyoldfunction:: Canny(image, edges, threshold1, threshold2, apertureSize=3)-> None .. ocv:pyoldfunction:: cv.Canny(image, edges, threshold1, threshold2, apertureSize=3)-> None
:param image: Single-channel 8-bit input image. :param image: Single-channel 8-bit input image.
...@@ -37,8 +39,10 @@ Calculates eigenvalues and eigenvectors of image blocks for corner detection. ...@@ -37,8 +39,10 @@ Calculates eigenvalues and eigenvectors of image blocks for corner detection.
.. ocv:function:: void cornerEigenValsAndVecs( InputArray src, OutputArray dst, int blockSize, int apertureSize, int borderType=BORDER_DEFAULT ) .. ocv:function:: void cornerEigenValsAndVecs( InputArray src, OutputArray dst, int blockSize, int apertureSize, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.cornerEigenValsAndVecs(src, blockSize, ksize[, dst[, borderType]]) -> dst
.. ocv:cfunction:: void cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv, int blockSize, int apertureSize=3 ) .. ocv:cfunction:: void cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv, int blockSize, int apertureSize=3 )
.. ocv:pyoldfunction:: CornerEigenValsAndVecs(image, eigenvv, blockSize, apertureSize=3)-> None .. ocv:pyoldfunction:: cv.CornerEigenValsAndVecs(image, eigenvv, blockSize, apertureSize=3)-> None
:param src: Input single-channel 8-bit or floating-point image. :param src: Input single-channel 8-bit or floating-point image.
...@@ -86,8 +90,10 @@ Harris edge detector. ...@@ -86,8 +90,10 @@ Harris edge detector.
.. ocv:function:: void cornerHarris( InputArray src, OutputArray dst, int blockSize, int apertureSize, double k, int borderType=BORDER_DEFAULT ) .. ocv:function:: void cornerHarris( InputArray src, OutputArray dst, int blockSize, int apertureSize, double k, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.cornerHarris(src, blockSize, ksize, k[, dst[, borderType]]) -> dst
.. ocv:cfunction:: void cvCornerHarris( const CvArr* image, CvArr* harrisDst, int blockSize, int apertureSize=3, double k=0.04 ) .. ocv:cfunction:: void cvCornerHarris( const CvArr* image, CvArr* harrisDst, int blockSize, int apertureSize=3, double k=0.04 )
.. ocv:pyoldfunction:: CornerHarris(image, harrisDst, blockSize, apertureSize=3, k=0.04)-> None .. ocv:pyoldfunction:: cv.CornerHarris(image, harrisDst, blockSize, apertureSize=3, k=0.04)-> None
:param src: Input single-channel 8-bit or floating-point image. :param src: Input single-channel 8-bit or floating-point image.
...@@ -123,8 +129,10 @@ Calculates the minimal eigenvalue of gradient matrices for corner detection. ...@@ -123,8 +129,10 @@ Calculates the minimal eigenvalue of gradient matrices for corner detection.
.. ocv:function:: void cornerMinEigenVal( InputArray src, OutputArray dst, int blockSize, int apertureSize=3, int borderType=BORDER_DEFAULT ) .. ocv:function:: void cornerMinEigenVal( InputArray src, OutputArray dst, int blockSize, int apertureSize=3, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.cornerMinEigenVal(src, blockSize[, dst[, ksize[, borderType]]]) -> dst
.. ocv:cfunction:: void cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval, int blockSize, int apertureSize=3 ) .. ocv:cfunction:: void cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval, int blockSize, int apertureSize=3 )
.. ocv:pyoldfunction:: CornerMinEigenVal(image, eigenval, blockSize, apertureSize=3)-> None .. ocv:pyoldfunction:: cv.CornerMinEigenVal(image, eigenval, blockSize, apertureSize=3)-> None
:param src: Input single-channel 8-bit or floating-point image. :param src: Input single-channel 8-bit or floating-point image.
...@@ -149,6 +157,8 @@ Refines the corner locations. ...@@ -149,6 +157,8 @@ Refines the corner locations.
.. ocv:function:: void cornerSubPix( InputArray image, InputOutputArray corners, Size winSize, Size zeroZone, TermCriteria criteria ) .. ocv:function:: void cornerSubPix( InputArray image, InputOutputArray corners, Size winSize, Size zeroZone, TermCriteria criteria )
.. ocv:pyfunction:: cv2.cornerSubPix(image, corners, winSize, zeroZone, criteria) -> None
:param image: Input image. :param image: Input image.
:param corners: Initial coordinates of the input corners and refined coordinates provided for output. :param corners: Initial coordinates of the input corners and refined coordinates provided for output.
...@@ -205,8 +215,10 @@ Determines strong corners on an image. ...@@ -205,8 +215,10 @@ Determines strong corners on an image.
.. ocv:function:: void goodFeaturesToTrack( InputArray image, OutputArray corners, int maxCorners, double qualityLevel, double minDistance, InputArray mask=noArray(), int blockSize=3, bool useHarrisDetector=false, double k=0.04 ) .. ocv:function:: void goodFeaturesToTrack( InputArray image, OutputArray corners, int maxCorners, double qualityLevel, double minDistance, InputArray mask=noArray(), int blockSize=3, bool useHarrisDetector=false, double k=0.04 )
.. ocv:pyfunction:: cv2.goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]) -> corners
.. ocv:cfunction:: void cvGoodFeaturesToTrack( const CvArr* image CvArr* eigImage, CvArr* tempImage CvPoint2D32f* corners int* cornerCount double qualityLevel double minDistance const CvArr* mask=NULL int blockSize=3 int useHarris=0 double k=0.04 ) .. ocv:cfunction:: void cvGoodFeaturesToTrack( const CvArr* image CvArr* eigImage, CvArr* tempImage CvPoint2D32f* corners int* cornerCount double qualityLevel double minDistance const CvArr* mask=NULL int blockSize=3 int useHarris=0 double k=0.04 )
.. ocv:pyoldfunction:: GoodFeaturesToTrack(image, eigImage, tempImage, cornerCount, qualityLevel, minDistance, mask=None, blockSize=3, useHarris=0, k=0.04)-> corners .. ocv:pyoldfunction:: cv.GoodFeaturesToTrack(image, eigImage, tempImage, cornerCount, qualityLevel, minDistance, mask=None, blockSize=3, useHarris=0, k=0.04)-> corners
:param image: Input 8-bit or floating-point 32-bit, single-channel image. :param image: Input 8-bit or floating-point 32-bit, single-channel image.
...@@ -265,6 +277,8 @@ Finds circles in a grayscale image using the Hough transform. ...@@ -265,6 +277,8 @@ Finds circles in a grayscale image using the Hough transform.
.. ocv:function:: void HoughCircles( InputArray image, OutputArray circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0 ) .. ocv:function:: void HoughCircles( InputArray image, OutputArray circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0 )
.. ocv:pyfunction:: cv2.HoughCircles(image, method, dp, minDist[, circles[, param1[, param2[, minRadius[, maxRadius]]]]]) -> circles
:param image: 8-bit, single-channel, grayscale input image. :param image: 8-bit, single-channel, grayscale input image.
:param circles: Output vector of found circles. Each vector is encoded as a 3-element floating-point vector :math:`(x, y, radius)` . :param circles: Output vector of found circles. Each vector is encoded as a 3-element floating-point vector :math:`(x, y, radius)` .
...@@ -330,6 +344,8 @@ Finds lines in a binary image using the standard Hough transform. ...@@ -330,6 +344,8 @@ Finds lines in a binary image using the standard Hough transform.
.. ocv:function:: void HoughLines( InputArray image, OutputArray lines, double rho, double theta, int threshold, double srn=0, double stn=0 ) .. ocv:function:: void HoughLines( InputArray image, OutputArray lines, double rho, double theta, int threshold, double srn=0, double stn=0 )
.. ocv:pyfunction:: cv2.HoughLines(image, rho, theta, threshold[, lines[, srn[, stn]]]) -> lines
:param image: 8-bit, single-channel binary source image. The image may be modified by the function. :param image: 8-bit, single-channel binary source image. The image may be modified by the function.
:param lines: Output vector of lines. Each line is represented by a two-element vector :math:`(\rho, \theta)` . :math:`\rho` is the distance from the coordinate origin :math:`(0,0)` (top-left corner of the image). :math:`\theta` is the line rotation angle in radians ( :math:`0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}` ). :param lines: Output vector of lines. Each line is represented by a two-element vector :math:`(\rho, \theta)` . :math:`\rho` is the distance from the coordinate origin :math:`(0,0)` (top-left corner of the image). :math:`\theta` is the line rotation angle in radians ( :math:`0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}` ).
...@@ -356,6 +372,8 @@ Finds line segments in a binary image using the probabilistic Hough transform. ...@@ -356,6 +372,8 @@ Finds line segments in a binary image using the probabilistic Hough transform.
.. ocv:function:: void HoughLinesP( InputArray image, OutputArray lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 ) .. ocv:function:: void HoughLinesP( InputArray image, OutputArray lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 )
.. ocv:pyfunction:: cv2.HoughLinesP(image, rho, theta, threshold[, lines[, minLineLength[, maxLineGap]]]) -> lines
:param image: 8-bit, single-channel binary source image. The image may be modified by the function. :param image: 8-bit, single-channel binary source image. The image may be modified by the function.
:param lines: Output vector of lines. Each line is represented by a 4-element vector :math:`(x_1, y_1, x_2, y_2)` , where :math:`(x_1,y_1)` and :math:`(x_2, y_2)` are the ending points of each detected line segment. :param lines: Output vector of lines. Each line is represented by a 4-element vector :math:`(x_1, y_1, x_2, y_2)` , where :math:`(x_1,y_1)` and :math:`(x_2, y_2)` are the ending points of each detected line segment.
...@@ -443,8 +461,10 @@ Calculates a feature map for corner detection. ...@@ -443,8 +461,10 @@ Calculates a feature map for corner detection.
.. ocv:function:: void preCornerDetect( InputArray src, OutputArray dst, int apertureSize, int borderType=BORDER_DEFAULT ) .. ocv:function:: void preCornerDetect( InputArray src, OutputArray dst, int apertureSize, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.preCornerDetect(src, ksize[, dst[, borderType]]) -> dst
.. ocv:cfunction:: void cvPreCornerDetect( const CvArr* image, CvArr* corners, int apertureSize=3 ) .. ocv:cfunction:: void cvPreCornerDetect( const CvArr* image, CvArr* corners, int apertureSize=3 )
.. ocv:pyoldfunction:: PreCornerDetect(image, corners, apertureSize=3)-> None .. ocv:pyoldfunction:: cv.PreCornerDetect(image, corners, apertureSize=3)-> None
:param src: Source single-channel 8-bit of floating-point image. :param src: Source single-channel 8-bit of floating-point image.
......
...@@ -374,6 +374,8 @@ Applies the bilateral filter to an image. ...@@ -374,6 +374,8 @@ Applies the bilateral filter to an image.
.. ocv:function:: void bilateralFilter( InputArray src, OutputArray dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT ) .. ocv:function:: void bilateralFilter( InputArray src, OutputArray dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.bilateralFilter(src, d, sigmaColor, sigmaSpace[, dst[, borderType]]) -> dst
:param src: Source 8-bit or floating-point, 1-channel or 3-channel image. :param src: Source 8-bit or floating-point, 1-channel or 3-channel image.
:param dst: Destination image of the same size and type as ``src`` . :param dst: Destination image of the same size and type as ``src`` .
...@@ -403,6 +405,8 @@ Smoothes an image using the normalized box filter. ...@@ -403,6 +405,8 @@ Smoothes an image using the normalized box filter.
.. ocv:function:: void blur( InputArray src, OutputArray dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT ) .. ocv:function:: void blur( InputArray src, OutputArray dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.blur(src, ksize[, dst[, anchor[, borderType]]]) -> dst
:param src: Source image. :param src: Source image.
:param dst: Destination image of the same size and type as ``src`` . :param dst: Destination image of the same size and type as ``src`` .
...@@ -435,6 +439,8 @@ Computes the source location of an extrapolated pixel. ...@@ -435,6 +439,8 @@ Computes the source location of an extrapolated pixel.
.. ocv:function:: int borderInterpolate( int p, int len, int borderType ) .. ocv:function:: int borderInterpolate( int p, int len, int borderType )
.. ocv:pyfunction:: cv2.borderInterpolate(p, len, borderType) -> retval
:param p: 0-based coordinate of the extrapolated pixel along one of the axes, likely <0 or >= ``len`` . :param p: 0-based coordinate of the extrapolated pixel along one of the axes, likely <0 or >= ``len`` .
:param len: Length of the array along the corresponding axis. :param len: Length of the array along the corresponding axis.
...@@ -463,6 +469,8 @@ Smoothes an image using the box filter. ...@@ -463,6 +469,8 @@ Smoothes an image using the box filter.
.. ocv:function:: void boxFilter( InputArray src, OutputArray dst, int ddepth, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT ) .. ocv:function:: void boxFilter( InputArray src, OutputArray dst, int ddepth, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.boxFilter(src, ddepth, ksize[, dst[, anchor[, normalize[, borderType]]]]) -> dst
:param src: Source image. :param src: Source image.
:param dst: Destination image of the same size and type as ``src`` . :param dst: Destination image of the same size and type as ``src`` .
...@@ -523,8 +531,10 @@ Forms a border around an image. ...@@ -523,8 +531,10 @@ Forms a border around an image.
.. ocv:function:: void copyMakeBorder( InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, const Scalar& value=Scalar() ) .. ocv:function:: void copyMakeBorder( InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, const Scalar& value=Scalar() )
.. ocv:pyfunction:: cv2.copyMakeBorder(src, top, bottom, left, right, borderType[, dst[, value]]) -> dst
.. ocv:cfunction:: void cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset, int bordertype, CvScalar value=cvScalarAll(0) ) .. ocv:cfunction:: void cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset, int bordertype, CvScalar value=cvScalarAll(0) )
.. ocv:pyoldfunction:: CopyMakeBorder(src, dst, offset, bordertype, value=(0, 0, 0, 0))-> None .. ocv:pyoldfunction:: cv.CopyMakeBorder(src, dst, offset, bordertype, value=(0, 0, 0, 0))-> None
:param src: Source image. :param src: Source image.
...@@ -789,8 +799,10 @@ Dilates an image by using a specific structuring element. ...@@ -789,8 +799,10 @@ Dilates an image by using a specific structuring element.
.. ocv:function:: void dilate( InputArray src, OutputArray dst, InputArray element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() ) .. ocv:function:: void dilate( InputArray src, OutputArray dst, InputArray element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
.. ocv:pyfunction:: cv2.dilate(src, kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]]) -> dst
.. ocv:cfunction:: void cvDilate( const CvArr* src, CvArr* dst, IplConvKernel* element=NULL, int iterations=1 ) .. ocv:cfunction:: void cvDilate( const CvArr* src, CvArr* dst, IplConvKernel* element=NULL, int iterations=1 )
.. ocv:pyoldfunction:: Dilate(src, dst, element=None, iterations=1)-> None .. ocv:pyoldfunction:: cv.Dilate(src, dst, element=None, iterations=1)-> None
:param src: Source image. :param src: Source image.
...@@ -826,8 +838,10 @@ Erodes an image by using a specific structuring element. ...@@ -826,8 +838,10 @@ Erodes an image by using a specific structuring element.
.. ocv:function:: void erode( InputArray src, OutputArray dst, InputArray element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() ) .. ocv:function:: void erode( InputArray src, OutputArray dst, InputArray element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
.. ocv:pyfunction:: cv2.erode(src, kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]]) -> dst
.. ocv:cfunction:: void cvErode( const CvArr* src, CvArr* dst, IplConvKernel* element=NULL, int iterations=1) .. ocv:cfunction:: void cvErode( const CvArr* src, CvArr* dst, IplConvKernel* element=NULL, int iterations=1)
.. ocv:pyoldfunction:: Erode(src, dst, element=None, iterations=1)-> None .. ocv:pyoldfunction:: cv.Erode(src, dst, element=None, iterations=1)-> None
:param src: Source image. :param src: Source image.
...@@ -864,8 +878,10 @@ Convolves an image with the kernel. ...@@ -864,8 +878,10 @@ Convolves an image with the kernel.
.. ocv:function:: void filter2D( InputArray src, OutputArray dst, int ddepth, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT ) .. ocv:function:: void filter2D( InputArray src, OutputArray dst, int ddepth, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.filter2D(src, ddepth, kernel[, dst[, anchor[, delta[, borderType]]]]) -> dst
.. ocv:cfunction:: void cvFilter2D( const CvArr* src, CvArr* dst, const CvMat* kernel, CvPoint anchor=cvPoint(-1, -1)) .. ocv:cfunction:: void cvFilter2D( const CvArr* src, CvArr* dst, const CvMat* kernel, CvPoint anchor=cvPoint(-1, -1))
.. ocv:pyoldfunction:: Filter2D(src, dst, kernel, anchor=(-1, -1))-> None .. ocv:pyoldfunction:: cv.Filter2D(src, dst, kernel, anchor=(-1, -1))-> None
:param src: Source image. :param src: Source image.
...@@ -908,6 +924,8 @@ Smoothes an image using a Gaussian filter. ...@@ -908,6 +924,8 @@ Smoothes an image using a Gaussian filter.
.. ocv:function:: void GaussianBlur( InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT ) .. ocv:function:: void GaussianBlur( InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.GaussianBlur(src, ksize, sigma1[, dst[, sigma2[, borderType]]]) -> dst
:param src: Source image. :param src: Source image.
:param dst: Destination image of the same size and type as ``src`` . :param dst: Destination image of the same size and type as ``src`` .
...@@ -935,6 +953,8 @@ Returns filter coefficients for computing spatial image derivatives. ...@@ -935,6 +953,8 @@ Returns filter coefficients for computing spatial image derivatives.
.. ocv:function:: void getDerivKernels( OutputArray kx, OutputArray ky, int dx, int dy, int ksize, bool normalize=false, int ktype=CV_32F ) .. ocv:function:: void getDerivKernels( OutputArray kx, OutputArray ky, int dx, int dy, int ksize, bool normalize=false, int ktype=CV_32F )
.. ocv:pyfunction:: cv2.getDerivKernels(dx, dy, ksize[, kx[, ky[, normalize[, ktype]]]]) -> kx, ky
:param kx: Output matrix of row filter coefficients. It has the type ``ktype`` . :param kx: Output matrix of row filter coefficients. It has the type ``ktype`` .
:param ky: Output matrix of column filter coefficients. It has the type ``ktype`` . :param ky: Output matrix of column filter coefficients. It has the type ``ktype`` .
...@@ -964,6 +984,8 @@ Returns Gaussian filter coefficients. ...@@ -964,6 +984,8 @@ Returns Gaussian filter coefficients.
.. ocv:function:: Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F ) .. ocv:function:: Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F )
.. ocv:pyfunction:: cv2.getGaussianKernel(ksize, sigma[, ktype]) -> retval
:param ksize: Aperture size. It should be odd ( :math:`\texttt{ksize} \mod 2 = 1` ) and positive. :param ksize: Aperture size. It should be odd ( :math:`\texttt{ksize} \mod 2 = 1` ) and positive.
:param sigma: Gaussian standard deviation. If it is non-positive, it is computed from ``ksize`` as \ ``sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8`` . :param sigma: Gaussian standard deviation. If it is non-positive, it is computed from ``ksize`` as \ ``sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8`` .
...@@ -1024,6 +1046,8 @@ Returns a structuring element of the specified size and shape for morphological ...@@ -1024,6 +1046,8 @@ Returns a structuring element of the specified size and shape for morphological
.. ocv:function:: Mat getStructuringElement(int shape, Size esize, Point anchor=Point(-1,-1)) .. ocv:function:: Mat getStructuringElement(int shape, Size esize, Point anchor=Point(-1,-1))
.. ocv:pyfunction:: cv2.getStructuringElement(shape, ksize[, anchor]) -> retval
:param shape: Element shape that could be one of the following: :param shape: Element shape that could be one of the following:
* **MORPH_RECT** - a rectangular structuring element: * **MORPH_RECT** - a rectangular structuring element:
...@@ -1058,6 +1082,8 @@ Smoothes an image using the median filter. ...@@ -1058,6 +1082,8 @@ Smoothes an image using the median filter.
.. ocv:function:: void medianBlur( InputArray src, OutputArray dst, int ksize ) .. ocv:function:: void medianBlur( InputArray src, OutputArray dst, int ksize )
.. ocv:pyfunction:: cv2.medianBlur(src, ksize[, dst]) -> dst
:param src: Source 1-, 3-, or 4-channel image. When ``ksize`` is 3 or 5, the image depth should be ``CV_8U`` , ``CV_16U`` , or ``CV_32F`` . For larger aperture sizes, it can only be ``CV_8U`` . :param src: Source 1-, 3-, or 4-channel image. When ``ksize`` is 3 or 5, the image depth should be ``CV_8U`` , ``CV_16U`` , or ``CV_32F`` . For larger aperture sizes, it can only be ``CV_8U`` .
:param dst: Destination array of the same size and type as ``src`` . :param dst: Destination array of the same size and type as ``src`` .
...@@ -1081,8 +1107,10 @@ Performs advanced morphological transformations. ...@@ -1081,8 +1107,10 @@ Performs advanced morphological transformations.
.. ocv:function:: void morphologyEx( InputArray src, OutputArray dst, int op, InputArray element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() ) .. ocv:function:: void morphologyEx( InputArray src, OutputArray dst, int op, InputArray element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
.. ocv:pyfunction:: cv2.morphologyEx(src, op, kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]]) -> dst
.. ocv:cfunction:: void cvMorphologyEx( const CvArr* src, CvArr* dst, CvArr* temp, IplConvKernel* element, int operation, int iterations=1 ) .. ocv:cfunction:: void cvMorphologyEx( const CvArr* src, CvArr* dst, CvArr* temp, IplConvKernel* element, int operation, int iterations=1 )
.. ocv:pyoldfunction:: MorphologyEx(src, dst, temp, element, operation, iterations=1)-> None .. ocv:pyoldfunction:: cv.MorphologyEx(src, dst, temp, element, operation, iterations=1)-> None
:param src: Source image. :param src: Source image.
...@@ -1155,6 +1183,8 @@ Calculates the Laplacian of an image. ...@@ -1155,6 +1183,8 @@ Calculates the Laplacian of an image.
.. ocv:function:: void Laplacian( InputArray src, OutputArray dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT ) .. ocv:function:: void Laplacian( InputArray src, OutputArray dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.Laplacian(src, ddepth[, dst[, ksize[, scale[, delta[, borderType]]]]]) -> dst
:param src: Source image. :param src: Source image.
:param dst: Destination image of the same size and the same number of channels as ``src`` . :param dst: Destination image of the same size and the same number of channels as ``src`` .
...@@ -1194,8 +1224,10 @@ Smoothes an image and downsamples it. ...@@ -1194,8 +1224,10 @@ Smoothes an image and downsamples it.
.. ocv:function:: void pyrDown( InputArray src, OutputArray dst, const Size& dstsize=Size()) .. ocv:function:: void pyrDown( InputArray src, OutputArray dst, const Size& dstsize=Size())
.. ocv:pyfunction:: cv2.pyrDown(src[, dst[, dstsize]]) -> dst
.. ocv:cfunction:: void cvPyrDown( const CvArr* src, CvArr* dst, int filter=CV_GAUSSIAN_5x5 ) .. ocv:cfunction:: void cvPyrDown( const CvArr* src, CvArr* dst, int filter=CV_GAUSSIAN_5x5 )
.. ocv:pyoldfunction:: PyrDown(src, dst, filter=CV_GAUSSIAN_5X5)-> None .. ocv:pyoldfunction:: cv.PyrDown(src, dst, filter=CV_GAUSSIAN_5X5)-> None
:param src: Source image. :param src: Source image.
...@@ -1224,6 +1256,8 @@ Upsamples an image and then smoothes it. ...@@ -1224,6 +1256,8 @@ Upsamples an image and then smoothes it.
.. ocv:function:: void pyrUp( InputArray src, OutputArray dst, const Size& dstsize=Size()) .. ocv:function:: void pyrUp( InputArray src, OutputArray dst, const Size& dstsize=Size())
.. ocv:pyfunction:: cv2.pyrUp(src[, dst[, dstsize]]) -> dst
:param src: Source image. :param src: Source image.
:param dst: Destination image. It has the specified size and the same type as ``src`` . :param dst: Destination image. It has the specified size and the same type as ``src`` .
...@@ -1246,6 +1280,8 @@ Applies a separable linear filter to an image. ...@@ -1246,6 +1280,8 @@ Applies a separable linear filter to an image.
.. ocv:function:: void sepFilter2D( InputArray src, OutputArray dst, int ddepth, InputArray rowKernel, InputArray columnKernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT ) .. ocv:function:: void sepFilter2D( InputArray src, OutputArray dst, int ddepth, InputArray rowKernel, InputArray columnKernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.sepFilter2D(src, ddepth, kernelX, kernelY[, dst[, anchor[, delta[, borderType]]]]) -> dst
:param src: Source image. :param src: Source image.
:param dst: Destination image of the same size and the same number of channels as ``src`` . :param dst: Destination image of the same size and the same number of channels as ``src`` .
...@@ -1280,8 +1316,10 @@ Calculates the first, second, third, or mixed image derivatives using an extende ...@@ -1280,8 +1316,10 @@ Calculates the first, second, third, or mixed image derivatives using an extende
.. ocv:function:: void Sobel( InputArray src, OutputArray dst, int ddepth, int xorder, int yorder, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT ) .. ocv:function:: void Sobel( InputArray src, OutputArray dst, int ddepth, int xorder, int yorder, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.Sobel(src, ddepth, dx, dy[, dst[, ksize[, scale[, delta[, borderType]]]]]) -> dst
.. ocv:cfunction:: void cvSobel( const CvArr* src, CvArr* dst, int xorder, int yorder, int apertureSize=3 ) .. ocv:cfunction:: void cvSobel( const CvArr* src, CvArr* dst, int xorder, int yorder, int apertureSize=3 )
.. ocv:pyoldfunction:: Sobel(src, dst, xorder, yorder, apertureSize=3)-> None .. ocv:pyoldfunction:: cv.Sobel(src, dst, xorder, yorder, apertureSize=3)-> None
:param src: Source image. :param src: Source image.
...@@ -1356,6 +1394,8 @@ Calculates the first x- or y- image derivative using Scharr operator. ...@@ -1356,6 +1394,8 @@ Calculates the first x- or y- image derivative using Scharr operator.
.. ocv:function:: void Scharr( InputArray src, OutputArray dst, int ddepth, int xorder, int yorder, double scale=1, double delta=0, int borderType=BORDER_DEFAULT ) .. ocv:function:: void Scharr( InputArray src, OutputArray dst, int ddepth, int xorder, int yorder, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.Scharr(src, ddepth, dx, dy[, dst[, scale[, delta[, borderType]]]]) -> dst
:param src: Source image. :param src: Source image.
:param dst: Destination image of the same size and the same number of channels as ``src`` . :param dst: Destination image of the same size and the same number of channels as ``src`` .
......
...@@ -39,6 +39,8 @@ Converts image transformation maps from one representation to another. ...@@ -39,6 +39,8 @@ Converts image transformation maps from one representation to another.
.. ocv:function:: void convertMaps( InputArray map1, InputArray map2, OutputArray dstmap1, OutputArray dstmap2, int dstmap1type, bool nninterpolation=false ) .. ocv:function:: void convertMaps( InputArray map1, InputArray map2, OutputArray dstmap1, OutputArray dstmap2, int dstmap1type, bool nninterpolation=false )
.. ocv:pyfunction:: cv2.convertMaps(map1, map2, dstmap1type[, dstmap1[, dstmap2[, nninterpolation]]]) -> dstmap1, dstmap2
:param map1: The first input map of type ``CV_16SC2`` , ``CV_32FC1`` , or ``CV_32FC2`` . :param map1: The first input map of type ``CV_16SC2`` , ``CV_32FC1`` , or ``CV_32FC2`` .
:param map2: The second input map of type ``CV_16UC1`` , ``CV_32FC1`` , or none (empty matrix), respectively. :param map2: The second input map of type ``CV_16UC1`` , ``CV_32FC1`` , or none (empty matrix), respectively.
...@@ -77,8 +79,10 @@ Calculates an affine transform from three pairs of the corresponding points. ...@@ -77,8 +79,10 @@ Calculates an affine transform from three pairs of the corresponding points.
.. ocv:function:: Mat getAffineTransform( const Point2f src[], const Point2f dst[] ) .. ocv:function:: Mat getAffineTransform( const Point2f src[], const Point2f dst[] )
.. ocv:pyfunction:: cv2.getAffineTransform(src, dst) -> retval
.. ocv:cfunction:: CvMat* cvGetAffineTransform( const CvPoint2D32f* src, const CvPoint2D32f* dst, CvMat* mapMatrix ) .. ocv:cfunction:: CvMat* cvGetAffineTransform( const CvPoint2D32f* src, const CvPoint2D32f* dst, CvMat* mapMatrix )
.. ocv:pyoldfunction:: GetAffineTransform(src, dst, mapMatrix)-> None .. ocv:pyoldfunction:: cv.GetAffineTransform(src, dst, mapMatrix)-> None
:param src: Coordinates of triangle vertices in the source image. :param src: Coordinates of triangle vertices in the source image.
...@@ -110,8 +114,10 @@ Calculates a perspective transform from four pairs of the corresponding points. ...@@ -110,8 +114,10 @@ Calculates a perspective transform from four pairs of the corresponding points.
.. ocv:function:: Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] ) .. ocv:function:: Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] )
.. ocv:pyfunction:: cv2.getPerspectiveTransform(src, dst) -> retval
.. ocv:cfunction:: CvMat* cvGetPerspectiveTransform( const CvPoint2D32f* src, const CvPoint2D32f* dst, CvMat* mapMatrix ) .. ocv:cfunction:: CvMat* cvGetPerspectiveTransform( const CvPoint2D32f* src, const CvPoint2D32f* dst, CvMat* mapMatrix )
.. ocv:pyoldfunction:: GetPerspectiveTransform(src, dst, mapMatrix)-> None .. ocv:pyoldfunction:: cv.GetPerspectiveTransform(src, dst, mapMatrix)-> None
:param src: Coordinates of quadrangle vertices in the source image. :param src: Coordinates of quadrangle vertices in the source image.
...@@ -143,8 +149,10 @@ Retrieves a pixel rectangle from an image with sub-pixel accuracy. ...@@ -143,8 +149,10 @@ Retrieves a pixel rectangle from an image with sub-pixel accuracy.
.. ocv:function:: void getRectSubPix( InputArray image, Size patchSize, Point2f center, OutputArray dst, int patchType=-1 ) .. ocv:function:: void getRectSubPix( InputArray image, Size patchSize, Point2f center, OutputArray dst, int patchType=-1 )
.. ocv:pyfunction:: cv2.getRectSubPix(image, patchSize, center[, patch[, patchType]]) -> patch
.. ocv:cfunction:: void cvGetRectSubPix( const CvArr* src, CvArr* dst, CvPoint2D32f center ) .. ocv:cfunction:: void cvGetRectSubPix( const CvArr* src, CvArr* dst, CvPoint2D32f center )
.. ocv:pyoldfunction:: GetRectSubPix(src, dst, center)-> None .. ocv:pyoldfunction:: cv.GetRectSubPix(src, dst, center)-> None
:param src: Source image. :param src: Source image.
...@@ -181,7 +189,9 @@ Calculates an affine matrix of 2D rotation. ...@@ -181,7 +189,9 @@ Calculates an affine matrix of 2D rotation.
.. ocv:function:: Mat getRotationMatrix2D( Point2f center, double angle, double scale ) .. ocv:function:: Mat getRotationMatrix2D( Point2f center, double angle, double scale )
.. ocv:pyoldfunction:: GetRotationMatrix2D(center, angle, scale, mapMatrix)-> None .. ocv:pyfunction:: cv2.getRotationMatrix2D(center, angle, scale) -> retval
.. ocv:pyoldfunction:: cv.GetRotationMatrix2D(center, angle, scale, mapMatrix)-> None
:param center: Center of the rotation in the source image. :param center: Center of the rotation in the source image.
...@@ -218,6 +228,8 @@ Inverts an affine transformation. ...@@ -218,6 +228,8 @@ Inverts an affine transformation.
.. ocv:function:: void invertAffineTransform(InputArray M, OutputArray iM) .. ocv:function:: void invertAffineTransform(InputArray M, OutputArray iM)
.. ocv:pyfunction:: cv2.invertAffineTransform(M[, iM]) -> iM
:param M: Original affine transformation. :param M: Original affine transformation.
:param iM: Output reverse affine transformation. :param iM: Output reverse affine transformation.
...@@ -242,8 +254,10 @@ Applies a generic geometrical transformation to an image. ...@@ -242,8 +254,10 @@ Applies a generic geometrical transformation to an image.
.. ocv:function:: void remap( InputArray src, OutputArray dst, InputArray map1, InputArray map2, int interpolation, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar()) .. ocv:function:: void remap( InputArray src, OutputArray dst, InputArray map1, InputArray map2, int interpolation, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
.. ocv:pyfunction:: cv2.remap(src, map1, map2, interpolation[, dst[, borderMode[, borderValue]]]) -> dst
.. ocv:cfunction:: void cvRemap( const CvArr* src, CvArr* dst, const CvArr* mapx, const CvArr* mapy, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) ) .. ocv:cfunction:: void cvRemap( const CvArr* src, CvArr* dst, const CvArr* mapx, const CvArr* mapy, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
.. ocv:pyoldfunction:: Remap(src, dst, mapx, mapy, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None .. ocv:pyoldfunction:: cv.Remap(src, dst, mapx, mapy, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
:param src: Source image. :param src: Source image.
...@@ -287,8 +301,10 @@ Resizes an image. ...@@ -287,8 +301,10 @@ Resizes an image.
.. ocv:function:: void resize( InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR ) .. ocv:function:: void resize( InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR )
.. ocv:pyfunction:: cv2.resize(src, dsize[, dst[, fx[, fy[, interpolation]]]]) -> dst
.. ocv:cfunction:: void cvResize( const CvArr* src, CvArr* dst, int interpolation=CV_INTER_LINEAR ) .. ocv:cfunction:: void cvResize( const CvArr* src, CvArr* dst, int interpolation=CV_INTER_LINEAR )
.. ocv:pyoldfunction:: Resize(src, dst, interpolation=CV_INTER_LINEAR)-> None .. ocv:pyoldfunction:: cv.Resize(src, dst, interpolation=CV_INTER_LINEAR)-> None
:param src: Source image. :param src: Source image.
...@@ -355,8 +371,10 @@ Applies an affine transformation to an image. ...@@ -355,8 +371,10 @@ Applies an affine transformation to an image.
.. ocv:function:: void warpAffine( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar()) .. ocv:function:: void warpAffine( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
.. ocv:pyfunction:: cv2.warpAffine(src, M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) -> dst
.. ocv:cfunction:: void cvWarpAffine( const CvArr* src, CvArr* dst, const CvMat* mapMatrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) ) .. ocv:cfunction:: void cvWarpAffine( const CvArr* src, CvArr* dst, const CvMat* mapMatrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
.. ocv:pyoldfunction:: WarpAffine(src, dst, mapMatrix, flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None .. ocv:pyoldfunction:: cv.WarpAffine(src, dst, mapMatrix, flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
:param src: Source image. :param src: Source image.
...@@ -397,8 +415,10 @@ Applies a perspective transformation to an image. ...@@ -397,8 +415,10 @@ Applies a perspective transformation to an image.
.. ocv:function:: void warpPerspective( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar()) .. ocv:function:: void warpPerspective( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
.. ocv:pyfunction:: cv2.warpPerspective(src, M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) -> dst
.. ocv:cfunction:: void cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* mapMatrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) ) .. ocv:cfunction:: void cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* mapMatrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
.. ocv:pyoldfunction:: WarpPerspective(src, dst, mapMatrix, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None .. ocv:pyoldfunction:: cv.WarpPerspective(src, dst, mapMatrix, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
:param src: Source image. :param src: Source image.
...@@ -441,8 +461,10 @@ Computes the undistortion and rectification transformation map. ...@@ -441,8 +461,10 @@ Computes the undistortion and rectification transformation map.
.. ocv:function:: void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs, InputArray R, InputArray newCameraMatrix, Size size, int m1type, OutputArray map1, OutputArray map2 ) .. ocv:function:: void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs, InputArray R, InputArray newCameraMatrix, Size size, int m1type, OutputArray map1, OutputArray map2 )
.. ocv:pyfunction:: cv2.initUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, size, m1type[, map1[, map2]]) -> map1, map2
.. ocv:cfunction:: void cvInitUndistortRectifyMap( const CvMat* cameraMatrix, const CvMat* distCoeffs, const CvMat* R, const CvMat* newCameraMatrix, CvArr* map1, CvArr* map2 ) .. ocv:cfunction:: void cvInitUndistortRectifyMap( const CvMat* cameraMatrix, const CvMat* distCoeffs, const CvMat* R, const CvMat* newCameraMatrix, CvArr* map1, CvArr* map2 )
.. ocv:pyoldfunction:: InitUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, map1, map2)-> None .. ocv:pyoldfunction:: cv.InitUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, map1, map2)-> None
:param cameraMatrix: Input camera matrix :math:`A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}` . :param cameraMatrix: Input camera matrix :math:`A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}` .
...@@ -498,6 +520,8 @@ Returns the default new camera matrix. ...@@ -498,6 +520,8 @@ Returns the default new camera matrix.
.. ocv:function:: Mat getDefaultNewCameraMatrix(InputArray cameraMatrix, Size imgSize=Size(), bool centerPrincipalPoint=false ) .. ocv:function:: Mat getDefaultNewCameraMatrix(InputArray cameraMatrix, Size imgSize=Size(), bool centerPrincipalPoint=false )
.. ocv:pyfunction:: cv2.getDefaultNewCameraMatrix(cameraMatrix[, imgsize[, centerPrincipalPoint]]) -> retval
:param cameraMatrix: Input camera matrix. :param cameraMatrix: Input camera matrix.
:param imageSize: Camera view image size in pixels. :param imageSize: Camera view image size in pixels.
...@@ -531,6 +555,8 @@ Transforms an image to compensate for lens distortion. ...@@ -531,6 +555,8 @@ Transforms an image to compensate for lens distortion.
.. ocv:function:: void undistort( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray newCameraMatrix=noArray() ) .. ocv:function:: void undistort( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray newCameraMatrix=noArray() )
.. ocv:pyfunction:: cv2.undistort(src, cameraMatrix, distCoeffs[, dst[, newCameraMatrix]]) -> dst
:param src: Input (distorted) image. :param src: Input (distorted) image.
:param dst: Output (corrected) image that has the same size and type as ``src`` . :param dst: Output (corrected) image that has the same size and type as ``src`` .
...@@ -567,7 +593,7 @@ Computes the ideal point coordinates from the observed point coordinates. ...@@ -567,7 +593,7 @@ Computes the ideal point coordinates from the observed point coordinates.
.. ocv:function:: void undistortPoints( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray R=noArray(), InputArray P=noArray()) .. ocv:function:: void undistortPoints( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray R=noArray(), InputArray P=noArray())
.. ocv:cfunction:: void cvUndistortPoints( const CvMat* src, CvMat* dst, const CvMat* cameraMatrix, const CvMat* distCoeffs, const CvMat* R=NULL, const CvMat* P=NULL) .. ocv:cfunction:: void cvUndistortPoints( const CvMat* src, CvMat* dst, const CvMat* cameraMatrix, const CvMat* distCoeffs, const CvMat* R=NULL, const CvMat* P=NULL)
.. ocv:pyoldfunction:: UndistortPoints(src, dst, cameraMatrix, distCoeffs, R=None, P=None)-> None .. ocv:pyoldfunction:: cv.UndistortPoints(src, dst, cameraMatrix, distCoeffs, R=None, P=None)-> None
:param src: Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2). :param src: Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2).
......
...@@ -13,8 +13,10 @@ Calculates a histogram of a set of arrays. ...@@ -13,8 +13,10 @@ Calculates a histogram of a set of arrays.
.. ocv:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, InputArray mask, SparseMat& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false ) .. ocv:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, InputArray mask, SparseMat& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. ocv:pyfunction:: cv2.calcHist(images, channels, mask, histSize, ranges[, hist[, accumulate]]) -> hist
.. ocv:cfunction:: void cvCalcHist( IplImage** image, CvHistogram* hist, int accumulate=0, const CvArr* mask=NULL ) .. ocv:cfunction:: void cvCalcHist( IplImage** image, CvHistogram* hist, int accumulate=0, const CvArr* mask=NULL )
.. ocv:pyoldfunction:: CalcHist(image, hist, accumulate=0, mask=None)-> None .. ocv:pyoldfunction:: cv.CalcHist(image, hist, accumulate=0, mask=None)-> None
:param arrays: Source arrays. They all should have the same depth, ``CV_8U`` or ``CV_32F`` , and the same size. Each of them can have an arbitrary number of channels. :param arrays: Source arrays. They all should have the same depth, ``CV_8U`` or ``CV_32F`` , and the same size. Each of them can have an arbitrary number of channels.
...@@ -108,8 +110,10 @@ Calculates the back projection of a histogram. ...@@ -108,8 +110,10 @@ Calculates the back projection of a histogram.
.. ocv:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const SparseMat& hist, OutputArray backProject, const float** ranges, double scale=1, bool uniform=true ) .. ocv:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const SparseMat& hist, OutputArray backProject, const float** ranges, double scale=1, bool uniform=true )
.. ocv:pyfunction:: cv2.calcBackProject(images, channels, hist, ranges[, dst[, scale]]) -> dst
.. ocv:cfunction:: void cvCalcBackProject( IplImage** image, CvArr* backProject, const CvHistogram* hist ) .. ocv:cfunction:: void cvCalcBackProject( IplImage** image, CvArr* backProject, const CvHistogram* hist )
.. ocv:pyoldfunction:: CalcBackProject(image, backProject, hist)-> None .. ocv:pyoldfunction:: cv.CalcBackProject(image, backProject, hist)-> None
:param arrays: Source arrays. They all should have the same depth, ``CV_8U`` or ``CV_32F`` , and the same size. Each of them can have an arbitrary number of channels. :param arrays: Source arrays. They all should have the same depth, ``CV_8U`` or ``CV_32F`` , and the same size. Each of them can have an arbitrary number of channels.
...@@ -154,8 +158,10 @@ Compares two histograms. ...@@ -154,8 +158,10 @@ Compares two histograms.
.. ocv:function:: double compareHist( const SparseMat& H1, const SparseMat& H2, int method ) .. ocv:function:: double compareHist( const SparseMat& H1, const SparseMat& H2, int method )
.. ocv:pyfunction:: cv2.compareHist(H1, H2, method) -> retval
.. ocv:cfunction:: double cvCompareHist( const CvHistogram* hist1, const CvHistogram* hist2, int method ) .. ocv:cfunction:: double cvCompareHist( const CvHistogram* hist1, const CvHistogram* hist2, int method )
.. ocv:pyoldfunction:: CompareHist(hist1, hist2, method)->float .. ocv:pyoldfunction:: cv.CompareHist(hist1, hist2, method)->float
:param H1: The first compared histogram. :param H1: The first compared histogram.
...@@ -243,6 +249,8 @@ Equalizes the histogram of a grayscale image. ...@@ -243,6 +249,8 @@ Equalizes the histogram of a grayscale image.
.. ocv:function:: void equalizeHist( InputArray src, OutputArray dst ) .. ocv:function:: void equalizeHist( InputArray src, OutputArray dst )
.. ocv:pyfunction:: cv2.equalizeHist(src[, dst]) -> dst
:param src: Source 8-bit single channel image. :param src: Source 8-bit single channel image.
:param dst: Destination image of the same size and type as ``src`` . :param dst: Destination image of the same size and type as ``src`` .
......
...@@ -10,8 +10,10 @@ Applies an adaptive threshold to an array. ...@@ -10,8 +10,10 @@ Applies an adaptive threshold to an array.
.. ocv:function:: void adaptiveThreshold( InputArray src, OutputArray dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C ) .. ocv:function:: void adaptiveThreshold( InputArray src, OutputArray dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C )
.. ocv:pyfunction:: cv2.adaptiveThreshold(src, maxValue, adaptiveMethod, thresholdType, blockSize, C[, dst]) -> dst
.. ocv:cfunction:: void cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double maxValue, int adaptiveMethod=CV_ADAPTIVE_THRESH_MEAN_C, int thresholdType=CV_THRESH_BINARY, int blockSize=3, double param1=5 ) .. ocv:cfunction:: void cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double maxValue, int adaptiveMethod=CV_ADAPTIVE_THRESH_MEAN_C, int thresholdType=CV_THRESH_BINARY, int blockSize=3, double param1=5 )
.. ocv:pyoldfunction:: AdaptiveThreshold(src, dst, maxValue, adaptiveMethod=CV_ADAPTIVE_THRESH_MEAN_C, thresholdType=CV_THRESH_BINARY, blockSize=3, param1=5)-> None .. ocv:pyoldfunction:: cv.AdaptiveThreshold(src, dst, maxValue, adaptiveMethod=CV_ADAPTIVE_THRESH_MEAN_C, thresholdType=CV_THRESH_BINARY, blockSize=3, param1=5)-> None
:param src: Source 8-bit single-channel image. :param src: Source 8-bit single-channel image.
...@@ -71,8 +73,10 @@ Converts an image from one color space to another. ...@@ -71,8 +73,10 @@ Converts an image from one color space to another.
.. ocv:function:: void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 ) .. ocv:function:: void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 )
.. ocv:pyfunction:: cv2.cvtColor(src, code[, dst[, dstCn]]) -> dst
.. ocv:cfunction:: void cvCvtColor( const CvArr* src, CvArr* dst, int code ) .. ocv:cfunction:: void cvCvtColor( const CvArr* src, CvArr* dst, int code )
.. ocv:pyoldfunction:: CvtColor(src, dst, code)-> None .. ocv:pyoldfunction:: cv.CvtColor(src, dst, code)-> None
:param src: Source image: 8-bit unsigned, 16-bit unsigned ( ``CV_16UC...`` ), or single-precision floating-point. :param src: Source image: 8-bit unsigned, 16-bit unsigned ( ``CV_16UC...`` ), or single-precision floating-point.
...@@ -408,6 +412,8 @@ Calculates the distance to the closest zero pixel for each pixel of the source i ...@@ -408,6 +412,8 @@ Calculates the distance to the closest zero pixel for each pixel of the source i
.. ocv:function:: void distanceTransform( InputArray src, OutputArray dst, OutputArray labels, int distanceType, int maskSize ) .. ocv:function:: void distanceTransform( InputArray src, OutputArray dst, OutputArray labels, int distanceType, int maskSize )
.. ocv:pyfunction:: cv2.distanceTransform(src, distanceType, maskSize[, dst[, labels]]) -> dst, labels
:param src: 8-bit, single-channel (binary) source image. :param src: 8-bit, single-channel (binary) source image.
:param dst: Output image with calculated distances. It is a 32-bit floating-point, single-channel image of the same size as ``src`` . :param dst: Output image with calculated distances. It is a 32-bit floating-point, single-channel image of the same size as ``src`` .
...@@ -476,8 +482,10 @@ Fills a connected component with the given color. ...@@ -476,8 +482,10 @@ Fills a connected component with the given color.
.. ocv:function:: int floodFill( InputOutputArray image, InputOutputArray mask, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 ) .. ocv:function:: int floodFill( InputOutputArray image, InputOutputArray mask, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. ocv:pyfunction:: cv2.floodFill(image, mask, seedPoint, newVal[, loDiff[, upDiff[, flags]]]) -> retval, rect
.. ocv:cfunction:: void cvFloodFill( CvArr* image, CvPoint seedPoint, CvScalar newVal, CvScalar loDiff=cvScalarAll(0), CvScalar upDiff=cvScalarAll(0), CvConnectedComp* comp=NULL, int flags=4, CvArr* mask=NULL ) .. ocv:cfunction:: void cvFloodFill( CvArr* image, CvPoint seedPoint, CvScalar newVal, CvScalar loDiff=cvScalarAll(0), CvScalar upDiff=cvScalarAll(0), CvConnectedComp* comp=NULL, int flags=4, CvArr* mask=NULL )
.. ocv:pyoldfunction:: FloodFill(image, seedPoint, newVal, loDiff=(0, 0, 0, 0), upDiff=(0, 0, 0, 0), flags=4, mask=None)-> comp .. ocv:pyoldfunction:: cv.FloodFill(image, seedPoint, newVal, loDiff=(0, 0, 0, 0), upDiff=(0, 0, 0, 0), flags=4, mask=None)-> comp
:param image: Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the function unless the ``FLOODFILL_MASK_ONLY`` flag is set in the second variant of the function. See the details below. :param image: Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the function unless the ``FLOODFILL_MASK_ONLY`` flag is set in the second variant of the function. See the details below.
...@@ -579,8 +587,10 @@ Restores the selected region in an image using the region neighborhood. ...@@ -579,8 +587,10 @@ Restores the selected region in an image using the region neighborhood.
.. ocv:function:: void inpaint( InputArray src, InputArray inpaintMask, OutputArray dst, double inpaintRadius, int flags ) .. ocv:function:: void inpaint( InputArray src, InputArray inpaintMask, OutputArray dst, double inpaintRadius, int flags )
.. ocv:pyfunction:: cv2.inpaint(src, inpaintMask, inpaintRange, flags[, dst]) -> dst
.. ocv:cfunction:: void cvInpaint( const CvArr* src, const CvArr* mask, CvArr* dst, double inpaintRadius, int flags) .. ocv:cfunction:: void cvInpaint( const CvArr* src, const CvArr* mask, CvArr* dst, double inpaintRadius, int flags)
.. ocv:pyoldfunction:: Inpaint(src, mask, dst, inpaintRadius, flags) -> None .. ocv:pyoldfunction:: cv.Inpaint(src, mask, dst, inpaintRadius, flags) -> None
:param src: Input 8-bit 1-channel or 3-channel image. :param src: Input 8-bit 1-channel or 3-channel image.
...@@ -612,8 +622,10 @@ Calculates the integral of an image. ...@@ -612,8 +622,10 @@ Calculates the integral of an image.
.. ocv:function:: void integral( InputArray image, OutputArray sum, OutputArray sqsum, OutputArray tilted, int sdepth=-1 ) .. ocv:function:: void integral( InputArray image, OutputArray sum, OutputArray sqsum, OutputArray tilted, int sdepth=-1 )
.. ocv:pyfunction:: cv2.integral(src[, sum[, sdepth]]) -> sum
.. ocv:cfunction:: void cvIntegral( const CvArr* image, CvArr* sum, CvArr* sqsum=NULL, CvArr* tiltedSum=NULL ) .. ocv:cfunction:: void cvIntegral( const CvArr* image, CvArr* sum, CvArr* sqsum=NULL, CvArr* tiltedSum=NULL )
.. ocv:pyoldfunction:: Integral(image, sum, sqsum=None, tiltedSum=None)-> None .. ocv:pyoldfunction:: cv.Integral(image, sum, sqsum=None, tiltedSum=None)-> None
:param image: Source image as :math:`W \times H` , 8-bit or floating-point (32f or 64f). :param image: Source image as :math:`W \times H` , 8-bit or floating-point (32f or 64f).
...@@ -661,8 +673,10 @@ Applies a fixed-level threshold to each array element. ...@@ -661,8 +673,10 @@ Applies a fixed-level threshold to each array element.
.. ocv:function:: double threshold( InputArray src, OutputArray dst, double thresh, double maxVal, int thresholdType ) .. ocv:function:: double threshold( InputArray src, OutputArray dst, double thresh, double maxVal, int thresholdType )
.. ocv:pyfunction:: cv2.threshold(src, thresh, maxval, type[, dst]) -> retval, dst
.. ocv:cfunction:: double cvThreshold( const CvArr* src, CvArr* dst, double threshold, double maxValue, int thresholdType ) .. ocv:cfunction:: double cvThreshold( const CvArr* src, CvArr* dst, double threshold, double maxValue, int thresholdType )
.. ocv:pyoldfunction:: Threshold(src, dst, threshold, maxValue, thresholdType)-> None .. ocv:pyoldfunction:: cv.Threshold(src, dst, threshold, maxValue, thresholdType)-> None
:param src: Source array (single-channel, 8-bit of 32-bit floating point) :param src: Source array (single-channel, 8-bit of 32-bit floating point)
...@@ -735,6 +749,8 @@ Performs a marker-based image segmentation using the watershed algrorithm. ...@@ -735,6 +749,8 @@ Performs a marker-based image segmentation using the watershed algrorithm.
.. ocv:function:: void watershed( InputArray image, InputOutputArray markers ) .. ocv:function:: void watershed( InputArray image, InputOutputArray markers )
.. ocv:pyfunction:: cv2.watershed(image, markers) -> None
:param image: Input 8-bit 3-channel image. :param image: Input 8-bit 3-channel image.
:param markers: Input/output 32-bit single-channel image (map) of markers. It should have the same size as ``image`` . :param markers: Input/output 32-bit single-channel image (map) of markers. It should have the same size as ``image`` .
...@@ -773,6 +789,8 @@ Runs the GrabCut algorithm. ...@@ -773,6 +789,8 @@ Runs the GrabCut algorithm.
.. ocv:function:: void grabCut(InputArray image, InputOutputArray mask, Rect rect, InputOutputArray bgdModel, InputOutputArray fgdModel, int iterCount, int mode ) .. ocv:function:: void grabCut(InputArray image, InputOutputArray mask, Rect rect, InputOutputArray bgdModel, InputOutputArray fgdModel, int iterCount, int mode )
.. ocv:pyfunction:: cv2.grabCut(img, mask, rect, bgdModel, fgdModel, iterCount[, mode]) -> None
:param image: Input 8-bit 3-channel image. :param image: Input 8-bit 3-channel image.
:param mask: Input/output 8-bit single-channel mask. The mask is initialized by the function when ``mode`` is set to ``GC_INIT_WITH_RECT``. Its elements may have one of following values: :param mask: Input/output 8-bit single-channel mask. The mask is initialized by the function when ``mode`` is set to ``GC_INIT_WITH_RECT``. Its elements may have one of following values:
......
...@@ -9,6 +9,8 @@ Adds an image to the accumulator. ...@@ -9,6 +9,8 @@ Adds an image to the accumulator.
.. ocv:function:: void accumulate( InputArray src, InputOutputArray dst, InputArray mask=noArray() ) .. ocv:function:: void accumulate( InputArray src, InputOutputArray dst, InputArray mask=noArray() )
.. ocv:pyfunction:: cv2.accumulate(src, dst[, mask]) -> dst
:param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point. :param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
:param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point. :param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point.
...@@ -38,6 +40,8 @@ Adds the square of a source image to the accumulator. ...@@ -38,6 +40,8 @@ Adds the square of a source image to the accumulator.
.. ocv:function:: void accumulateSquare( InputArray src, InputOutputArray dst, InputArray mask=noArray() ) .. ocv:function:: void accumulateSquare( InputArray src, InputOutputArray dst, InputArray mask=noArray() )
.. ocv:pyfunction:: cv2.accumulateSquare(src, dst[, mask]) -> dst
:param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point. :param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
:param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point. :param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point.
...@@ -65,6 +69,8 @@ Adds the per-element product of two input images to the accumulator. ...@@ -65,6 +69,8 @@ Adds the per-element product of two input images to the accumulator.
.. ocv:function:: void accumulateProduct( InputArray src1, InputArray src2, InputOutputArray dst, InputArray mask=noArray() ) .. ocv:function:: void accumulateProduct( InputArray src1, InputArray src2, InputOutputArray dst, InputArray mask=noArray() )
.. ocv:pyfunction:: cv2.accumulateProduct(src1, src2, dst[, mask]) -> dst
:param src1: First input image, 1- or 3-channel, 8-bit or 32-bit floating point. :param src1: First input image, 1- or 3-channel, 8-bit or 32-bit floating point.
:param src2: Second input image of the same type and the same size as ``src1`` . :param src2: Second input image of the same type and the same size as ``src1`` .
...@@ -94,6 +100,8 @@ Updates a running average. ...@@ -94,6 +100,8 @@ Updates a running average.
.. ocv:function:: void accumulateWeighted( InputArray src, InputOutputArray dst, double alpha, InputArray mask=noArray() ) .. ocv:function:: void accumulateWeighted( InputArray src, InputOutputArray dst, double alpha, InputArray mask=noArray() )
.. ocv:pyfunction:: cv2.accumulateWeighted(src, dst, alpha[, mask]) -> dst
:param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point. :param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
:param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point. :param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point.
......
...@@ -9,8 +9,10 @@ Compares a template against overlapped image regions. ...@@ -9,8 +9,10 @@ Compares a template against overlapped image regions.
.. ocv:function:: void matchTemplate( InputArray image, InputArray temp, OutputArray result, int method ) .. ocv:function:: void matchTemplate( InputArray image, InputArray temp, OutputArray result, int method )
.. ocv:pyfunction:: cv2.matchTemplate(image, templ, method[, result]) -> result
.. ocv:cfunction:: void cvMatchTemplate( const CvArr* image, const CvArr* templ, CvArr* result, int method ) .. ocv:cfunction:: void cvMatchTemplate( const CvArr* image, const CvArr* templ, CvArr* result, int method )
.. ocv:pyoldfunction:: MatchTemplate(image, templ, result, method)-> None .. ocv:pyoldfunction:: cv.MatchTemplate(image, templ, result, method)-> None
:param image: Image where the search is running. It must be 8-bit or 32-bit floating-point. :param image: Image where the search is running. It must be 8-bit or 32-bit floating-point.
......
...@@ -9,8 +9,10 @@ Calculates all of the moments up to the third order of a polygon or rasterized s ...@@ -9,8 +9,10 @@ Calculates all of the moments up to the third order of a polygon or rasterized s
.. ocv:function:: Moments moments( InputArray array, bool binaryImage=false ) .. ocv:function:: Moments moments( InputArray array, bool binaryImage=false )
.. ocv:pyfunction:: cv2.moments(array[, binaryImage]) -> retval
.. ocv:cfunction:: void cvMoments( const CvArr* arr, CvMoments* moments, int binary=0 ) .. ocv:cfunction:: void cvMoments( const CvArr* arr, CvMoments* moments, int binary=0 )
.. ocv:pyoldfunction:: Moments(arr, binary=0) -> moments .. ocv:pyoldfunction:: cv.Moments(arr, binary=0) -> moments
: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`` ). :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`` ).
...@@ -86,6 +88,8 @@ Calculates the seven Hu invariants. ...@@ -86,6 +88,8 @@ Calculates the seven Hu invariants.
.. ocv:function:: void HuMoments( const Moments& moments, double h[7] ) .. ocv:function:: void HuMoments( const Moments& moments, double h[7] )
.. ocv:pyfunction:: cv2.HuMoments(m) -> hu
:param moments: Input moments computed with :ocv:func:`moments` . :param moments: Input moments computed with :ocv:func:`moments` .
:param h: Output Hu invariants. :param h: Output Hu invariants.
...@@ -116,7 +120,7 @@ Finds contours in a binary image. ...@@ -116,7 +120,7 @@ Finds contours in a binary image.
.. ocv:function:: void findContours( InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point()) .. ocv:function:: void findContours( InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point())
.. ocv:cfunction:: int cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** firstContour, int headerSize=sizeof(CvContour), int mode=CV_RETR_LIST, int method=CV_CHAIN_APPROX_SIMPLE, CvPoint offset=cvPoint(0, 0) ) .. ocv:cfunction:: int cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** firstContour, int headerSize=sizeof(CvContour), int mode=CV_RETR_LIST, int method=CV_CHAIN_APPROX_SIMPLE, CvPoint offset=cvPoint(0, 0) )
.. ocv:pyoldfunction:: FindContours(image, storage, mode=CV_RETR_LIST, method=CV_CHAIN_APPROX_SIMPLE, offset=(0, 0)) -> cvseq .. ocv:pyoldfunction:: cv.FindContours(image, storage, mode=CV_RETR_LIST, method=CV_CHAIN_APPROX_SIMPLE, offset=(0, 0)) -> cvseq
:param image: Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero pixels remain 0's, so the image is treated as ``binary`` . You can use :ocv:func:`compare` , :ocv:func:`inRange` , :ocv:func:`threshold` , :ocv:func:`adaptiveThreshold` , :ocv:func:`Canny` , and others to create a binary image out of a grayscale or color one. The function modifies the ``image`` while extracting the contours. :param image: Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero pixels remain 0's, so the image is treated as ``binary`` . You can use :ocv:func:`compare` , :ocv:func:`inRange` , :ocv:func:`threshold` , :ocv:func:`adaptiveThreshold` , :ocv:func:`Canny` , and others to create a binary image out of a grayscale or color one. The function modifies the ``image`` while extracting the contours.
...@@ -159,8 +163,10 @@ Draws contours outlines or filled contours. ...@@ -159,8 +163,10 @@ Draws contours outlines or filled contours.
.. ocv:function:: void drawContours( InputOutputArray image, InputArrayOfArrays contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, InputArray hierarchy=noArray(), int maxLevel=INT_MAX, Point offset=Point() ) .. ocv:function:: void drawContours( InputOutputArray image, InputArrayOfArrays contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, InputArray hierarchy=noArray(), int maxLevel=INT_MAX, Point offset=Point() )
.. ocv:pyfunction:: cv2.drawContours(image, contours, contourIdx, color[, thickness[, lineType[, hierarchy[, maxLevel[, offset]]]]]) -> None
.. ocv:cfunction:: void cvDrawContours( CvArr *img, CvSeq* contour, CvScalar externalColor, CvScalar holeColor, int maxLevel, int thickness=1, int lineType=8 ) .. ocv:cfunction:: void cvDrawContours( CvArr *img, CvSeq* contour, CvScalar externalColor, CvScalar holeColor, int maxLevel, int thickness=1, int lineType=8 )
.. ocv:pyoldfunction:: DrawContours(img, contour, externalColor, holeColor, maxLevel, thickness=1, lineType=8, offset=(0, 0))-> None .. ocv:pyoldfunction:: cv.DrawContours(img, contour, externalColor, holeColor, maxLevel, thickness=1, lineType=8, offset=(0, 0))-> None
:param image: Destination image. :param image: Destination image.
...@@ -233,6 +239,8 @@ Approximates a polygonal curve(s) with the specified precision. ...@@ -233,6 +239,8 @@ Approximates a polygonal curve(s) with the specified precision.
.. ocv:function:: void approxPolyDP( InputArray curve, OutputArray approxCurve, double epsilon, bool closed ) .. ocv:function:: void approxPolyDP( InputArray curve, OutputArray approxCurve, double epsilon, bool closed )
.. ocv:pyfunction:: cv2.approxPolyDP(curve, epsilon, closed[, approxCurve]) -> approxCurve
:param curve: Input vector of 2d point, stored in ``std::vector`` or ``Mat``. :param curve: Input vector of 2d point, stored in ``std::vector`` or ``Mat``.
:param approxCurve: Result of the approximation. The type should match the type of the input curve. :param approxCurve: Result of the approximation. The type should match the type of the input curve.
...@@ -254,8 +262,10 @@ Calculates a contour perimeter or a curve length. ...@@ -254,8 +262,10 @@ Calculates a contour perimeter or a curve length.
.. ocv:function:: double arcLength( InputArray curve, bool closed ) .. ocv:function:: double arcLength( InputArray curve, bool closed )
.. ocv:pyfunction:: cv2.arcLength(curve, closed) -> retval
.. ocv:cfunction:: double cvArcLength( const void* curve, CvSlice slice=CV_WHOLE_SEQ, int isClosed=-1 ) .. ocv:cfunction:: double cvArcLength( const void* curve, CvSlice slice=CV_WHOLE_SEQ, int isClosed=-1 )
.. ocv:pyoldfunction:: ArcLength(curve, slice=CV_WHOLE_SEQ, isClosed=-1)-> double .. ocv:pyoldfunction:: cv.ArcLength(curve, slice=CV_WHOLE_SEQ, isClosed=-1)-> double
:param curve: Input vector of 2D points, stored in ``std::vector`` or ``Mat``. :param curve: Input vector of 2D points, stored in ``std::vector`` or ``Mat``.
...@@ -271,8 +281,10 @@ Calculates the up-right bounding rectangle of a point set. ...@@ -271,8 +281,10 @@ Calculates the up-right bounding rectangle of a point set.
.. ocv:function:: Rect boundingRect( InputArray points ) .. ocv:function:: Rect boundingRect( InputArray points )
.. ocv:pyfunction:: cv2.boundingRect(points) -> retval
.. ocv:cfunction:: CvRect cvBoundingRect( CvArr* points, int update=0 ) .. ocv:cfunction:: CvRect cvBoundingRect( CvArr* points, int update=0 )
.. ocv:pyoldfunction:: BoundingRect(points, update=0)-> CvRect .. ocv:pyoldfunction:: cv.BoundingRect(points, update=0)-> CvRect
:param points: Input 2D point set, stored in ``std::vector`` or ``Mat``. :param points: Input 2D point set, stored in ``std::vector`` or ``Mat``.
...@@ -287,8 +299,10 @@ Calculates a contour area. ...@@ -287,8 +299,10 @@ Calculates a contour area.
.. ocv:function:: double contourArea( InputArray contour, bool oriented=false ) .. ocv:function:: double contourArea( InputArray contour, bool oriented=false )
.. ocv:pyfunction:: cv2.contourArea(contour[, oriented]) -> retval
.. ocv:cfunction:: double cvContourArea( const CvArr* contour, CvSlice slice=CV_WHOLE_SEQ ) .. ocv:cfunction:: double cvContourArea( const CvArr* contour, CvSlice slice=CV_WHOLE_SEQ )
.. ocv:pyoldfunction:: ContourArea(contour, slice=CV_WHOLE_SEQ)-> double .. ocv:pyoldfunction:: cv.ContourArea(contour, slice=CV_WHOLE_SEQ)-> double
:param contour: Input vector of 2d points (contour vertices), stored in ``std::vector`` or ``Mat``. :param contour: Input vector of 2d points (contour vertices), stored in ``std::vector`` or ``Mat``.
:param orientation: Oriented area flag. If it is true, the function returns a signed area value, depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can determine orientation of a contour by taking sign of the area. By default the parameter is ``false``, which means that the absolute value is returned. :param orientation: Oriented area flag. If it is true, the function returns a signed area value, depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can determine orientation of a contour by taking sign of the area. By default the parameter is ``false``, which means that the absolute value is returned.
...@@ -322,6 +336,8 @@ Finds the convex hull of a point set. ...@@ -322,6 +336,8 @@ Finds the convex hull of a point set.
.. ocv:function:: void convexHull( InputArray points, OutputArray hull, bool clockwise=false, bool returnPoints=true ) .. ocv:function:: void convexHull( InputArray points, OutputArray hull, bool clockwise=false, bool returnPoints=true )
.. ocv:pyfunction:: cv2.convexHull(points[, hull[, returnPoints[, clockwise]]]) -> hull
:param points: Input 2D point set, stored in ``std::vector`` or ``Mat``. :param points: Input 2D point set, stored in ``std::vector`` or ``Mat``.
:param hull: Output convex hull. It is either an integer vector of indices or vector of points. In the first case the ``hull`` elements are 0-based indices of the convex hull points in the original array (since the set of convex hull points is a subset of the original point set). In the second case ``hull`` elements will be the convex hull points themselves. :param hull: Output convex hull. It is either an integer vector of indices or vector of points. In the first case the ``hull`` elements are 0-based indices of the convex hull points in the original array (since the set of convex hull points is a subset of the original point set). In the second case ``hull`` elements will be the convex hull points themselves.
...@@ -343,6 +359,8 @@ Fits an ellipse around a set of 2D points. ...@@ -343,6 +359,8 @@ Fits an ellipse around a set of 2D points.
.. ocv:function:: RotatedRect fitEllipse( InputArray points ) .. ocv:function:: RotatedRect fitEllipse( InputArray points )
.. ocv:pyfunction:: cv2.fitEllipse(points) -> retval
:param points: Input vector of 2D points, stored in ``std::vector<>`` or ``Mat``. :param points: Input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
The function calculates the ellipse that fits (in least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed. The function calculates the ellipse that fits (in least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed.
...@@ -355,8 +373,10 @@ Fits a line to a 2D or 3D point set. ...@@ -355,8 +373,10 @@ Fits a line to a 2D or 3D point set.
.. ocv:function:: void fitLine( InputArray points, OutputArray line, int distType, double param, double reps, double aeps ) .. ocv:function:: void fitLine( InputArray points, OutputArray line, int distType, double param, double reps, double aeps )
.. ocv:pyfunction:: cv2.fitLine(points, distType, param, reps, aeps) -> line
.. ocv:cfunction:: void cvFitLine( const CvArr* points, int distType, double param, double reps, double aeps, float* line ) .. ocv:cfunction:: void cvFitLine( const CvArr* points, int distType, double param, double reps, double aeps, float* line )
.. ocv:pyoldfunction:: FitLine(points, distType, param, reps, aeps) -> line .. ocv:pyoldfunction:: cv.FitLine(points, distType, param, reps, aeps) -> line
:param points: Input vector of 2D or 3D points, stored in ``std::vector<>`` or ``Mat``. :param points: Input vector of 2D or 3D points, stored in ``std::vector<>`` or ``Mat``.
...@@ -424,6 +444,8 @@ Tests a contour convexity. ...@@ -424,6 +444,8 @@ Tests a contour convexity.
.. ocv:function:: bool isContourConvex( InputArray contour ) .. ocv:function:: bool isContourConvex( InputArray contour )
.. ocv:pyfunction:: cv2.isContourConvex(contour) -> retval
:param contour: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``. :param contour: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
The function tests whether the input contour is convex or not. The contour must be simple, that is, without self-intersections. Otherwise, the function output is undefined. The function tests whether the input contour is convex or not. The contour must be simple, that is, without self-intersections. Otherwise, the function output is undefined.
...@@ -436,6 +458,8 @@ Finds a rotated rectangle of the minimum area enclosing the input 2D point set. ...@@ -436,6 +458,8 @@ Finds a rotated rectangle of the minimum area enclosing the input 2D point set.
.. ocv:function:: RotatedRect minAreaRect( InputArray points ) .. ocv:function:: RotatedRect minAreaRect( InputArray points )
.. ocv:pyfunction:: cv2.minAreaRect(points) -> retval
:param points: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``. :param points: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a specified point set. See the OpenCV sample ``minarea.cpp`` . The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a specified point set. See the OpenCV sample ``minarea.cpp`` .
...@@ -448,8 +472,10 @@ Finds a circle of the minimum area enclosing a 2D point set. ...@@ -448,8 +472,10 @@ Finds a circle of the minimum area enclosing a 2D point set.
.. ocv:function:: void minEnclosingCircle( InputArray points, Point2f& center, float& radius ) .. ocv:function:: void minEnclosingCircle( InputArray points, Point2f& center, float& radius )
.. ocv:pyfunction:: cv2.minEnclosingCircle(points, center, radius) -> None
.. ocv:cfunction:: int cvMinEnclosingCircle( const CvArr* points, CvPoint2D32f* center, float* radius ) .. ocv:cfunction:: int cvMinEnclosingCircle( const CvArr* points, CvPoint2D32f* center, float* radius )
.. ocv:pyoldfunction:: MinEnclosingCircle(points)-> (int, center, radius) .. ocv:pyoldfunction:: cv.MinEnclosingCircle(points)-> (int, center, radius)
:param points: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``. :param points: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
...@@ -467,8 +493,10 @@ Compares two shapes. ...@@ -467,8 +493,10 @@ Compares two shapes.
.. ocv:function:: double matchShapes( InputArray object1, InputArray object2, int method, double parameter=0 ) .. ocv:function:: double matchShapes( InputArray object1, InputArray object2, int method, double parameter=0 )
.. ocv:pyfunction:: cv2.matchShapes(contour1, contour2, method, parameter) -> retval
.. ocv:cfunction:: double cvMatchShapes( const void* object1, const void* object2, int method, double parameter=0 ) .. ocv:cfunction:: double cvMatchShapes( const void* object1, const void* object2, int method, double parameter=0 )
.. ocv:pyoldfunction:: MatchShapes(object1, object2, method, parameter=0)-> None .. ocv:pyoldfunction:: cv.MatchShapes(object1, object2, method, parameter=0)-> None
:param object1: The first contour or grayscale image. :param object1: The first contour or grayscale image.
...@@ -520,8 +548,10 @@ Performs a point-in-contour test. ...@@ -520,8 +548,10 @@ Performs a point-in-contour test.
.. ocv:function:: double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist ) .. ocv:function:: double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist )
.. ocv:pyfunction:: cv2.pointPolygonTest(contour, pt, measureDist) -> retval
.. ocv:cfunction:: double cvPointPolygonTest( const CvArr* contour, CvPoint2D32f pt, int measureDist ) .. ocv:cfunction:: double cvPointPolygonTest( const CvArr* contour, CvPoint2D32f pt, int measureDist )
.. ocv:pyoldfunction:: PointPolygonTest(contour, pt, measureDist)-> double .. ocv:pyoldfunction:: cv.PointPolygonTest(contour, pt, measureDist)-> double
:param contour: Input contour. :param contour: Input contour.
......
...@@ -146,6 +146,8 @@ Trains a boosted tree classifier. ...@@ -146,6 +146,8 @@ Trains a boosted tree classifier.
.. ocv:function:: bool CvBoost::train( const Mat& trainData, int tflag, const Mat& responses, const Mat& varIdx=Mat(), const Mat& sampleIdx=Mat(), const Mat& varType=Mat(), const Mat& missingDataMask=Mat(), CvBoostParams params=CvBoostParams(), bool update=false ) .. ocv:function:: bool CvBoost::train( const Mat& trainData, int tflag, const Mat& responses, const Mat& varIdx=Mat(), const Mat& sampleIdx=Mat(), const Mat& varType=Mat(), const Mat& missingDataMask=Mat(), CvBoostParams params=CvBoostParams(), bool update=false )
.. ocv:pyfunction:: cv2.CvBoost.train(trainData, tflag, responses[, varIdx[, sampleIdx[, varType[, missingDataMask[, params[, update]]]]]]) -> retval
.. ocv:cfunction:: bool CvBoost::train( const CvMat* trainData, int tflag, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, const CvMat* varType=0, const CvMat* missingDataMask=0, CvBoostParams params=CvBoostParams(), bool update=false ) .. ocv:cfunction:: bool CvBoost::train( const CvMat* trainData, int tflag, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, const CvMat* varType=0, const CvMat* missingDataMask=0, CvBoostParams params=CvBoostParams(), bool update=false )
.. ocv:cfunction:: bool CvBoost::train( CvMLData* data, CvBoostParams params=CvBoostParams(), bool update=false ) .. ocv:cfunction:: bool CvBoost::train( CvMLData* data, CvBoostParams params=CvBoostParams(), bool update=false )
...@@ -160,6 +162,8 @@ Predicts a response for an input sample. ...@@ -160,6 +162,8 @@ Predicts a response for an input sample.
.. ocv:function:: float CvBoost::predict( const Mat& sample, const Mat& missing=Mat(), const Range& slice=Range::all(), bool rawMode=false, bool returnSum=false ) const .. ocv:function:: float CvBoost::predict( const Mat& sample, const Mat& missing=Mat(), const Range& slice=Range::all(), bool rawMode=false, bool returnSum=false ) const
.. ocv:pyfunction:: cv2.CvBoost.predict(sample[, missing[, slice[, rawMode[, returnSum]]]]) -> retval
The method runs the sample through the trees in the ensemble and returns the output class label based on the weighted voting. The method runs the sample through the trees in the ensemble and returns the output class label based on the weighted voting.
CvBoost::prune CvBoost::prune
...@@ -168,6 +172,8 @@ Removes the specified weak classifiers. ...@@ -168,6 +172,8 @@ Removes the specified weak classifiers.
.. ocv:function:: void CvBoost::prune( CvSlice slice ) .. ocv:function:: void CvBoost::prune( CvSlice slice )
.. ocv:pyfunction:: cv2.CvBoost.prune(slice) -> None
The method removes the specified weak classifiers from the sequence. The method removes the specified weak classifiers from the sequence.
.. note:: Do not confuse this method with the pruning of individual decision trees, which is currently not supported. .. note:: Do not confuse this method with the pruning of individual decision trees, which is currently not supported.
......
...@@ -222,6 +222,8 @@ Trains a decision tree. ...@@ -222,6 +222,8 @@ Trains a decision tree.
.. ocv:function:: bool CvDTree::train( CvDTreeTrainData* trainData, const CvMat* subsampleIdx ) .. ocv:function:: bool CvDTree::train( CvDTreeTrainData* trainData, const CvMat* subsampleIdx )
.. ocv:pyfunction:: cv2.CvDTree.train(trainData, tflag, responses[, varIdx[, sampleIdx[, varType[, missingDataMask[, params]]]]]) -> retval
There are four ``train`` methods in :ocv:class:`CvDTree`: There are four ``train`` methods in :ocv:class:`CvDTree`:
* The **first two** methods follow the generic ``CvStatModel::train`` conventions. It is the most complete form. Both data layouts (``tflag=CV_ROW_SAMPLE`` and ``tflag=CV_COL_SAMPLE``) are supported, as well as sample and variable subsets, missing measurements, arbitrary combinations of input and output variable types, and so on. The last parameter contains all of the necessary training parameters (see the :ref:`CvDTreeParams` description). * The **first two** methods follow the generic ``CvStatModel::train`` conventions. It is the most complete form. Both data layouts (``tflag=CV_ROW_SAMPLE`` and ``tflag=CV_COL_SAMPLE``) are supported, as well as sample and variable subsets, missing measurements, arbitrary combinations of input and output variable types, and so on. The last parameter contains all of the necessary training parameters (see the :ref:`CvDTreeParams` description).
...@@ -240,6 +242,8 @@ Returns the leaf node of a decision tree corresponding to the input vector. ...@@ -240,6 +242,8 @@ Returns the leaf node of a decision tree corresponding to the input vector.
.. ocv:function:: CvDTreeNode* CvDTree::predict( const CvMat* sample, const CvMat* missingDataMask=0, bool preprocessedInput=false ) const .. ocv:function:: CvDTreeNode* CvDTree::predict( const CvMat* sample, const CvMat* missingDataMask=0, bool preprocessedInput=false ) const
.. ocv:pyfunction:: cv2.CvDTree.predict(sample[, missingDataMask[, preprocessedInput]]) -> retval
:param sample: Sample for prediction. :param sample: Sample for prediction.
:param missing_data: Optional input missing measurement mask. :param missing_data: Optional input missing measurement mask.
......
...@@ -155,6 +155,8 @@ Estimates the Gaussian mixture parameters from a sample set. ...@@ -155,6 +155,8 @@ Estimates the Gaussian mixture parameters from a sample set.
.. ocv:function:: bool CvEM::train( const CvMat* samples, const CvMat* sampleIdx=0, CvEMParams params=CvEMParams(), CvMat* labels=0 ) .. ocv:function:: bool CvEM::train( const CvMat* samples, const CvMat* sampleIdx=0, CvEMParams params=CvEMParams(), CvMat* labels=0 )
.. ocv:pyfunction:: cv2.CvEM.train(samples[, sampleIdx[, params]]) -> retval, labels
:param samples: Samples from which the Gaussian mixture model will be estimated. :param samples: Samples from which the Gaussian mixture model will be estimated.
:param sample_idx: Mask of samples to use. All samples are used by default. :param sample_idx: Mask of samples to use. All samples are used by default.
...@@ -187,6 +189,8 @@ Returns a mixture component index of a sample. ...@@ -187,6 +189,8 @@ Returns a mixture component index of a sample.
.. ocv:function:: float CvEM::predict( const CvMat* sample, CvMat* probs ) const .. ocv:function:: float CvEM::predict( const CvMat* sample, CvMat* probs ) const
.. ocv:pyfunction:: cv2.CvEM.predict(sample) -> retval, probs
:param sample: A sample for classification. :param sample: A sample for classification.
:param probs: If it is not null then the method will write posterior probabilities of each component given the sample data to this parameter. :param probs: If it is not null then the method will write posterior probabilities of each component given the sample data to this parameter.
......
...@@ -169,6 +169,8 @@ Trains a Gradient boosted tree model. ...@@ -169,6 +169,8 @@ Trains a Gradient boosted tree model.
.. ocv:function:: bool CvGBTrees::train(const Mat& trainData, int tflag, const Mat& responses, const Mat& varIdx=Mat(), const Mat& sampleIdx=Mat(), const Mat& varType=Mat(), const Mat& missingDataMask=Mat(), CvGBTreesParams params=CvGBTreesParams(), bool update=false) .. ocv:function:: bool CvGBTrees::train(const Mat& trainData, int tflag, const Mat& responses, const Mat& varIdx=Mat(), const Mat& sampleIdx=Mat(), const Mat& varType=Mat(), const Mat& missingDataMask=Mat(), CvGBTreesParams params=CvGBTreesParams(), bool update=false)
.. ocv:pyfunction:: cv2.CvGBTrees.train(trainData, tflag, responses[, varIdx[, sampleIdx[, varType[, missingDataMask[, params[, update]]]]]]) -> retval
.. ocv:cfunction:: bool CvGBTrees::train( const CvMat* trainData, int tflag, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, const CvMat* varType=0, const CvMat* missingDataMask=0, CvGBTreesParams params=CvGBTreesParams(), bool update=false ) .. ocv:cfunction:: bool CvGBTrees::train( const CvMat* trainData, int tflag, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, const CvMat* varType=0, const CvMat* missingDataMask=0, CvGBTreesParams params=CvGBTreesParams(), bool update=false )
.. ocv:cfunction:: bool CvGBTrees::train(CvMLData* data, CvGBTreesParams params=CvGBTreesParams(), bool update=false) .. ocv:cfunction:: bool CvGBTrees::train(CvMLData* data, CvGBTreesParams params=CvGBTreesParams(), bool update=false)
...@@ -194,6 +196,8 @@ Predicts a response for an input sample. ...@@ -194,6 +196,8 @@ Predicts a response for an input sample.
.. ocv:function:: float CvGBTrees::predict(const Mat& sample, const Mat& missing=Mat(), const Range& slice = Range::all(), int k=-1) const .. ocv:function:: float CvGBTrees::predict(const Mat& sample, const Mat& missing=Mat(), const Range& slice = Range::all(), int k=-1) const
.. ocv:pyfunction:: cv2.CvGBTrees.predict(sample[, missing[, slice[, k]]]) -> retval
.. ocv:cfunction:: float CvGBTrees::predict( const CvMat* sample, const CvMat* missing=0, CvMat* weakResponses=0, CvSlice slice = CV_WHOLE_SEQ, int k=-1 ) const .. ocv:cfunction:: float CvGBTrees::predict( const CvMat* sample, const CvMat* missing=0, CvMat* weakResponses=0, CvSlice slice = CV_WHOLE_SEQ, int k=-1 ) const
:param sample: Input feature vector that has the same format as every training set :param sample: Input feature vector that has the same format as every training set
...@@ -235,6 +239,8 @@ Clears the model. ...@@ -235,6 +239,8 @@ Clears the model.
.. ocv:function:: void CvGBTrees::clear() .. ocv:function:: void CvGBTrees::clear()
.. ocv:pyfunction:: cv2.CvGBTrees.clear() -> None
The function deletes the data set information and all the weak models and sets all internal The function deletes the data set information and all the weak models and sets all internal
variables to the initial state. The function is called in :ocv:func:`CvGBTrees::train` and in the variables to the initial state. The function is called in :ocv:func:`CvGBTrees::train` and in the
destructor. destructor.
......
...@@ -29,6 +29,8 @@ Trains the model. ...@@ -29,6 +29,8 @@ Trains the model.
.. ocv:function:: bool CvKNearest::train( const Mat& trainData, const Mat& responses, const Mat& sampleIdx=Mat(), bool isRegression=false, int maxK=32, bool updateBase=false ) .. ocv:function:: bool CvKNearest::train( const Mat& trainData, const Mat& responses, const Mat& sampleIdx=Mat(), bool isRegression=false, int maxK=32, bool updateBase=false )
.. ocv:pyfunction:: cv2.CvKNearest.train(trainData, responses[, sampleIdx[, isRegression[, maxK[, updateBase]]]]) -> retval
.. ocv:cfunction:: bool CvKNearest::train( const CvMat* trainData, const CvMat* responses, const CvMat* sampleIdx=0, bool is_regression=false, int maxK=32, bool updateBase=false ) .. ocv:cfunction:: bool CvKNearest::train( const CvMat* trainData, const CvMat* responses, const CvMat* sampleIdx=0, bool is_regression=false, int maxK=32, bool updateBase=false )
:param isRegression: Type of the problem: ``true`` for regression and ``false`` for classification. :param isRegression: Type of the problem: ``true`` for regression and ``false`` for classification.
...@@ -52,6 +54,8 @@ Finds the neighbors and predicts responses for input vectors. ...@@ -52,6 +54,8 @@ Finds the neighbors and predicts responses for input vectors.
.. ocv:function:: float CvKNearest::find_nearest( const Mat& samples, int k, Mat& results, Mat& neighborResponses, Mat& dists) const .. ocv:function:: float CvKNearest::find_nearest( const Mat& samples, int k, Mat& results, Mat& neighborResponses, Mat& dists) const
.. ocv:pyfunction:: cv2.CvKNearest.find_nearest(samples, k[, results[, neighborResponses[, dists]]]) -> retval, results, neighborResponses, dists
.. ocv:cfunction:: float CvKNearest::find_nearest( const CvMat* samples, int k, CvMat* results=0, const float** neighbors=0, CvMat* neighborResponses=0, CvMat* dist=0 ) const .. ocv:cfunction:: float CvKNearest::find_nearest( const CvMat* samples, int k, CvMat* results=0, const float** neighbors=0, CvMat* neighborResponses=0, CvMat* dist=0 ) const
:param samples: Input samples stored by rows. It is a single-precision floating-point matrix of :math:`number\_of\_samples \times number\_of\_features` size. :param samples: Input samples stored by rows. It is a single-precision floating-point matrix of :math:`number\_of\_samples \times number\_of\_features` size.
......
...@@ -33,6 +33,8 @@ Trains the model. ...@@ -33,6 +33,8 @@ Trains the model.
.. ocv:function:: bool CvNormalBayesClassifier::train( const Mat& trainData, const Mat& responses, const Mat& varIdx = Mat(), const Mat& sampleIdx=Mat(), bool update=false ) .. ocv:function:: bool CvNormalBayesClassifier::train( const Mat& trainData, const Mat& responses, const Mat& varIdx = Mat(), const Mat& sampleIdx=Mat(), bool update=false )
.. ocv:pyfunction:: cv2.CvNormalBayesClassifier.train(trainData, responses[, varIdx[, sampleIdx[, update]]]) -> retval
.. ocv:cfunction:: bool CvNormalBayesClassifier::train( const CvMat* trainData, const CvMat* responses, const CvMat* varIdx = 0, const CvMat* sampleIdx=0, bool update=false ) .. ocv:cfunction:: bool CvNormalBayesClassifier::train( const CvMat* trainData, const CvMat* responses, const CvMat* varIdx = 0, const CvMat* sampleIdx=0, bool update=false )
:param update: Identifies whether the model should be trained from scratch (``update=false``) or should be updated using the new training data (``update=true``). :param update: Identifies whether the model should be trained from scratch (``update=false``) or should be updated using the new training data (``update=true``).
...@@ -50,6 +52,8 @@ Predicts the response for sample(s). ...@@ -50,6 +52,8 @@ Predicts the response for sample(s).
.. ocv:function:: float CvNormalBayesClassifier::predict( const Mat& samples, Mat* results=0 ) const .. ocv:function:: float CvNormalBayesClassifier::predict( const Mat& samples, Mat* results=0 ) const
.. ocv:pyfunction:: cv2.CvNormalBayesClassifier.predict(samples) -> retval, results
.. ocv:cfunction:: float CvNormalBayesClassifier::predict( const CvMat* samples, CvMat* results=0 ) const .. ocv:cfunction:: float CvNormalBayesClassifier::predict( const CvMat* samples, CvMat* results=0 ) const
The method estimates the most probable classes for input vectors. Input vectors (one or more) are stored as rows of the matrix ``samples``. In case of multiple input vectors, there should be one output vector ``results``. The predicted class for a single input vector is returned by the method. The method estimates the most probable classes for input vectors. Input vectors (one or more) are stored as rows of the matrix ``samples``. In case of multiple input vectors, there should be one output vector ``results``. The predicted class for a single input vector is returned by the method.
......
...@@ -105,6 +105,8 @@ Trains the Random Trees model. ...@@ -105,6 +105,8 @@ Trains the Random Trees model.
.. ocv:function:: bool CvRTrees::train( const CvMat* trainData, int tflag, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, const CvMat* varType=0, const CvMat* missingDataMask=0, CvRTParams params=CvRTParams() ) .. ocv:function:: bool CvRTrees::train( const CvMat* trainData, int tflag, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, const CvMat* varType=0, const CvMat* missingDataMask=0, CvRTParams params=CvRTParams() )
.. ocv:pyfunction:: cv2.CvRTrees.train(trainData, tflag, responses[, varIdx[, sampleIdx[, varType[, missingDataMask[, params]]]]]) -> retval
The method :ocv:func:`CvRTrees::train` is very similar to the method :ocv:func:`CvDTree::train` and follows the generic method :ocv:func:`CvStatModel::train` conventions. All the parameters specific to the algorithm training are passed as a :ocv:class:`CvRTParams` instance. The estimate of the training error (``oob-error``) is stored in the protected class member ``oob_error``. The method :ocv:func:`CvRTrees::train` is very similar to the method :ocv:func:`CvDTree::train` and follows the generic method :ocv:func:`CvStatModel::train` conventions. All the parameters specific to the algorithm training are passed as a :ocv:class:`CvRTParams` instance. The estimate of the training error (``oob-error``) is stored in the protected class member ``oob_error``.
CvRTrees::predict CvRTrees::predict
...@@ -115,6 +117,8 @@ Predicts the output for an input sample. ...@@ -115,6 +117,8 @@ Predicts the output for an input sample.
.. ocv:function:: float CvRTrees::predict( const CvMat* sample, const CvMat* missing = 0 ) const .. ocv:function:: float CvRTrees::predict( const CvMat* sample, const CvMat* missing = 0 ) const
.. ocv:pyfunction:: cv2.CvRTrees.predict(sample[, missing]) -> retval
:param sample: Sample for classification. :param sample: Sample for classification.
:param missing: Optional missing measurement mask of the sample. :param missing: Optional missing measurement mask of the sample.
...@@ -130,6 +134,8 @@ Returns a fuzzy-predicted class label. ...@@ -130,6 +134,8 @@ Returns a fuzzy-predicted class label.
.. ocv:function:: float CvRTrees::predict_prob( const CvMat* sample, const CvMat* missing = 0 ) const .. ocv:function:: float CvRTrees::predict_prob( const CvMat* sample, const CvMat* missing = 0 ) const
.. ocv:pyfunction:: cv2.CvRTrees.predict_prob(sample[, missing]) -> retval
:param sample: Sample for classification. :param sample: Sample for classification.
:param missing: Optional missing measurement mask of the sample. :param missing: Optional missing measurement mask of the sample.
......
...@@ -89,6 +89,8 @@ Saves the model to a file. ...@@ -89,6 +89,8 @@ Saves the model to a file.
.. ocv:function:: void CvStatModel::save( const char* filename, const char* name=0 ) .. ocv:function:: void CvStatModel::save( const char* filename, const char* name=0 )
.. ocv:pyfunction:: cv2.CvStatModel.save(filename[, name]) -> None
The method ``save`` saves the complete model state to the specified XML or YAML file with the specified name or default name (which depends on a particular class). *Data persistence* functionality from ``CxCore`` is used. The method ``save`` saves the complete model state to the specified XML or YAML file with the specified name or default name (which depends on a particular class). *Data persistence* functionality from ``CxCore`` is used.
CvStatModel::load CvStatModel::load
...@@ -97,6 +99,8 @@ Loads the model from a file. ...@@ -97,6 +99,8 @@ Loads the model from a file.
.. ocv:function:: void CvStatModel::load( const char* filename, const char* name=0 ) .. ocv:function:: void CvStatModel::load( const char* filename, const char* name=0 )
.. ocv:pyfunction:: cv2.CvStatModel.load(filename[, name]) -> None
The method ``load`` loads the complete model state with the specified name (or default model-dependent name) from the specified XML or YAML file. The previous model state is cleared by ``clear()`` . The method ``load`` loads the complete model state with the specified name (or default model-dependent name) from the specified XML or YAML file. The previous model state is cleared by ``clear()`` .
......
...@@ -117,6 +117,8 @@ Trains an SVM. ...@@ -117,6 +117,8 @@ Trains an SVM.
.. ocv:function:: bool CvSVM::train( const Mat& _train_data, const Mat& _responses, const Mat& _var_idx=Mat(), const Mat& _sample_idx=Mat(), CvSVMParams _params=CvSVMParams() ) .. ocv:function:: bool CvSVM::train( const Mat& _train_data, const Mat& _responses, const Mat& _var_idx=Mat(), const Mat& _sample_idx=Mat(), CvSVMParams _params=CvSVMParams() )
.. ocv:pyfunction:: cv2.CvSVM.train(trainData, responses[, varIdx[, sampleIdx[, params]]]) -> retval
The method trains the SVM model. It follows the conventions of the generic ``train`` approach with the following limitations: The method trains the SVM model. It follows the conventions of the generic ``train`` approach with the following limitations:
* Only the ``CV_ROW_SAMPLE`` data layout is supported. * Only the ``CV_ROW_SAMPLE`` data layout is supported.
......
...@@ -199,12 +199,16 @@ Checks whether the classifier has been loaded. ...@@ -199,12 +199,16 @@ Checks whether the classifier has been loaded.
.. ocv:function:: bool CascadeClassifier::empty() const .. ocv:function:: bool CascadeClassifier::empty() const
.. ocv:pyfunction:: cv2.CascadeClassifier.empty() -> retval
CascadeClassifier::load CascadeClassifier::load
--------------------------- ---------------------------
Loads a classifier from a file. Loads a classifier from a file.
.. ocv:function:: bool CascadeClassifier::load(const string& filename) .. ocv:function:: bool CascadeClassifier::load(const string& filename)
.. ocv:pyfunction:: cv2.CascadeClassifier.load(filename) -> retval
:param filename: Name of the file from which the classifier is loaded. The file may contain an old HAAR classifier trained by the haartraining application or a new cascade classifier trained by the traincascade application. :param filename: Name of the file from which the classifier is loaded. The file may contain an old HAAR classifier trained by the haartraining application or a new cascade classifier trained by the traincascade application.
...@@ -224,6 +228,9 @@ Detects objects of different sizes in the input image. The detected objects are ...@@ -224,6 +228,9 @@ Detects objects of different sizes in the input image. The detected objects are
.. ocv:function:: void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size()) .. ocv:function:: void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size())
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image, rejectLevels, levelWeights[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects
:param image: Matrix of the type ``CV_8U`` containing an image where objects are detected. :param image: Matrix of the type ``CV_8U`` containing an image where objects are detected.
:param objects: Vector of rectangles where each rectangle contains the detected object. :param objects: Vector of rectangles where each rectangle contains the detected object.
...@@ -271,6 +278,10 @@ Groups the object candidate rectangles. ...@@ -271,6 +278,10 @@ Groups the object candidate rectangles.
.. ocv:function:: void groupRectangles(vector<Rect>& rectList, int groupThreshold, double eps=0.2) .. ocv:function:: void groupRectangles(vector<Rect>& rectList, int groupThreshold, double eps=0.2)
.. ocv:pyfunction:: cv2.groupRectangles(rectList, groupThreshold[, eps]) -> None
.. ocv:pyfunction:: cv2.groupRectangles(rectList, groupThreshold[, eps]) -> weights
.. ocv:pyfunction:: cv2.groupRectangles(rectList, groupThreshold, eps, weights, levelWeights) -> None
:param rectList: Input/output vector of rectangles. Output vector includes retained and grouped rectangles. :param rectList: Input/output vector of rectangles. Output vector includes retained and grouped rectangles.
:param groupThreshold: Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it. :param groupThreshold: Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.
......
...@@ -11,8 +11,10 @@ Calculates an optical flow for a sparse feature set using the iterative Lucas-Ka ...@@ -11,8 +11,10 @@ Calculates an optical flow for a sparse feature set using the iterative Lucas-Ka
.. ocv:function:: void calcOpticalFlowPyrLK( InputArray prevImg, InputArray nextImg, InputArray prevPts, InputOutputArray nextPts, OutputArray status, OutputArray 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 ) .. ocv:function:: void calcOpticalFlowPyrLK( InputArray prevImg, InputArray nextImg, InputArray prevPts, InputOutputArray nextPts, OutputArray status, OutputArray 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 )
.. ocv:pyfunction:: cv2.calcOpticalFlowPyrLK(prevImg, nextImg, prevPts[, nextPts[, status[, err[, winSize[, maxLevel[, criteria[, derivLambda[, flags]]]]]]]]) -> nextPts, status, err
.. ocv:cfunction:: void cvCalcOpticalFlowPyrLK( const CvArr* prev, const CvArr* curr, CvArr* prevPyr, CvArr* currPyr, const CvPoint2D32f* prevFeatures, CvPoint2D32f* currFeatures, int count, CvSize winSize, int level, char* status, float* trackError, CvTermCriteria criteria, int flags ) .. ocv:cfunction:: void cvCalcOpticalFlowPyrLK( const CvArr* prev, const CvArr* curr, CvArr* prevPyr, CvArr* currPyr, const CvPoint2D32f* prevFeatures, CvPoint2D32f* currFeatures, int count, CvSize winSize, int level, char* status, float* trackError, CvTermCriteria criteria, int flags )
.. ocv:pyoldfunction:: CalcOpticalFlowPyrLK( prev, curr, prevPyr, currPyr, prevFeatures, winSize, level, criteria, flags, guesses=None) -> (currFeatures, status, trackError) .. ocv:pyoldfunction:: cv.CalcOpticalFlowPyrLK( prev, curr, prevPyr, currPyr, prevFeatures, winSize, level, criteria, flags, guesses=None) -> (currFeatures, status, trackError)
:param prevImg: First 8-bit single-channel or 3-channel input image. :param prevImg: First 8-bit single-channel or 3-channel input image.
...@@ -50,6 +52,8 @@ Computes a dense optical flow using the Gunnar Farneback's algorithm. ...@@ -50,6 +52,8 @@ Computes a dense optical flow using the Gunnar Farneback's algorithm.
.. ocv:function:: void calcOpticalFlowFarneback( InputArray prevImg, InputArray nextImg, InputOutputArray flow, double pyrScale, int levels, int winsize, int iterations, int polyN, double polySigma, int flags ) .. ocv:function:: void calcOpticalFlowFarneback( InputArray prevImg, InputArray nextImg, InputOutputArray flow, double pyrScale, int levels, int winsize, int iterations, int polyN, double polySigma, int flags )
.. ocv:pyfunction:: cv2.calcOpticalFlowFarneback(prev, next, pyr_scale, levels, winsize, iterations, poly_n, poly_sigma, flags[, flow]) -> flow
:param prevImg: First 8-bit single-channel input image. :param prevImg: First 8-bit single-channel input image.
:param nextImg: Second input image of the same size and the same type as ``prevImg`` . :param nextImg: Second input image of the same size and the same type as ``prevImg`` .
...@@ -89,6 +93,8 @@ Computes an optimal affine transformation between two 2D point sets. ...@@ -89,6 +93,8 @@ Computes an optimal affine transformation between two 2D point sets.
.. ocv:function:: Mat estimateRigidTransform( InputArray src, InputArray dst, bool fullAffine ) .. ocv:function:: Mat estimateRigidTransform( InputArray src, InputArray dst, bool fullAffine )
.. ocv:pyfunction:: cv2.estimateRigidTransform(src, dst, fullAffine) -> retval
:param src: First input 2D point set stored in ``std::vector`` or ``Mat``, or an image stored in ``Mat``. :param src: First input 2D point set stored in ``std::vector`` or ``Mat``, or an image stored in ``Mat``.
:param dst: Second input 2D point set of the same size and the same type as ``A``, or another image. :param dst: Second input 2D point set of the same size and the same type as ``A``, or another image.
...@@ -132,8 +138,10 @@ Updates the motion history image by a moving silhouette. ...@@ -132,8 +138,10 @@ Updates the motion history image by a moving silhouette.
.. ocv:function:: void updateMotionHistory( InputArray silhouette, InputOutputArray mhi, double timestamp, double duration ) .. ocv:function:: void updateMotionHistory( InputArray silhouette, InputOutputArray mhi, double timestamp, double duration )
.. ocv:pyfunction:: cv2.updateMotionHistory(silhouette, mhi, timestamp, duration) -> None
.. ocv:cfunction:: void cvUpdateMotionHistory( const CvArr* silhouette, CvArr* mhi, double timestamp, double duration ) .. ocv:cfunction:: void cvUpdateMotionHistory( const CvArr* silhouette, CvArr* mhi, double timestamp, double duration )
.. ocv:pyoldfunction:: UpdateMotionHistory(silhouette, mhi, timestamp, duration)-> None .. ocv:pyoldfunction:: cv.UpdateMotionHistory(silhouette, mhi, timestamp, duration)-> None
:param silhouette: Silhouette mask that has non-zero pixels where the motion occurs. :param silhouette: Silhouette mask that has non-zero pixels where the motion occurs.
...@@ -168,8 +176,10 @@ Calculates a gradient orientation of a motion history image. ...@@ -168,8 +176,10 @@ Calculates a gradient orientation of a motion history image.
.. ocv:function:: void calcMotionGradient( InputArray mhi, OutputArray mask, OutputArray orientation, double delta1, double delta2, int apertureSize=3 ) .. ocv:function:: void calcMotionGradient( InputArray mhi, OutputArray mask, OutputArray orientation, double delta1, double delta2, int apertureSize=3 )
.. ocv:pyfunction:: cv2.calcMotionGradient(mhi, delta1, delta2[, mask[, orientation[, apertureSize]]]) -> mask, orientation
.. ocv:cfunction:: void cvCalcMotionGradient( const CvArr* mhi, CvArr* mask, CvArr* orientation, double delta1, double delta2, int apertureSize=3 ) .. ocv:cfunction:: void cvCalcMotionGradient( const CvArr* mhi, CvArr* mask, CvArr* orientation, double delta1, double delta2, int apertureSize=3 )
.. ocv:pyoldfunction:: CalcMotionGradient(mhi, mask, orientation, delta1, delta2, apertureSize=3)-> None .. ocv:pyoldfunction:: cv.CalcMotionGradient(mhi, mask, orientation, delta1, delta2, apertureSize=3)-> None
:param mhi: Motion history single-channel floating-point image. :param mhi: Motion history single-channel floating-point image.
...@@ -204,8 +214,10 @@ Calculates a global motion orientation in a selected region. ...@@ -204,8 +214,10 @@ Calculates a global motion orientation in a selected region.
.. ocv:function:: double calcGlobalOrientation( InputArray orientation, InputArray mask, InputArray mhi, double timestamp, double duration ) .. ocv:function:: double calcGlobalOrientation( InputArray orientation, InputArray mask, InputArray mhi, double timestamp, double duration )
.. ocv:pyfunction:: cv2.calcGlobalOrientation(orientation, mask, mhi, timestamp, duration) -> retval
.. ocv:cfunction:: double cvCalcGlobalOrientation( const CvArr* orientation, const CvArr* mask, const CvArr* mhi, double timestamp, double duration ) .. ocv:cfunction:: double cvCalcGlobalOrientation( const CvArr* orientation, const CvArr* mask, const CvArr* mhi, double timestamp, double duration )
.. ocv:pyoldfunction:: CalcGlobalOrientation(orientation, mask, mhi, timestamp, duration)-> float .. ocv:pyoldfunction:: cv.CalcGlobalOrientation(orientation, mask, mhi, timestamp, duration)-> float
:param orientation: Motion gradient orientation image calculated by the function :ocv:func:`calcMotionGradient` . :param orientation: Motion gradient orientation image calculated by the function :ocv:func:`calcMotionGradient` .
...@@ -232,8 +244,10 @@ Splits a motion history image into a few parts corresponding to separate indepen ...@@ -232,8 +244,10 @@ Splits a motion history image into a few parts corresponding to separate indepen
.. ocv:function:: void segmentMotion(InputArray mhi, OutputArray segmask, vector<Rect>& boundingRects, double timestamp, double segThresh) .. ocv:function:: void segmentMotion(InputArray mhi, OutputArray segmask, vector<Rect>& boundingRects, double timestamp, double segThresh)
.. ocv:pyfunction:: cv2.segmentMotion(mhi, boundingRects, timestamp, segThresh[, segmask]) -> segmask
.. ocv:cfunction:: CvSeq* cvSegmentMotion( const CvArr* mhi, CvArr* segMask, CvMemStorage* storage, double timestamp, double segThresh ) .. ocv:cfunction:: CvSeq* cvSegmentMotion( const CvArr* mhi, CvArr* segMask, CvMemStorage* storage, double timestamp, double segThresh )
.. ocv:pyoldfunction:: SegmentMotion(mhi, segMask, storage, timestamp, segThresh)-> None .. ocv:pyoldfunction:: cv.SegmentMotion(mhi, segMask, storage, timestamp, segThresh)-> None
:param mhi: Motion history image. :param mhi: Motion history image.
...@@ -257,8 +271,10 @@ Finds an object center, size, and orientation. ...@@ -257,8 +271,10 @@ Finds an object center, size, and orientation.
.. ocv:function:: RotatedRect CamShift( InputArray probImage, Rect& window, TermCriteria criteria ) .. ocv:function:: RotatedRect CamShift( InputArray probImage, Rect& window, TermCriteria criteria )
.. ocv:pyfunction:: cv2.CamShift(probImage, window, criteria) -> retval, window
.. ocv:cfunction:: int cvCamShift( const CvArr* probImage, CvRect window, CvTermCriteria criteria, CvConnectedComp* comp, CvBox2D* box=NULL ) .. ocv:cfunction:: int cvCamShift( const CvArr* probImage, CvRect window, CvTermCriteria criteria, CvConnectedComp* comp, CvBox2D* box=NULL )
.. ocv:pyoldfunction:: CamShift(probImage, window, criteria)-> (int, comp, box) .. ocv:pyoldfunction:: cv.CamShift(probImage, window, criteria)-> (int, comp, box)
:param probImage: Back projection of the object histogram. See :ocv:func:`calcBackProject` . :param probImage: Back projection of the object histogram. See :ocv:func:`calcBackProject` .
...@@ -282,8 +298,10 @@ Finds an object on a back projection image. ...@@ -282,8 +298,10 @@ Finds an object on a back projection image.
.. ocv:function:: int meanShift( InputArray probImage, Rect& window, TermCriteria criteria ) .. ocv:function:: int meanShift( InputArray probImage, Rect& window, TermCriteria criteria )
.. ocv:pyfunction:: cv2.meanShift(probImage, window, criteria) -> retval, window
.. ocv:cfunction:: int cvMeanShift( const CvArr* probImage, CvRect window, CvTermCriteria criteria, CvConnectedComp* comp ) .. ocv:cfunction:: int cvMeanShift( const CvArr* probImage, CvRect window, CvTermCriteria criteria, CvConnectedComp* comp )
.. ocv:pyoldfunction:: MeanShift(probImage, window, criteria)-> comp .. ocv:pyoldfunction:: cv.MeanShift(probImage, window, criteria)-> comp
:param probImage: Back projection of the object histogram. See :ocv:func:`calcBackProject` for details. :param probImage: Back projection of the object histogram. See :ocv:func:`calcBackProject` for details.
...@@ -355,6 +373,8 @@ Computes a predicted state. ...@@ -355,6 +373,8 @@ Computes a predicted state.
.. ocv:function:: const Mat& KalmanFilter::predict(const Mat& control=Mat()) .. ocv:function:: const Mat& KalmanFilter::predict(const Mat& control=Mat())
.. ocv:pyfunction:: cv2.KalmanFilter.predict([, control]) -> retval
:param control: The optional input control :param control: The optional input control
...@@ -364,6 +384,8 @@ Updates the predicted state from the measurement. ...@@ -364,6 +384,8 @@ Updates the predicted state from the measurement.
.. ocv:function:: const Mat& KalmanFilter::correct(const Mat& measurement) .. ocv:function:: const Mat& KalmanFilter::correct(const Mat& measurement)
.. ocv:pyfunction:: cv2.KalmanFilter.correct(measurement) -> retval
:param control: The measured system parameters :param control: The measured system parameters
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment