Computes an optimal affine transformation between two 3D point sets.
:param srcpt:The first input 3D point set.
:param dstpt:The second input 3D point set.
:param out:Output 3D affine transformation matrix :math:`3 \times 4` .
:param outliers:Output vector indicating which points are outliers.
:param ransacThreshold:Maximum reprojection error in the RANSAC algorithm to consider a point as an inlier.
.._getOptimalNewCameraMatrix:
:param confidence:The confidence level, between 0 and 1, that the estimated transformation will have. Anything between 0.95 and 0.99 is usually good enough. Too close to 1 values can slow down the estimation too much, lower than 0.8-0.9 confidence values can result in an incorrectly estimated transformation.
The function estimates an optimal 3D affine transformation between two 3D point sets using the RANSAC algorithm.
..index:: getOptimalNewCameraMatrix
getOptimalNewCameraMatrix
-----------------------------
@ -787,7 +804,7 @@ The function computes partial derivatives of the elements of the matrix product
:param imagePoints:Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, or ``vector<Point2f>`` .
:param dpdrot:Optional 2Nx3 matrix of derivatives of image points with respect to components of the rotation vector.
:param jacobian:Optional output 2Nx(10+<numDistCoeffs>) jacobian matrix of derivatives of image points with respect to components of the rotation vector, translation vector, focal lengths, coordinates of the principal point and the distortion coefficients.
:param dpdt:Optional 2Nx3 matrix of derivatives of image points with respect to components of the translation vector.
:param dpdf:Optional 2Nx2 matrix of derivatives of image points with respect to :math:`f_x` and :math:`f_y` .
:param dpdc:Optional 2Nx2 matrix of derivatives of image points with respect to :math:`c_x` and :math:`c_y` .
:param dpddist:Optional 2Nx4 matrix of derivatives of image points with respect to distortion coefficients.
:param aspectRatio:Optional "fixed aspect ratio" parameter. If the parameter is not 0, the function assumes that the aspect ratio (*fx/fy*) is fixed and correspondingly adjusts the jacobian matrix.
The function computes projections of 3D
points to the image plane given intrinsic and extrinsic camera
@ -837,7 +848,7 @@ By setting ``rvec=tvec=(0,0,0)`` or by setting ``cameraMatrix`` to a 3x3 identi
..cpp:function:: void reprojectImageTo3D( InputArray disparity, OutputArray _3dImage, InputArray Q, bool handleMissingValues=false, int depth=-1 )
Reprojects a disparity image to 3D space.
@ -849,6 +860,8 @@ reprojectImageTo3D
:param handleMissingValues:Indicates, whether the function should handle missing values (i.e. points where the disparity was not computed). If ``handleMissingValues=true``, then pixels with the minimal disparity that corresponds to the outliers (see :ref:`StereoBM::operator ()` ) are transformed to 3D points with a very large Z value (currently set to 10000).
:param ddepth:The optional output array depth. If it is ``-1``, the output image will have ``CV_32F`` depth. ``ddepth`` can also be set to ``CV_16S``, ``CV_32S`` or ``CV_32F``.
The function transforms a single-channel disparity map to a 3-channel image representing a 3D surface. That is, for each pixel ``(x,y)`` andthe corresponding disparity ``d=disparity(x,y)`` , it computes:
..math::
@ -862,13 +875,10 @@ The matrix ``Q`` can be an arbitrary
..index:: RQDecomp3x3
.._RQDecomp3x3:
RQDecomp3x3
---------------
..cpp:function:: void RQDecomp3x3( InputArray M, OutputArray R, OutputArray Q )
..cpp:function:: Vec3d RQDecomp3x3( InputArray M, OutputArray R, OutputArray Q, OutputArray Qx, OutputArray Qy, OutputArray Qz )
..cpp:function:: Vec3d RQDecomp3x3( InputArray M, OutputArray R, OutputArray Q, OutputArray Qx=noArray(), OutputArray Qy=noArray(), OutputArray Qz=noArray() )
Computes an RQ decomposition of 3x3 matrices.
@ -878,11 +888,11 @@ RQDecomp3x3
:param Q:Output 3x3 orthogonal matrix.
:param Qx:Optional 3x3 rotation matrix around x-axis.
:param Qx:Optional output 3x3 rotation matrix around x-axis.
:param Qy:Optional 3x3 rotation matrix around y-axis.
:param Qy:Optional output 3x3 rotation matrix around y-axis.
:param Qz:Optional 3x3 rotation matrix around z-axis.
:param Qz:Optional output 3x3 rotation matrix around z-axis.
The function computes a RQ decomposition using the given rotations. This function is used in
:ref:`DecomposeProjectionMatrix` to decompose the left 3x3 submatrix of a projection matrix into a camera and a rotation matrix.
This filter does not check out-of-border accesses, so only a proper sub-matrix of a bigger matrix has to be passed to it.
See Also: :c:cpp:func:`createMorphologyFilter`
See Also: :cpp:func:`createMorphologyFilter`
..index:: gpu::erode
@ -320,7 +320,7 @@ gpu::erode
This filter does not check out-of-border accesses, so only a proper sub-matrix of a bigger matrix has to be passed to it.
See Also: :c:cpp:func:`erode`
See Also: :cpp:func:`erode`
..index:: gpu::dilate
@ -344,7 +344,7 @@ gpu::dilate
This filter does not check out-of-border accesses, so only a proper sub-matrix of a bigger matrix has to be passed to it.
See Also: :c:cpp:func:`dilate`
See Also: :cpp:func:`dilate`
..index:: gpu::morphologyEx
@ -381,7 +381,7 @@ gpu::morphologyEx
This filter does not check out-of-border accesses, so only a proper sub-matrix of a bigger matrix has to be passed to it.
See Also: :c:cpp:func:`morphologyEx`
See Also: :cpp:func:`morphologyEx`
..index:: gpu::createLinearFilter_GPU
@ -407,7 +407,7 @@ gpu::createLinearFilter_GPU
This filter does not check out-of-border accesses, so only a proper sub-matrix of a bigger matrix has to be passed to it.
See Also: :c:cpp:func:`createLinearFilter`
See Also: :cpp:func:`createLinearFilter`
..index:: gpu::filter2D
@ -431,7 +431,7 @@ gpu::filter2D
This filter does not check out-of-border accesses, so only a proper sub-matrix of a bigger matrix has to be passed to it.
See Also: :c:cpp:func:`filter2D`
See Also: :cpp:func:`filter2D`
..index:: gpu::Laplacian
@ -447,15 +447,15 @@ gpu::Laplacian
:param ddepth:Desired depth of the destination image. It supports only the same depth as the source image depth.
:param ksize:Aperture size used to compute the second-derivative filters (see :c:cpp:func:`getDerivKernels`). It must be positive and odd. Only ``ksize`` = 1 and ``ksize`` = 3 are supported.
:param ksize:Aperture size used to compute the second-derivative filters (see :cpp:func:`getDerivKernels`). It must be positive and odd. Only ``ksize`` = 1 and ``ksize`` = 3 are supported.
:param scale:Optional scale factor for the computed Laplacian values. By default, no scaling is applied (see :c:cpp:func:`getDerivKernels` ).
:param scale:Optional scale factor for the computed Laplacian values. By default, no scaling is applied (see :cpp:func:`getDerivKernels` ).
**Note:**
This filter does not check out-of-border accesses, so only a proper sub-matrix of a bigger matrix has to be passed to it.
See Also: :c:cpp:func:`Laplacian`,:cpp:func:`gpu::filter2D` .
See Also: :cpp:func:`Laplacian`,:cpp:func:`gpu::filter2D` .
..index:: gpu::getLinearRowFilter_GPU
@ -473,7 +473,7 @@ gpu::getLinearRowFilter_GPU
:param anchor:Anchor position within the kernel. Negative values mean that the anchor is positioned at the aperture center.
:param borderType:Pixel extrapolation method. For details, see :c:cpp:func:`borderInterpolate`. For details on limitations, see below.
:param borderType:Pixel extrapolation method. For details, see :cpp:func:`borderInterpolate`. For details on limitations, see below.
There are two versions of the algorithm: NPP and OpenCV.
* NPP version is called when ``srcType == CV_8UC1`` or ``srcType == CV_8UC4`` and ``bufType == srcType`` . Otherwise, the OpenCV version is called. NPP supports only ``BORDER_CONSTANT`` border type and does not check indices outside the image.
:param anchor:Anchor position within the kernel. Negative values mean that the anchor is positioned at the aperture center.
:param borderType:Pixel extrapolation method. For details, see :c:cpp:func:`borderInterpolate` . For details on limitations, see below.
:param borderType:Pixel extrapolation method. For details, see :cpp:func:`borderInterpolate` . For details on limitations, see below.
There are two versions of the algorithm: NPP and OpenCV.
* NPP version is called when ``dstType == CV_8UC1`` or ``dstType == CV_8UC4`` and ``bufType == dstType`` . Otherwise, the OpenCV version is called. NPP supports only ``BORDER_CONSTANT`` border type and does not check indices outside the image.
* OpenCV version supports only ``CV_32F`` buffer depth and ``BORDER_REFLECT101``, ``BORDER_REPLICATE``, and ``BORDER_CONSTANT`` border types. It checks indices outside image.
See Also: :cpp:func:`gpu::getLinearRowFilter_GPU`, :c:cpp:func:`createSeparableLinearFilter`
See Also: :cpp:func:`gpu::getLinearRowFilter_GPU`, :cpp:func:`createSeparableLinearFilter`
:param anchor:Anchor position within the kernel. Negative values mean that anchor is positioned at the aperture center.
:param rowBorderType, columnBorderType:Pixel extrapolation method in the horizontal and vertical directions For details, see :c:cpp:func:`borderInterpolate`. For details on limitations, see :cpp:func:`gpu::getLinearRowFilter_GPU`, cpp:cpp:func:`gpu::getLinearColumnFilter_GPU`.
:param rowBorderType, columnBorderType:Pixel extrapolation method in the horizontal and vertical directions For details, see :cpp:func:`borderInterpolate`. For details on limitations, see :cpp:func:`gpu::getLinearRowFilter_GPU`, cpp:cpp:func:`gpu::getLinearColumnFilter_GPU`.
See Also: :cpp:func:`gpu::getLinearRowFilter_GPU`, :cpp:func:`gpu::getLinearColumnFilter_GPU`, :c:cpp:func:`createSeparableLinearFilter`
See Also: :cpp:func:`gpu::getLinearRowFilter_GPU`, :cpp:func:`gpu::getLinearColumnFilter_GPU`, :cpp:func:`createSeparableLinearFilter`
..index:: gpu::sepFilter2D
@ -544,9 +544,9 @@ gpu::sepFilter2D
:param anchor:Anchor position within the kernel. The default value ``(-1, 1)`` means that the anchor is at the kernel center.
:param rowBorderType, columnBorderType:Pixel extrapolation method. For details, see :c:cpp:func:`borderInterpolate`.
:param rowBorderType, columnBorderType:Pixel extrapolation method. For details, see :cpp:func:`borderInterpolate`.
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :c:cpp:func:`sepFilter2D`
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :cpp:func:`sepFilter2D`
..index:: gpu::createDerivFilter_GPU
@ -564,11 +564,11 @@ gpu::createDerivFilter_GPU
:param dy:Derivative order in respect of y.
:param ksize:Aperture size. See :c:cpp:func:`getDerivKernels` for details.
:param ksize:Aperture size. See :cpp:func:`getDerivKernels` for details.
:param rowBorderType, columnBorderType:Pixel extrapolation method. See :c:cpp:func:`borderInterpolate` for details.
:param rowBorderType, columnBorderType:Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :c:cpp:func:`createDerivFilter`
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :cpp:func:`createDerivFilter`
..index:: gpu::Sobel
@ -590,11 +590,11 @@ gpu::Sobel
:param ksize:Size of the extended Sobel kernel. Possible valies are 1, 3, 5 or 7.
:param scale:Optional scale factor for the computed derivative values. By default, no scaling is applied. For details, see :c:cpp:func:`getDerivKernels` .
:param scale:Optional scale factor for the computed derivative values. By default, no scaling is applied. For details, see :cpp:func:`getDerivKernels` .
:param rowBorderType, columnBorderType:Pixel extrapolation method. See :c:cpp:func:`borderInterpolate` for details.
:param rowBorderType, columnBorderType:Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :c:cpp:func:`Sobel`
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :cpp:func:`Sobel`
..index:: gpu::Scharr
@ -614,11 +614,11 @@ gpu::Scharr
:param yorder:Order of the derivative y.
:param scale:Optional scale factor for the computed derivative values. By default, no scaling is applied. See :c:cpp:func:`getDerivKernels` for details.
:param scale:Optional scale factor for the computed derivative values. By default, no scaling is applied. See :cpp:func:`getDerivKernels` for details.
:param rowBorderType, columnBorderType:Pixel extrapolation method. For details, see :c:cpp:func:`borderInterpolate` and :c:cpp:func:`Scharr` .
:param rowBorderType, columnBorderType:Pixel extrapolation method. For details, see :cpp:func:`borderInterpolate` and :cpp:func:`Scharr` .
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :c:cpp:func:`Scharr`
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :cpp:func:`Scharr`
:param type:Source and destination image type. ``CV_8UC1``, ``CV_8UC4``, ``CV_16SC1``, ``CV_16SC2``, ``CV_32SC1``, ``CV_32FC1`` are supported.
:param ksize:Aperture size. See :c:cpp:func:`getGaussianKernel` for details.
:param ksize:Aperture size. See :cpp:func:`getGaussianKernel` for details.
:param sigmaX:Gaussian sigma in the horizontal direction. See :c:cpp:func:`getGaussianKernel` for details.
:param sigmaX:Gaussian sigma in the horizontal direction. See :cpp:func:`getGaussianKernel` for details.
:param sigmaY:Gaussian sigma in the vertical direction. If 0, then :math:`\texttt{sigmaY}\leftarrow\texttt{sigmaX}` .
:param rowBorderType, columnBorderType:Border type to use. See :c:cpp:func:`borderInterpolate` for details.
:param rowBorderType, columnBorderType:Border type to use. See :cpp:func:`borderInterpolate` for details.
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :c:cpp:func:`createGaussianFilter`
See Also: :cpp:func:`gpu::createSeparableLinearFilter_GPU`, :cpp:func:`createGaussianFilter`
..index:: gpu::GaussianBlur
@ -654,11 +654,11 @@ gpu::GaussianBlur
:param ksize:Gaussian kernel size. ``ksize.width`` and ``ksize.height`` can differ but they both must be positive and odd. If they are zeros, they are computed from ``sigmaX`` and ``sigmaY`` .
:param sigmaX, sigmaY:Gaussian kernel standard deviations in X and Y direction. If ``sigmaY`` is zero, it is set to be equal to ``sigmaX`` . If they are both zeros, they are computed from ``ksize.width`` and ``ksize.height``, respectively. See :c:cpp:func:`getGaussianKernel` for details. To fully control the result regardless of possible future modification of all this semantics, you are recommended to specify all of ``ksize``, ``sigmaX``, and ``sigmaY`` .
:param sigmaX, sigmaY:Gaussian kernel standard deviations in X and Y direction. If ``sigmaY`` is zero, it is set to be equal to ``sigmaX`` . If they are both zeros, they are computed from ``ksize.width`` and ``ksize.height``, respectively. See :cpp:func:`getGaussianKernel` for details. To fully control the result regardless of possible future modification of all this semantics, you are recommended to specify all of ``ksize``, ``sigmaX``, and ``sigmaY`` .
:param rowBorderType, columnBorderType:Pixel extrapolation method. See :c:cpp:func:`borderInterpolate` for details.
:param rowBorderType, columnBorderType:Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
See Also: :cpp:func:`gpu::createGaussianFilter_GPU`, :c:cpp:func:`GaussianBlur`
See Also: :cpp:func:`gpu::createGaussianFilter_GPU`, :cpp:func:`GaussianBlur`
:param criteria:Termination criteria. See :cpp:class:`TermCriteria`.
See Also:
:c:cpp:func:`gpu::meanShiftFiltering`
:cpp:func:`gpu::meanShiftFiltering`
..index:: gpu::meanShiftSegmentation
@ -81,7 +81,7 @@ gpu::integral
:param sqsum:Squared integral image of the ``CV_32FC1`` type.
See Also:
:c:cpp:func:`integral`
:cpp:func:`integral`
..index:: gpu::sqrIntegral
@ -128,7 +128,7 @@ gpu::cornerHarris
:param borderType:Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now.
See Also:
:c:cpp:func:`cornerHarris`
:cpp:func:`cornerHarris`
..index:: gpu::cornerMinEigenVal
@ -150,7 +150,7 @@ gpu::cornerMinEigenVal
:param borderType:Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now.
See also: :c:cpp:func:`cornerMinEigenVal`
See also: :cpp:func:`cornerMinEigenVal`
..index:: gpu::mulSpectrums
@ -173,7 +173,7 @@ gpu::mulSpectrums
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
See Also:
:c:cpp:func:`mulSpectrums`
:cpp:func:`mulSpectrums`
..index:: gpu::mulAndScaleSpectrums
@ -198,7 +198,7 @@ gpu::mulAndScaleSpectrums
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
See Also:
:c:cpp:func:`mulSpectrums`
:cpp:func:`mulSpectrums`
..index:: gpu::dft
@ -237,7 +237,7 @@ gpu::dft
If the source matrix is real (its type is ``CV_32FC1`` ), forward DFT is performed. The result of the DFT is packed into complex ( ``CV_32FC2`` ) matrix. So, the width of the destination matrix is ``dft_size.width / 2 + 1`` . But if the source is a single column, the height is reduced instead of the width.
..cpp:function:: void findContours( InputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point())
..cpp:function:: void findContours( InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point())
..cpp:function:: void findContours( InputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point())
..cpp:function:: void findContours( InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point())
Finds contours in a binary image.
@ -264,75 +264,17 @@ boundingRect
The function calculates and returns the minimal up-right bounding rectangle for the specified point set.
..index:: estimateRigidTransform
estimateRigidTransform
--------------------------
..cpp:function:: Mat estimateRigidTransform( InputArray srcpt, InputArray dstpt, bool fullAffine )
Computes an optimal affine transformation between two 2D point sets.
:param srcpt:The first input 2D point set, stored in ``std::vector`` or ``Mat``.
:param dst:The second input 2D point set of the same size and the same type as ``A`` .
:param fullAffine:If true, the function finds an optimal affine transformation with no additional resrictions (6 degrees of freedom). Otherwise, the class of transformations to choose from is limited to combinations of translation, rotation, and uniform scaling (5 degrees of freedom).
The function finds an optimal affine transform
:math:`[A|b]` (a
:math:`2 \times 3` floating-point matrix) that approximates best the transformation from
:math:`\texttt{srcpt}_i` to
:math:`\texttt{dstpt}_i` :
..math::
[A^*|b^*] = arg \min _{[A|b]} \sum _i \| \texttt{dstpt} _i - A { \texttt{srcpt} _i}^T - b \| ^2
where
:math:`[A|b]` can be either arbitrary (when ``fullAffine=true`` ) or have form
Computes an optimal affine transformation between two 3D point sets.
:param srcpt:The first input 3D point set.
:param dstpt:The second input 3D point set.
:param out:Output 3D affine transformation matrix :math:`3 \times 4` .
:param outliers:Output vector indicating which points are outliers.
:param ransacThreshold:Maximum reprojection error in the RANSAC algorithm to consider a point as an inlier.
:param confidence:The confidence level, between 0 and 1, that the estimated transformation will have. Anything between 0.95 and 0.99 is usually good enough. Too close to 1 values can slow down the estimation too much, lower than 0.8-0.9 confidence values can result in an incorrectly estimated transformation.
The function estimates an optimal 3D affine transformation between two 3D point sets using the RANSAC algorithm.
: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.
The function computes a contour area. Similarly to
:cpp:func:`moments` , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using
Retrieves the proximity measure between two training samples.
The method returns proximity measure between any two samples, which is the ratio of those trees in the ensemble, in which the samples fall into the same leaf node, to the total number of the trees.
Example: Prediction of mushroom goodness using the random-tree classifier ::