mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Fixed documentation: corrected parameter names
This commit is contained in:
@@ -52,7 +52,7 @@ Calculates eigenvalues and eigenvectors of image blocks for corner detection.
|
||||
|
||||
:param blockSize: Neighborhood size (see details below).
|
||||
|
||||
:param apertureSize: Aperture parameter for the :ocv:func:`Sobel` operator.
|
||||
:param ksize: Aperture parameter for the :ocv:func:`Sobel` operator.
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` .
|
||||
|
||||
@@ -105,7 +105,7 @@ Harris edge detector.
|
||||
|
||||
:param blockSize: Neighborhood size (see the details on :ocv:func:`cornerEigenValsAndVecs` ).
|
||||
|
||||
:param apertureSize: Aperture parameter for the :ocv:func:`Sobel` operator.
|
||||
:param ksize: Aperture parameter for the :ocv:func:`Sobel` operator.
|
||||
|
||||
:param k: Harris detector free parameter. See the formula below.
|
||||
|
||||
@@ -145,7 +145,7 @@ Calculates the minimal eigenvalue of gradient matrices for corner detection.
|
||||
|
||||
:param blockSize: Neighborhood size (see the details on :ocv:func:`cornerEigenValsAndVecs` ).
|
||||
|
||||
:param apertureSize: Aperture parameter for the :ocv:func:`Sobel` operator.
|
||||
:param ksize: Aperture parameter for the :ocv:func:`Sobel` operator.
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` .
|
||||
|
||||
@@ -232,9 +232,9 @@ Determines strong corners on an image.
|
||||
|
||||
:param image: Input 8-bit or floating-point 32-bit, single-channel image.
|
||||
|
||||
:param eigImage: The parameter is ignored.
|
||||
:param eig_image: The parameter is ignored.
|
||||
|
||||
:param tempImage: The parameter is ignored.
|
||||
:param temp_image: The parameter is ignored.
|
||||
|
||||
:param corners: Output vector of detected corners.
|
||||
|
||||
@@ -298,7 +298,7 @@ Finds circles in a grayscale image using the Hough transform.
|
||||
|
||||
:param circles: Output vector of found circles. Each vector is encoded as a 3-element floating-point vector :math:`(x, y, radius)` .
|
||||
|
||||
:param circleStorage: In C function this is a memory storage that will contain the output sequence of found circles.
|
||||
:param circle_storage: In C function this is a memory storage that will contain the output sequence of found circles.
|
||||
|
||||
:param method: Detection method to use. Currently, the only implemented method is ``CV_HOUGH_GRADIENT`` , which is basically *21HT* , described in [Yuen90]_.
|
||||
|
||||
@@ -516,7 +516,7 @@ Calculates a feature map for corner detection.
|
||||
|
||||
:param dst: Output image that has the type ``CV_32F`` and the same size as ``src`` .
|
||||
|
||||
:param apertureSize: Aperture size of the :ocv:func:`Sobel` .
|
||||
:param ksize: Aperture size of the :ocv:func:`Sobel` .
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` .
|
||||
|
||||
|
||||
@@ -678,9 +678,9 @@ Returns an engine for smoothing images with the Gaussian filter.
|
||||
|
||||
:param ksize: Aperture size. See :ocv:func:`getGaussianKernel` .
|
||||
|
||||
:param sigmaX: Gaussian sigma in the horizontal direction. See :ocv:func:`getGaussianKernel` .
|
||||
:param sigma1: Gaussian sigma in the horizontal direction. See :ocv:func:`getGaussianKernel` .
|
||||
|
||||
:param sigmaY: Gaussian sigma in the vertical direction. If 0, then :math:`\texttt{sigmaY}\leftarrow\texttt{sigmaX}` .
|
||||
:param sigma2: Gaussian sigma in the vertical direction. If 0, then :math:`\texttt{sigma2}\leftarrow\texttt{sigma1}` .
|
||||
|
||||
:param borderType: Border type to use. See :ocv:func:`borderInterpolate` .
|
||||
|
||||
@@ -701,7 +701,7 @@ createLinearFilter
|
||||
----------------------
|
||||
Creates a non-separable linear filter engine.
|
||||
|
||||
.. ocv:function:: Ptr<FilterEngine> createLinearFilter( int srcType, int dstType, InputArray kernel, Point _anchor=Point(-1,-1), double delta=0, int _rowBorderType=BORDER_DEFAULT, int _columnBorderType=-1, const Scalar& _borderValue=Scalar() )
|
||||
.. ocv:function:: Ptr<FilterEngine> createLinearFilter( int srcType, int dstType, InputArray kernel, Point _anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar& borderValue=Scalar() )
|
||||
|
||||
.. ocv:function:: Ptr<BaseFilter> getLinearFilter(int srcType, int dstType, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int bits=0)
|
||||
|
||||
@@ -737,7 +737,7 @@ createMorphologyFilter
|
||||
--------------------------
|
||||
Creates an engine for non-separable morphological operations.
|
||||
|
||||
.. ocv:function:: Ptr<FilterEngine> createMorphologyFilter( int op, int type, InputArray kernel, Point anchor=Point(-1,-1), int _rowBorderType=BORDER_CONSTANT, int _columnBorderType=-1, const Scalar& _borderValue=morphologyDefaultBorderValue() )
|
||||
.. ocv:function:: Ptr<FilterEngine> createMorphologyFilter( int op, int type, InputArray kernel, Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT, int columnBorderType=-1, const Scalar& borderValue=morphologyDefaultBorderValue() )
|
||||
|
||||
.. ocv:function:: Ptr<BaseFilter> getMorphologyFilter( int op, int type, InputArray kernel, Point anchor=Point(-1,-1) )
|
||||
|
||||
@@ -751,9 +751,9 @@ Creates an engine for non-separable morphological operations.
|
||||
|
||||
:param type: Input/output image type. The number of channels can be arbitrary. The depth should be one of ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F` or ``CV_64F``.
|
||||
|
||||
:param element: 2D 8-bit structuring element for a morphological operation. Non-zero elements indicate the pixels that belong to the element.
|
||||
:param kernel: 2D 8-bit structuring element for a morphological operation. Non-zero elements indicate the pixels that belong to the element.
|
||||
|
||||
:param esize: Horizontal or vertical structuring element size for separable morphological operations.
|
||||
:param ksize: Horizontal or vertical structuring element size for separable morphological operations.
|
||||
|
||||
:param anchor: Anchor position within the structuring element. Negative values mean that the anchor is at the kernel center.
|
||||
|
||||
@@ -783,7 +783,7 @@ createSeparableLinearFilter
|
||||
-------------------------------
|
||||
Creates an engine for a separable linear filter.
|
||||
|
||||
.. ocv:function:: Ptr<FilterEngine> createSeparableLinearFilter( int srcType, int dstType, InputArray rowKernel, InputArray columnKernel, Point _anchor=Point(-1,-1), double delta=0, int _rowBorderType=BORDER_DEFAULT, int _columnBorderType=-1, const Scalar& _borderValue=Scalar() )
|
||||
.. ocv:function:: Ptr<FilterEngine> createSeparableLinearFilter( int srcType, int dstType, InputArray rowKernel, InputArray columnKernel, Point anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar& borderValue=Scalar() )
|
||||
|
||||
.. ocv:function:: Ptr<BaseColumnFilter> getLinearColumnFilter( int bufType, int dstType, InputArray kernel, int anchor, int symmetryType, double delta=0, int bits=0 )
|
||||
|
||||
@@ -1126,9 +1126,9 @@ Returns a structuring element of the specified size and shape for morphological
|
||||
|
||||
:param anchor: Anchor position within the element. The default value :math:`(-1, -1)` means that the anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor position. In other cases the anchor just regulates how much the result of the morphological operation is shifted.
|
||||
|
||||
:param anchorX: x-coordinate of the anchor
|
||||
:param anchor_x: x-coordinate of the anchor
|
||||
|
||||
:param anchorY: y-coordinate of the anchor
|
||||
:param anchor_y: y-coordinate of the anchor
|
||||
|
||||
:param values: integer array of ``cols``*``rows`` elements that specifies the custom shape of the structuring element, when ``shape=CV_SHAPE_CUSTOM``.
|
||||
|
||||
@@ -1418,9 +1418,9 @@ Applies a separable linear filter to an image.
|
||||
|
||||
when ``ddepth=-1``, the destination image will have the same depth as the source.
|
||||
|
||||
:param rowKernel: Coefficients for filtering each row.
|
||||
:param kernelX: Coefficients for filtering each row.
|
||||
|
||||
:param columnKernel: Coefficients for filtering each column.
|
||||
:param kernelY: Coefficients for filtering each column.
|
||||
|
||||
:param anchor: Anchor position within the kernel. The default value :math:`(-1, 1)` means that the anchor is at the kernel center.
|
||||
|
||||
@@ -1428,7 +1428,7 @@ Applies a separable linear filter to an image.
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
|
||||
|
||||
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`` .
|
||||
The function applies a separable linear filter to the image. That is, first, every row of ``src`` is filtered with the 1D kernel ``kernelX`` . Then, every column of the result is filtered with the 1D kernel ``kernelY`` . The final result shifted by ``delta`` is stored in ``dst`` .
|
||||
|
||||
.. seealso::
|
||||
|
||||
@@ -1454,32 +1454,32 @@ 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 :ocv:func:`integral`
|
||||
* **CV_BLUR_NO_SCALE** linear convolution with :math:`\texttt{size1}\times\texttt{size2}` 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})`
|
||||
* **CV_BLUR** linear convolution with :math:`\texttt{size1}\times\texttt{size2}` box kernel (all 1's) with subsequent scaling by :math:`1/(\texttt{size1}\cdot\texttt{size2})`
|
||||
|
||||
|
||||
* **CV_GAUSSIAN** linear convolution with a :math:`\texttt{param1}\times\texttt{param2}` Gaussian kernel
|
||||
* **CV_GAUSSIAN** linear convolution with a :math:`\texttt{size1}\times\texttt{size2}` Gaussian kernel
|
||||
|
||||
|
||||
* **CV_MEDIAN** median filter with a :math:`\texttt{param1}\times\texttt{param1}` square aperture
|
||||
* **CV_MEDIAN** median filter with a :math:`\texttt{size1}\times\texttt{size1}` square aperture
|
||||
|
||||
|
||||
* **CV_BILATERAL** bilateral filter with a :math:`\texttt{param1}\times\texttt{param1}` square aperture, color sigma= ``param3`` and spatial sigma= ``param4`` . If ``param1=0`` , the aperture square side is set to ``cvRound(param4*1.5)*2+1`` . Information about bilateral filtering can be found at http://www.dai.ed.ac.uk/CVonline/LOCAL\_COPIES/MANDUCHI1/Bilateral\_Filtering.html
|
||||
* **CV_BILATERAL** bilateral filter with a :math:`\texttt{size1}\times\texttt{size1}` square aperture, color sigma= ``sigma1`` and spatial sigma= ``sigma2`` . If ``size1=0`` , the aperture square side is set to ``cvRound(sigma2*1.5)*2+1`` . Information about bilateral filtering can be found at http://www.dai.ed.ac.uk/CVonline/LOCAL\_COPIES/MANDUCHI1/Bilateral\_Filtering.html
|
||||
|
||||
|
||||
:param param1: The first parameter of the smoothing operation, the aperture width. Must be a positive odd number (1, 3, 5, ...)
|
||||
:param size1: The first parameter of the smoothing operation, the aperture width. Must be a positive odd number (1, 3, 5, ...)
|
||||
|
||||
:param param2: The second parameter of the smoothing operation, the aperture height. Ignored by ``CV_MEDIAN`` and ``CV_BILATERAL`` methods. In the case of simple scaled/non-scaled and Gaussian blur if ``param2`` is zero, it is set to ``param1`` . Otherwise it must be a positive odd number.
|
||||
:param size2: The second parameter of the smoothing operation, the aperture height. Ignored by ``CV_MEDIAN`` and ``CV_BILATERAL`` methods. In the case of simple scaled/non-scaled and Gaussian blur if ``size2`` is zero, it is set to ``size1`` . Otherwise it must be a positive odd number.
|
||||
|
||||
:param param3: In the case of a Gaussian parameter this parameter may specify Gaussian :math:`\sigma` (standard deviation). If it is zero, it is calculated from the kernel size:
|
||||
:param sigma1: In the case of a Gaussian parameter this parameter may specify Gaussian :math:`\sigma` (standard deviation). If it is zero, it is calculated from the kernel size:
|
||||
|
||||
.. math::
|
||||
|
||||
\sigma = 0.3 (n/2 - 1) + 0.8 \quad \text{where} \quad n= \begin{array}{l l} \mbox{\texttt{param1} for horizontal kernel} \\ \mbox{\texttt{param2} for vertical kernel} \end{array}
|
||||
\sigma = 0.3 (n/2 - 1) + 0.8 \quad \text{where} \quad n= \begin{array}{l l} \mbox{\texttt{size1} for horizontal kernel} \\ \mbox{\texttt{size2} for vertical kernel} \end{array}
|
||||
|
||||
Using standard sigma for small kernels ( :math:`3\times 3` to :math:`7\times 7` ) gives better speed. If ``param3`` is not zero, while ``param1`` and ``param2`` are zeros, the kernel size is calculated from the sigma (to provide accurate enough operation).
|
||||
Using standard sigma for small kernels ( :math:`3\times 3` to :math:`7\times 7` ) gives better speed. If ``sigma1`` is not zero, while ``size1`` and ``size2`` are zeros, the kernel size is calculated from the sigma (to provide accurate enough operation).
|
||||
|
||||
The function smooths an image using one of several methods. Every of the methods has some features and restrictions listed below:
|
||||
|
||||
@@ -1593,9 +1593,9 @@ Calculates the first x- or y- image derivative using Scharr operator.
|
||||
|
||||
:param ddepth: Destination image depth. See :ocv:func:`Sobel` for the list of supported combination of ``src.depth()`` and ``ddepth``.
|
||||
|
||||
:param xorder: Order of the derivative x.
|
||||
:param dx: Order of the derivative x.
|
||||
|
||||
:param yorder: Order of the derivative y.
|
||||
:param dy: Order of the derivative y.
|
||||
|
||||
:param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :ocv:func:`getDerivKernels` for details.
|
||||
|
||||
@@ -1607,13 +1607,13 @@ The function computes the first x- or y- spatial image derivative using the Scha
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{Scharr(src, dst, ddepth, xorder, yorder, scale, delta, borderType)}
|
||||
\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}
|
||||
|
||||
is equivalent to
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{Sobel(src, dst, ddepth, xorder, yorder, CV\_SCHARR, scale, delta, borderType)} .
|
||||
\texttt{Sobel(src, dst, ddepth, dx, dy, CV\_SCHARR, scale, delta, borderType)} .
|
||||
|
||||
.. seealso::
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ Calculates an affine matrix of 2D rotation.
|
||||
|
||||
:param scale: Isotropic scale factor.
|
||||
|
||||
:param mapMatrix: The output affine transformation, 2x3 floating-point matrix.
|
||||
:param map_matrix: The output affine transformation, 2x3 floating-point matrix.
|
||||
|
||||
The function calculates the following matrix:
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ Calculates a histogram of a set of arrays.
|
||||
.. ocv:cfunction:: void cvCalcHist( IplImage** image, CvHistogram* hist, int accumulate=0, const CvArr* mask=NULL )
|
||||
.. 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 images: 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 narrays: Number of source arrays.
|
||||
:param nimages: Number of source images.
|
||||
|
||||
:param channels: List of the ``dims`` channels used to compute the histogram. The first array channels are numerated from 0 to ``arrays[0].channels()-1`` , the second array channels are counted from ``arrays[0].channels()`` to ``arrays[0].channels() + arrays[1].channels()-1``, and so on.
|
||||
:param channels: List of the ``dims`` channels used to compute the histogram. The first array channels are numerated from 0 to ``images[0].channels()-1`` , the second array channels are counted from ``images[0].channels()`` to ``images[0].channels() + images[1].channels()-1``, and so on.
|
||||
|
||||
:param mask: Optional mask. If the matrix is not empty, it must be an 8-bit array of the same size as ``arrays[i]`` . The non-zero mask elements mark the array elements counted in the histogram.
|
||||
:param mask: Optional mask. If the matrix is not empty, it must be an 8-bit array of the same size as ``images[i]`` . The non-zero mask elements mark the array elements counted in the histogram.
|
||||
|
||||
:param hist: Output histogram, which is a dense or sparse ``dims`` -dimensional array.
|
||||
|
||||
@@ -115,15 +115,15 @@ Calculates the back projection of a histogram.
|
||||
.. ocv:cfunction:: void cvCalcBackProject( IplImage** image, CvArr* backProject, const CvHistogram* hist )
|
||||
.. ocv:pyoldfunction:: cv.CalcBackProject(image, back_project, 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 images: 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 narrays: Number of source arrays.
|
||||
:param nimages: Number of source images.
|
||||
|
||||
:param channels: The list of channels used to compute the back projection. The number of channels must match the histogram dimensionality. The first array channels are numerated from 0 to ``arrays[0].channels()-1`` , the second array channels are counted from ``arrays[0].channels()`` to ``arrays[0].channels() + arrays[1].channels()-1``, and so on.
|
||||
:param channels: The list of channels used to compute the back projection. The number of channels must match the histogram dimensionality. The first array channels are numerated from 0 to ``images[0].channels()-1`` , the second array channels are counted from ``images[0].channels()`` to ``images[0].channels() + images[1].channels()-1``, and so on.
|
||||
|
||||
:param hist: Input histogram that can be dense or sparse.
|
||||
|
||||
:param backProject: Destination back projection array that is a single-channel array of the same size and depth as ``arrays[0]`` .
|
||||
:param backProject: Destination back projection array that is a single-channel array of the same size and depth as ``images[0]`` .
|
||||
|
||||
:param ranges: Array of arrays of the histogram bin boundaries in each dimension. See :ocv:func:`calcHist` .
|
||||
|
||||
@@ -235,7 +235,7 @@ Computes the "minimal work" distance between two weighted point configurations.
|
||||
|
||||
:param distType: Used metric. ``CV_DIST_L1, CV_DIST_L2`` , and ``CV_DIST_C`` stand for one of the standard metrics. ``CV_DIST_USER`` means that a pre-calculated cost matrix ``cost`` is used.
|
||||
|
||||
:param distFunc: Custom distance function supported by the old interface. ``CvDistanceFunction`` is defined as: ::
|
||||
:param distance_func: Custom distance function supported by the old interface. ``CvDistanceFunction`` is defined as: ::
|
||||
|
||||
typedef float (CV_CDECL * CvDistanceFunction)( const float* a,
|
||||
const float* b, void* userdata );
|
||||
@@ -333,7 +333,7 @@ Divides one histogram by another.
|
||||
|
||||
:param hist2: Second histogram.
|
||||
|
||||
:param dsthist: Destination histogram.
|
||||
:param dst_hist: Destination histogram.
|
||||
|
||||
:param scale: Scale factor for the destination histogram.
|
||||
|
||||
|
||||
@@ -499,7 +499,7 @@ Fills a connected component with the given color.
|
||||
|
||||
.. note:: Since the mask is larger than the filled image, a pixel :math:`(x, y)` in ``image`` corresponds to the pixel :math:`(x+1, y+1)` in the ``mask`` .
|
||||
|
||||
:param seed: Starting point.
|
||||
:param seedPoint: Starting point.
|
||||
|
||||
:param newVal: New value of the repainted domain pixels.
|
||||
|
||||
@@ -529,7 +529,7 @@ The functions ``floodFill`` fill a connected component starting from the seed po
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)+ \texttt{upDiff}
|
||||
\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}
|
||||
|
||||
in case of a grayscale image and fixed range
|
||||
|
||||
@@ -556,17 +556,17 @@ The functions ``floodFill`` fill a connected component starting from the seed po
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_r+ \texttt{upDiff} _r,
|
||||
\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_g+ \texttt{upDiff} _g
|
||||
\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g
|
||||
|
||||
and
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_b+ \texttt{upDiff} _b
|
||||
\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b
|
||||
|
||||
in case of a color image and fixed range
|
||||
|
||||
@@ -663,9 +663,9 @@ Applies a fixed-level threshold to each array element.
|
||||
|
||||
:param thresh: Threshold value.
|
||||
|
||||
:param maxVal: Maximum value to use with the ``THRESH_BINARY`` and ``THRESH_BINARY_INV`` thresholding types.
|
||||
:param maxval: Maximum value to use with the ``THRESH_BINARY`` and ``THRESH_BINARY_INV`` thresholding types.
|
||||
|
||||
:param thresholdType: Thresholding type (see the details below).
|
||||
:param type: Thresholding type (see the details below).
|
||||
|
||||
The function applies fixed-level thresholding
|
||||
to a single-channel array. The function is typically used to get a
|
||||
@@ -673,19 +673,19 @@ bi-level (binary) image out of a grayscale image (
|
||||
:ocv:func:`compare` could
|
||||
be also used for this purpose) or for removing a noise, that is, filtering
|
||||
out pixels with too small or too large values. There are several
|
||||
types of thresholding supported by the function. They are determined by ``thresholdType`` :
|
||||
types of thresholding supported by the function. They are determined by ``type`` :
|
||||
|
||||
* **THRESH_BINARY**
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{dst} (x,y) = \fork{\texttt{maxVal}}{if $\texttt{src}(x,y) > \texttt{thresh}$}{0}{otherwise}
|
||||
\texttt{dst} (x,y) = \fork{\texttt{maxval}}{if $\texttt{src}(x,y) > \texttt{thresh}$}{0}{otherwise}
|
||||
|
||||
* **THRESH_BINARY_INV**
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{dst} (x,y) = \fork{0}{if $\texttt{src}(x,y) > \texttt{thresh}$}{\texttt{maxVal}}{otherwise}
|
||||
\texttt{dst} (x,y) = \fork{0}{if $\texttt{src}(x,y) > \texttt{thresh}$}{\texttt{maxval}}{otherwise}
|
||||
|
||||
* **THRESH_TRUNC**
|
||||
|
||||
@@ -755,7 +755,7 @@ Runs the GrabCut algorithm.
|
||||
|
||||
.. ocv:pyfunction:: cv2.grabCut(img, mask, rect, bgdModel, fgdModel, iterCount[, mode]) -> None
|
||||
|
||||
:param image: Input 8-bit 3-channel image.
|
||||
:param img: 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:
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ Approximates a polygonal curve(s) with the specified precision.
|
||||
|
||||
.. ocv:pyfunction:: cv2.approxPolyDP(curve, epsilon, closed[, approxCurve]) -> approxCurve
|
||||
|
||||
.. ocv:cfunction:: CvSeq* cvApproxPoly( const void* src_seq, int header_size, CvMemStorage* storage, int method, double parameter, int parameter2=0 )
|
||||
.. ocv:cfunction:: CvSeq* cvApproxPoly( const void* src_seq, int header_size, CvMemStorage* storage, int method, double eps, int recursive=0 )
|
||||
|
||||
:param curve: Input vector of a 2D point stored in:
|
||||
|
||||
@@ -191,7 +191,7 @@ Approximates a polygonal curve(s) with the specified precision.
|
||||
|
||||
:param closed: If true, the approximated curve is closed (its first and last vertices are connected). Otherwise, it is not closed.
|
||||
|
||||
:param headerSize: Header size of the approximated curve. Normally, ``sizeof(CvContour)`` is used.
|
||||
:param header_size: Header size of the approximated curve. Normally, ``sizeof(CvContour)`` is used.
|
||||
|
||||
:param storage: Memory storage where the approximated curve is stored.
|
||||
|
||||
@@ -213,7 +213,7 @@ Approximates Freeman chain(s) with a polygonal curve.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.ApproxChains(src_seq, storage, method=CV_CHAIN_APPROX_SIMPLE, parameter=0, minimal_perimeter=0, recursive=0)-> contours
|
||||
|
||||
:param chain: Pointer to the approximated Freeman chain that can refer to other chains.
|
||||
:param src_seq: Pointer to the approximated Freeman chain that can refer to other chains.
|
||||
|
||||
:param storage: Storage location for the resulting polylines.
|
||||
|
||||
@@ -221,7 +221,7 @@ Approximates Freeman chain(s) with a polygonal curve.
|
||||
|
||||
:param parameter: Method parameter (not used now).
|
||||
|
||||
:param minimalPerimeter: Approximates only those contours whose perimeters are not less than ``minimal_perimeter`` . Other chains are removed from the resulting structure.
|
||||
:param minimal_perimeter: Approximates only those contours whose perimeters are not less than ``minimal_perimeter`` . Other chains are removed from the resulting structure.
|
||||
|
||||
:param recursive: Recursion flag. If it is non-zero, the function approximates all chains that can be obtained from ``chain`` by using the ``h_next`` or ``v_next`` links. Otherwise, the single input chain is approximated.
|
||||
|
||||
@@ -323,7 +323,7 @@ Finds the convex hull of a point set.
|
||||
|
||||
: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 are the convex hull points themselves.
|
||||
|
||||
:param storage: Output memory storage in the old API (``cvConvexHull2`` returns a sequence containing the convex hull points or their indices).
|
||||
:param hull_storage: Output memory storage in the old API (``cvConvexHull2`` returns a sequence containing the convex hull points or their indices).
|
||||
|
||||
:param clockwise: Orientation flag. If it is true, the output convex hull is oriented clockwise. Otherwise, it is oriented counter-clockwise. The usual screen coordinate system is assumed so that the origin is at the top-left corner, x axis is oriented to the right, and y axis is oriented downwards.
|
||||
|
||||
|
||||
@@ -60,20 +60,20 @@ namespace cv
|
||||
|
||||
//! various border interpolation methods
|
||||
enum { BORDER_REPLICATE=IPL_BORDER_REPLICATE, BORDER_CONSTANT=IPL_BORDER_CONSTANT,
|
||||
BORDER_REFLECT=IPL_BORDER_REFLECT, BORDER_WRAP=IPL_BORDER_WRAP,
|
||||
BORDER_REFLECT=IPL_BORDER_REFLECT, BORDER_WRAP=IPL_BORDER_WRAP,
|
||||
BORDER_REFLECT_101=IPL_BORDER_REFLECT_101, BORDER_REFLECT101=BORDER_REFLECT_101,
|
||||
BORDER_TRANSPARENT=IPL_BORDER_TRANSPARENT,
|
||||
BORDER_DEFAULT=BORDER_REFLECT_101, BORDER_ISOLATED=16 };
|
||||
|
||||
//! 1D interpolation function: returns coordinate of the "donor" pixel for the specified location p.
|
||||
//! 1D interpolation function: returns coordinate of the "donor" pixel for the specified location p.
|
||||
CV_EXPORTS_W int borderInterpolate( int p, int len, int borderType );
|
||||
|
||||
/*!
|
||||
The Base Class for 1D or Row-wise Filters
|
||||
|
||||
|
||||
This is the base class for linear or non-linear filters that process 1D data.
|
||||
In particular, such filters are used for the "horizontal" filtering parts in separable filters.
|
||||
|
||||
|
||||
Several functions in OpenCV return Ptr<BaseRowFilter> for the specific types of filters,
|
||||
and those pointers can be used directly or within cv::FilterEngine.
|
||||
*/
|
||||
@@ -93,17 +93,17 @@ public:
|
||||
|
||||
/*!
|
||||
The Base Class for Column-wise Filters
|
||||
|
||||
|
||||
This is the base class for linear or non-linear filters that process columns of 2D arrays.
|
||||
Such filters are used for the "vertical" filtering parts in separable filters.
|
||||
|
||||
|
||||
Several functions in OpenCV return Ptr<BaseColumnFilter> for the specific types of filters,
|
||||
and those pointers can be used directly or within cv::FilterEngine.
|
||||
|
||||
|
||||
Unlike cv::BaseRowFilter, cv::BaseColumnFilter may have some context information,
|
||||
i.e. box filter keeps the sliding sum of elements. To reset the state BaseColumnFilter::reset()
|
||||
must be called (e.g. the method is called by cv::FilterEngine)
|
||||
*/
|
||||
*/
|
||||
class CV_EXPORTS BaseColumnFilter
|
||||
{
|
||||
public:
|
||||
@@ -121,15 +121,15 @@ public:
|
||||
|
||||
/*!
|
||||
The Base Class for Non-Separable 2D Filters.
|
||||
|
||||
|
||||
This is the base class for linear or non-linear 2D filters.
|
||||
|
||||
|
||||
Several functions in OpenCV return Ptr<BaseFilter> for the specific types of filters,
|
||||
and those pointers can be used directly or within cv::FilterEngine.
|
||||
|
||||
|
||||
Similar to cv::BaseColumnFilter, the class may have some context information,
|
||||
that should be reset using BaseFilter::reset() method before processing the new array.
|
||||
*/
|
||||
*/
|
||||
class CV_EXPORTS BaseFilter
|
||||
{
|
||||
public:
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
|
||||
/*!
|
||||
The Main Class for Image Filtering.
|
||||
|
||||
|
||||
The class can be used to apply an arbitrary filtering operation to an image.
|
||||
It contains all the necessary intermediate buffers, it computes extrapolated values
|
||||
of the "virtual" pixels outside of the image etc.
|
||||
@@ -156,45 +156,45 @@ public:
|
||||
are returned by various OpenCV functions, such as cv::createSeparableLinearFilter(),
|
||||
cv::createLinearFilter(), cv::createGaussianFilter(), cv::createDerivFilter(),
|
||||
cv::createBoxFilter() and cv::createMorphologyFilter().
|
||||
|
||||
|
||||
Using the class you can process large images by parts and build complex pipelines
|
||||
that include filtering as some of the stages. If all you need is to apply some pre-defined
|
||||
filtering operation, you may use cv::filter2D(), cv::erode(), cv::dilate() etc.
|
||||
functions that create FilterEngine internally.
|
||||
|
||||
|
||||
Here is the example on how to use the class to implement Laplacian operator, which is the sum of
|
||||
second-order derivatives. More complex variant for different types is implemented in cv::Laplacian().
|
||||
|
||||
|
||||
\code
|
||||
void laplace_f(const Mat& src, Mat& dst)
|
||||
{
|
||||
CV_Assert( src.type() == CV_32F );
|
||||
// make sure the destination array has the proper size and type
|
||||
dst.create(src.size(), src.type());
|
||||
|
||||
|
||||
// get the derivative and smooth kernels for d2I/dx2.
|
||||
// for d2I/dy2 we could use the same kernels, just swapped
|
||||
Mat kd, ks;
|
||||
getSobelKernels( kd, ks, 2, 0, ksize, false, ktype );
|
||||
|
||||
|
||||
// let's process 10 source rows at once
|
||||
int DELTA = std::min(10, src.rows);
|
||||
Ptr<FilterEngine> Fxx = createSeparableLinearFilter(src.type(),
|
||||
dst.type(), kd, ks, Point(-1,-1), 0, borderType, borderType, Scalar() );
|
||||
dst.type(), kd, ks, Point(-1,-1), 0, borderType, borderType, Scalar() );
|
||||
Ptr<FilterEngine> Fyy = createSeparableLinearFilter(src.type(),
|
||||
dst.type(), ks, kd, Point(-1,-1), 0, borderType, borderType, Scalar() );
|
||||
|
||||
|
||||
int y = Fxx->start(src), dsty = 0, dy = 0;
|
||||
Fyy->start(src);
|
||||
const uchar* sptr = src.data + y*src.step;
|
||||
|
||||
|
||||
// allocate the buffers for the spatial image derivatives;
|
||||
// the buffers need to have more than DELTA rows, because at the
|
||||
// last iteration the output may take max(kd.rows-1,ks.rows-1)
|
||||
// rows more than the input.
|
||||
Mat Ixx( DELTA + kd.rows - 1, src.cols, dst.type() );
|
||||
Mat Iyy( DELTA + kd.rows - 1, src.cols, dst.type() );
|
||||
|
||||
|
||||
// inside the loop we always pass DELTA rows to the filter
|
||||
// (note that the "proceed" method takes care of possibe overflow, since
|
||||
// it was given the actual image height in the "start" method)
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
int srcType, int dstType, int bufType,
|
||||
int _rowBorderType=BORDER_REPLICATE, int _columnBorderType=-1,
|
||||
const Scalar& _borderValue=Scalar());
|
||||
//! starts filtering of the specified ROI of an image of size wholeSize.
|
||||
//! starts filtering of the specified ROI of an image of size wholeSize.
|
||||
virtual int start(Size wholeSize, Rect roi, int maxBufRows=-1);
|
||||
//! starts filtering of the specified ROI of the specified image.
|
||||
virtual int start(const Mat& src, const Rect& srcRoi=Rect(0,0,-1,-1),
|
||||
@@ -256,10 +256,10 @@ public:
|
||||
bool isolated=false);
|
||||
//! returns true if the filter is separable
|
||||
bool isSeparable() const { return (const BaseFilter*)filter2D == 0; }
|
||||
//! returns the number
|
||||
//! returns the number
|
||||
int remainingInputRows() const;
|
||||
int remainingOutputRows() const;
|
||||
|
||||
|
||||
int srcType, dstType, bufType;
|
||||
Size ksize;
|
||||
Point anchor;
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
vector<uchar> constBorderRow;
|
||||
int bufStep, startY, startY0, endY, rowCount, dstY;
|
||||
vector<uchar*> rows;
|
||||
|
||||
|
||||
Ptr<BaseFilter> filter2D;
|
||||
Ptr<BaseRowFilter> rowFilter;
|
||||
Ptr<BaseColumnFilter> columnFilter;
|
||||
@@ -309,16 +309,16 @@ CV_EXPORTS Ptr<BaseFilter> getLinearFilter(int srcType, int dstType,
|
||||
//! returns the separable linear filter engine
|
||||
CV_EXPORTS Ptr<FilterEngine> createSeparableLinearFilter(int srcType, int dstType,
|
||||
InputArray rowKernel, InputArray columnKernel,
|
||||
Point _anchor=Point(-1,-1), double delta=0,
|
||||
int _rowBorderType=BORDER_DEFAULT,
|
||||
int _columnBorderType=-1,
|
||||
const Scalar& _borderValue=Scalar());
|
||||
Point anchor=Point(-1,-1), double delta=0,
|
||||
int rowBorderType=BORDER_DEFAULT,
|
||||
int columnBorderType=-1,
|
||||
const Scalar& borderValue=Scalar());
|
||||
|
||||
//! returns the non-separable linear filter engine
|
||||
CV_EXPORTS Ptr<FilterEngine> createLinearFilter(int srcType, int dstType,
|
||||
InputArray kernel, Point _anchor=Point(-1,-1),
|
||||
double delta=0, int _rowBorderType=BORDER_DEFAULT,
|
||||
int _columnBorderType=-1, const Scalar& _borderValue=Scalar());
|
||||
double delta=0, int rowBorderType=BORDER_DEFAULT,
|
||||
int columnBorderType=-1, const Scalar& borderValue=Scalar());
|
||||
|
||||
//! returns the Gaussian kernel with the specified parameters
|
||||
CV_EXPORTS_W Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F );
|
||||
@@ -335,7 +335,7 @@ CV_EXPORTS_W void getDerivKernels( OutputArray kx, OutputArray ky,
|
||||
CV_EXPORTS Ptr<FilterEngine> createDerivFilter( int srcType, int dstType,
|
||||
int dx, int dy, int ksize,
|
||||
int borderType=BORDER_DEFAULT );
|
||||
//! returns horizontal 1D box filter
|
||||
//! returns horizontal 1D box filter
|
||||
CV_EXPORTS Ptr<BaseRowFilter> getRowSumFilter(int srcType, int sumType,
|
||||
int ksize, int anchor=-1);
|
||||
//! returns vertical 1D box filter
|
||||
@@ -347,11 +347,11 @@ CV_EXPORTS Ptr<FilterEngine> createBoxFilter( int srcType, int dstType, Size ksi
|
||||
Point anchor=Point(-1,-1),
|
||||
bool normalize=true,
|
||||
int borderType=BORDER_DEFAULT);
|
||||
|
||||
|
||||
//! returns the Gabor kernel with the specified parameters
|
||||
CV_EXPORTS_W Mat getGaborKernel( Size ksize, double sigma, double theta, double lambd,
|
||||
double gamma, double psi=CV_PI*0.5, int ktype=CV_64F );
|
||||
|
||||
|
||||
//! type of morphological operation
|
||||
enum { MORPH_ERODE=CV_MOP_ERODE, MORPH_DILATE=CV_MOP_DILATE,
|
||||
MORPH_OPEN=CV_MOP_OPEN, MORPH_CLOSE=CV_MOP_CLOSE,
|
||||
@@ -365,15 +365,15 @@ CV_EXPORTS Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int
|
||||
//! returns 2D morphological filter
|
||||
CV_EXPORTS Ptr<BaseFilter> getMorphologyFilter(int op, int type, InputArray kernel,
|
||||
Point anchor=Point(-1,-1));
|
||||
|
||||
|
||||
//! returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.
|
||||
static inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); }
|
||||
|
||||
//! returns morphological filter engine. Only MORPH_ERODE and MORPH_DILATE are supported.
|
||||
CV_EXPORTS Ptr<FilterEngine> createMorphologyFilter(int op, int type, InputArray kernel,
|
||||
Point anchor=Point(-1,-1), int _rowBorderType=BORDER_CONSTANT,
|
||||
int _columnBorderType=-1,
|
||||
const Scalar& _borderValue=morphologyDefaultBorderValue());
|
||||
Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT,
|
||||
int columnBorderType=-1,
|
||||
const Scalar& borderValue=morphologyDefaultBorderValue());
|
||||
|
||||
//! shape of the structuring element
|
||||
enum { MORPH_RECT=0, MORPH_CROSS=1, MORPH_ELLIPSE=2 };
|
||||
@@ -382,7 +382,7 @@ CV_EXPORTS_W Mat getStructuringElement(int shape, Size ksize, Point anchor=Point
|
||||
|
||||
template<> CV_EXPORTS void Ptr<IplConvKernel>::delete_obj();
|
||||
|
||||
//! copies 2D array to a larger destination array with extrapolation of the outer part of src using the specified border mode
|
||||
//! copies 2D array to a larger destination array with extrapolation of the outer part of src using the specified border mode
|
||||
CV_EXPORTS_W void copyMakeBorder( InputArray src, OutputArray dst,
|
||||
int top, int bottom, int left, int right,
|
||||
int borderType, const Scalar& value=Scalar() );
|
||||
@@ -418,7 +418,7 @@ CV_EXPORTS_W void sepFilter2D( InputArray src, OutputArray dst, int ddepth,
|
||||
InputArray kernelX, InputArray kernelY,
|
||||
Point anchor=Point(-1,-1),
|
||||
double delta=0, int borderType=BORDER_DEFAULT );
|
||||
|
||||
|
||||
//! applies generalized Sobel operator to the image
|
||||
CV_EXPORTS_W void Sobel( InputArray src, OutputArray dst, int ddepth,
|
||||
int dx, int dy, int ksize=3,
|
||||
@@ -452,7 +452,7 @@ CV_EXPORTS_W void cornerHarris( InputArray src, OutputArray dst, int blockSize,
|
||||
|
||||
// low-level function for computing eigenvalues and eigenvectors of 2x2 matrices
|
||||
CV_EXPORTS void eigen2x2( const float* a, float* e, int n );
|
||||
|
||||
|
||||
//! computes both eigenvalues and the eigenvectors of 2x2 derivative covariation matrix at each pixel. The output is stored as 6-channel matrix.
|
||||
CV_EXPORTS_W void cornerEigenValsAndVecs( InputArray src, OutputArray dst,
|
||||
int blockSize, int ksize,
|
||||
@@ -483,7 +483,7 @@ CV_EXPORTS_W void HoughLinesP( InputArray image, OutputArray lines,
|
||||
double rho, double theta, int threshold,
|
||||
double minLineLength=0, double maxLineGap=0 );
|
||||
|
||||
//! finds circles in the grayscale image using 2+1 gradient Hough transform
|
||||
//! finds circles in the grayscale image using 2+1 gradient Hough transform
|
||||
CV_EXPORTS_W void HoughCircles( InputArray image, OutputArray circles,
|
||||
int method, double dp, double minDist,
|
||||
double param1=100, double param2=100,
|
||||
@@ -494,13 +494,13 @@ CV_EXPORTS_W void erode( InputArray src, OutputArray dst, InputArray kernel,
|
||||
Point anchor=Point(-1,-1), int iterations=1,
|
||||
int borderType=BORDER_CONSTANT,
|
||||
const Scalar& borderValue=morphologyDefaultBorderValue() );
|
||||
|
||||
|
||||
//! dilates the image (applies the local maximum operator)
|
||||
CV_EXPORTS_W void dilate( InputArray src, OutputArray dst, InputArray kernel,
|
||||
Point anchor=Point(-1,-1), int iterations=1,
|
||||
int borderType=BORDER_CONSTANT,
|
||||
const Scalar& borderValue=morphologyDefaultBorderValue() );
|
||||
|
||||
|
||||
//! applies an advanced morphological operation to the image
|
||||
CV_EXPORTS_W void morphologyEx( InputArray src, OutputArray dst,
|
||||
int op, InputArray kernel,
|
||||
@@ -531,7 +531,7 @@ CV_EXPORTS_W void warpAffine( InputArray src, OutputArray dst,
|
||||
int flags=INTER_LINEAR,
|
||||
int borderMode=BORDER_CONSTANT,
|
||||
const Scalar& borderValue=Scalar());
|
||||
|
||||
|
||||
//! warps the image using perspective transformation
|
||||
CV_EXPORTS_W void warpPerspective( InputArray src, OutputArray dst,
|
||||
InputArray M, Size dsize,
|
||||
@@ -556,7 +556,7 @@ CV_EXPORTS_W void remap( InputArray src, OutputArray dst,
|
||||
CV_EXPORTS_W void convertMaps( InputArray map1, InputArray map2,
|
||||
OutputArray dstmap1, OutputArray dstmap2,
|
||||
int dstmap1type, bool nninterpolation=false );
|
||||
|
||||
|
||||
//! returns 2x3 affine transformation matrix for the planar rotation.
|
||||
CV_EXPORTS_W Mat getRotationMatrix2D( Point2f center, double angle, double scale );
|
||||
//! returns 3x3 perspective transformation for the corresponding 4 point pairs.
|
||||
@@ -597,12 +597,12 @@ CV_EXPORTS_W void accumulateProduct( InputArray src1, InputArray src2,
|
||||
CV_EXPORTS_W void accumulateWeighted( InputArray src, InputOutputArray dst,
|
||||
double alpha, InputArray mask=noArray() );
|
||||
|
||||
//! computes PSNR image/video quality metric
|
||||
//! computes PSNR image/video quality metric
|
||||
CV_EXPORTS_W double PSNR(InputArray src1, InputArray src2);
|
||||
|
||||
|
||||
CV_EXPORTS_W Point2d phaseCorrelate(InputArray src1, InputArray src2, InputArray window = noArray());
|
||||
CV_EXPORTS_W void createHanningWindow(OutputArray dst, Size winSize, int type);
|
||||
|
||||
|
||||
//! type of the threshold operation
|
||||
enum { THRESH_BINARY=CV_THRESH_BINARY, THRESH_BINARY_INV=CV_THRESH_BINARY_INV,
|
||||
THRESH_TRUNC=CV_THRESH_TRUNC, THRESH_TOZERO=CV_THRESH_TOZERO,
|
||||
@@ -637,7 +637,7 @@ CV_EXPORTS_W void undistort( InputArray src, OutputArray dst,
|
||||
InputArray cameraMatrix,
|
||||
InputArray distCoeffs,
|
||||
InputArray newCameraMatrix=noArray() );
|
||||
|
||||
|
||||
//! initializes maps for cv::remap() to correct lens distortion and optionally rectify the image
|
||||
CV_EXPORTS_W void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs,
|
||||
InputArray R, InputArray newCameraMatrix,
|
||||
@@ -647,25 +647,25 @@ enum
|
||||
{
|
||||
PROJ_SPHERICAL_ORTHO = 0,
|
||||
PROJ_SPHERICAL_EQRECT = 1
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//! initializes maps for cv::remap() for wide-angle
|
||||
CV_EXPORTS_W float initWideAngleProjMap( InputArray cameraMatrix, InputArray distCoeffs,
|
||||
Size imageSize, int destImageWidth,
|
||||
int m1type, OutputArray map1, OutputArray map2,
|
||||
int projType=PROJ_SPHERICAL_EQRECT, double alpha=0);
|
||||
|
||||
|
||||
//! returns the default new camera matrix (by default it is the same as cameraMatrix unless centerPricipalPoint=true)
|
||||
CV_EXPORTS_W Mat getDefaultNewCameraMatrix( InputArray cameraMatrix, Size imgsize=Size(),
|
||||
bool centerPrincipalPoint=false );
|
||||
|
||||
|
||||
//! returns points' coordinates after lens distortion correction
|
||||
CV_EXPORTS_W void undistortPoints( InputArray src, OutputArray dst,
|
||||
InputArray cameraMatrix, InputArray distCoeffs,
|
||||
InputArray R=noArray(), InputArray P=noArray());
|
||||
|
||||
template<> CV_EXPORTS void Ptr<CvHistogram>::delete_obj();
|
||||
|
||||
|
||||
//! computes the joint dense histogram for a set of images.
|
||||
CV_EXPORTS void calcHist( const Mat* images, int nimages,
|
||||
const int* channels, InputArray mask,
|
||||
@@ -678,7 +678,7 @@ CV_EXPORTS void calcHist( const Mat* images, int nimages,
|
||||
SparseMat& hist, int dims,
|
||||
const int* histSize, const float** ranges,
|
||||
bool uniform=true, bool accumulate=false );
|
||||
|
||||
|
||||
CV_EXPORTS_W void calcHist( InputArrayOfArrays images,
|
||||
const vector<int>& channels,
|
||||
InputArray mask, OutputArray hist,
|
||||
@@ -694,7 +694,7 @@ CV_EXPORTS void calcBackProject( const Mat* images, int nimages,
|
||||
|
||||
//! computes back projection for the set of images
|
||||
CV_EXPORTS void calcBackProject( const Mat* images, int nimages,
|
||||
const int* channels, const SparseMat& hist,
|
||||
const int* channels, const SparseMat& hist,
|
||||
OutputArray backProject, const float** ranges,
|
||||
double scale=1, bool uniform=true );
|
||||
|
||||
@@ -705,8 +705,8 @@ CV_EXPORTS_W void calcBackProject( InputArrayOfArrays images, const vector<int>&
|
||||
|
||||
/*CV_EXPORTS void calcBackProjectPatch( const Mat* images, int nimages, const int* channels,
|
||||
InputArray hist, OutputArray dst, Size patchSize,
|
||||
int method, double factor=1 );
|
||||
|
||||
int method, double factor=1 );
|
||||
|
||||
CV_EXPORTS_W void calcBackProjectPatch( InputArrayOfArrays images, const vector<int>& channels,
|
||||
InputArray hist, OutputArray dst, Size patchSize,
|
||||
int method, double factor=1 );*/
|
||||
@@ -719,7 +719,7 @@ CV_EXPORTS double compareHist( const SparseMat& H1, const SparseMat& H2, int met
|
||||
|
||||
//! normalizes the grayscale image brightness and contrast by normalizing its histogram
|
||||
CV_EXPORTS_W void equalizeHist( InputArray src, OutputArray dst );
|
||||
|
||||
|
||||
CV_EXPORTS float EMD( InputArray signature1, InputArray signature2,
|
||||
int distType, InputArray cost=noArray(),
|
||||
float* lowerBound=0, OutputArray flow=noArray() );
|
||||
@@ -739,7 +739,7 @@ enum
|
||||
GC_BGD = 0, //!< background
|
||||
GC_FGD = 1, //!< foreground
|
||||
GC_PR_BGD = 2, //!< most probably background
|
||||
GC_PR_FGD = 3 //!< most probably foreground
|
||||
GC_PR_FGD = 3 //!< most probably foreground
|
||||
};
|
||||
|
||||
//! GrabCut algorithm flags
|
||||
@@ -751,7 +751,7 @@ enum
|
||||
};
|
||||
|
||||
//! segments the image using GrabCut algorithm
|
||||
CV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, Rect rect,
|
||||
CV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, Rect rect,
|
||||
InputOutputArray bgdModel, InputOutputArray fgdModel,
|
||||
int iterCount, int mode = GC_EVAL );
|
||||
|
||||
@@ -760,7 +760,7 @@ enum
|
||||
DIST_LABEL_CCOMP = 0,
|
||||
DIST_LABEL_PIXEL = 1
|
||||
};
|
||||
|
||||
|
||||
//! builds the discrete Voronoi diagram
|
||||
CV_EXPORTS_AS(distanceTransformWithLabels) void distanceTransform( InputArray src, OutputArray dst,
|
||||
OutputArray labels, int distanceType, int maskSize,
|
||||
@@ -784,27 +784,27 @@ CV_EXPORTS_W int floodFill( InputOutputArray image, InputOutputArray mask,
|
||||
Scalar loDiff=Scalar(), Scalar upDiff=Scalar(),
|
||||
int flags=4 );
|
||||
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
COLOR_BGR2BGRA =0,
|
||||
COLOR_RGB2RGBA =COLOR_BGR2BGRA,
|
||||
|
||||
|
||||
COLOR_BGRA2BGR =1,
|
||||
COLOR_RGBA2RGB =COLOR_BGRA2BGR,
|
||||
|
||||
|
||||
COLOR_BGR2RGBA =2,
|
||||
COLOR_RGB2BGRA =COLOR_BGR2RGBA,
|
||||
|
||||
|
||||
COLOR_RGBA2BGR =3,
|
||||
COLOR_BGRA2RGB =COLOR_RGBA2BGR,
|
||||
|
||||
|
||||
COLOR_BGR2RGB =4,
|
||||
COLOR_RGB2BGR =COLOR_BGR2RGB,
|
||||
|
||||
|
||||
COLOR_BGRA2RGBA =5,
|
||||
COLOR_RGBA2BGRA =COLOR_BGRA2RGBA,
|
||||
|
||||
|
||||
COLOR_BGR2GRAY =6,
|
||||
COLOR_RGB2GRAY =7,
|
||||
COLOR_GRAY2BGR =8,
|
||||
@@ -813,7 +813,7 @@ enum
|
||||
COLOR_GRAY2RGBA =COLOR_GRAY2BGRA,
|
||||
COLOR_BGRA2GRAY =10,
|
||||
COLOR_RGBA2GRAY =11,
|
||||
|
||||
|
||||
COLOR_BGR2BGR565 =12,
|
||||
COLOR_RGB2BGR565 =13,
|
||||
COLOR_BGR5652BGR =14,
|
||||
@@ -822,10 +822,10 @@ enum
|
||||
COLOR_RGBA2BGR565 =17,
|
||||
COLOR_BGR5652BGRA =18,
|
||||
COLOR_BGR5652RGBA =19,
|
||||
|
||||
|
||||
COLOR_GRAY2BGR565 =20,
|
||||
COLOR_BGR5652GRAY =21,
|
||||
|
||||
|
||||
COLOR_BGR2BGR555 =22,
|
||||
COLOR_RGB2BGR555 =23,
|
||||
COLOR_BGR5552BGR =24,
|
||||
@@ -834,86 +834,86 @@ enum
|
||||
COLOR_RGBA2BGR555 =27,
|
||||
COLOR_BGR5552BGRA =28,
|
||||
COLOR_BGR5552RGBA =29,
|
||||
|
||||
|
||||
COLOR_GRAY2BGR555 =30,
|
||||
COLOR_BGR5552GRAY =31,
|
||||
|
||||
|
||||
COLOR_BGR2XYZ =32,
|
||||
COLOR_RGB2XYZ =33,
|
||||
COLOR_XYZ2BGR =34,
|
||||
COLOR_XYZ2RGB =35,
|
||||
|
||||
|
||||
COLOR_BGR2YCrCb =36,
|
||||
COLOR_RGB2YCrCb =37,
|
||||
COLOR_YCrCb2BGR =38,
|
||||
COLOR_YCrCb2RGB =39,
|
||||
|
||||
|
||||
COLOR_BGR2HSV =40,
|
||||
COLOR_RGB2HSV =41,
|
||||
|
||||
|
||||
COLOR_BGR2Lab =44,
|
||||
COLOR_RGB2Lab =45,
|
||||
|
||||
|
||||
COLOR_BayerBG2BGR =46,
|
||||
COLOR_BayerGB2BGR =47,
|
||||
COLOR_BayerRG2BGR =48,
|
||||
COLOR_BayerGR2BGR =49,
|
||||
|
||||
|
||||
COLOR_BayerBG2RGB =COLOR_BayerRG2BGR,
|
||||
COLOR_BayerGB2RGB =COLOR_BayerGR2BGR,
|
||||
COLOR_BayerRG2RGB =COLOR_BayerBG2BGR,
|
||||
COLOR_BayerGR2RGB =COLOR_BayerGB2BGR,
|
||||
|
||||
|
||||
COLOR_BGR2Luv =50,
|
||||
COLOR_RGB2Luv =51,
|
||||
COLOR_BGR2HLS =52,
|
||||
COLOR_RGB2HLS =53,
|
||||
|
||||
|
||||
COLOR_HSV2BGR =54,
|
||||
COLOR_HSV2RGB =55,
|
||||
|
||||
|
||||
COLOR_Lab2BGR =56,
|
||||
COLOR_Lab2RGB =57,
|
||||
COLOR_Luv2BGR =58,
|
||||
COLOR_Luv2RGB =59,
|
||||
COLOR_HLS2BGR =60,
|
||||
COLOR_HLS2RGB =61,
|
||||
|
||||
|
||||
COLOR_BayerBG2BGR_VNG =62,
|
||||
COLOR_BayerGB2BGR_VNG =63,
|
||||
COLOR_BayerRG2BGR_VNG =64,
|
||||
COLOR_BayerGR2BGR_VNG =65,
|
||||
|
||||
|
||||
COLOR_BayerBG2RGB_VNG =COLOR_BayerRG2BGR_VNG,
|
||||
COLOR_BayerGB2RGB_VNG =COLOR_BayerGR2BGR_VNG,
|
||||
COLOR_BayerRG2RGB_VNG =COLOR_BayerBG2BGR_VNG,
|
||||
COLOR_BayerGR2RGB_VNG =COLOR_BayerGB2BGR_VNG,
|
||||
|
||||
|
||||
COLOR_BGR2HSV_FULL = 66,
|
||||
COLOR_RGB2HSV_FULL = 67,
|
||||
COLOR_BGR2HLS_FULL = 68,
|
||||
COLOR_RGB2HLS_FULL = 69,
|
||||
|
||||
|
||||
COLOR_HSV2BGR_FULL = 70,
|
||||
COLOR_HSV2RGB_FULL = 71,
|
||||
COLOR_HLS2BGR_FULL = 72,
|
||||
COLOR_HLS2RGB_FULL = 73,
|
||||
|
||||
|
||||
COLOR_LBGR2Lab = 74,
|
||||
COLOR_LRGB2Lab = 75,
|
||||
COLOR_LBGR2Luv = 76,
|
||||
COLOR_LRGB2Luv = 77,
|
||||
|
||||
|
||||
COLOR_Lab2LBGR = 78,
|
||||
COLOR_Lab2LRGB = 79,
|
||||
COLOR_Luv2LBGR = 80,
|
||||
COLOR_Luv2LRGB = 81,
|
||||
|
||||
|
||||
COLOR_BGR2YUV = 82,
|
||||
COLOR_RGB2YUV = 83,
|
||||
COLOR_YUV2BGR = 84,
|
||||
COLOR_YUV2RGB = 85,
|
||||
|
||||
|
||||
COLOR_BayerBG2GRAY = 86,
|
||||
COLOR_BayerGB2GRAY = 87,
|
||||
COLOR_BayerRG2GRAY = 88,
|
||||
@@ -921,7 +921,7 @@ enum
|
||||
|
||||
//YUV 4:2:0 formats family
|
||||
COLOR_YUV2RGB_NV12 = 90,
|
||||
COLOR_YUV2BGR_NV12 = 91,
|
||||
COLOR_YUV2BGR_NV12 = 91,
|
||||
COLOR_YUV2RGB_NV21 = 92,
|
||||
COLOR_YUV2BGR_NV21 = 93,
|
||||
COLOR_YUV420sp2RGB = COLOR_YUV2RGB_NV21,
|
||||
@@ -933,7 +933,7 @@ enum
|
||||
COLOR_YUV2BGRA_NV21 = 97,
|
||||
COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21,
|
||||
COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21,
|
||||
|
||||
|
||||
COLOR_YUV2RGB_YV12 = 98,
|
||||
COLOR_YUV2BGR_YV12 = 99,
|
||||
COLOR_YUV2RGB_IYUV = 100,
|
||||
@@ -942,7 +942,7 @@ enum
|
||||
COLOR_YUV2BGR_I420 = COLOR_YUV2BGR_IYUV,
|
||||
COLOR_YUV420p2RGB = COLOR_YUV2RGB_YV12,
|
||||
COLOR_YUV420p2BGR = COLOR_YUV2BGR_YV12,
|
||||
|
||||
|
||||
COLOR_YUV2RGBA_YV12 = 102,
|
||||
COLOR_YUV2BGRA_YV12 = 103,
|
||||
COLOR_YUV2RGBA_IYUV = 104,
|
||||
@@ -951,7 +951,7 @@ enum
|
||||
COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV,
|
||||
COLOR_YUV420p2RGBA = COLOR_YUV2RGBA_YV12,
|
||||
COLOR_YUV420p2BGRA = COLOR_YUV2BGRA_YV12,
|
||||
|
||||
|
||||
COLOR_YUV2GRAY_420 = 106,
|
||||
COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420,
|
||||
COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420,
|
||||
@@ -960,7 +960,7 @@ enum
|
||||
COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420,
|
||||
COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420,
|
||||
COLOR_YUV420p2GRAY = COLOR_YUV2GRAY_420,
|
||||
|
||||
|
||||
//YUV 4:2:2 formats family
|
||||
COLOR_YUV2RGB_UYVY = 107,
|
||||
COLOR_YUV2BGR_UYVY = 108,
|
||||
@@ -970,7 +970,7 @@ enum
|
||||
COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY,
|
||||
COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY,
|
||||
COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY,
|
||||
|
||||
|
||||
COLOR_YUV2RGBA_UYVY = 111,
|
||||
COLOR_YUV2BGRA_UYVY = 112,
|
||||
//COLOR_YUV2RGBA_VYUY = 113,
|
||||
@@ -979,7 +979,7 @@ enum
|
||||
COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY,
|
||||
COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY,
|
||||
COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY,
|
||||
|
||||
|
||||
COLOR_YUV2RGB_YUY2 = 115,
|
||||
COLOR_YUV2BGR_YUY2 = 116,
|
||||
COLOR_YUV2RGB_YVYU = 117,
|
||||
@@ -988,7 +988,7 @@ enum
|
||||
COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2,
|
||||
COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2,
|
||||
COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2,
|
||||
|
||||
|
||||
COLOR_YUV2RGBA_YUY2 = 119,
|
||||
COLOR_YUV2BGRA_YUY2 = 120,
|
||||
COLOR_YUV2RGBA_YVYU = 121,
|
||||
@@ -997,7 +997,7 @@ enum
|
||||
COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2,
|
||||
COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2,
|
||||
COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2,
|
||||
|
||||
|
||||
COLOR_YUV2GRAY_UYVY = 123,
|
||||
COLOR_YUV2GRAY_YUY2 = 124,
|
||||
//COLOR_YUV2GRAY_VYUY = COLOR_YUV2GRAY_UYVY,
|
||||
@@ -1006,11 +1006,11 @@ enum
|
||||
COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2,
|
||||
COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2,
|
||||
COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2,
|
||||
|
||||
|
||||
COLOR_COLORCVT_MAX = 125
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//! converts image from one color space to another
|
||||
CV_EXPORTS_W void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 );
|
||||
|
||||
@@ -1027,7 +1027,7 @@ public:
|
||||
Moments( const CvMoments& moments );
|
||||
//! the conversion to CvMoments
|
||||
operator CvMoments() const;
|
||||
|
||||
|
||||
//! spatial moments
|
||||
CV_PROP_RW double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03;
|
||||
//! central moments
|
||||
@@ -1093,7 +1093,7 @@ CV_EXPORTS_W double contourArea( InputArray contour, bool oriented=false );
|
||||
CV_EXPORTS_W RotatedRect minAreaRect( InputArray points );
|
||||
//! computes the minimal enclosing circle for a set of points
|
||||
CV_EXPORTS_W void minEnclosingCircle( InputArray points,
|
||||
CV_OUT Point2f& center, CV_OUT float& radius );
|
||||
CV_OUT Point2f& center, CV_OUT float& radius );
|
||||
//! matches two contours using one of the available algorithms
|
||||
CV_EXPORTS_W double matchShapes( InputArray contour1, InputArray contour2,
|
||||
int method, double parameter );
|
||||
@@ -1118,7 +1118,7 @@ CV_EXPORTS_W void fitLine( InputArray points, OutputArray line, int distType,
|
||||
double param, double reps, double aeps );
|
||||
//! checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary
|
||||
CV_EXPORTS_W double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist );
|
||||
|
||||
|
||||
|
||||
class CV_EXPORTS_W Subdiv2D
|
||||
{
|
||||
@@ -1131,7 +1131,7 @@ public:
|
||||
PTLOC_VERTEX = 1,
|
||||
PTLOC_ON_EDGE = 2
|
||||
};
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
NEXT_AROUND_ORG = 0x00,
|
||||
@@ -1143,30 +1143,30 @@ public:
|
||||
PREV_AROUND_LEFT = 0x20,
|
||||
PREV_AROUND_RIGHT = 0x02
|
||||
};
|
||||
|
||||
|
||||
CV_WRAP Subdiv2D();
|
||||
CV_WRAP Subdiv2D(Rect rect);
|
||||
CV_WRAP void initDelaunay(Rect rect);
|
||||
|
||||
|
||||
CV_WRAP int insert(Point2f pt);
|
||||
CV_WRAP void insert(const vector<Point2f>& ptvec);
|
||||
CV_WRAP int locate(Point2f pt, CV_OUT int& edge, CV_OUT int& vertex);
|
||||
|
||||
|
||||
CV_WRAP int findNearest(Point2f pt, CV_OUT Point2f* nearestPt=0);
|
||||
CV_WRAP void getEdgeList(CV_OUT vector<Vec4f>& edgeList) const;
|
||||
CV_WRAP void getTriangleList(CV_OUT vector<Vec6f>& triangleList) const;
|
||||
CV_WRAP void getVoronoiFacetList(const vector<int>& idx, CV_OUT vector<vector<Point2f> >& facetList,
|
||||
CV_OUT vector<Point2f>& facetCenters);
|
||||
|
||||
|
||||
CV_WRAP Point2f getVertex(int vertex, CV_OUT int* firstEdge=0) const;
|
||||
|
||||
|
||||
CV_WRAP int getEdge( int edge, int nextEdgeType ) const;
|
||||
CV_WRAP int nextEdge(int edge) const;
|
||||
CV_WRAP int rotateEdge(int edge, int rotate) const;
|
||||
CV_WRAP int symEdge(int edge) const;
|
||||
CV_WRAP int edgeOrg(int edge, CV_OUT Point2f* orgpt=0) const;
|
||||
CV_WRAP int edgeDst(int edge, CV_OUT Point2f* dstpt=0) const;
|
||||
|
||||
|
||||
protected:
|
||||
int newEdge();
|
||||
void deleteEdge(int edge);
|
||||
@@ -1180,7 +1180,7 @@ protected:
|
||||
void calcVoronoi();
|
||||
void clearVoronoi();
|
||||
void checkSubdiv() const;
|
||||
|
||||
|
||||
struct CV_EXPORTS Vertex
|
||||
{
|
||||
Vertex();
|
||||
@@ -1199,13 +1199,13 @@ protected:
|
||||
int next[4];
|
||||
int pt[4];
|
||||
};
|
||||
|
||||
|
||||
vector<Vertex> vtx;
|
||||
vector<QuadEdge> qedges;
|
||||
int freeQEdge;
|
||||
int freePoint;
|
||||
bool validGeometry;
|
||||
|
||||
|
||||
int recentEdge;
|
||||
Point2f topLeft;
|
||||
Point2f bottomRight;
|
||||
|
||||
@@ -351,8 +351,8 @@ CVAPI(CvPoint) cvReadChainPoint( CvChainPtReader* reader );
|
||||
a tree of polygonal curves (contours) */
|
||||
CVAPI(CvSeq*) cvApproxPoly( const void* src_seq,
|
||||
int header_size, CvMemStorage* storage,
|
||||
int method, double parameter,
|
||||
int parameter2 CV_DEFAULT(0));
|
||||
int method, double eps,
|
||||
int recursive CV_DEFAULT(0));
|
||||
|
||||
/* Calculates perimeter of a contour or length of a part of contour */
|
||||
CVAPI(double) cvArcLength( const void* curve,
|
||||
|
||||
@@ -70,15 +70,15 @@ CvSeq* icvApproximateChainTC89( CvChain* chain, int header_size,
|
||||
CvChainPtReader reader;
|
||||
CvSeqWriter writer;
|
||||
CvPoint pt = chain->origin;
|
||||
|
||||
|
||||
CV_Assert( CV_IS_SEQ_CHAIN_CONTOUR( chain ));
|
||||
CV_Assert( header_size >= (int)sizeof(CvContour) );
|
||||
|
||||
|
||||
cvStartWriteSeq( (chain->flags & ~CV_SEQ_ELTYPE_MASK) | CV_SEQ_ELTYPE_POINT,
|
||||
header_size, sizeof( CvPoint ), storage, &writer );
|
||||
|
||||
|
||||
if( chain->total == 0 )
|
||||
{
|
||||
{
|
||||
CV_WRITE_SEQ_ELEM( pt, writer );
|
||||
return cvEndWriteSeq( &writer );
|
||||
}
|
||||
@@ -380,13 +380,13 @@ CV_IMPL CvSeq*
|
||||
cvApproxChains( CvSeq* src_seq,
|
||||
CvMemStorage* storage,
|
||||
int method,
|
||||
double /*parameter*/,
|
||||
int minimal_perimeter,
|
||||
double /*parameter*/,
|
||||
int minimal_perimeter,
|
||||
int recursive )
|
||||
{
|
||||
CvSeq *prev_contour = 0, *parent = 0;
|
||||
CvSeq *dst_seq = 0;
|
||||
|
||||
|
||||
if( !src_seq || !storage )
|
||||
CV_Error( CV_StsNullPtr, "" );
|
||||
if( method > CV_CHAIN_APPROX_TC89_KCOS || method <= 0 || minimal_perimeter < 0 )
|
||||
@@ -399,7 +399,7 @@ cvApproxChains( CvSeq* src_seq,
|
||||
if( len >= minimal_perimeter )
|
||||
{
|
||||
CvSeq *contour = 0;
|
||||
|
||||
|
||||
switch( method )
|
||||
{
|
||||
case CV_CHAIN_APPROX_NONE:
|
||||
@@ -471,7 +471,7 @@ cvApproxChains( CvSeq* src_seq,
|
||||
|
||||
/* the version for integer point coordinates */
|
||||
template<typename T> static CvSeq*
|
||||
icvApproxPolyDP( CvSeq* src_contour, int header_size,
|
||||
icvApproxPolyDP( CvSeq* src_contour, int header_size,
|
||||
CvMemStorage* storage, double eps )
|
||||
{
|
||||
typedef cv::Point_<T> PT;
|
||||
@@ -486,7 +486,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
|
||||
CvMemStorage* temp_storage = 0;
|
||||
CvSeq* stack = 0;
|
||||
CvSeq* dst_contour;
|
||||
|
||||
|
||||
assert( CV_SEQ_ELTYPE(src_contour) == cv::DataType<PT>::type );
|
||||
cvStartWriteSeq( src_contour->flags, header_size, sizeof(pt), storage, &writer );
|
||||
|
||||
@@ -518,7 +518,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
|
||||
init_iters = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( is_closed )
|
||||
{
|
||||
/* 1. Find approximately two farthest points of the contour */
|
||||
@@ -629,10 +629,10 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
|
||||
CV_WRITE_SEQ_ELEM( end_pt, writer );
|
||||
|
||||
dst_contour = cvEndWriteSeq( &writer );
|
||||
|
||||
|
||||
// last stage: do final clean-up of the approximated contour -
|
||||
// remove extra points on the [almost] stright lines.
|
||||
|
||||
// remove extra points on the [almost] stright lines.
|
||||
|
||||
cvStartReadSeq( dst_contour, &reader, is_closed );
|
||||
CV_READ_SEQ_ELEM( start_pt, reader );
|
||||
|
||||
@@ -675,7 +675,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
|
||||
|
||||
CV_IMPL CvSeq*
|
||||
cvApproxPoly( const void* array, int header_size,
|
||||
CvMemStorage* storage, int method,
|
||||
CvMemStorage* storage, int method,
|
||||
double parameter, int parameter2 )
|
||||
{
|
||||
CvSeq* dst_seq = 0;
|
||||
|
||||
Reference in New Issue
Block a user