mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
propagated some more fixes from 2.3 branch to the trunk
This commit is contained in:
@@ -77,10 +77,11 @@ After that it finds eigenvectors and eigenvalues of
|
||||
|
||||
The output of the function can be used for robust edge or corner detection.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`cornerMinEigenVal`,
|
||||
:ocv:func:`cornerHarris`,
|
||||
:ocv:func:`preCornerDetect`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`cornerMinEigenVal`,
|
||||
:ocv:func:`cornerHarris`,
|
||||
:ocv:func:`preCornerDetect`
|
||||
|
||||
|
||||
|
||||
@@ -221,7 +222,8 @@ Determines strong corners on an image.
|
||||
|
||||
.. 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:: 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.
|
||||
@@ -266,12 +268,14 @@ The function can be used to initialize a point-based tracker of an object.
|
||||
|
||||
**Note**: If the function is called with different values ``A`` and ``B`` of the parameter ``qualityLevel`` , and ``A`` > {B}, the vector of returned corners with ``qualityLevel=A`` will be the prefix of the output vector with ``qualityLevel=B`` .
|
||||
|
||||
See Also: :ocv:func:`cornerMinEigenVal`,
|
||||
:ocv:func:`cornerHarris`,
|
||||
:ocv:func:`calcOpticalFlowPyrLK`,
|
||||
:ocv:func:`estimateRigidMotion`,
|
||||
:ocv:func:`PlanarObjectDetector`,
|
||||
:ocv:func:`OneWayDescriptor`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`cornerMinEigenVal`,
|
||||
:ocv:func:`cornerHarris`,
|
||||
:ocv:func:`calcOpticalFlowPyrLK`,
|
||||
:ocv:func:`estimateRigidMotion`,
|
||||
:ocv:func:`PlanarObjectDetector`,
|
||||
:ocv:func:`OneWayDescriptor`
|
||||
|
||||
|
||||
|
||||
@@ -336,10 +340,10 @@ The function finds circles in a grayscale image using a modification of the Houg
|
||||
|
||||
**Note**: Usually the function detects the centers of circles well. However, it may fail to find correct radii. You can assist to the function by specifying the radius range ( ``minRadius`` and ``maxRadius`` ) if you know it. Or, you may ignore the returned radius, use only the center, and find the correct radius using an additional procedure.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`fitEllipse`,
|
||||
:ocv:func:`minEnclosingCircle`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`fitEllipse`,
|
||||
:ocv:func:`minEnclosingCircle`
|
||||
|
||||
|
||||
HoughLines
|
||||
|
||||
@@ -54,6 +54,7 @@ where
|
||||
:ocv:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`BaseRowFilter`,
|
||||
:ocv:func:`BaseFilter`,
|
||||
:ocv:func:`FilterEngine`,
|
||||
@@ -62,7 +63,6 @@ where
|
||||
:ocv:func:`getMorphologyColumnFilter`
|
||||
|
||||
|
||||
|
||||
BaseFilter
|
||||
----------
|
||||
.. ocv:class:: BaseFilter
|
||||
@@ -104,11 +104,12 @@ where
|
||||
:ocv:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`BaseColumnFilter`,
|
||||
:ocv:func:`BaseRowFilter`,
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`getLinearFilter`,
|
||||
:ocv:func:`getMorphologyFilter`
|
||||
|
||||
:ocv:func:`BaseColumnFilter`,
|
||||
:ocv:func:`BaseRowFilter`,
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`getLinearFilter`,
|
||||
:ocv:func:`getMorphologyFilter`
|
||||
|
||||
|
||||
|
||||
@@ -145,12 +146,13 @@ where
|
||||
:ocv:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`BaseColumnFilter`,
|
||||
:ocv:func:`Filter`,
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`getLinearRowFilter`,
|
||||
:ocv:func:`getMorphologyRowFilter`,
|
||||
:ocv:func:`getRowSumFilter`
|
||||
|
||||
:ocv:func:`BaseColumnFilter`,
|
||||
:ocv:func:`Filter`,
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`getLinearRowFilter`,
|
||||
:ocv:func:`getMorphologyRowFilter`,
|
||||
:ocv:func:`getRowSumFilter`
|
||||
|
||||
|
||||
|
||||
@@ -356,6 +358,7 @@ Explore the data types. As it was mentioned in the
|
||||
In case of non-separable filtering, ``bufType`` must be the same as ``srcType`` . The source data is copied to the temporary buffer, if needed, and then just passed to ``FilterEngine::filter2D`` . That is, the input type for ``filter2D`` is ``srcType`` (= ``bufType`` ) and the output type is ``dstType`` .
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`BaseColumnFilter`,
|
||||
:ocv:func:`BaseFilter`,
|
||||
:ocv:func:`BaseRowFilter`,
|
||||
@@ -426,13 +429,13 @@ The function smoothes an image using the kernel:
|
||||
The call ``blur(src, dst, ksize, anchor, borderType)`` is equivalent to ``boxFilter(src, dst, src.type(), anchor, true, borderType)`` .
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`boxFilter`,
|
||||
:ocv:func:`bilateralFilter`,
|
||||
:ocv:func:`GaussianBlur`,
|
||||
:ocv:func:`medianBlur`
|
||||
|
||||
|
||||
|
||||
borderInterpolate
|
||||
---------------------
|
||||
Computes the source location of an extrapolated pixel.
|
||||
@@ -458,8 +461,9 @@ Normally, the function is not called directly. It is used inside
|
||||
:ocv:func:`copyMakeBorder` to compute tables for quick extrapolation.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`copyMakeBorder`
|
||||
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`copyMakeBorder`
|
||||
|
||||
|
||||
|
||||
@@ -500,11 +504,12 @@ and so on). If you need to compute pixel sums over variable-size windows, use
|
||||
:ocv:func:`integral` .
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`boxFilter`,
|
||||
:ocv:func:`bilateralFilter`,
|
||||
:ocv:func:`GaussianBlur`,
|
||||
:ocv:func:`medianBlur`,
|
||||
:ocv:func:`integral`
|
||||
|
||||
:ocv:func:`boxFilter`,
|
||||
:ocv:func:`bilateralFilter`,
|
||||
:ocv:func:`GaussianBlur`,
|
||||
:ocv:func:`medianBlur`,
|
||||
:ocv:func:`integral`
|
||||
|
||||
|
||||
|
||||
@@ -540,7 +545,13 @@ Forms a border around an image.
|
||||
|
||||
:param dst: Destination image of the same type as ``src`` and the size ``Size(src.cols+left+right, src.rows+top+bottom)`` .
|
||||
|
||||
:param top, bottom, left, right: Parameter specifying how many pixels in each direction from the source image rectangle to extrapolate. For example, ``top=1, bottom=1, left=1, right=1`` mean that 1 pixel-wide border needs to be built.
|
||||
:param top:
|
||||
|
||||
:param bottom:
|
||||
|
||||
:param left:
|
||||
|
||||
:param right: Parameter specifying how many pixels in each direction from the source image rectangle to extrapolate. For example, ``top=1, bottom=1, left=1, right=1`` mean that 1 pixel-wide border needs to be built.
|
||||
|
||||
:param borderType: Border type. See :ocv:func:`borderInterpolate` for details.
|
||||
|
||||
@@ -567,7 +578,8 @@ The function supports the mode when ``src`` is already in the middle of ``dst``
|
||||
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`borderInterpolate`
|
||||
|
||||
:ocv:func:`borderInterpolate`
|
||||
|
||||
|
||||
createBoxFilter
|
||||
@@ -606,9 +618,10 @@ The function itself is used by
|
||||
:ocv:func:`boxFilter` .
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`blur`,
|
||||
:ocv:func:`boxFilter`
|
||||
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`blur`,
|
||||
:ocv:func:`boxFilter`
|
||||
|
||||
|
||||
|
||||
@@ -637,10 +650,11 @@ The function :ocv:func:`createDerivFilter` is a small convenience function that
|
||||
:ocv:func:`Scharr` .
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`createSeparableLinearFilter`,
|
||||
:ocv:func:`getDerivKernels`,
|
||||
:ocv:func:`Scharr`,
|
||||
:ocv:func:`Sobel`
|
||||
|
||||
:ocv:func:`createSeparableLinearFilter`,
|
||||
:ocv:func:`getDerivKernels`,
|
||||
:ocv:func:`Scharr`,
|
||||
:ocv:func:`Sobel`
|
||||
|
||||
|
||||
|
||||
@@ -666,9 +680,10 @@ The function :ocv:func:`createGaussianFilter` computes Gaussian kernel coefficie
|
||||
:ocv:func:`createSeparableFilter` directly.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`createSeparableLinearFilter`,
|
||||
:ocv:func:`getGaussianKernel`,
|
||||
:ocv:func:`GaussianBlur`
|
||||
|
||||
:ocv:func:`createSeparableLinearFilter`,
|
||||
:ocv:func:`getGaussianKernel`,
|
||||
:ocv:func:`GaussianBlur`
|
||||
|
||||
|
||||
|
||||
@@ -692,7 +707,9 @@ Creates a non-separable linear filter engine.
|
||||
|
||||
:param bits: Number of the fractional bits. the parameter is used when the kernel is an integer matrix representing fixed-point filter coefficients.
|
||||
|
||||
:param rowBorderType, columnBorderType: Pixel extrapolation methods in the horizontal and vertical directions. See :ocv:func:`borderInterpolate` for details.
|
||||
:param rowBorderType: Pixel extrapolation method in the vertical direction. For details, see :ocv:func:`borderInterpolate`.
|
||||
|
||||
:param columnBorderType: Pixel extrapolation method in the horizontal direction.
|
||||
|
||||
:param borderValue: Border vaule used in case of a constant border.
|
||||
|
||||
@@ -700,9 +717,10 @@ The function returns a pointer to a 2D linear filter for the specified kernel, t
|
||||
:ocv:func:`FilterEngine` constructor.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`createSeparableLinearFilter`,
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`filter2D`
|
||||
|
||||
:ocv:func:`createSeparableLinearFilter`,
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`filter2D`
|
||||
|
||||
|
||||
createMorphologyFilter
|
||||
@@ -729,7 +747,9 @@ Creates an engine for non-separable morphological operations.
|
||||
|
||||
:param anchor: Anchor position within the structuring element. Negative values mean that the anchor is at the kernel center.
|
||||
|
||||
:param rowBorderType, columnBorderType: Pixel extrapolation methods in the horizontal and vertical directions. See :ocv:func:`borderInterpolate` for details.
|
||||
:param rowBorderType: Pixel extrapolation method in the vertical direction. For details, see :ocv:func:`borderInterpolate`.
|
||||
|
||||
:param columnBorderType: Pixel extrapolation method in the horizontal direction.
|
||||
|
||||
:param borderValue: Border value in case of a constant border. The default value, \ ``morphologyDefaultBorderValue`` , has a special meaning. It is transformed :math:`+\inf` for the erosion and to :math:`-\inf` for the dilation, which means that the minimum (maximum) is effectively computed only over the pixels that are inside the image.
|
||||
|
||||
@@ -742,10 +762,11 @@ Note that
|
||||
:ocv:func:`createMorphologyFilter` analyzes the structuring element shape and builds a separable morphological filter engine when the structuring element is square.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`erode`,
|
||||
:ocv:func:`dilate`,
|
||||
:ocv:func:`morphologyEx`,
|
||||
:ocv:func:`FilterEngine`
|
||||
|
||||
:ocv:func:`erode`,
|
||||
:ocv:func:`dilate`,
|
||||
:ocv:func:`morphologyEx`,
|
||||
:ocv:func:`FilterEngine`
|
||||
|
||||
|
||||
createSeparableLinearFilter
|
||||
@@ -774,7 +795,9 @@ Creates an engine for a separable linear filter.
|
||||
|
||||
:param bits: Number of the fractional bits. The parameter is used when the kernel is an integer matrix representing fixed-point filter coefficients.
|
||||
|
||||
:param rowBorderType, columnBorderType: Pixel extrapolation methods in the horizontal and vertical directions. See :ocv:func:`borderInterpolate` for details.
|
||||
:param rowBorderType: Pixel extrapolation method in the vertical direction. For details, see :ocv:func:`borderInterpolate`.
|
||||
|
||||
:param columnBorderType: Pixel extrapolation method in the horizontal direction.
|
||||
|
||||
:param borderValue: Border value used in case of a constant border.
|
||||
|
||||
@@ -787,10 +810,11 @@ The functions construct primitive separable linear filtering operations or a fil
|
||||
:ocv:func:`FilterEngine` constructor.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`sepFilter2D`,
|
||||
:ocv:func:`createLinearFilter`,
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`getKernelType`
|
||||
|
||||
:ocv:func:`sepFilter2D`,
|
||||
:ocv:func:`createLinearFilter`,
|
||||
:ocv:func:`FilterEngine`,
|
||||
:ocv:func:`getKernelType`
|
||||
|
||||
|
||||
dilate
|
||||
@@ -827,9 +851,10 @@ The function dilates the source image using the specified structuring element th
|
||||
The function supports the in-place mode. Dilation can be applied several ( ``iterations`` ) times. In case of multi-channel images, each channel is processed independently.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`erode`,
|
||||
:ocv:func:`morphologyEx`,
|
||||
:ocv:func:`createMorphologyFilter`
|
||||
|
||||
:ocv:func:`erode`,
|
||||
:ocv:func:`morphologyEx`,
|
||||
:ocv:func:`createMorphologyFilter`
|
||||
|
||||
|
||||
erode
|
||||
@@ -866,9 +891,10 @@ The function erodes the source image using the specified structuring element tha
|
||||
The function supports the in-place mode. Erosion can be applied several ( ``iterations`` ) times. In case of multi-channel images, each channel is processed independently.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`dilate`,
|
||||
:ocv:func:`morphologyEx`,
|
||||
:ocv:func:`createMorphologyFilter`
|
||||
|
||||
:ocv:func:`dilate`,
|
||||
:ocv:func:`morphologyEx`,
|
||||
:ocv:func:`createMorphologyFilter`
|
||||
|
||||
|
||||
|
||||
@@ -911,10 +937,11 @@ That is, the kernel is not mirrored around the anchor point. If you need a real
|
||||
The function uses the DFT-based algorithm in case of sufficiently large kernels (~``11 x 11`` or larger) and the direct algorithm (that uses the engine retrieved by :ocv:func:`createLinearFilter` ) for small kernels.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`sepFilter2D`,
|
||||
:ocv:func:`createLinearFilter`,
|
||||
:ocv:func:`dft`,
|
||||
:ocv:func:`matchTemplate`
|
||||
|
||||
:ocv:func:`sepFilter2D`,
|
||||
:ocv:func:`createLinearFilter`,
|
||||
:ocv:func:`dft`,
|
||||
:ocv:func:`matchTemplate`
|
||||
|
||||
|
||||
|
||||
@@ -932,13 +959,16 @@ Smoothes an image using a Gaussian filter.
|
||||
|
||||
:param ksize: Gaussian kernel size. ``ksize.width`` and ``ksize.height`` can differ but they both must be positive and odd. Or, they can be zero's and then they are computed from ``sigma*`` .
|
||||
|
||||
: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 :ocv:func:`getGaussianKernel` for details. To fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ``ksize`` , ``sigmaX`` , and ``sigmaY`` .
|
||||
:param sigmaX: Gaussian kernel standard deviation in X direction.
|
||||
|
||||
:param sigmaY: Gaussian kernel standard deviation in Y direction. If ``sigmaY`` is zero, it is set to be equal to ``sigmaX`` . If both sigmas are zeros, they are computed from ``ksize.width`` and ``ksize.height`` , respectively. See :ocv:func:`getGaussianKernel` for details. To fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ``ksize`` , ``sigmaX`` , and ``sigmaY`` .
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
|
||||
|
||||
The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`sepFilter2D`,
|
||||
:ocv:func:`filter2D`,
|
||||
:ocv:func:`blur`,
|
||||
@@ -1009,6 +1039,7 @@ Two of such generated kernels can be passed to
|
||||
:ocv:func:`GaussianBlur`.
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`sepFilter2D`,
|
||||
:ocv:func:`createSeparableLinearFilter`,
|
||||
:ocv:func:`getDerivKernels`,
|
||||
@@ -1111,10 +1142,11 @@ The function smoothes an image using the median filter with the
|
||||
:math:`\texttt{ksize} \times \texttt{ksize}` aperture. Each channel of a multi-channel image is processed independently. In-place operation is supported.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`bilateralFilter`,
|
||||
:ocv:func:`blur`,
|
||||
:ocv:func:`boxFilter`,
|
||||
:ocv:func:`GaussianBlur`
|
||||
|
||||
:ocv:func:`bilateralFilter`,
|
||||
:ocv:func:`blur`,
|
||||
:ocv:func:`boxFilter`,
|
||||
:ocv:func:`GaussianBlur`
|
||||
|
||||
|
||||
|
||||
@@ -1188,9 +1220,10 @@ Morphological gradient:
|
||||
Any of the operations can be done in-place.
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`dilate`,
|
||||
:ocv:func:`erode`,
|
||||
:ocv:func:`createMorphologyFilter`
|
||||
|
||||
:ocv:func:`dilate`,
|
||||
:ocv:func:`erode`,
|
||||
:ocv:func:`createMorphologyFilter`
|
||||
|
||||
|
||||
|
||||
@@ -1234,8 +1267,9 @@ This is done when ``ksize > 1`` . When ``ksize == 1`` , the Laplacian is compute
|
||||
\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`Sobel`,
|
||||
:ocv:func:`Scharr`
|
||||
|
||||
:ocv:func:`Sobel`,
|
||||
:ocv:func:`Scharr`
|
||||
|
||||
|
||||
|
||||
@@ -1370,6 +1404,7 @@ Applies a separable linear filter to an image.
|
||||
The function applies a separable linear filter to the image. That is, first, every row of ``src`` is filtered with the 1D kernel ``rowKernel`` . Then, every column of the result is filtered with the 1D kernel ``columnKernel`` . The final result shifted by ``delta`` is stored in ``dst`` .
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`createSeparableLinearFilter`,
|
||||
:ocv:func:`filter2D`,
|
||||
:ocv:func:`Sobel`,
|
||||
@@ -1392,7 +1427,7 @@ Smooths the image in one of several ways.
|
||||
|
||||
:param smoothtype: Type of the smoothing:
|
||||
|
||||
* **CV_BLUR_NO_SCALE** linear convolution with :math:`\texttt{param1}\times\texttt{param2}` box kernel (all 1's). If you want to smooth different pixels with different-size box kernels, you can use the integral image that is computed using :ref:`Integral`
|
||||
* **CV_BLUR_NO_SCALE** linear convolution with :math:`\texttt{param1}\times\texttt{param2}` box kernel (all 1's). If you want to smooth different pixels with different-size box kernels, you can use the integral image that is computed using :ocv:func:`integral`
|
||||
|
||||
|
||||
* **CV_BLUR** linear convolution with :math:`\texttt{param1}\times\texttt{param2}` box kernel (all 1's) with subsequent scaling by :math:`1/(\texttt{param1}\cdot\texttt{param2})`
|
||||
@@ -1500,11 +1535,12 @@ The second case corresponds to a kernel of:
|
||||
\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`Scharr`,
|
||||
:ocv:func:`Lapacian`,
|
||||
:ocv:func:`sepFilter2D`,
|
||||
:ocv:func:`filter2D`,
|
||||
:ocv:func:`GaussianBlur`
|
||||
|
||||
:ocv:func:`Scharr`,
|
||||
:ocv:func:`Lapacian`,
|
||||
:ocv:func:`sepFilter2D`,
|
||||
:ocv:func:`filter2D`,
|
||||
:ocv:func:`GaussianBlur`
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ In case when you specify the forward mapping
|
||||
:math:`\left<f_x, f_y\right>: \texttt{dst} \rightarrow \texttt{src}` and then use the above formula.
|
||||
|
||||
The actual implementations of the geometrical transformations, from the most generic
|
||||
:ref:`Remap` and to the simplest and the fastest
|
||||
:ref:`Resize` , need to solve two main problems with the above formula:
|
||||
:ocv:func:`remap` and to the simplest and the fastest
|
||||
:ocv:func:`resize` , need to solve two main problems with the above formula:
|
||||
|
||||
*
|
||||
Extrapolation of non-existing pixels. Similarly to the filtering functions described in the previous section, for some
|
||||
@@ -32,7 +32,7 @@ The actual implementations of the geometrical transformations, from the most gen
|
||||
, where a polynomial function is fit into some neighborhood of the computed pixel
|
||||
:math:`(f_x(x,y), f_y(x,y))` , and then the value of the polynomial at
|
||||
:math:`(f_x(x,y), f_y(x,y))` is taken as the interpolated pixel value. In OpenCV, you can choose between several interpolation methods. See
|
||||
:ref:`Resize` for details.
|
||||
:ocv:func:`resize` for details.
|
||||
|
||||
convertMaps
|
||||
-----------
|
||||
@@ -67,10 +67,11 @@ The function converts a pair of maps for
|
||||
*
|
||||
Reverse conversion. Obviously, the reconstructed floating-point maps will not be exactly the same as the originals.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`remap`,
|
||||
:ocv:func:`undisort`,
|
||||
:ocv:func:`initUndistortRectifyMap`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`remap`,
|
||||
:ocv:func:`undisort`,
|
||||
:ocv:func:`initUndistortRectifyMap`
|
||||
|
||||
|
||||
|
||||
@@ -78,11 +79,12 @@ getAffineTransform
|
||||
----------------------
|
||||
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:pyoldfunction:: cv.GetAffineTransform(src, dst, mapMatrix)-> None
|
||||
|
||||
:param src: Coordinates of triangle vertices in the source image.
|
||||
@@ -103,9 +105,10 @@ where
|
||||
src(i)=(x_i, y_i),
|
||||
i=0,1,2
|
||||
|
||||
See Also:
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`transform`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`transform`
|
||||
|
||||
|
||||
|
||||
@@ -113,11 +116,12 @@ getPerspectiveTransform
|
||||
---------------------------
|
||||
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:pyoldfunction:: cv.GetPerspectiveTransform(src, dst, mapMatrix)-> None
|
||||
|
||||
:param src: Coordinates of quadrangle vertices in the source image.
|
||||
@@ -138,10 +142,11 @@ where
|
||||
src(i)=(x_i, y_i),
|
||||
i=0,1,2,3
|
||||
|
||||
See Also:
|
||||
:ocv:func:`findHomography`,
|
||||
:ocv:func:`warpPerspective`,
|
||||
:ocv:func:`perspectiveTransform`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`findHomography`,
|
||||
:ocv:func:`warpPerspective`,
|
||||
:ocv:func:`perspectiveTransform`
|
||||
|
||||
|
||||
getRectSubPix
|
||||
@@ -179,9 +184,10 @@ outside. In this case, the replication border mode (see
|
||||
:ocv:func:`borderInterpolate` ) is used to extrapolate
|
||||
the pixel values outside of the image.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`warpPerspective`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`warpPerspective`
|
||||
|
||||
|
||||
getRotationMatrix2D
|
||||
@@ -218,12 +224,11 @@ where
|
||||
|
||||
The transformation maps the rotation center to itself. If this is not the target, adjust the shift.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`getAffineTransform`,
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`transform`
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`getAffineTransform`,
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`transform`
|
||||
|
||||
|
||||
|
||||
@@ -269,21 +274,22 @@ Remaps an image to log-polar space.
|
||||
|
||||
:param flags: A combination of interpolation methods and the following optional flags:
|
||||
|
||||
* **CV_WARP_FILL_OUTLIERS** fills all of the destination image pixels. If some of them correspond to outliers in the source image, they are set to zero
|
||||
|
||||
* **CV_WARP_FILL_OUTLIERS** fills all of the destination image pixels. If some of them correspond to outliers in the source image, they are set to zero
|
||||
|
||||
* **CV_WARP_INVERSE_MAP** See below
|
||||
* **CV_WARP_INVERSE_MAP** See below
|
||||
|
||||
The function ``cvLogPolar`` transforms the source image using the following transformation:
|
||||
|
||||
* Forward transformation (``CV_WARP_INVERSE_MAP``is not set):
|
||||
*
|
||||
Forward transformation (``CV_WARP_INVERSE_MAP``is not set):
|
||||
|
||||
.. math::
|
||||
|
||||
dst( \phi , \rho ) = src(x,y)
|
||||
|
||||
|
||||
* Inverse transformation (``CV_WARP_INVERSE_MAP`` is set):
|
||||
*
|
||||
Inverse transformation (``CV_WARP_INVERSE_MAP`` is set):
|
||||
|
||||
.. math::
|
||||
|
||||
@@ -409,12 +415,11 @@ If you want to decimate the image by factor of 2 in each direction, you can call
|
||||
|
||||
To shrink an image, it will generally look best with CV_INTER_AREA interpolation, whereas to enlarge an image, it will generally look best with CV_INTER_CUBIC (slow) or CV_INTER_LINEAR (faster but still looks OK).
|
||||
|
||||
See Also:
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`warpPerspective`,
|
||||
:ocv:func:`remap`
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`warpPerspective`,
|
||||
:ocv:func:`remap`
|
||||
|
||||
|
||||
warpAffine
|
||||
@@ -455,12 +460,13 @@ when the flag ``WARP_INVERSE_MAP`` is set. Otherwise, the transformation is firs
|
||||
:ocv:func:`invertAffineTransform` and then put in the formula above instead of ``M`` .
|
||||
The function cannot operate in-place.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`warpPerspective`,
|
||||
:ocv:func:`resize`,
|
||||
:ocv:func:`remap`,
|
||||
:ocv:func:`getRectSubPix`,
|
||||
:ocv:func:`transform`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`warpPerspective`,
|
||||
:ocv:func:`resize`,
|
||||
:ocv:func:`remap`,
|
||||
:ocv:func:`getRectSubPix`,
|
||||
:ocv:func:`transform`
|
||||
|
||||
|
||||
.. note:: ``cvGetQuadrangleSubPix`` is similar to ``cvWarpAffine``, but the outliers are extrapolated using replication border mode.
|
||||
@@ -501,12 +507,13 @@ when the flag ``WARP_INVERSE_MAP`` is set. Otherwise, the transformation is firs
|
||||
:ocv:func:`invert` and then put in the formula above instead of ``M`` .
|
||||
The function cannot operate in-place.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`resize`,
|
||||
:ocv:func:`remap`,
|
||||
:ocv:func:`getRectSubPix`,
|
||||
:ocv:func:`perspectiveTransform`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`warpAffine`,
|
||||
:ocv:func:`resize`,
|
||||
:ocv:func:`remap`,
|
||||
:ocv:func:`getRectSubPix`,
|
||||
:ocv:func:`perspectiveTransform`
|
||||
|
||||
|
||||
|
||||
@@ -529,27 +536,27 @@ Computes the undistortion and rectification transformation map.
|
||||
|
||||
:param distCoeffs: Input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5, or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
|
||||
|
||||
:param R: Optional rectification transformation in the object space (3x3 matrix). ``R1`` or ``R2`` , computed by :ref:`StereoRectify` can be passed here. If the matrix is empty, the identity transformation is assumed. In ``cvInitUndistortMap`` R assumed to be an identity matrix.
|
||||
:param R: Optional rectification transformation in the object space (3x3 matrix). ``R1`` or ``R2`` , computed by :ocv:func:`stereoRectify` can be passed here. If the matrix is empty, the identity transformation is assumed. In ``cvInitUndistortMap`` R assumed to be an identity matrix.
|
||||
|
||||
:param newCameraMatrix: New camera matrix :math:`A'=\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}` .
|
||||
|
||||
:param size: Undistorted image size.
|
||||
|
||||
:param m1type: Type of the first output map that can be ``CV_32FC1`` or ``CV_16SC2`` . See :ref:`convertMaps` for details.
|
||||
:param m1type: Type of the first output map that can be ``CV_32FC1`` or ``CV_16SC2`` . See :ocv:func:`convertMaps` for details.
|
||||
|
||||
:param map1: The first output map.
|
||||
|
||||
:param map2: The second output map.
|
||||
|
||||
The function computes the joint undistortion and rectification transformation and represents the result in the form of maps for
|
||||
:ref:`Remap` . The undistorted image looks like original, as if it is captured with a camera using the camera matrix ``=newCameraMatrix`` and zero distortion. In case of a monocular camera, ``newCameraMatrix`` is usually equal to ``cameraMatrix`` , or it can be computed by
|
||||
:ref:`GetOptimalNewCameraMatrix` for a better control over scaling. In case of a stereo camera, ``newCameraMatrix`` is normally set to ``P1`` or ``P2`` computed by
|
||||
:ref:`StereoRectify` .
|
||||
:ocv:func:`remap` . The undistorted image looks like original, as if it is captured with a camera using the camera matrix ``=newCameraMatrix`` and zero distortion. In case of a monocular camera, ``newCameraMatrix`` is usually equal to ``cameraMatrix`` , or it can be computed by
|
||||
:ocv:func:`getOptimalNewCameraMatrix` for a better control over scaling. In case of a stereo camera, ``newCameraMatrix`` is normally set to ``P1`` or ``P2`` computed by
|
||||
:ocv:func:`stereoRectify` .
|
||||
|
||||
Also, this new camera is oriented differently in the coordinate space, according to ``R`` . That, for example, helps to align two heads of a stereo camera so that the epipolar lines on both images become horizontal and have the same y- coordinate (in case of a horizontally aligned stereo camera).
|
||||
|
||||
The function actually builds the maps for the inverse mapping algorithm that is used by
|
||||
:ref:`Remap` . That is, for each pixel
|
||||
:ocv:func:`remap` . That is, for each pixel
|
||||
:math:`(u, v)` in the destination (corrected and rectified) image, the function computes the corresponding coordinates in the source image (that is, in the original image from camera). The following process is applied:
|
||||
|
||||
.. math::
|
||||
@@ -560,9 +567,9 @@ where
|
||||
:math:`(k_1, k_2, p_1, p_2[, k_3])` are the distortion coefficients.
|
||||
|
||||
In case of a stereo camera, this function is called twice: once for each camera head, after
|
||||
:ref:`StereoRectify` , which in its turn is called after
|
||||
:ref:`StereoCalibrate` . But if the stereo camera was not calibrated, it is still possible to compute the rectification transformations directly from the fundamental matrix using
|
||||
:ref:`StereoRectifyUncalibrated` . For each camera, the function computes homography ``H`` as the rectification transformation in a pixel domain, not a rotation matrix ``R`` in 3D space. ``R`` can be computed from ``H`` as
|
||||
:ocv:func:`stereoRectify` , which in its turn is called after
|
||||
:ocv:func:`stereoCalibrate` . But if the stereo camera was not calibrated, it is still possible to compute the rectification transformations directly from the fundamental matrix using
|
||||
:ocv:func:`stereoRectifyUncalibrated` . For each camera, the function computes homography ``H`` as the rectification transformation in a pixel domain, not a rotation matrix ``R`` in 3D space. ``R`` can be computed from ``H`` as
|
||||
|
||||
.. math::
|
||||
|
||||
@@ -587,7 +594,7 @@ Returns the default new camera matrix.
|
||||
|
||||
:param centerPrincipalPoint: Location of the principal point in the new camera matrix. The parameter indicates whether this location should be at the image center or not.
|
||||
|
||||
The function returns the camera matrix that is either an exact copy of the input ``cameraMatrix`` (when ``centerPrinicipalPoint=false`` ), or the modified one (when ``centerPrincipalPoint`` =true).
|
||||
The function returns the camera matrix that is either an exact copy of the input ``cameraMatrix`` (when ``centerPrinicipalPoint=false`` ), or the modified one (when ``centerPrincipalPoint=true``).
|
||||
|
||||
In the latter case, the new camera matrix will be:
|
||||
|
||||
@@ -602,8 +609,8 @@ where
|
||||
:math:`(1,1)` elements of ``cameraMatrix`` , respectively.
|
||||
|
||||
By default, the undistortion functions in OpenCV (see
|
||||
:ref:`initUndistortRectifyMap`,
|
||||
:ref:`undistort`) do not move the principal point. However, when you work with stereo, it is important to move the principal points in both views to the same y-coordinate (which is required by most of stereo correspondence algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for each view where the principal points are located at the center.
|
||||
:ocv:func:`initUndistortRectifyMap`,
|
||||
:ocv:func:`undistort`) do not move the principal point. However, when you work with stereo, it is important to move the principal points in both views to the same y-coordinate (which is required by most of stereo correspondence algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for each view where the principal points are located at the center.
|
||||
|
||||
|
||||
|
||||
@@ -639,10 +646,10 @@ The function is simply a combination of
|
||||
Those pixels in the destination image, for which there is no correspondent pixels in the source image, are filled with zeros (black color).
|
||||
|
||||
A particular subset of the source image that will be visible in the corrected image can be regulated by ``newCameraMatrix`` . You can use
|
||||
:ref:`GetOptimalNewCameraMatrix` to compute the appropriate ``newCameraMatrix`` depending on your requirements.
|
||||
:ocv:func:`getOptimalNewCameraMatrix` to compute the appropriate ``newCameraMatrix`` depending on your requirements.
|
||||
|
||||
The camera matrix and the distortion parameters can be determined using
|
||||
:ref:`calibrateCamera` . If the resolution of images is different from the resolution used at the calibration stage,
|
||||
:ocv:func:`calibrateCamera` . If the resolution of images is different from the resolution used at the calibration stage,
|
||||
:math:`f_x, f_y, c_x` and
|
||||
:math:`c_y` need to be scaled accordingly, while the distortion coefficients remain the same.
|
||||
|
||||
@@ -666,14 +673,14 @@ Computes the ideal point coordinates from the observed point coordinates.
|
||||
|
||||
:param distCoeffs: Input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5, or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
|
||||
|
||||
:param R: Rectification transformation in the object space (3x3 matrix). ``R1`` or ``R2`` computed by :ref:`StereoRectify` can be passed here. If the matrix is empty, the identity transformation is used.
|
||||
:param R: Rectification transformation in the object space (3x3 matrix). ``R1`` or ``R2`` computed by :ocv:func:`stereoRectify` can be passed here. If the matrix is empty, the identity transformation is used.
|
||||
|
||||
:param P: New camera matrix (3x3) or new projection matrix (3x4). ``P1`` or ``P2`` computed by :ref:`StereoRectify` can be passed here. If the matrix is empty, the identity new camera matrix is used.
|
||||
:param P: New camera matrix (3x3) or new projection matrix (3x4). ``P1`` or ``P2`` computed by :ocv:func:`stereoRectify` can be passed here. If the matrix is empty, the identity new camera matrix is used.
|
||||
|
||||
The function is similar to
|
||||
:ref:`undistort` and
|
||||
:ref:`initUndistortRectifyMap` but it operates on a sparse set of points instead of a raster image. Also the function performs a reverse transformation to
|
||||
:ref:`projectPoints` . In case of a 3D object, it does not reconstruct its 3D coordinates, but for a planar object, it does, up to a translation vector, if the proper ``R`` is specified. ::
|
||||
:ocv:func:`undistort` and
|
||||
:ocv:func:`initUndistortRectifyMap` but it operates on a sparse set of points instead of a raster image. Also the function performs a reverse transformation to
|
||||
:ocv:func:`projectPoints` . In case of a 3D object, it does not reconstruct its 3D coordinates, but for a planar object, it does, up to a translation vector, if the proper ``R`` is specified. ::
|
||||
|
||||
// (u,v) is the input point, (u', v') is the output point
|
||||
// camera_matrix=[fx 0 cx; 0 fy cy; 0 0 1]
|
||||
|
||||
@@ -145,9 +145,7 @@ The functions ``calcBackProject`` calculate the back project of the histogram. T
|
||||
This is an approximate algorithm of the
|
||||
:ocv:func:`CAMShift` color object tracker.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`calcHist`
|
||||
|
||||
.. seealso:: :ocv:func:`calcHist`
|
||||
.. _compareHist:
|
||||
|
||||
compareHist
|
||||
@@ -312,7 +310,7 @@ Locates a template within an image by using a histogram comparison.
|
||||
|
||||
:param hist: Histogram
|
||||
|
||||
:param method: Comparison method, passed to :ref:`CompareHist` (see description of that function)
|
||||
:param method: Comparison method, passed to :ocv:cfunc:`CompareHist` (see description of that function)
|
||||
|
||||
:param factor: Normalization factor for histograms, will affect the normalization scale of the destination image, pass 1 if unsure
|
||||
|
||||
@@ -420,7 +418,11 @@ Returns a pointer to the histogram bin.
|
||||
|
||||
:param hist: Histogram
|
||||
|
||||
:param idx0, idx1, idx2, idx3: Indices of the bin
|
||||
:param idx0: 0-th index
|
||||
|
||||
:param idx1: 1-st index
|
||||
|
||||
:param idx2: 2-nd index
|
||||
|
||||
:param idx: Array of indices
|
||||
|
||||
@@ -475,9 +477,9 @@ Makes a histogram out of an array.
|
||||
|
||||
:param data: Array that will be used to store histogram bins
|
||||
|
||||
:param ranges: Histogram bin ranges, see :ref:`CreateHist`
|
||||
:param ranges: Histogram bin ranges, see :ocv:cfunc:`CreateHist`
|
||||
|
||||
:param uniform: Uniformity flag, see :ref:`CreateHist`
|
||||
:param uniform: Uniformity flag, see :ocv:cfunc:`CreateHist`
|
||||
|
||||
The function initializes the histogram, whose header and bins are allocated by the user. :ocv:cfunc:`ReleaseHist` does not need to be called afterwards. Only dense histograms can be initialized this way. The function returns ``hist``.
|
||||
|
||||
@@ -511,7 +513,11 @@ Queries the value of the histogram bin.
|
||||
|
||||
:param hist: Histogram
|
||||
|
||||
:param idx0, idx1, idx2, idx3: Indices of the bin
|
||||
:param idx0: 0-th index
|
||||
|
||||
:param idx1: 1-st index
|
||||
|
||||
:param idx2: 2-nd index
|
||||
|
||||
:param idx: Array of indices
|
||||
|
||||
@@ -536,9 +542,9 @@ Sets the bounds of the histogram bins.
|
||||
|
||||
:param hist: Histogram
|
||||
|
||||
:param ranges: Array of bin ranges arrays, see :ref:`CreateHist`
|
||||
:param ranges: Array of bin ranges arrays, see :ocv:cfunc:`CreateHist`
|
||||
|
||||
:param uniform: Uniformity flag, see :ref:`CreateHist`
|
||||
:param uniform: Uniformity flag, see :ocv:cfunc:`CreateHist`
|
||||
|
||||
The function is a stand-alone function for setting bin ranges in the histogram. For a more detailed description of the parameters ``ranges`` and ``uniform`` see the :ocv:cfunc:`CalcHist` function, that can initialize the ranges as well. Ranges for the histogram bins must be set before the histogram is calculated or the backproject of the histogram is calculated.
|
||||
|
||||
@@ -581,5 +587,4 @@ between the calculated minimum and maximum distances are incremented
|
||||
|
||||
.. [RubnerSept98] Y. Rubner. C. Tomasi, L.J. Guibas. The Earth Mover’s Distance as a Metric for Image Retrieval. Technical Report STAN-CS-TN-98-86, Department of Computer Science, Stanford University, September 1998.
|
||||
|
||||
.. [Iivarinen97] Jukka Iivarinen, Markus Peura, Jaakko Srel, and Ari Visa. Comparison of Combined Shape Descriptors for Irregular Objects, 8th British Machine Vision Conference, BMVC'97.
|
||||
http://www.cis.hut.fi/research/IA/paper/publications/bmvc97/bmvc97.html
|
||||
.. [Iivarinen97] Jukka Iivarinen, Markus Peura, Jaakko Srel, and Ari Visa. Comparison of Combined Shape Descriptors for Irregular Objects, 8th British Machine Vision Conference, BMVC'97. http://www.cis.hut.fi/research/IA/paper/publications/bmvc97/bmvc97.html
|
||||
@@ -60,10 +60,11 @@ where
|
||||
|
||||
The function can process the image in-place.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`threshold`,
|
||||
:ocv:func:`blur`,
|
||||
:ocv:func:`GaussianBlur`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`threshold`,
|
||||
:ocv:func:`blur`,
|
||||
:ocv:func:`GaussianBlur`
|
||||
|
||||
|
||||
|
||||
@@ -579,10 +580,7 @@ where
|
||||
|
||||
Use these functions to either mark a connected component with the specified color in-place, or build a mask and then extract the contour, or copy the region to another image, and so on. Various modes of the function are demonstrated in the ``floodfill.cpp`` sample.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`findContours`
|
||||
|
||||
|
||||
.. seealso:: :ocv:func:`findContours`
|
||||
|
||||
|
||||
|
||||
@@ -743,13 +741,13 @@ Currently, Otsu's method is implemented only for 8-bit images.
|
||||
|
||||
.. image:: pics/threshold.png
|
||||
|
||||
See Also:
|
||||
:ocv:func:`adaptiveThreshold`,
|
||||
:ocv:func:`findContours`,
|
||||
:ocv:func:`compare`,
|
||||
:ocv:func:`min`,
|
||||
:ocv:func:`max`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`adaptiveThreshold`,
|
||||
:ocv:func:`findContours`,
|
||||
:ocv:func:`compare`,
|
||||
:ocv:func:`min`,
|
||||
:ocv:func:`max`
|
||||
|
||||
|
||||
watershed
|
||||
@@ -787,9 +785,7 @@ example, when such tangent components exist in the initial
|
||||
marker image. Visual demonstration and usage example of the function
|
||||
can be found in the OpenCV samples directory (see the ``watershed.cpp`` demo).
|
||||
|
||||
See Also:
|
||||
:ocv:func:`findContours`
|
||||
|
||||
.. seealso:: :ocv:func:`findContours`
|
||||
|
||||
|
||||
grabCut
|
||||
@@ -814,7 +810,9 @@ Runs the GrabCut algorithm.
|
||||
|
||||
:param rect: ROI containing a segmented object. The pixels outside of the ROI are marked as "obvious background". The parameter is only used when ``mode==GC_INIT_WITH_RECT`` .
|
||||
|
||||
:param bgdModel, fgdModel: Temporary arrays used for segmentation. Do not modify them while you are processing the same image.
|
||||
:param bgdModel: Temporary array for the background model. Do not modify it while you are processing the same image.
|
||||
|
||||
:param fgdModel: Temporary arrays for the foreground model. Do not modify it while you are processing the same image.
|
||||
|
||||
:param iterCount: Number of iterations the algorithm should make before returning the result. Note that the result can be refined with further calls with ``mode==GC_INIT_WITH_MASK`` or ``mode==GC_EVAL`` .
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ ClearSubdivVoronoi2D
|
||||
|
||||
The function removes all of the virtual points. It
|
||||
is called internally in
|
||||
:ref:`CalcSubdivVoronoi2D`
|
||||
:ocv:cfunc:`CalcSubdivVoronoi2D`
|
||||
if the subdivision
|
||||
was modified after previous call to the function.
|
||||
|
||||
@@ -154,7 +154,7 @@ Creates an empty Delaunay triangulation.
|
||||
|
||||
The function creates an empty Delaunay
|
||||
subdivision, where 2d points can be added using the function
|
||||
:ref:`SubdivDelaunay2DInsert`
|
||||
:ocv:cfunc:`SubdivDelaunay2DInsert`
|
||||
. All of the points to be added must be within
|
||||
the specified rectangle, otherwise a runtime error will be raised.
|
||||
|
||||
@@ -177,7 +177,7 @@ The function is another function that
|
||||
locates the input point within the subdivision. It finds the subdivision vertex that
|
||||
is the closest to the input point. It is not necessarily one of vertices
|
||||
of the facet containing the input point, though the facet (located using
|
||||
:ref:`Subdiv2DLocate`
|
||||
:ocv:cfunc:`Subdiv2DLocate`
|
||||
) is used as a starting
|
||||
point. The function returns a pointer to the found subdivision vertex.
|
||||
|
||||
@@ -194,8 +194,7 @@ The function returns the edge destination. The
|
||||
returned pointer may be NULL if the edge is from dual subdivision and
|
||||
the virtual point coordinates are not calculated yet. The virtual points
|
||||
can be calculated using the function
|
||||
:ref:`CalcSubdivVoronoi2D`
|
||||
.
|
||||
:ocv:cfunc:`CalcSubdivVoronoi2D`.
|
||||
|
||||
Subdiv2DGetEdge
|
||||
---------------
|
||||
@@ -319,7 +318,7 @@ Inserts a single point into a Delaunay triangulation.
|
||||
.. ocv:cfunction:: CvSubdiv2DPoint* cvSubdivDelaunay2DInsert( CvSubdiv2D* subdiv, CvPoint2D32f pt)
|
||||
.. ocv:pyoldfunction:: cv.SubdivDelaunay2DInsert(subdiv, pt)-> point
|
||||
|
||||
:param subdiv: Delaunay subdivision created by the function :ref:`CreateSubdivDelaunay2D`
|
||||
:param subdiv: Delaunay subdivision created by the function :ocv:cfunc:`CreateSubdivDelaunay2D`
|
||||
|
||||
:param pt: Inserted point
|
||||
|
||||
|
||||
@@ -71,9 +71,10 @@ The moments of a contour are defined in the same way but computed using Green's
|
||||
http://en.wikipedia.org/wiki/Green_theorem
|
||||
). So, due to a limited raster resolution, the moments computed for a contour are slightly different from the moments computed for the same rasterized contour.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`contourArea`,
|
||||
:ocv:func:`arcLength`
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`contourArea`,
|
||||
:ocv:func:`arcLength`
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +82,7 @@ HuMoments
|
||||
-------------
|
||||
Calculates the seven Hu invariants.
|
||||
|
||||
.. ocv:function:: void HuMoments( const Moments& moments, double h[7] )
|
||||
.. ocv:function:: void HuMoments( const Moments& moments, double* hu )
|
||||
|
||||
.. ocv:pyfunction:: cv2.HuMoments(m) -> hu
|
||||
|
||||
@@ -90,14 +91,14 @@ Calculates the seven Hu invariants.
|
||||
.. ocv:pyoldfunction:: cv.GetHuMoments(moments) -> hu
|
||||
|
||||
:param moments: Input moments computed with :ocv:func:`moments` .
|
||||
:param h: Output Hu invariants.
|
||||
:param hu: Output Hu invariants.
|
||||
|
||||
The function calculates the seven Hu invariants (introduced in [Hu62]_; see also
|
||||
http://en.wikipedia.org/wiki/Image_moment) defined as:
|
||||
|
||||
.. math::
|
||||
|
||||
\begin{array}{l} h[0]= \eta _{20}+ \eta _{02} \\ h[1]=( \eta _{20}- \eta _{02})^{2}+4 \eta _{11}^{2} \\ h[2]=( \eta _{30}-3 \eta _{12})^{2}+ (3 \eta _{21}- \eta _{03})^{2} \\ h[3]=( \eta _{30}+ \eta _{12})^{2}+ ( \eta _{21}+ \eta _{03})^{2} \\ h[4]=( \eta _{30}-3 \eta _{12})( \eta _{30}+ \eta _{12})[( \eta _{30}+ \eta _{12})^{2}-3( \eta _{21}+ \eta _{03})^{2}]+(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ h[5]=( \eta _{20}- \eta _{02})[( \eta _{30}+ \eta _{12})^{2}- ( \eta _{21}+ \eta _{03})^{2}]+4 \eta _{11}( \eta _{30}+ \eta _{12})( \eta _{21}+ \eta _{03}) \\ h[6]=(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}]-( \eta _{30}-3 \eta _{12})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ \end{array}
|
||||
\begin{array}{l} hu[0]= \eta _{20}+ \eta _{02} \\ hu[1]=( \eta _{20}- \eta _{02})^{2}+4 \eta _{11}^{2} \\ hu[2]=( \eta _{30}-3 \eta _{12})^{2}+ (3 \eta _{21}- \eta _{03})^{2} \\ hu[3]=( \eta _{30}+ \eta _{12})^{2}+ ( \eta _{21}+ \eta _{03})^{2} \\ hu[4]=( \eta _{30}-3 \eta _{12})( \eta _{30}+ \eta _{12})[( \eta _{30}+ \eta _{12})^{2}-3( \eta _{21}+ \eta _{03})^{2}]+(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ hu[5]=( \eta _{20}- \eta _{02})[( \eta _{30}+ \eta _{12})^{2}- ( \eta _{21}+ \eta _{03})^{2}]+4 \eta _{11}( \eta _{30}+ \eta _{12})( \eta _{21}+ \eta _{03}) \\ hu[6]=(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}]-( \eta _{30}-3 \eta _{12})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ \end{array}
|
||||
|
||||
where
|
||||
:math:`\eta_{ji}` stands for
|
||||
@@ -105,8 +106,7 @@ where
|
||||
|
||||
These values are proved to be invariants to the image scale, rotation, and reflection except the seventh one, whose sign is changed by reflection. This invariance is proved with the assumption of infinite image resolution. In case of raster images, the computed Hu invariants for the original and transformed images are a bit different.
|
||||
|
||||
See Also:
|
||||
:ocv:func:`matchShapes`
|
||||
.. seealso:: :ocv:func:`matchShapes`
|
||||
|
||||
|
||||
findContours
|
||||
@@ -280,7 +280,7 @@ Approximates Freeman chain(s) with a polygonal curve.
|
||||
|
||||
:param storage: Storage location for the resulting polylines
|
||||
|
||||
:param method: Approximation method (see the description of the function :ref:`FindContours` )
|
||||
:param method: Approximation method (see the description of the function :ocv:cfunc:`FindContours` )
|
||||
|
||||
:param parameter: Method parameter (not used now)
|
||||
|
||||
@@ -463,7 +463,9 @@ Fits a line to a 2D or 3D point set.
|
||||
|
||||
:param param: Numerical parameter ( ``C`` ) for some types of distances. If it is 0, an optimal value is chosen.
|
||||
|
||||
:param reps, aeps: Sufficient accuracy for the radius (distance between the coordinate origin and the line) and angle, respectively. 0.01 would be a good default value for both.
|
||||
:param reps: Sufficient accuracy for the radius (distance between the coordinate origin and the line).
|
||||
|
||||
:param aeps: Sufficient accuracy for the angle. 0.01 would be a good default value for ``reps`` and ``aeps``.
|
||||
|
||||
The function ``fitLine`` fits a line to a 2D or 3D point set by minimizing
|
||||
:math:`\sum_i \rho(r_i)` where
|
||||
|
||||
Reference in New Issue
Block a user