started work on API & doc synchronization (in particular, Mat& => Input/OutputArray in the descriptions)

This commit is contained in:
Vadim Pisarevsky
2011-06-07 22:51:31 +00:00
parent 927b5c88ea
commit c7a42e9682
52 changed files with 1782 additions and 2048 deletions

View File

@@ -5,11 +5,9 @@ Feature Detection
.. index:: Canny
.. _Canny:
Canny
---------
.. c:function:: void Canny( const Mat& image, Mat& edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false )
.. cpp:function:: void Canny( InputArray image, OutputArray edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false )
Finds edges in an image using the Canny algorithm.
@@ -21,7 +19,7 @@ Canny
:param threshold2: The second threshold for the hysteresis procedure.
:param apertureSize: Aperture size for the :func:`Sobel` operator.
:param apertureSize: Aperture size for the :cpp:func:`Sobel` operator.
:param L2gradient: Flag indicating whether a more accurate :math:`L_2` norm :math:`=\sqrt{(dI/dx)^2 + (dI/dy)^2}` should be used to compute the image gradient magnitude ( ``L2gradient=true`` ), or a faster default :math:`L_1` norm :math:`=|dI/dx|+|dI/dy|` is enough ( ``L2gradient=false`` ).
@@ -30,12 +28,10 @@ http://en.wikipedia.org/wiki/Canny_edge_detector
.. index:: cornerEigenValsAndVecs
.. _cornerEigenValsAndVecs:
cornerEigenValsAndVecs
----------------------
.. c:function:: void cornerEigenValsAndVecs( const Mat& src, Mat& dst, int blockSize, int apertureSize, int borderType=BORDER_DEFAULT )
.. cpp:function:: void cornerEigenValsAndVecs( InputArray src, OutputArray dst, int blockSize, int apertureSize, int borderType=BORDER_DEFAULT )
Calculates eigenvalues and eigenvectors of image blocks for corner detection.
@@ -45,9 +41,9 @@ cornerEigenValsAndVecs
:param blockSize: Neighborhood size (see details below).
:param apertureSize: Aperture parameter for the :func:`Sobel` operator.
:param apertureSize: Aperture parameter for the :cpp:func:`Sobel` operator.
:param boderType: Pixel extrapolation method. See :func:`borderInterpolate` .
:param boderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` .
For every pixel
:math:`p` , the function ``cornerEigenValsAndVecs`` considers a ``blockSize`` :math:`\times` ``blockSize`` neigborhood
@@ -58,7 +54,7 @@ For every pixel
M = \begin{bmatrix} \sum _{S(p)}(dI/dx)^2 & \sum _{S(p)}(dI/dx dI/dy)^2 \\ \sum _{S(p)}(dI/dx dI/dy)^2 & \sum _{S(p)}(dI/dy)^2 \end{bmatrix}
where the derivatives are computed using the
:func:`Sobel` operator.
:cpp:func:`Sobel` operator.
After that it finds eigenvectors and eigenvalues of
:math:`M` and stores them in the destination image as
@@ -73,18 +69,16 @@ After that it finds eigenvectors and eigenvalues of
The output of the function can be used for robust edge or corner detection.
See Also:
:func:`cornerMinEigenVal`,
:func:`cornerHarris`,
:func:`preCornerDetect`
:cpp:func:`cornerMinEigenVal`,
:cpp:func:`cornerHarris`,
:cpp:func:`preCornerDetect`
.. index:: cornerHarris
.. _cornerHarris:
cornerHarris
------------
.. c:function:: void cornerHarris( const Mat& src, Mat& dst, int blockSize, int apertureSize, double k, int borderType=BORDER_DEFAULT )
.. cpp:function:: void cornerHarris( InputArray src, OutputArray dst, int blockSize, int apertureSize, double k, int borderType=BORDER_DEFAULT )
Harris edge detector.
@@ -92,17 +86,17 @@ cornerHarris
:param dst: Image to store the Harris detector responses. It has the type ``CV_32FC1`` and the same size as ``src`` .
:param blockSize: Neighborhood size (see the details on :func:`cornerEigenValsAndVecs` ).
:param blockSize: Neighborhood size (see the details on :cpp:func:`cornerEigenValsAndVecs` ).
:param apertureSize: Aperture parameter for the :func:`Sobel` operator.
:param apertureSize: Aperture parameter for the :cpp:func:`Sobel` operator.
:param k: Harris detector free parameter. See the formula below.
:param boderType: Pixel extrapolation method. See :func:`borderInterpolate` .
:param boderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` .
The function runs the Harris edge detector on the image. Similarly to
:func:`cornerMinEigenVal` and
:func:`cornerEigenValsAndVecs` , for each pixel
:cpp:func:`cornerMinEigenVal` and
:cpp:func:`cornerEigenValsAndVecs` , for each pixel
:math:`(x, y)` it calculates a
:math:`2\times2` gradient covariation matrix
:math:`M^{(x,y)}` over a
@@ -116,12 +110,10 @@ Corners in the image can be found as the local maxima of this response map.
.. index:: cornerMinEigenVal
.. _cornerMinEigenVal:
cornerMinEigenVal
-----------------
.. c:function:: void cornerMinEigenVal( const Mat& src, Mat& dst, int blockSize, int apertureSize=3, int borderType=BORDER_DEFAULT )
.. cpp:function:: void cornerMinEigenVal( InputArray src, OutputArray dst, int blockSize, int apertureSize=3, int borderType=BORDER_DEFAULT )
Calculates the minimal eigenvalue of gradient matrices for corner detection.
@@ -129,24 +121,22 @@ cornerMinEigenVal
:param dst: Image to store the minimal eigenvalues. It has the type ``CV_32FC1`` and the same size as ``src`` .
:param blockSize: Neighborhood size (see the details on :func:`cornerEigenValsAndVecs` ).
:param blockSize: Neighborhood size (see the details on :cpp:func:`cornerEigenValsAndVecs` ).
:param apertureSize: Aperture parameter for the :func:`Sobel` operator.
:param apertureSize: Aperture parameter for the :cpp:func:`Sobel` operator.
:param boderType: Pixel extrapolation method. See :func:`borderInterpolate` .
:param boderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` .
The function is similar to
:func:`cornerEigenValsAndVecs` but it calculates and stores only the minimal eigenvalue of the covariation matrix of derivatives, that is,
:cpp:func:`cornerEigenValsAndVecs` but it calculates and stores only the minimal eigenvalue of the covariation matrix of derivatives, that is,
:math:`\min(\lambda_1, \lambda_2)` in terms of the formulae in the
:func:`cornerEigenValsAndVecs` description.
:cpp:func:`cornerEigenValsAndVecs` description.
.. index:: cornerSubPix
.. _cornerSubPix:
cornerSubPix
----------------
.. c:function:: void cornerSubPix( const Mat& image, vector<Point2f>& corners, Size winSize, Size zeroZone, TermCriteria criteria )
.. cpp:function:: void cornerSubPix( InputArray image, InputOutputArray corners, Size winSize, Size zeroZone, TermCriteria criteria )
Refines the corner locations.
@@ -200,12 +190,10 @@ The algorithm sets the center of the neighborhood window at this new center
.. index:: goodFeaturesToTrack
.. _goodFeaturesToTrack:
goodFeaturesToTrack
-------------------
.. c:function:: void goodFeaturesToTrack( const Mat& image, vector<Point2f>& corners, int maxCorners, double qualityLevel, double minDistance, const Mat& mask=Mat(), int blockSize=3, bool useHarrisDetector=false, double k=0.04 )
.. cpp:function:: void goodFeaturesToTrack( InputArray image, OutputArray corners, int maxCorners, double qualityLevel, double minDistance, InputArray mask=None(), int blockSize=3, bool useHarrisDetector=false, double k=0.04 )
Determines strong corners on an image.
@@ -215,15 +203,15 @@ goodFeaturesToTrack
:param maxCorners: Maximum number of corners to return. If there are more corners than are found, the strongest of them is returned.
:param qualityLevel: Parameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see :func:`cornerMinEigenVal` ) or the Harris function response (see :func:`cornerHarris` ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the ``qualityLevel=0.01`` , then all the corners with the quality measure less than 15 are rejected.
:param qualityLevel: Parameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see :cpp:func:`cornerMinEigenVal` ) or the Harris function response (see :cpp:func:`cornerHarris` ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the ``qualityLevel=0.01`` , then all the corners with the quality measure less than 15 are rejected.
:param minDistance: Minimum possible Euclidean distance between the returned corners.
:param mask: Optional region of interest. If the image is not empty (it needs to have the type ``CV_8UC1`` and the same size as ``image`` ), it specifies the region in which the corners are detected.
:param blockSize: Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. See :func:`cornerEigenValsAndVecs` .
:param blockSize: Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. See :cpp:func:`cornerEigenValsAndVecs` .
:param useHarrisDetector: Parameter indicating whether to use a Harris detector (see :func:`cornerHarris`) or :func:`cornerMinEigenVal`.
:param useHarrisDetector: Parameter indicating whether to use a Harris detector (see :cpp:func:`cornerHarris`) or :cpp:func:`cornerMinEigenVal`.
:param k: Free parameter of the Harris detector.
@@ -231,8 +219,8 @@ The function finds the most prominent corners in the image or in the specified i
#.
Function calculates the corner quality measure at every source image pixel using the
:func:`cornerMinEigenVal` or
:func:`cornerHarris` .
:cpp:func:`cornerMinEigenVal` or
:cpp:func:`cornerHarris` .
#.
Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are retained).
@@ -251,21 +239,19 @@ 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: :func:`cornerMinEigenVal`,
:func:`cornerHarris`,
:func:`calcOpticalFlowPyrLK`,
:func:`estimateRigidMotion`,
:func:`PlanarObjectDetector`,
:func:`OneWayDescriptor`
See Also: :cpp:func:`cornerMinEigenVal`,
:cpp:func:`cornerHarris`,
:cpp:func:`calcOpticalFlowPyrLK`,
:cpp:func:`estimateRigidMotion`,
:cpp:func:`PlanarObjectDetector`,
:cpp:func:`OneWayDescriptor`
.. index:: HoughCircles
.. _HoughCircles:
HoughCircles
------------
.. c:function:: void HoughCircles( Mat& image, vector<Vec3f>& circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0 )
.. cpp:function:: void HoughCircles( InputArray image, OutputArray circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0 )
Finds circles in a grayscale image using the Hough transform.
@@ -279,7 +265,7 @@ HoughCircles
:param minDist: Minimum distance between the centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed.
:param param1: The first method-specific parameter. In case of ``CV_HOUGH_GRADIENT`` , it is the higher threshold of the two passed to the :func:`Canny` edge detector (the lower one is twice smaller).
:param param1: The first method-specific parameter. In case of ``CV_HOUGH_GRADIENT`` , it is the higher threshold of the two passed to the :cpp:func:`Canny` edge detector (the lower one is twice smaller).
:param param2: The second method-specific parameter. In case of ``CV_HOUGH_GRADIENT`` , it is the accumulator threshold for the circle centers at the detection stage. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first
@@ -323,17 +309,15 @@ 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:
:func:`fitEllipse`,
:func:`minEnclosingCircle`
:cpp:func:`fitEllipse`,
:cpp:func:`minEnclosingCircle`
.. index:: HoughLines
.. _HoughLines:
HoughLines
----------
.. c:function:: void HoughLines( Mat& image, vector<Vec2f>& lines, double rho, double theta, int threshold, double srn=0, double stn=0 )
.. cpp:function:: void HoughLines( InputArray image, OutputArray lines, double rho, double theta, int threshold, double srn=0, double stn=0 )
Finds lines in a binary image using the standard Hough transform.
@@ -352,16 +336,14 @@ HoughLines
:param stn: For the multi-scale Hough transform, it is a divisor for the distance resolution ``theta`` .
The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See
:func:`HoughLinesP` for the code example.
:cpp:func:`HoughLinesP` for the code example.
.. index:: HoughLinesP
.. _HoughLinesP:
HoughLinesP
-----------
.. c:function:: void HoughLinesP( Mat& image, vector<Vec4i>& lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 )
.. cpp:function:: void HoughLinesP( InputArray image, OutputArray lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 )
Finds line segments in a binary image using the probabilistic Hough transform.
@@ -446,12 +428,10 @@ And this is the output of the above program in case of the probabilistic Hough t
.. index:: preCornerDetect
.. _preCornerDetect:
preCornerDetect
---------------
.. c:function:: void preCornerDetect( const Mat& src, Mat& dst, int apertureSize, int borderType=BORDER_DEFAULT )
.. cpp:function:: void preCornerDetect( InputArray src, OutputArray dst, int apertureSize, int borderType=BORDER_DEFAULT )
Calculates a feature map for corner detection.
@@ -459,9 +439,9 @@ preCornerDetect
:param dst: Output image that has the type ``CV_32F`` and the same size as ``src`` .
:param apertureSize: Aperture size of the :func:`Sobel` .
:param apertureSize: Aperture size of the :cpp:func:`Sobel` .
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` .
:param borderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` .
The function calculates the complex spatial derivative-based function of the source image

View File

@@ -6,21 +6,19 @@ Image Filtering
===============
Functions and classes described in this section are used to perform various linear or non-linear filtering operations on 2D images (represented as
:func:`Mat`'s). It means that for each pixel location
:cpp:func:`Mat`'s). It means that for each pixel location
:math:`(x,y)` in the source image (normally, rectangular), its neighborhood is considered and used to compute the response. In case of a linear filter, it is a weighted sum of pixel values. In case of morphological operations, it is the minimum or maximum values, and so on. The computed response is stored in the destination image at the same location
:math:`(x,y)` . It means that the output image will be of the same size as the input image. Normally, the functions support multi-channel arrays, in which case every channel is processed independently. Therefore, the output image will also have the same number of channels as the input one.
Another common feature of the functions and classes described in this section is that, unlike simple arithmetic functions, they need to extrapolate values of some non-existing pixels. For example, if you want to smooth an image using a Gaussian
:math:`3 \times 3` filter, then, when processing the left-most pixels in each row, you need pixels to the left of them, that is, outside of the image. You can let these pixels be the same as the left-most image pixels ("replicated border" extrapolation method), or assume that all the non-existing pixels are zeros ("contant border" extrapolation method), and so on.
OpenCV enables you to specify the extrapolation method. For details, see the function :func:`borderInterpolate` and discussion of the ``borderType`` parameter in various functions below.
OpenCV enables you to specify the extrapolation method. For details, see the function :cpp:func:`borderInterpolate` and discussion of the ``borderType`` parameter in various functions below.
.. index:: BaseColumnFilter
.. _BaseColumnFilter:
BaseColumnFilter
----------------
.. c:type:: BaseColumnFilter
.. cpp:class:: BaseColumnFilter
Base class for filters with single-column kernels ::
@@ -55,23 +53,21 @@ The class ``BaseColumnFilter`` is a base class for filtering data using single-c
where
:math:`F` is a filtering function but, as it is represented as a class, it can produce any side effects, memorize previously processed data, and so on. The class only defines an interface and is not used directly. Instead, there are several functions in OpenCV (and you can add more) that return pointers to the derived classes that implement specific filtering operations. Those pointers are then passed to the
:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
:cpp:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
See Also:
:func:`BaseRowFilter`,
:func:`BaseFilter`,
:func:`FilterEngine`,
:func:`getColumnSumFilter`,
:func:`getLinearColumnFilter`,
:func:`getMorphologyColumnFilter`
:cpp:func:`BaseRowFilter`,
:cpp:func:`BaseFilter`,
:cpp:func:`FilterEngine`,
:cpp:func:`getColumnSumFilter`,
:cpp:func:`getLinearColumnFilter`,
:cpp:func:`getMorphologyColumnFilter`
.. index:: BaseFilter
.. _BaseFilter:
BaseFilter
----------
.. c:type:: BaseFilter
.. cpp:class:: BaseFilter
Base class for 2D image filters ::
@@ -107,22 +103,20 @@ The class ``BaseFilter`` is a base class for filtering data using 2D kernels. Fi
where
:math:`F` is a filtering function. The class only defines an interface and is not used directly. Instead, there are several functions in OpenCV (and you can add more) that return pointers to the derived classes that implement specific filtering operations. Those pointers are then passed to the
:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
:cpp:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
See Also:
:func:`BaseColumnFilter`,
:func:`BaseRowFilter`,
:func:`FilterEngine`,
:func:`getLinearFilter`,
:func:`getMorphologyFilter`
:cpp:func:`BaseColumnFilter`,
:cpp:func:`BaseRowFilter`,
:cpp:func:`FilterEngine`,
:cpp:func:`getLinearFilter`,
:cpp:func:`getMorphologyFilter`
.. index:: BaseRowFilter
.. _BaseRowFilter:
BaseRowFilter
-------------
.. c:type:: BaseRowFilter
.. cpp:class:: BaseRowFilter
Base class for filters with single-row kernels ::
@@ -150,23 +144,21 @@ The class ``BaseRowFilter`` is a base class for filtering data using single-row
where
:math:`F` is a filtering function. The class only defines an interface and is not used directly. Instead, there are several functions in OpenCV (and you can add more) that return pointers to the derived classes that implement specific filtering operations. Those pointers are then passed to the
:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
:cpp:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
See Also:
:func:`BaseColumnFilter`,
:func:`Filter`,
:func:`FilterEngine`,
:func:`getLinearRowFilter`,
:func:`getMorphologyRowFilter`,
:func:`getRowSumFilter`
:cpp:func:`BaseColumnFilter`,
:cpp:func:`Filter`,
:cpp:func:`FilterEngine`,
:cpp:func:`getLinearRowFilter`,
:cpp:func:`getMorphologyRowFilter`,
:cpp:func:`getRowSumFilter`
.. index:: FilterEngine
.. _FilterEngine:
FilterEngine
------------
.. c:type:: FilterEngine
.. cpp:class:: FilterEngine
Generic image filtering class ::
@@ -239,12 +231,12 @@ The class ``FilterEngine`` can be used to apply an arbitrary filtering operation
It contains all the necessary intermediate buffers, computes extrapolated values
of the "virtual" pixels outside of the image, and so on. Pointers to the initialized ``FilterEngine`` instances
are returned by various ``create*Filter`` functions (see below) and they are used inside high-level functions such as
:func:`filter2D`,
:func:`erode`,
:func:`dilate`, and others. Thus, the class plays a key role in many of OpenCV filtering functions.
:cpp:func:`filter2D`,
:cpp:func:`erode`,
:cpp:func:`dilate`, and others. Thus, the class plays a key role in many of OpenCV filtering functions.
This class makes it easier to combine filtering operations with other operations, such as color space conversions, thresholding, arithmetic operations, and others. By combining several operations together you can get much better performance because your data will stay in cache. For example, see below the implementation of the Laplace operator for floating-point images, which is a simplified implementation of
:func:`Laplacian` : ::
:cpp:func:`Laplacian` : ::
void laplace_f(const Mat& src, Mat& dst)
{
@@ -355,7 +347,7 @@ Unlike the earlier versions of OpenCV, now the filtering operations fully suppor
Explore the data types. As it was mentioned in the
:func:`BaseFilter` description, the specific filters can process data of any type, despite that ``Base*Filter::operator()`` only takes ``uchar`` pointers and no information about the actual types. To make it all work, the following rules are used:
:cpp:func:`BaseFilter` description, the specific filters can process data of any type, despite that ``Base*Filter::operator()`` only takes ``uchar`` pointers and no information about the actual types. To make it all work, the following rules are used:
*
In case of separable filtering, ``FilterEngine::rowFilter`` is applied first. It transforms the input image data (of type ``srcType`` ) to the intermediate results stored in the internal buffers (of type ``bufType`` ). Then, these intermediate results are processed as
@@ -366,21 +358,21 @@ 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`` .
See Also:
:func:`BaseColumnFilter`,
:func:`BaseFilter`,
:func:`BaseRowFilter`,
:func:`createBoxFilter`,
:func:`createDerivFilter`,
:func:`createGaussianFilter`,
:func:`createLinearFilter`,
:func:`createMorphologyFilter`,
:func:`createSeparableLinearFilter`
:cpp:func:`BaseColumnFilter`,
:cpp:func:`BaseFilter`,
:cpp:func:`BaseRowFilter`,
:cpp:func:`createBoxFilter`,
:cpp:func:`createDerivFilter`,
:cpp:func:`createGaussianFilter`,
:cpp:func:`createLinearFilter`,
:cpp:func:`createMorphologyFilter`,
:cpp:func:`createSeparableLinearFilter`
.. index:: bilateralFilter
bilateralFilter
-------------------
.. c:function:: void bilateralFilter( const Mat& src, Mat& dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT )
.. cpp:function:: void bilateralFilter( InputArray src, OutputArray dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT )
Applies the bilateral filter to an image.
@@ -401,7 +393,7 @@ http://www.dai.ed.ac.uk/CVonline/LOCAL\_COPIES/MANDUCHI1/Bilateral\_Filtering.ht
blur
--------
.. c:function:: void blur( const Mat& src, Mat& dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT )
.. cpp:function:: void blur( InputArray src, OutputArray dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT )
Smoothes an image using the normalized box filter.
@@ -424,16 +416,16 @@ 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)`` .
See Also:
:func:`boxFilter`,
:func:`bilateralFilter`,
:func:`GaussianBlur`,
:func:`medianBlur`
:cpp:func:`boxFilter`,
:cpp:func:`bilateralFilter`,
:cpp:func:`GaussianBlur`,
:cpp:func:`medianBlur`
.. index:: borderInterpolate
borderInterpolate
---------------------
.. c:function:: int borderInterpolate( int p, int len, int borderType )
.. cpp:function:: int borderInterpolate( int p, int len, int borderType )
Computes the source location of an extrapolated pixel.
@@ -450,18 +442,18 @@ The function computes and returns the coordinate of the donor pixel, correspondi
Normally, the function is not called directly. It is used inside
:func:`FilterEngine` and
:func:`copyMakeBorder` to compute tables for quick extrapolation.
:cpp:func:`FilterEngine` and
:cpp:func:`copyMakeBorder` to compute tables for quick extrapolation.
See Also:
:func:`FilterEngine`,
:func:`copyMakeBorder`
:cpp:func:`FilterEngine`,
:cpp:func:`copyMakeBorder`
.. index:: boxFilter
boxFilter
-------------
.. c:function:: void boxFilter( const Mat& src, Mat& dst, int ddepth, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT )
.. cpp:function:: void boxFilter( InputArray src, OutputArray dst, int ddepth, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT )
Smoothes an image using the box filter.
@@ -491,24 +483,24 @@ where
Unnormalized box filter is useful for computing various integral characteristics over each pixel neighborhood, such as covariance matrices of image derivatives (used in dense optical flow algorithms,
and so on). If you need to compute pixel sums over variable-size windows, use
:func:`integral` .
:cpp:func:`integral` .
See Also:
:func:`boxFilter`,
:func:`bilateralFilter`,
:func:`GaussianBlur`,
:func:`medianBlur`,
:func:`integral`
:cpp:func:`boxFilter`,
:cpp:func:`bilateralFilter`,
:cpp:func:`GaussianBlur`,
:cpp:func:`medianBlur`,
:cpp:func:`integral`
.. index:: buildPyramid
buildPyramid
----------------
.. c:function:: void buildPyramid( const Mat& src, vector<Mat>& dst, int maxlevel )
.. cpp:function:: void buildPyramid( InputArray src, OutputArrayOfArrays dst, int maxlevel )
Constructs the Gaussian pyramid for an image.
:param src: Source image. Check :func:`pyrDown` for the list of supported types.
:param src: Source image. Check :cpp:func:`pyrDown` for the list of supported types.
:param dst: Destination vector of ``maxlevel+1`` images of the same type as ``src`` . ``dst[0]`` will be the same as ``src`` . ``dst[1]`` is the next pyramid layer,
a smoothed and down-sized ``src`` , and so on.
@@ -516,13 +508,13 @@ buildPyramid
:param maxlevel: 0-based index of the last (the smallest) pyramid layer. It must be non-negative.
The function constructs a vector of images and builds the Gaussian pyramid by recursively applying
:func:`pyrDown` to the previously built pyramid layers, starting from ``dst[0]==src`` .
:cpp:func:`pyrDown` to the previously built pyramid layers, starting from ``dst[0]==src`` .
.. index:: copyMakeBorder
copyMakeBorder
------------------
.. c:function:: void copyMakeBorder( const Mat& src, Mat& dst, int top, int bottom, int left, int right, int borderType, const Scalar& value=Scalar() )
.. cpp:function:: void copyMakeBorder( InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, const Scalar& value=Scalar() )
Forms a border around an image.
@@ -532,12 +524,12 @@ copyMakeBorder
: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 borderType: Border type. See :func:`borderInterpolate` for details.
:param borderType: Border type. See :cpp:func:`borderInterpolate` for details.
:param value: Border value if ``borderType==BORDER_CONSTANT`` .
The function copies the source image into the middle of the destination image. The areas to the left, to the right, above and below the copied source image will be filled with extrapolated pixels. This is not what
:func:`FilterEngine` or filtering functions based on it do (they extrapolate pixels on-fly), but what other more complex functions, including your own, may do to simplify image boundary handling.
:cpp:func:`FilterEngine` or filtering functions based on it do (they extrapolate pixels on-fly), but what other more complex functions, including your own, may do to simplify image boundary handling.
The function supports the mode when ``src`` is already in the middle of ``dst`` . In this case, the function does not copy ``src`` itself but simply constructs the border, for example: ::
@@ -557,16 +549,16 @@ The function supports the mode when ``src`` is already in the middle of ``dst``
See Also:
:func:`borderInterpolate`
:cpp:func:`borderInterpolate`
.. index:: createBoxFilter
createBoxFilter
-------------------
.. c:function:: Ptr<FilterEngine> createBoxFilter( int srcType, int dstType, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT)
.. cpp:function:: Ptr<FilterEngine> createBoxFilter( int srcType, int dstType, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT)
.. c:function:: Ptr<BaseRowFilter> getRowSumFilter(int srcType, int sumType, int ksize, int anchor=-1)
.. cpp:function:: Ptr<BaseRowFilter> getRowSumFilter(int srcType, int sumType, int ksize, int anchor=-1)
.. c:function:: Ptr<BaseColumnFilter> getColumnSumFilter(int sumType, int dstType, int ksize, int anchor=-1, double scale=1)
.. cpp:function:: Ptr<BaseColumnFilter> getColumnSumFilter(int sumType, int dstType, int ksize, int anchor=-1, double scale=1)
Returns a box filter engine.
@@ -580,31 +572,31 @@ createBoxFilter
:param anchor: Anchor position with the kernel. Negative values mean that the anchor is at the kernel center.
:param normalize: Flag specifying whether the sums are normalized or not. See :func:`boxFilter` for details.
:param normalize: Flag specifying whether the sums are normalized or not. See :cpp:func:`boxFilter` for details.
:param scale: Another way to specify normalization in lower-level ``getColumnSumFilter`` .
:param borderType: Border type to use. See :func:`borderInterpolate` .
:param borderType: Border type to use. See :cpp:func:`borderInterpolate` .
The function is a convenience function that retrieves the horizontal sum primitive filter with
:func:`getRowSumFilter` , vertical sum filter with
:func:`getColumnSumFilter` , constructs new
:func:`FilterEngine` , and passes both of the primitive filters there. The constructed filter engine can be used for image filtering with normalized or unnormalized box filter.
:cpp:func:`getRowSumFilter` , vertical sum filter with
:cpp:func:`getColumnSumFilter` , constructs new
:cpp:func:`FilterEngine` , and passes both of the primitive filters there. The constructed filter engine can be used for image filtering with normalized or unnormalized box filter.
The function itself is used by
:func:`blur` and
:func:`boxFilter` .
:cpp:func:`blur` and
:cpp:func:`boxFilter` .
See Also:
:func:`FilterEngine`,
:func:`blur`,
:func:`boxFilter`
:cpp:func:`FilterEngine`,
:cpp:func:`blur`,
:cpp:func:`boxFilter`
.. index:: createDerivFilter
createDerivFilter
---------------------
.. c:function:: Ptr<FilterEngine> createDerivFilter( int srcType, int dstType, int dx, int dy, int ksize, int borderType=BORDER_DEFAULT )
.. cpp:function:: Ptr<FilterEngine> createDerivFilter( int srcType, int dstType, int dx, int dy, int ksize, int borderType=BORDER_DEFAULT )
Returns an engine for computing image derivatives.
@@ -616,57 +608,57 @@ createDerivFilter
:param dy: Derivative order in respect of y.
:param ksize: Aperture size See :func:`getDerivKernels` .
:param ksize: Aperture size See :cpp:func:`getDerivKernels` .
:param borderType: Border type to use. See :func:`borderInterpolate` .
:param borderType: Border type to use. See :cpp:func:`borderInterpolate` .
The function :func:`createDerivFilter` is a small convenience function that retrieves linear filter coefficients for computing image derivatives using
:func:`getDerivKernels` and then creates a separable linear filter with
:func:`createSeparableLinearFilter` . The function is used by
:func:`Sobel` and
:func:`Scharr` .
The function :cpp:func:`createDerivFilter` is a small convenience function that retrieves linear filter coefficients for computing image derivatives using
:cpp:func:`getDerivKernels` and then creates a separable linear filter with
:cpp:func:`createSeparableLinearFilter` . The function is used by
:cpp:func:`Sobel` and
:cpp:func:`Scharr` .
See Also:
:func:`createSeparableLinearFilter`,
:func:`getDerivKernels`,
:func:`Scharr`,
:func:`Sobel`
:cpp:func:`createSeparableLinearFilter`,
:cpp:func:`getDerivKernels`,
:cpp:func:`Scharr`,
:cpp:func:`Sobel`
.. index:: createGaussianFilter
createGaussianFilter
------------------------
.. c:function:: Ptr<FilterEngine> createGaussianFilter( int type, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT)
.. cpp:function:: Ptr<FilterEngine> createGaussianFilter( int type, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT)
Returns an engine for smoothing images with the Gaussian filter.
:param type: Source and destination image type.
:param ksize: Aperture size. See :func:`getGaussianKernel` .
:param ksize: Aperture size. See :cpp:func:`getGaussianKernel` .
:param sigmaX: Gaussian sigma in the horizontal direction. See :func:`getGaussianKernel` .
:param sigmaX: Gaussian sigma in the horizontal direction. See :cpp:func:`getGaussianKernel` .
:param sigmaY: Gaussian sigma in the vertical direction. If 0, then :math:`\texttt{sigmaY}\leftarrow\texttt{sigmaX}` .
:param borderType: Border type to use. See :func:`borderInterpolate` .
:param borderType: Border type to use. See :cpp:func:`borderInterpolate` .
The function :func:`createGaussianFilter` computes Gaussian kernel coefficients and then returns a separable linear filter for that kernel. The function is used by
:func:`GaussianBlur` . Note that while the function takes just one data type, both for input and output, you can pass this limitation by calling
:func:`getGaussianKernel` and then
:func:`createSeparableFilter` directly.
The function :cpp:func:`createGaussianFilter` computes Gaussian kernel coefficients and then returns a separable linear filter for that kernel. The function is used by
:cpp:func:`GaussianBlur` . Note that while the function takes just one data type, both for input and output, you can pass this limitation by calling
:cpp:func:`getGaussianKernel` and then
:cpp:func:`createSeparableFilter` directly.
See Also:
:func:`createSeparableLinearFilter`,
:func:`getGaussianKernel`,
:func:`GaussianBlur`
:cpp:func:`createSeparableLinearFilter`,
:cpp:func:`getGaussianKernel`,
:cpp:func:`GaussianBlur`
.. index:: createLinearFilter
createLinearFilter
----------------------
.. c:function:: Ptr<FilterEngine> createLinearFilter(int srcType, int dstType, const Mat& kernel, Point _anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar& borderValue=Scalar())
.. cpp: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())
.. c:function:: Ptr<BaseFilter> getLinearFilter(int srcType, int dstType, const Mat& kernel, Point anchor=Point(-1,-1), double delta=0, int bits=0)
.. cpp:function:: Ptr<BaseFilter> getLinearFilter(int srcType, int dstType, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int bits=0)
Creates a non-separable linear filter engine.
@@ -682,30 +674,30 @@ createLinearFilter
: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 :func:`borderInterpolate` for details.
:param rowBorderType, columnBorderType: Pixel extrapolation methods in the horizontal and vertical directions. See :cpp:func:`borderInterpolate` for details.
:param borderValue: Border vaule used in case of a constant border.
The function returns a pointer to a 2D linear filter for the specified kernel, the source array type, and the destination array type. The function is a higher-level function that calls ``getLinearFilter`` and passes the retrieved 2D filter to the
:func:`FilterEngine` constructor.
:cpp:func:`FilterEngine` constructor.
See Also:
:func:`createSeparableLinearFilter`,
:func:`FilterEngine`,
:func:`filter2D`
:cpp:func:`createSeparableLinearFilter`,
:cpp:func:`FilterEngine`,
:cpp:func:`filter2D`
.. index:: createMorphologyFilter
createMorphologyFilter
--------------------------
.. c:function:: Ptr<FilterEngine> createMorphologyFilter(int op, int type, const Mat& element, Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT, int columnBorderType=-1, const Scalar& borderValue=morphologyDefaultBorderValue())
.. cpp:function:: Ptr<FilterEngine> createMorphologyFilter(int op, int type, InputArray element, Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT, int columnBorderType=-1, const Scalar& borderValue=morphologyDefaultBorderValue())
.. c:function:: Ptr<BaseFilter> getMorphologyFilter(int op, int type, const Mat& element, Point anchor=Point(-1,-1))
.. cpp:function:: Ptr<BaseFilter> getMorphologyFilter(int op, int type, InputArray element, Point anchor=Point(-1,-1))
.. c:function:: Ptr<BaseRowFilter> getMorphologyRowFilter(int op, int type, int esize, int anchor=-1)
.. cpp:function:: Ptr<BaseRowFilter> getMorphologyRowFilter(int op, int type, int esize, int anchor=-1)
.. c:function:: Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int esize, int anchor=-1)
.. cpp:function:: Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int esize, int anchor=-1)
.. c:function:: static inline Scalar morphologyDefaultBorderValue(){ return Scalar::all(DBL_MAX) }
.. cpp:function:: static inline Scalar morphologyDefaultBorderValue(){ return Scalar::all(DBL_MAX) }
Creates an engine for non-separable morphological operations.
@@ -719,32 +711,32 @@ createMorphologyFilter
: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 :func:`borderInterpolate` for details.
:param rowBorderType, columnBorderType: Pixel extrapolation methods in the horizontal and vertical directions. See :cpp:func:`borderInterpolate` for details.
: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.
The functions construct primitive morphological filtering operations or a filter engine based on them. Normally it is enough to use
:func:`createMorphologyFilter` or even higher-level
:func:`erode`,
:func:`dilate` , or
:func:`morphologyEx` .
:cpp:func:`createMorphologyFilter` or even higher-level
:cpp:func:`erode`,
:cpp:func:`dilate` , or
:cpp:func:`morphologyEx` .
Note that
:func:`createMorphologyFilter` analyzes the structuring element shape and builds a separable morphological filter engine when the structuring element is square.
:cpp:func:`createMorphologyFilter` analyzes the structuring element shape and builds a separable morphological filter engine when the structuring element is square.
See Also:
:func:`erode`,
:func:`dilate`,
:func:`morphologyEx`,
:func:`FilterEngine`
:cpp:func:`erode`,
:cpp:func:`dilate`,
:cpp:func:`morphologyEx`,
:cpp:func:`FilterEngine`
.. index:: createSeparableLinearFilter
createSeparableLinearFilter
-------------------------------
.. c:function:: Ptr<FilterEngine> createSeparableLinearFilter(int srcType, int dstType, const Mat& rowKernel, const Mat& columnKernel, Point anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar& borderValue=Scalar())
.. cpp: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())
.. c:function:: Ptr<BaseColumnFilter> getLinearColumnFilter(int bufType, int dstType, const Mat& columnKernel, int anchor, int symmetryType, double delta=0, int bits=0)
.. cpp:function:: Ptr<BaseColumnFilter> getLinearColumnFilter(int bufType, int dstType, InputArray columnKernel, int anchor, int symmetryType, double delta=0, int bits=0)
.. c:function:: Ptr<BaseRowFilter> getLinearRowFilter(int srcType, int bufType, const Mat& rowKernel, int anchor, int symmetryType)
.. cpp:function:: Ptr<BaseRowFilter> getLinearRowFilter(int srcType, int bufType, InputArray rowKernel, int anchor, int symmetryType)
Creates an engine for a separable linear filter.
@@ -764,28 +756,28 @@ createSeparableLinearFilter
: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 :func:`borderInterpolate` for details.
:param rowBorderType, columnBorderType: Pixel extrapolation methods in the horizontal and vertical directions. See :cpp:func:`borderInterpolate` for details.
:param borderValue: Border value used in case of a constant border.
:param symmetryType: Type of each row and column kernel. See :func:`getKernelType` .
:param symmetryType: Type of each row and column kernel. See :cpp:func:`getKernelType` .
The functions construct primitive separable linear filtering operations or a filter engine based on them. Normally it is enough to use
:func:`createSeparableLinearFilter` or even higher-level
:func:`sepFilter2D` . The function
:func:`createMorphologyFilter` is smart enough to figure out the ``symmetryType`` for each of the two kernels, the intermediate ``bufType`` and, if filtering can be done in integer arithmetics, the number of ``bits`` to encode the filter coefficients. If it does not work for you, it is possible to call ``getLinearColumnFilter``,``getLinearRowFilter`` directly and then pass them to the
:func:`FilterEngine` constructor.
:cpp:func:`createSeparableLinearFilter` or even higher-level
:cpp:func:`sepFilter2D` . The function
:cpp:func:`createMorphologyFilter` is smart enough to figure out the ``symmetryType`` for each of the two kernels, the intermediate ``bufType`` and, if filtering can be done in integer arithmetics, the number of ``bits`` to encode the filter coefficients. If it does not work for you, it is possible to call ``getLinearColumnFilter``,``getLinearRowFilter`` directly and then pass them to the
:cpp:func:`FilterEngine` constructor.
See Also:
:func:`sepFilter2D`,
:func:`createLinearFilter`,
:func:`FilterEngine`,
:func:`getKernelType`
:cpp:func:`sepFilter2D`,
:cpp:func:`createLinearFilter`,
:cpp:func:`FilterEngine`,
:cpp:func:`getKernelType`
.. index:: dilate
dilate
----------
.. c:function:: void dilate( const Mat& src, Mat& dst, const Mat& element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
.. cpp:function:: void dilate( InputArray src, OutputArray dst, InputArray element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
Dilates an image by using a specific structuring element.
@@ -799,9 +791,9 @@ dilate
:param iterations: Number of times dilation is applied.
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` for details.
:param borderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
:param borderValue: Border value in case of a constant border. The default value has a special meaning. See :func:`createMorphologyFilter` for details.
:param borderValue: Border value in case of a constant border. The default value has a special meaning. See :cpp:func:`createMorphologyFilter` for details.
The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken:
@@ -812,14 +804,14 @@ 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.
See Also:
:func:`erode`,
:func:`morphologyEx`,
:func:`createMorphologyFilter`
:cpp:func:`erode`,
:cpp:func:`morphologyEx`,
:cpp:func:`createMorphologyFilter`
.. index:: erode
erode
---------
.. c:function:: void erode( const Mat& src, Mat& dst, const Mat& element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
.. cpp:function:: void erode( InputArray src, OutputArray dst, InputArray element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
Erodes an image by using a specific structuring element.
@@ -833,9 +825,9 @@ erode
:param iterations: Number of times erosion is applied.
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` for details.
:param borderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
:param borderValue: Border value in case of a constant border. The default value has a special meaning. See :func:`createMorphoogyFilter` for details.
:param borderValue: Border value in case of a constant border. The default value has a special meaning. See :cpp:func:`createMorphoogyFilter` for details.
The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken:
@@ -846,15 +838,15 @@ 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.
See Also:
:func:`dilate`,
:func:`morphologyEx`,
:func:`createMorphologyFilter`
:cpp:func:`dilate`,
:cpp:func:`morphologyEx`,
:cpp:func:`createMorphologyFilter`
.. index:: filter2D
filter2D
------------
.. c:function:: void filter2D( const Mat& src, Mat& dst, int ddepth, const Mat& kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
.. cpp:function:: void filter2D( InputArray src, OutputArray dst, int ddepth, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
Convolves an image with the kernel.
@@ -864,13 +856,13 @@ filter2D
:param ddepth: Desired depth of the destination image. If it is negative, it will be the same as ``src.depth()`` .
:param kernel: Convolution kernel (or rather a correlation kernel), a single-channel floating point matrix. If you want to apply different kernels to different channels, split the image into separate color planes using :func:`split` and process them individually.
:param kernel: Convolution kernel (or rather a correlation kernel), a single-channel floating point matrix. If you want to apply different kernels to different channels, split the image into separate color planes using :cpp:func:`split` and process them individually.
:param anchor: Anchor of the kernel that indicates the relative position of a filtered point within the kernel. The anchor should lie within the kernel. The special default value (-1,-1) means that the anchor is at the kernel center.
:param delta: Optional value added to the filtered pixels before storing them in ``dst`` .
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` for details.
:param borderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode.
@@ -881,21 +873,21 @@ The function does actually compute correlation, not the convolution:
\texttt{dst} (x,y) = \sum _{ \stackrel{0\leq x' < \texttt{kernel.cols},}{0\leq y' < \texttt{kernel.rows}} } \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )
That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip the kernel using
:func:`flip` and set the new anchor to ``(kernel.cols - anchor.x - 1, kernel.rows - anchor.y - 1)`` .
:cpp:func:`flip` and set the new anchor to ``(kernel.cols - anchor.x - 1, kernel.rows - anchor.y - 1)`` .
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 :func:`createLinearFilter` ) for small kernels.
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 :cpp:func:`createLinearFilter` ) for small kernels.
See Also:
:func:`sepFilter2D`,
:func:`createLinearFilter`,
:func:`dft`,
:func:`matchTemplate`
:cpp:func:`sepFilter2D`,
:cpp:func:`createLinearFilter`,
:cpp:func:`dft`,
:cpp:func:`matchTemplate`
.. index:: GaussianBlur
GaussianBlur
----------------
.. c:function:: void GaussianBlur( const Mat& src, Mat& dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )
.. cpp:function:: void GaussianBlur( InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )
Smoothes an image using a Gaussian filter.
@@ -905,24 +897,24 @@ GaussianBlur
: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 :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, sigmaY: Gaussian kernel standard deviations in X and Y direction. If ``sigmaY`` is zero, it is set to be equal to ``sigmaX`` . If they are both zeros, they are computed from ``ksize.width`` and ``ksize.height`` , respectively. See :cpp:func:`getGaussianKernel` for details. To fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ``ksize`` , ``sigmaX`` , and ``sigmaY`` .
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` for details.
:param borderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.
See Also:
:func:`sepFilter2D`,
:func:`filter2D`,
:func:`blur`,
:func:`boxFilter`,
:func:`bilateralFilter`,
:func:`medianBlur`
:cpp:func:`sepFilter2D`,
:cpp:func:`filter2D`,
:cpp:func:`blur`,
:cpp:func:`boxFilter`,
:cpp:func:`bilateralFilter`,
:cpp:func:`medianBlur`
.. index:: getDerivKernels
getDerivKernels
-------------------
.. c:function:: void getDerivKernels( Mat& kx, Mat& ky, int dx, int dy, int ksize, bool normalize=false, int ktype=CV_32F )
.. cpp:function:: void getDerivKernels( OutputArray kx, OutputArray ky, int dx, int dy, int ksize, bool normalize=false, int ktype=CV_32F )
Returns filter coefficients for computing spatial image derivatives.
@@ -942,16 +934,16 @@ getDerivKernels
The function computes and returns the filter coefficients for spatial image derivatives. When ``ksize=CV_SCHARR`` , the Scharr
:math:`3 \times 3` kernels are generated (see
:func:`Scharr` ). Otherwise, Sobel kernels are generated (see
:func:`Sobel` ). The filters are normally passed to
:func:`sepFilter2D` or to
:func:`createSeparableLinearFilter` .
:cpp:func:`Scharr` ). Otherwise, Sobel kernels are generated (see
:cpp:func:`Sobel` ). The filters are normally passed to
:cpp:func:`sepFilter2D` or to
:cpp:func:`createSeparableLinearFilter` .
.. index:: getGaussianKernel
getGaussianKernel
---------------------
.. c:function:: Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F )
.. cpp:function:: Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F )
Returns Gaussian filter coefficients.
@@ -973,22 +965,22 @@ where
:math:`\sum_i G_i=1`.
Two of such generated kernels can be passed to
:func:`sepFilter2D` or to
:func:`createSeparableLinearFilter`. Those functions automatically recognize smoothing kernels (i.e. symmetrical kernel with sum of weights = 1) and handle them accordingly. You may also use the higher-level
:func:`GaussianBlur`.
:cpp:func:`sepFilter2D` or to
:cpp:func:`createSeparableLinearFilter`. Those functions automatically recognize smoothing kernels (i.e. symmetrical kernel with sum of weights = 1) and handle them accordingly. You may also use the higher-level
:cpp:func:`GaussianBlur`.
See Also:
:func:`sepFilter2D`,
:func:`createSeparableLinearFilter`,
:func:`getDerivKernels`,
:func:`getStructuringElement`,
:func:`GaussianBlur`
:cpp:func:`sepFilter2D`,
:cpp:func:`createSeparableLinearFilter`,
:cpp:func:`getDerivKernels`,
:cpp:func:`getStructuringElement`,
:cpp:func:`GaussianBlur`
.. index:: getKernelType
getKernelType
-----------------
.. c:function:: int getKernelType(const Mat& kernel, Point anchor)
.. cpp:function:: int getKernelType(InputArray kernel, Point anchor)
Returns the kernel type.
@@ -1011,7 +1003,7 @@ The function analyzes the kernel coefficients and returns the corresponding kern
getStructuringElement
-------------------------
.. c:function:: Mat getStructuringElement(int shape, Size esize, Point anchor=Point(-1,-1))
.. cpp:function:: Mat getStructuringElement(int shape, Size esize, Point anchor=Point(-1,-1))
Returns a structuring element of the specified size and shape for morphological operations.
@@ -1036,16 +1028,16 @@ getStructuringElement
: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.
The function constructs and returns the structuring element that can be then passed to
:func:`createMorphologyFilter`,
:func:`erode`,
:func:`dilate` or
:func:`morphologyEx` . But you can also construct an arbitrary binary mask yourself and use it as the structuring element.
:cpp:func:`createMorphologyFilter`,
:cpp:func:`erode`,
:cpp:func:`dilate` or
:cpp:func:`morphologyEx` . But you can also construct an arbitrary binary mask yourself and use it as the structuring element.
.. index:: medianBlur
medianBlur
--------------
.. c:function:: void medianBlur( const Mat& src, Mat& dst, int ksize )
.. cpp:function:: void medianBlur( InputArray src, OutputArray dst, int ksize )
Smoothes an image using the median filter.
@@ -1059,16 +1051,16 @@ 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.
See Also:
:func:`bilateralFilter`,
:func:`blur`,
:func:`boxFilter`,
:func:`GaussianBlur`
:cpp:func:`bilateralFilter`,
:cpp:func:`blur`,
:cpp:func:`boxFilter`,
:cpp:func:`GaussianBlur`
.. index:: morphologyEx
morphologyEx
----------------
.. c:function:: void morphologyEx( const Mat& src, Mat& dst, int op, const Mat& element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
.. cpp:function:: void morphologyEx( InputArray src, OutputArray dst, int op, InputArray element, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
Performs advanced morphological transformations.
@@ -1092,9 +1084,9 @@ morphologyEx
:param iterations: Number of times erosion and dilation are applied.
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` for details.
:param borderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
:param borderValue: Border value in case of a constant border. The default value has a special meaning. See :func:`createMorphoogyFilter` for details.
:param borderValue: Border value in case of a constant border. The default value has a special meaning. See :cpp:func:`createMorphoogyFilter` for details.
The function can perform advanced morphological transformations using an erosion and dilation as basic operations.
@@ -1131,15 +1123,15 @@ Morphological gradient:
Any of the operations can be done in-place.
See Also:
:func:`dilate`,
:func:`erode`,
:func:`createMorphologyFilter`
:cpp:func:`dilate`,
:cpp:func:`erode`,
:cpp:func:`createMorphologyFilter`
.. index:: Laplacian
Laplacian
-------------
.. c:function:: void Laplacian( const Mat& src, Mat& dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
.. cpp:function:: void Laplacian( InputArray src, OutputArray dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
Calculates the Laplacian of an image.
@@ -1149,13 +1141,13 @@ Laplacian
:param ddepth: Desired depth of the destination image.
:param ksize: Aperture size used to compute the second-derivative filters. See :func:`getDerivKernels` for details. The size must be positive and odd.
:param ksize: Aperture size used to compute the second-derivative filters. See :cpp:func:`getDerivKernels` for details. The size must be positive and odd.
:param scale: Optional scale factor for the computed Laplacian values. By default, no scaling is applied. See :func:`getDerivKernels` for details.
:param scale: Optional scale factor for the computed Laplacian values. By default, no scaling is applied. See :cpp:func:`getDerivKernels` for details.
:param delta: Optional delta value that is added to the results prior to storing them in ``dst`` .
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` for details.
:param borderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator:
@@ -1171,14 +1163,14 @@ This is done when ``ksize > 1`` . When ``ksize == 1`` , the Laplacian is compute
\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}
See Also:
:func:`Sobel`,
:func:`Scharr`
:cpp:func:`Sobel`,
:cpp:func:`Scharr`
.. index:: pyrDown
pyrDown
-----------
.. c:function:: void pyrDown( const Mat& src, Mat& dst, const Size& dstsize=Size())
.. cpp:function:: void pyrDown( InputArray src, OutputArray dst, const Size& dstsize=Size())
Smoothes an image and downsamples it.
@@ -1205,7 +1197,7 @@ Then, it downsamples the image by rejecting even rows and columns.
pyrUp
---------
.. c:function:: void pyrUp( const Mat& src, Mat& dst, const Size& dstsize=Size())
.. cpp:function:: void pyrUp( InputArray src, OutputArray dst, const Size& dstsize=Size())
Upsamples an image and then smoothes it.
@@ -1221,13 +1213,13 @@ pyrUp
| \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}
The function performs the upsampling step of the Gaussian pyramid construction though it can actually be used to construct the Laplacian pyramid. First, it upsamples the source image by injecting even zero rows and columns and then convolves the result with the same kernel as in
:func:`pyrDown` multiplied by 4.
:cpp:func:`pyrDown` multiplied by 4.
.. index:: sepFilter2D
sepFilter2D
---------------
.. c:function:: void sepFilter2D( const Mat& src, Mat& dst, int ddepth, const Mat& rowKernel, const Mat& columnKernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
.. cpp:function:: void sepFilter2D( InputArray src, OutputArray dst, int ddepth, InputArray rowKernel, InputArray columnKernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
Applies a separable linear filter to an image.
@@ -1245,23 +1237,23 @@ sepFilter2D
:param delta: Value added to the filtered results before storing them.
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` for details.
:param borderType: Pixel extrapolation method. See :cpp: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`` .
See Also:
:func:`createSeparableLinearFilter`,
:func:`filter2D`,
:func:`Sobel`,
:func:`GaussianBlur`,
:func:`boxFilter`,
:func:`blur`
:cpp:func:`createSeparableLinearFilter`,
:cpp:func:`filter2D`,
:cpp:func:`Sobel`,
:cpp:func:`GaussianBlur`,
:cpp:func:`boxFilter`,
:cpp:func:`blur`
.. index:: Sobel
Sobel
---------
.. c:function:: void Sobel( const Mat& src, Mat& dst, int ddepth, int xorder, int yorder, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
.. cpp:function:: void Sobel( InputArray src, OutputArray dst, int ddepth, int xorder, int yorder, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
@@ -1277,11 +1269,11 @@ Sobel
:param ksize: Size of the extended Sobel kernel. It must be 1, 3, 5, or 7.
:param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :func:`getDerivKernels` for details.
:param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :cpp:func:`getDerivKernels` for details.
:param delta: Optional delta value that is added to the results prior to storing them in ``dst`` .
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` for details.
:param borderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
In all cases except one, the
:math:`\texttt{ksize} \times
@@ -1324,17 +1316,17 @@ The second case corresponds to a kernel of:
\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}
See Also:
:func:`Scharr`,
:func:`Lapacian`,
:func:`sepFilter2D`,
:func:`filter2D`,
:func:`GaussianBlur`
:cpp:func:`Scharr`,
:cpp:func:`Lapacian`,
:cpp:func:`sepFilter2D`,
:cpp:func:`filter2D`,
:cpp:func:`GaussianBlur`
.. index:: Scharr
Scharr
----------
.. c:function:: void Scharr( const Mat& src, Mat& dst, int ddepth, int xorder, int yorder, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
.. cpp:function:: void Scharr( InputArray src, OutputArray dst, int ddepth, int xorder, int yorder, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
Calculates the first x- or y- image derivative using Scharr operator.
@@ -1348,11 +1340,11 @@ Scharr
:param yorder: Order of the derivative y.
:param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :func:`getDerivKernels` for details.
:param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :cpp:func:`getDerivKernels` for details.
:param delta: Optional delta value that is added to the results prior to storing them in ``dst`` .
:param borderType: Pixel extrapolation method. See :func:`borderInterpolate` for details.
:param borderType: Pixel extrapolation method. See :cpp:func:`borderInterpolate` for details.
The function computes the first x- or y- spatial image derivative using the Scharr operator. The call

View File

@@ -39,7 +39,7 @@ The actual implementations of the geometrical transformations, from the most gen
convertMaps
-----------
.. c:function:: void convertMaps( const Mat& map1, const Mat& map2, Mat& dstmap1, Mat& dstmap2, int dstmap1type, bool nninterpolation=false )
.. cpp:function:: void convertMaps( InputArray map1, InputArray map2, OutputArray dstmap1, OutputArray dstmap2, int dstmap1type, bool nninterpolation=false )
Converts image transformation maps from one representation to another.
@@ -56,11 +56,11 @@ convertMaps
:param nninterpolation: Flag indicating whether the fixed-point maps are used for the nearest-neighbor or for a more complex interpolation.
The function converts a pair of maps for
:func:`remap` from one representation to another. The following options ( ``(map1.type(), map2.type())`` :math:`\rightarrow` ``(dstmap1.type(), dstmap2.type())`` ) are supported:
:cpp:func:`remap` from one representation to another. The following options ( ``(map1.type(), map2.type())`` :math:`\rightarrow` ``(dstmap1.type(), dstmap2.type())`` ) are supported:
*
:math:`\texttt{(CV\_32FC1, CV\_32FC1)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}` . This is the most frequently used conversion operation, in which the original floating-point maps (see
:func:`remap` ) are converted to a more compact and much faster fixed-point representation. The first output array contains the rounded coordinates and the second array (created only when ``nninterpolation=false`` ) contains indices in the interpolation tables.
:cpp:func:`remap` ) are converted to a more compact and much faster fixed-point representation. The first output array contains the rounded coordinates and the second array (created only when ``nninterpolation=false`` ) contains indices in the interpolation tables.
*
:math:`\texttt{(CV\_32FC2)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}` . The same as above but the original maps are stored in one 2-channel matrix.
@@ -69,17 +69,15 @@ 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:
:func:`remap`,
:func:`undisort`,
:func:`initUndistortRectifyMap`
:cpp:func:`remap`,
:cpp:func:`undisort`,
:cpp:func:`initUndistortRectifyMap`
.. index:: getAffineTransform
.. _getAffineTransform:
getAffineTransform
----------------------
.. c:function:: Mat getAffineTransform( const Point2f src[], const Point2f dst[] )
.. cpp:function:: Mat getAffineTransform( const Point2f src[], const Point2f dst[] )
Calculates an affine transform from three pairs of the corresponding points.
@@ -102,8 +100,8 @@ where
i=0,1,2
See Also:
:func:`warpAffine`,
:func:`transform`
:cpp:func:`warpAffine`,
:cpp:func:`transform`
.. index:: getPerspectiveTransform
@@ -112,7 +110,7 @@ See Also:
getPerspectiveTransform
---------------------------
.. c:function:: Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] )
.. cpp:function:: Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] )
Calculates a perspective transform from four pairs of the corresponding points.
@@ -135,9 +133,9 @@ where
i=0,1,2
See Also:
:func:`findHomography`,
:func:`warpPerspective`,
:func:`perspectiveTransform`
:cpp:func:`findHomography`,
:cpp:func:`warpPerspective`,
:cpp:func:`perspectiveTransform`
.. index:: getRectSubPix
@@ -145,7 +143,7 @@ See Also:
getRectSubPix
-----------------
.. c:function:: void getRectSubPix( const Mat& image, Size patchSize, Point2f center, Mat& dst, int patchType=-1 )
.. cpp:function:: void getRectSubPix( InputArray image, Size patchSize, Point2f center, OutputArray dst, int patchType=-1 )
Retrieves a pixel rectangle from an image with sub-pixel accuracy.
@@ -170,12 +168,12 @@ using bilinear interpolation. Every channel of multi-channel
images is processed independently. While the center of the rectangle
must be inside the image, parts of the rectangle may be
outside. In this case, the replication border mode (see
:func:`borderInterpolate` ) is used to extrapolate
:cpp:func:`borderInterpolate` ) is used to extrapolate
the pixel values outside of the image.
See Also:
:func:`warpAffine`,
:func:`warpPerspective`
:cpp:func:`warpAffine`,
:cpp:func:`warpPerspective`
.. index:: getRotationMatrix2D
@@ -183,7 +181,7 @@ See Also:
getRotationMatrix2D
-----------------------
.. c:function:: Mat getRotationMatrix2D( Point2f center, double angle, double scale )
.. cpp:function:: Mat getRotationMatrix2D( Point2f center, double angle, double scale )
Calculates an affine matrix of 2D rotation.
@@ -208,9 +206,9 @@ where
The transformation maps the rotation center to itself. If this is not the target, adjust the shift.
See Also:
:func:`getAffineTransform`,
:func:`warpAffine`,
:func:`transform`
:cpp:func:`getAffineTransform`,
:cpp:func:`warpAffine`,
:cpp:func:`transform`
.. index:: invertAffineTransform
@@ -218,7 +216,7 @@ See Also:
invertAffineTransform
-------------------------
.. c:function:: void invertAffineTransform(const Mat& M, Mat& iM)
.. cpp:function:: void invertAffineTransform(InputArray M, OutputArray iM)
Inverts an affine transformation.
@@ -243,20 +241,20 @@ The result is also a
remap
-----
.. c:function:: void remap( const Mat& src, Mat& dst, const Mat& map1, const Mat& map2, int interpolation, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
.. cpp:function:: void remap( InputArray src, OutputArray dst, InputArray map1, InputArray map2, int interpolation, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
Applies a generic geometrical transformation to an image.
:param src: Source image.
:param dst: Destination image. It has the same size as ``map1`` and the same type as ``src`` .
:param map1: The first map of either ``(x,y)`` points or just ``x`` values having the type ``CV_16SC2`` , ``CV_32FC1`` , or ``CV_32FC2`` . See :func:`convertMaps` for details on converting a floating point representation to fixed-point for speed.
:param map1: The first map of either ``(x,y)`` points or just ``x`` values having the type ``CV_16SC2`` , ``CV_32FC1`` , or ``CV_32FC2`` . See :cpp:func:`convertMaps` for details on converting a floating point representation to fixed-point for speed.
:param map2: The second map of ``y`` values having the type ``CV_16UC1`` , ``CV_32FC1`` , or none (empty map if ``map1`` is ``(x,y)`` points), respectively.
:param interpolation: Interpolation method (see :func:`resize` ). The method ``INTER_AREA`` is not supported by this function.
:param interpolation: Interpolation method (see :cpp:func:`resize` ). The method ``INTER_AREA`` is not supported by this function.
:param borderMode: Pixel extrapolation method (see :func:`borderInterpolate` ). When \ ``borderMode=BORDER_TRANSPARENT`` , it means that the pixels in the destination image that corresponds to the "outliers" in the source image are not modified by the function.
:param borderMode: Pixel extrapolation method (see :cpp:func:`borderInterpolate` ). When \ ``borderMode=BORDER_TRANSPARENT`` , it means that the pixels in the destination image that corresponds to the "outliers" in the source image are not modified by the function.
:param borderValue: Value used in case of a constant border. By default, it is 0.
@@ -274,7 +272,7 @@ where values of pixels with non-integer coordinates are computed using one of av
:math:`(x,y)` in
:math:`map_1` , or
fixed-point maps created by using
:func:`convertMaps` . The reason you might want to convert from floating to fixed-point
:cpp:func:`convertMaps` . The reason you might want to convert from floating to fixed-point
representations of a map is that they can yield much faster (~2x) remapping operations. In the converted case,
:math:`map_1` contains pairs ``(cvFloor(x), cvFloor(y))`` and
:math:`map_2` contains indices in a table of interpolation coefficients.
@@ -288,7 +286,7 @@ This function cannot operate in-place.
resize
----------
.. c:function:: void resize( const Mat& src, Mat& dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR )
.. cpp:function:: void resize( InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR )
Resizes an image.
@@ -343,9 +341,9 @@ If you want to decimate the image by factor of 2 in each direction, you can call
See Also:
:func:`warpAffine`,
:func:`warpPerspective`,
:func:`remap`
:cpp:func:`warpAffine`,
:cpp:func:`warpPerspective`,
:cpp:func:`remap`
.. index:: warpAffine
@@ -353,7 +351,7 @@ See Also:
warpAffine
--------------
.. c:function:: void warpAffine( const Mat& src, Mat& dst, const Mat& M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
.. cpp:function:: void warpAffine( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
Applies an affine transformation to an image.
@@ -365,9 +363,9 @@ warpAffine
:param dsize: Size of the destination image.
:param flags: Combination of interpolation methods (see :func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` that means that ``M`` is the inverse transformation ( :math:`\texttt{dst}\rightarrow\texttt{src}` ).
:param flags: Combination of interpolation methods (see :cpp:func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` that means that ``M`` is the inverse transformation ( :math:`\texttt{dst}\rightarrow\texttt{src}` ).
:param borderMode: Pixel extrapolation method (see :func:`borderInterpolate` ). When \ ``borderMode=BORDER_TRANSPARENT`` , it means that the pixels in the destination image corresponding to the "outliers" in the source image are not modified by the function.
:param borderMode: Pixel extrapolation method (see :cpp:func:`borderInterpolate` ). When \ ``borderMode=BORDER_TRANSPARENT`` , it means that the pixels in the destination image corresponding to the "outliers" in the source image are not modified by the function.
:param borderValue: Value used in case of a constant border. By default, it is 0.
@@ -378,23 +376,21 @@ The function ``warpAffine`` transforms the source image using the specified matr
\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})
when the flag ``WARP_INVERSE_MAP`` is set. Otherwise, the transformation is first inverted with
:func:`invertAffineTransform` and then put in the formula above instead of ``M`` .
:cpp:func:`invertAffineTransform` and then put in the formula above instead of ``M`` .
The function cannot operate in-place.
See Also:
:func:`warpPerspective`,
:func:`resize`,
:func:`remap`,
:func:`getRectSubPix`,
:func:`transform`
:cpp:func:`warpPerspective`,
:cpp:func:`resize`,
:cpp:func:`remap`,
:cpp:func:`getRectSubPix`,
:cpp:func:`transform`
.. index:: warpPerspective
.. _warpPerspective:
warpPerspective
-------------------
.. c:function:: void warpPerspective( const Mat& src, Mat& dst, const Mat& M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
.. cpp:function:: void warpPerspective( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
Applies a perspective transformation to an image.
@@ -406,9 +402,9 @@ warpPerspective
:param dsize: Size of the destination image.
:param flags: Combination of interpolation methods (see :func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` that means that ``M`` is the inverse transformation ( :math:`\texttt{dst}\rightarrow\texttt{src}` ).
:param flags: Combination of interpolation methods (see :cpp:func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` that means that ``M`` is the inverse transformation ( :math:`\texttt{dst}\rightarrow\texttt{src}` ).
:param borderMode: Pixel extrapolation method (see :func:`borderInterpolate` ). When \ ``borderMode=BORDER_TRANSPARENT`` , it means that the pixels in the destination image that corresponds to the "outliers" in the source image are not modified by the function.
:param borderMode: Pixel extrapolation method (see :cpp:func:`borderInterpolate` ). When \ ``borderMode=BORDER_TRANSPARENT`` , it means that the pixels in the destination image that corresponds to the "outliers" in the source image are not modified by the function.
:param borderValue: Value used in case of a constant border. By default, it is 0.
@@ -420,13 +416,178 @@ The function ``warpPerspective`` transforms the source image using the specified
\frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )
when the flag ``WARP_INVERSE_MAP`` is set. Otherwise, the transformation is first inverted with
:func:`invert` and then put in the formula above instead of ``M`` .
:cpp:func:`invert` and then put in the formula above instead of ``M`` .
The function cannot operate in-place.
See Also:
:func:`warpAffine`,
:func:`resize`,
:func:`remap`,
:func:`getRectSubPix`,
:func:`perspectiveTransform`
:cpp:func:`warpAffine`,
:cpp:func:`resize`,
:cpp:func:`remap`,
:cpp:func:`getRectSubPix`,
:cpp:func:`perspectiveTransform`
.. index:: initUndistortRectifyMap
initUndistortRectifyMap
---------------------------
.. cpp:function:: void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs, InputArray R, InputArray newCameraMatrix, Size size, int m1type, OutputArray map1, OutputArray map2 )
Computes the undistortion and rectification transformation map.
:param cameraMatrix: Input camera matrix :math:`A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}` .
: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.
: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 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` .
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
: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::
\begin{array}{l} x \leftarrow (u - {c'}_x)/{f'}_x \\ y \leftarrow (v - {c'}_y)/{f'}_y \\{[X\,Y\,W]} ^T \leftarrow R^{-1}*[x \, y \, 1]^T \\ x' \leftarrow X/W \\ y' \leftarrow Y/W \\ x" \leftarrow x' (1 + k_1 r^2 + k_2 r^4 + k_3 r^6) + 2p_1 x' y' + p_2(r^2 + 2 x'^2) \\ y" \leftarrow y' (1 + k_1 r^2 + k_2 r^4 + k_3 r^6) + p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' \\ map_x(u,v) \leftarrow x" f_x + c_x \\ map_y(u,v) \leftarrow y" f_y + c_y \end{array}
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
.. math::
\texttt{R} = \texttt{cameraMatrix} ^{-1} \cdot \texttt{H} \cdot \texttt{cameraMatrix}
where ``cameraMatrix`` can be chosen arbitrarily.
.. index:: getDefaultNewCameraMatrix
getDefaultNewCameraMatrix
-----------------------------
.. cpp:function:: Mat getDefaultNewCameraMatrix(InputArray cameraMatrix, Size imgSize=Size(), bool centerPrincipalPoint=false )
Returns the default new camera matrix.
:param cameraMatrix: Input camera matrix.
:param imageSize: Camera view image size in pixels.
: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).
In the latter case, the new camera matrix will be:
.. math::
\begin{bmatrix} f_x && 0 && ( \texttt{imgSize.width} -1)*0.5 \\ 0 && f_y && ( \texttt{imgSize.height} -1)*0.5 \\ 0 && 0 && 1 \end{bmatrix} ,
where
:math:`f_x` and
:math:`f_y` are
:math:`(0,0)` and
: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.
.. index:: undistort
undistort
-------------
.. cpp:function:: void undistort( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray newCameraMatrix=None() )
Transforms an image to compensate for lens distortion.
:param src: Input (distorted) image.
:param dst: Output (corrected) image that has the same size and type as ``src`` .
:param cameraMatrix: Input camera matrix :math:`A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}` .
: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 newCameraMatrix: Camera matrix of the distorted image. By default, it is the same as ``cameraMatrix`` but you may additionally scale and shift the result by using a different matrix.
The function transforms an image to compensate radial and tangential lens distortion.
The function is simply a combination of
:ref:`InitUndistortRectifyMap` (with unity ``R`` ) and
:ref:`Remap` (with bilinear interpolation). See the former function for details of the transformation being performed.
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.
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,
:math:`f_x, f_y, c_x` and
:math:`c_y` need to be scaled accordingly, while the distortion coefficients remain the same.
.. index:: undistortPoints
undistortPoints
-------------------
.. cpp:function:: void undistortPoints( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray R=None(), InputArray P=None())
Computes the ideal point coordinates from the observed point coordinates.
:param src: Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2).
:param dst: Output ideal point coordinates after undistortion and reverse perspective transformation.
:param cameraMatrix: Camera matrix :math:`\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}` .
: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 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.
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. ::
// (u,v) is the input point, (u', v') is the output point
// camera_matrix=[fx 0 cx; 0 fy cy; 0 0 1]
// P=[fx' 0 cx' tx; 0 fy' cy' ty; 0 0 1 tz]
x" = (u - cx)/fx
y" = (v - cy)/fy
(x',y') = undistort(x",y",dist_coeffs)
[X,Y,W]T = R*[x' y' 1]T
x = X/W, y = Y/W
u' = x*fx' + cx'
v' = y*fy' + cy',
where ``undistort()`` is an approximate iterative algorithm that estimates the normalized original point coordinates out of the normalized distorted point coordinates ("normalized" means that the coordinates do not depend on the camera matrix).
The function can be used for both a stereo camera head or a monocular camera (when R is empty).

View File

@@ -5,13 +5,11 @@ Histograms
.. index:: calcHist
.. _calcHist:
calcHist
------------
.. c:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, const Mat\& mask, MatND\& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. cpp:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, InputArray mask, OutputArray hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. c:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, const Mat\& mask, SparseMat\& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. cpp:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, InputArray mask, SparseMat& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
Calculates a histogram of a set of arrays.
@@ -99,13 +97,11 @@ input arrays at the same location. The sample below shows how to compute a 2D Hu
.. index:: calcBackProject
.. _calcBackProject:
calcBackProject
-------------------
.. c:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const MatND\& hist, Mat\& backProject, const float** ranges, double scale=1, bool uniform=true )
.. cpp:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, InputArray hist, OutputArray backProject, const float** ranges, double scale=1, bool uniform=true )
.. c:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const SparseMat\& hist, Mat\& backProject, const float** ranges, double scale=1, bool uniform=true )
.. cpp:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const SparseMat& hist, OutputArray backProject, const float** ranges, double scale=1, bool uniform=true )
Calculates the back projection of a histogram.
@@ -119,7 +115,7 @@ calcBackProject
:param backProject: Destination back projection aray that is a single-channel array of the same size and depth as ``arrays[0]`` .
:param ranges: Array of arrays of the histogram bin boundaries in each dimension. See :func:`calcHist` .
:param ranges: Array of arrays of the histogram bin boundaries in each dimension. See :cpp:func:`calcHist` .
:param scale: Optional scale factor for the output back projection.
@@ -137,21 +133,19 @@ The functions ``calcBackProject`` calculate the back project of the histogram. T
Find connected components in the resulting picture and choose, for example, the largest component.
This is an approximate algorithm of the
:func:`CAMShift` color object tracker.
:cpp:func:`CAMShift` color object tracker.
See Also:
:func:`calcHist`
:cpp:func:`calcHist`
.. index:: compareHist
.. _compareHist:
compareHist
-----------
.. c:function:: double compareHist( const MatND\& H1, const MatND\& H2, int method )
.. cpp:function:: double compareHist( InputArray H1, InputArray H2, int method )
.. c:function:: double compareHist( const SparseMat\& H1, const SparseMat\& H2, int method )
.. cpp:function:: double compareHist( const SparseMat& H1, const SparseMat& H2, int method )
Compares two histograms.
@@ -207,15 +201,13 @@ The function returns
:math:`d(H_1, H_2)` .
While the function works well with 1-, 2-, 3-dimensional dense histograms, it may not be suitable for high-dimensional sparse histograms. In such histograms, because of aliasing and sampling problems, the coordinates of non-zero histogram bins can slightly shift. To compare such histograms or more general sparse configurations of weighted points, consider using the
:func:`calcEMD` function.
:cpp:func:`calcEMD` function.
.. index:: equalizeHist
.. _equalizeHist:
equalizeHist
----------------
.. c:function:: void equalizeHist( const Mat\& src, Mat\& dst )
.. cpp:function:: void equalizeHist( InputArray src, OutputArray dst )
Equalizes the histogram of a grayscale image.

View File

@@ -9,7 +9,7 @@ Miscellaneous Image Transformations
adaptiveThreshold
---------------------
.. c:function:: void adaptiveThreshold( const Mat& src, Mat& dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C )
.. cpp:function:: void adaptiveThreshold( InputArray src, OutputArray dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C )
Applies an adaptive threshold to an array.
@@ -54,14 +54,14 @@ where
:math:`T(x, y)` is a weighted sum (cross-correlation with a Gaussian window) of the
:math:`\texttt{blockSize} \times \texttt{blockSize}` neighborhood of
:math:`(x, y)` minus ``C`` . The default sigma (standard deviation) is used for the specified ``blockSize`` . See
:func:`getGaussianKernel` .
:cpp:func:`getGaussianKernel` .
The function can process the image in-place.
See Also:
:func:`threshold`,
:func:`blur`,
:func:`GaussianBlur`
:cpp:func:`threshold`,
:cpp:func:`blur`,
:cpp:func:`GaussianBlur`
.. index:: cvtColor
@@ -70,7 +70,7 @@ See Also:
cvtColor
------------
.. c:function:: void cvtColor( const Mat& src, Mat& dst, int code, int dstCn=0 )
.. cpp:function:: void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 )
Converts an image from one color space to another.
@@ -127,7 +127,7 @@ The function can do the following transformations:
..
More advanced channel reordering can also be done with
:func:`mixChannels` .
:cpp:func:`mixChannels` .
*
RGB
@@ -404,9 +404,9 @@ The function can do the following transformations:
distanceTransform
---------------------
.. c:function:: void distanceTransform( const Mat& src, Mat& dst, int distanceType, int maskSize )
.. cpp:function:: void distanceTransform( InputArray src, OutputArray dst, int distanceType, int maskSize )
.. c:function:: void distanceTransform( const Mat& src, Mat& dst, Mat& labels, int distanceType, int maskSize )
.. cpp:function:: void distanceTransform( InputArray src, OutputArray dst, OutputArray labels, int distanceType, int maskSize )
Calculates the distance to the closest zero pixel for each pixel of the source image.
@@ -472,9 +472,9 @@ Currently, the second variant can use only the approximate distance transform al
floodFill
-------------
.. c:function:: int floodFill( Mat& image, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. cpp:function:: int floodFill( InputOutputArray image, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. c:function:: int floodFill( Mat& image, Mat& mask, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. cpp:function:: int floodFill( InputOutputArray image, InputOutputArray mask, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
Fills a connected component with the given color.
@@ -566,7 +566,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:
:func:`findContours`
:cpp:func:`findContours`
.. index:: inpaint
@@ -574,7 +574,7 @@ See Also:
inpaint
-----------
.. c:function:: void inpaint( const Mat& src, const Mat& inpaintMask, Mat& dst, double inpaintRadius, int flags )
.. cpp:function:: void inpaint( InputArray src, InputArray inpaintMask, OutputArray dst, double inpaintRadius, int flags )
Restores the selected region in an image using the region neighborhood.
@@ -598,15 +598,13 @@ for more details.
.. index:: integral
.. _integral:
integral
------------
.. c:function:: void integral( const Mat& image, Mat& sum, int sdepth=-1 )
.. cpp:function:: void integral( InputArray image, OutputArray sum, int sdepth=-1 )
.. c:function:: void integral( const Mat& image, Mat& sum, Mat& sqsum, int sdepth=-1 )
.. cpp:function:: void integral( InputArray image, OutputArray sum, OutputArray sqsum, int sdepth=-1 )
.. c:function:: void integral( const Mat& image, Mat& sum, Mat& sqsum, Mat& tilted, int sdepth=-1 )
.. cpp:function:: void integral( InputArray image, OutputArray sum, OutputArray sqsum, OutputArray tilted, int sdepth=-1 )
Calculates the integral of an image.
@@ -656,7 +654,7 @@ As a practical example, the next figure shows the calculation of the integral of
threshold
-------------
.. c:function:: double threshold( const Mat& src, Mat& dst, double thresh, double maxVal, int thresholdType )
.. cpp:function:: double threshold( InputArray src, OutputArray dst, double thresh, double maxVal, int thresholdType )
Applies a fixed-level threshold to each array element.
@@ -673,7 +671,7 @@ threshold
The function applies fixed-level thresholding
to a single-channel array. The function is typically used to get a
bi-level (binary) image out of a grayscale image (
:func:`compare` could
:cpp: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`` :
@@ -717,19 +715,17 @@ Currently, Otsu's method is implemented only for 8-bit images.
.. image:: pics/threshold.png
See Also:
:func:`adaptiveThreshold`,
:func:`findContours`,
:func:`compare`,
:func:`min`,
:func:`max`
:cpp:func:`adaptiveThreshold`,
:cpp:func:`findContours`,
:cpp:func:`compare`,
:cpp:func:`min`,
:cpp:func:`max`
.. index:: watershed
.. _watershed:
watershed
-------------
.. c:function:: void watershed( const Mat& image, Mat& markers )
.. cpp:function:: void watershed( InputArray image, InputOutputArray markers )
Performs a marker-based image segmentation using the watershed algrorithm.
@@ -745,8 +741,8 @@ function, you have to roughly outline the desired regions in the image ``markers
represented as one or more connected components with the pixel values
1, 2, 3, and so on. Such markers can be retrieved from a binary mask
using
:func:`findContours` and
:func:`drawContours` (see the ``watershed.cpp`` demo).
:cpp:func:`findContours` and
:cpp:func:`drawContours` (see the ``watershed.cpp`` demo).
The markers are "seeds" of the future image
regions. All the other pixels in ``markers`` , whose relation to the
outlined regions is not known and should be defined by the algorithm,
@@ -761,16 +757,14 @@ 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:
:func:`findContours`
:cpp:func:`findContours`
.. index:: grabCut
.. _grabCut:
grabCut
-------
.. c:function:: void grabCut(const Mat& image, Mat& mask, Rect rect, Mat& bgdModel, Mat& fgdModel, int iterCount, int mode )
.. cpp:function:: void grabCut(InputArray image, InputOutputArray mask, Rect rect, InputOutputArray bgdModel, InputOutputArray fgdModel, int iterCount, int mode )
Runs the GrabCut algorithm.

View File

@@ -7,7 +7,7 @@ Motion Analysis and Object Tracking
accumulate
--------------
.. c:function:: void accumulate( const Mat\& src, Mat\& dst, const Mat\& mask=Mat() )
.. cpp:function:: void accumulate( InputArray src, InputOutputArray dst, InputArray mask=None() )
Adds an image to the accumulator.
@@ -28,15 +28,15 @@ The function supports multi-channel images. Each channel is processed independen
The functions ``accumulate*`` can be used, for example, to collect statistics of a scene background viewed by a still camera and for the further foreground-background segmentation.
See Also:
:func:`accumulateSquare`,
:func:`accumulateProduct`,
:func:`accumulateWeighted`
:cpp:func:`accumulateSquare`,
:cpp:func:`accumulateProduct`,
:cpp:func:`accumulateWeighted`
.. index:: accumulateSquare
accumulateSquare
--------------------
.. c:function:: void accumulateSquare( const Mat\& src, Mat\& dst, const Mat\& mask=Mat() )
.. cpp:function:: void accumulateSquare( InputArray src, InputOutputArray dst, InputArray mask=None() )
Adds the square of a source image to the accumulator.
@@ -55,15 +55,15 @@ The function adds the input image ``src`` or its selected region, raised to powe
The function supports multi-channel images Each channel is processed independently.
See Also:
:func:`accumulateSquare`,
:func:`accumulateProduct`,
:func:`accumulateWeighted`
:cpp:func:`accumulateSquare`,
:cpp:func:`accumulateProduct`,
:cpp:func:`accumulateWeighted`
.. index:: accumulateProduct
accumulateProduct
---------------------
.. c:function:: void accumulateProduct( const Mat\& src1, const Mat\& src2, Mat\& dst, const Mat\& mask=Mat() )
.. cpp:function:: void accumulateProduct( InputArray src1, InputArray src2, InputOutputArray dst, InputArray mask=None() )
Adds the per-element product of two input images to the accumulator.
@@ -84,15 +84,15 @@ The function adds the product of 2 images or their selected regions to the accum
The function supports multi-channel images. Each channel is processed independently.
See Also:
:func:`accumulate`,
:func:`accumulateSquare`,
:func:`accumulateWeighted`
:cpp:func:`accumulate`,
:cpp:func:`accumulateSquare`,
:cpp:func:`accumulateWeighted`
.. index:: accumulateWeighted
accumulateWeighted
----------------------
.. c:function:: void accumulateWeighted( const Mat\& src, Mat\& dst, double alpha, const Mat\& mask=Mat() )
.. cpp:function:: void accumulateWeighted( InputArray src, InputOutputArray dst, double alpha, InputArray mask=None() )
Updates a running average.
@@ -114,6 +114,6 @@ That is, ``alpha`` regulates the update speed (how fast the accumulator "forgets
The function supports multi-channel images. Each channel is processed independently.
See Also:
:func:`accumulate`,
:func:`accumulateSquare`,
:func:`accumulateProduct`
:cpp:func:`accumulate`,
:cpp:func:`accumulateSquare`,
:cpp:func:`accumulateProduct`

View File

@@ -7,7 +7,7 @@ Object Detection
matchTemplate
-----------------
.. c:function:: void matchTemplate( const Mat& image, const Mat& temp, Mat& result, int method )
.. cpp:function:: void matchTemplate( InputArray image, InputArray temp, OutputArray result, int method )
Compares a template against overlapped image regions.
@@ -69,5 +69,5 @@ image patch:
R(x,y)= \frac{ \sum_{x',y'} (T'(x',y') \cdot I'(x+x',y+y')) }{ \sqrt{\sum_{x',y'}T'(x',y')^2 \cdot \sum_{x',y'} I'(x+x',y+y')^2} }
After the function finishes the comparison, the best matches can be found as global minimums (when ``CV_TM_SQDIFF`` was used) or maximums (when ``CV_TM_CCORR`` or ``CV_TM_CCOEFF`` was used) using the
:func:`minMaxLoc` function. In case of a color image, template summation in the numerator and each sum in the denominator is done over all of the channels and separate mean values are used for each channel. That is, the function can take a color template and a color image. The result will still be a single-channel image, which is easier to analyze.
:cpp:func:`minMaxLoc` function. In case of a color image, template summation in the numerator and each sum in the denominator is done over all of the channels and separate mean values are used for each channel. That is, the function can take a color template and a color image. The result will still be a single-channel image, which is easier to analyze.

View File

@@ -7,7 +7,7 @@ Structural Analysis and Shape Descriptors
moments
-----------
.. c:function:: Moments moments( const Mat& array, bool binaryImage=false )
.. cpp:function:: Moments moments( InputArray array, bool binaryImage=false )
Calculates all of the moments up to the third order of a polygon or rasterized shape where the class ``Moments`` is defined as: ::
@@ -72,18 +72,18 @@ 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:
:func:`contourArea`,
:func:`arcLength`
:cpp:func:`contourArea`,
:cpp:func:`arcLength`
.. index:: HuMoments
HuMoments
-------------
.. c:function:: void HuMoments( const Moments& moments, double h[7] )
.. cpp:function:: void HuMoments( const Moments& moments, double h[7] )
Calculates the seven Hu invariants.
:param moments: Input moments computed with :func:`moments` .
:param moments: Input moments computed with :cpp:func:`moments` .
:param h: Output Hu invariants.
The function calculates the seven Hu invariants (see
@@ -101,19 +101,19 @@ 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:
:func:`matchShapes`
:cpp:func:`matchShapes`
.. index:: findContours
findContours
----------------
.. c:function:: void findContours( const Mat& image, vector<vector<Point> >& contours, vector<Vec4i>& hierarchy, int mode, int method, Point offset=Point())
.. cpp:function:: void findContours( InputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point())
.. c:function:: void findContours( const Mat& image, vector<vector<Point> >& contours, int mode, int method, Point offset=Point())
.. cpp:function:: void findContours( InputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point())
Finds contours in a binary image.
:param image: Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero pixels remain 0's, so the image is treated as ``binary`` . You can use :func:`compare` , :func:`inRange` , :func:`threshold` , :func:`adaptiveThreshold` , :func:`Canny` , and others to create a binary image out of a grayscale or color one. The function modifies the ``image`` while extracting the contours.
:param image: Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero pixels remain 0's, so the image is treated as ``binary`` . You can use :cpp:func:`compare` , :cpp:func:`inRange` , :cpp:func:`threshold` , :cpp:func:`adaptiveThreshold` , :cpp:func:`Canny` , and others to create a binary image out of a grayscale or color one. The function modifies the ``image`` while extracting the contours.
:param contours: Detected contours. Each contour is stored as a vector of points.
@@ -150,7 +150,7 @@ Source ``image`` is modified by this function.
drawContours
----------------
.. c:function:: void drawContours( Mat& image, const vector<vector<Point> >& contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, const vector<Vec4i>& hierarchy=vector<Vec4i>(), int maxLevel=INT_MAX, Point offset=Point() )
.. cpp:function:: void drawContours( InputOutputArray image, InputArrayOfArrays contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, InputArray hierarchy=None(), int maxLevel=INT_MAX, Point offset=Point() )
Draws contours outlines or filled contours.
@@ -165,7 +165,7 @@ drawContours
:param thickness: Thickness of lines the contours are drawn with. If it is negative (for example, ``thickness=CV_FILLED`` ), the contour interiors are
drawn.
:param lineType: Line connectivity. See :func:`line` for details.
:param lineType: Line connectivity. See :cpp:func:`line` for details.
:param hierarchy: Optional information about hierarchy. It is only needed if you want to draw only some of the contours (see ``maxLevel`` ).
@@ -221,13 +221,11 @@ The function draws contour outlines in the image if
approxPolyDP
----------------
.. c:function:: void approxPolyDP( const Mat& curve, vector<Point>& approxCurve, double epsilon, bool closed )
.. c:function:: void approxPolyDP( const Mat& curve, vector<Point2f>& approxCurve, double epsilon, bool closed )
.. cpp:function:: void approxPolyDP( InputArray curve, OutputArray approxCurve, double epsilon, bool closed )
Approximates a polygonal curve(s) with the specified precision.
:param curve: Polygon or curve to approximate. It must be :math:`1 \times N` or :math:`N \times 1` matrix of type ``CV_32SC2`` or ``CV_32FC2`` . You can also convert ``vector<Point>`` or ``vector<Point2f>`` to the matrix by calling the ``Mat(const vector<T>&)`` constructor.
:param curve: Input vector of 2d point, stored in ``std::vector`` or ``Mat``.
:param approxCurve: Result of the approximation. The type should match the type of the input curve.
@@ -238,15 +236,17 @@ approxPolyDP
The functions ``approxPolyDP`` approximate a curve or a polygon with another curve/polygon with less vertices, so that the distance between them is less or equal to the specified precision. It uses the Douglas-Peucker algorithm
http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
See http://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/contours.cpp on how to use the function.
.. index:: arcLength
arcLength
-------------
.. c:function:: double arcLength( const Mat& curve, bool closed )
.. cpp:function:: double arcLength( InputArray curve, bool closed )
Calculates a contour perimeter or a curve length.
:param curve: Input vector of 2D points represented either by ``CV_32SC2`` or ``CV_32FC2`` matrix, or by ``vector<Point>`` /``vector<Point2f>`` converted to a matrix with the ``Mat(const vector<T>&)`` constructor.
:param curve: Input vector of 2D points, stored in ``std::vector`` or ``Mat``.
:param closed: Flag indicating whether the curve is closed or not.
@@ -256,11 +256,11 @@ The function computes a curve length or a closed contour perimeter.
boundingRect
----------------
.. c:function:: Rect boundingRect( const Mat& points )
.. cpp:function:: Rect boundingRect( InputArray points )
Calculates the up-right bounding rectangle of a point set.
:param points: Input 2D point set represented either by ``CV_32SC2`` or ``CV_32FC2`` matrix, or by ``vector<Point>`` /``vector<Point2f>`` converted to a matrix using the ``Mat(const vector<T>&)`` constructor.
:param points: Input 2D point set, stored in ``std::vector`` or ``Mat``.
The function calculates and returns the minimal up-right bounding rectangle for the specified point set.
@@ -268,14 +268,14 @@ The function calculates and returns the minimal up-right bounding rectangle for
estimateRigidTransform
--------------------------
.. c:function:: Mat estimateRigidTransform( const Mat& srcpt, const Mat& dstpt, bool fullAffine )
.. cpp:function:: Mat estimateRigidTransform( InputArray srcpt, InputArray dstpt, bool fullAffine )
Computes an optimal affine transformation between two 2D point sets.
:param srcpt: The first input 2D point set.
:param srcpt: The first input 2D point set, stored in ``std::vector`` or ``Mat``.
:param dst: The second input 2D point set of the same size and the same type as ``A`` .
:param fullAffine: If true, the function finds an optimal affine transformation with no additional resrictions (6 degrees of freedom). Otherwise, the class of transformations to choose from is limited to combinations of translation, rotation, and uniform scaling (5 degrees of freedom).
The function finds an optimal affine transform
@@ -298,15 +298,15 @@ where
when ``fullAffine=false`` .
See Also:
:func:`getAffineTransform`,
:func:`getPerspectiveTransform`,
:func:`findHomography`
:cpp:func:`getAffineTransform`,
:cpp:func:`getPerspectiveTransform`,
:cpp:func:`findHomography`
.. index:: estimateAffine3D
estimateAffine3D
--------------------
.. c:function:: int estimateAffine3D(const Mat& srcpt, const Mat& dstpt, Mat& out, vector<uchar>& outliers, double ransacThreshold = 3.0, double confidence = 0.99)
.. cpp:function:: int estimateAffine3D(InputArray srcpt, InputArray dstpt, OutputArray out, OutputArray outliers, double ransacThreshold = 3.0, double confidence = 0.99)
Computes an optimal affine transformation between two 3D point sets.
@@ -328,16 +328,16 @@ The function estimates an optimal 3D affine transformation between two 3D point
contourArea
---------------
.. c:function:: double contourArea( const Mat& contour )
.. cpp:function:: double contourArea( InputArray contour )
Calculates a contour area.
:param contour: Contour vertices represented either by ``CV_32SC2`` or ``CV_32FC2`` matrix, or by ``vector<Point>`` /``vector<Point2f>`` converted to a matrix using the ``Mat(const vector<T>&)`` constructor.
:param contour: Input vector of 2d points (contour vertices), stored in ``std::vector`` or ``Mat``.
The function computes a contour area. Similarly to
:func:`moments` , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using
:func:`drawContours` or
:func:`fillPoly` , can be different.
:cpp:func:`moments` , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using
:cpp:func:`drawContours` or
:cpp:func:`fillPoly` , can be different.
Here is a short example: ::
vector<Point> contour;
@@ -351,45 +351,40 @@ Here is a short example: ::
approxPolyDP(contour, approx, 5, true);
double area1 = contourArea(approx);
cout << "area0 = " << area0 << endl <<
"area1 = " << area1 << endl <<
"approx poly vertices = " << approx.size() << endl;
cout << "area0 =" << area0 << endl <<
"area1 =" << area1 << endl <<
"approx poly vertices" << approx.size() << endl;
.. index:: convexHull
convexHull
--------------
.. c:function:: void convexHull( const Mat& points, vector<int>& hull, bool clockwise=false )
.. c:function:: void convexHull( const Mat& points, vector<Point>& hull, bool clockwise=false )
.. c:function:: void convexHull( const Mat& points, vector<Point2f>& hull, bool clockwise=false )
.. cpp:function:: void convexHull( InputArray points, OutputArray hull, bool clockwise=false, bool returnPoints=true )
Finds the convex hull of a point set.
:param points: Input 2D point set represented either by ``CV_32SC2`` or ``CV_32FC2`` matrix, or by ``vector<Point>`` /``vector<Point2f>`` converted to a matrix using the ``Mat(const vector<T>&)`` constructor.
:param points: Input 2D point set, stored in ``std::vector`` or ``Mat``.
:param hull: Output convex hull. It is either a vector of points that form the hull (must have the same type as the input points), or a vector of 0-based point indices of the hull points in the original array (since the set of convex hull points is a subset of the original 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 will be the convex hull points themselves.
:param clockwise: If true, the output convex hull will be oriented clockwise. Otherwise, it will be oriented counter-clockwise. The usual screen coordinate system is assumed where the origin is at the top-left corner, x axis is oriented to the right, and y axis is oriented downwards.
:param clockwise: Orientation flag. If true, the output convex hull will be oriented clockwise. Otherwise, it will be oriented counter-clockwise. The usual screen coordinate system is assumed where the origin is at the top-left corner, x axis is oriented to the right, and y axis is oriented downwards.
:param returnPoints: Operation flag. In the case of matrix, when the flag is true, the function will return convex hull points, otherwise it will return indices of the convex hull points. When the output array is ``std::vector``, the flag is ignored, and the output depends on the type of the vector - ``std::vector<int>`` implies ``returnPoints=true``, ``std::vector<Point>`` implies ``returnPoints=false``.
The functions find the convex hull of a 2D point set using the Sklansky's algorithm
Sklansky82
that has
:math:`O(N logN)` or
:math:`O(N)` complexity (where
:math:`N` is the number of input points), depending on how the initial sorting is implemented (currently it is
:math:`O(N logN)` . See the OpenCV sample ``convexhull.c`` that demonstrates the usage of different function variants.
*O(N logN)* complexity in the current implementation. See the OpenCV sample ``convexhull.cpp`` that demonstrates the usage of different function variants.
.. index:: fitEllipse
fitEllipse
--------------
.. c:function:: RotatedRect fitEllipse( const InputArray& points )
.. cpp:function:: RotatedRect fitEllipse( InputArray points )
Fits an ellipse around a set of 2D points.
:param points: Input 2D point set represented either by ``CV_32SC2`` or ``CV_32FC2`` matrix, or by ``vector<Point>`` or ``vector<Point2f>``.
:param points: Input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
The function calculates the ellipse that fits (in least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed.
@@ -397,13 +392,13 @@ The function calculates the ellipse that fits (in least-squares sense) a set of
fitLine
-----------
.. c:function:: void fitLine( const InputArray& points, OutputArray& line, int distType, double param, double reps, double aeps )
.. cpp:function:: void fitLine( InputArray points, OutputArray line, int distType, double param, double reps, double aeps )
Fits a line to a 2D or 3D point set.
:param points: Input 2D or 3D point set represented either by ``CV_32SC2`` or ``CV_32FC2`` matrix, or by ``vector<Point>``, ``vector<Point2f>``, ``vector<Point3i>`` or ``vector<Point3f>``.
:param points: Input vector of 2D or 3D points, stored in ``std::vector<>`` or ``Mat``.
:param line: Output line parameters. In case of 2D fitting it should be ``Vec4f``, a vector of 4 floats ``(vx, vy, x0, y0)``, where ``(vx, vy)`` is a normalized vector collinear to the line and ``(x0, y0)`` is a point on the line. In case of 3D fitting, it should be ``Vec6f``, a vector of 6 floats ``(vx, vy, vz, x0, y0, z0)``, where ``(vx, vy, vz)`` is a normalized vector collinear to the line and ``(x0, y0, z0)`` is a point on the line.
:param line: Output line parameters. In case of 2D fitting it should be a vector of 4 elements (like ``Vec4f``) - ``(vx, vy, x0, y0)``, where ``(vx, vy)`` is a normalized vector collinear to the line and ``(x0, y0)`` is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like ``Vec6f``) - ``(vx, vy, vz, x0, y0, z0)``, where ``(vx, vy, vz)`` is a normalized vector collinear to the line and ``(x0, y0, z0)`` is a point on the line.
:param distType: Distance used by the M-estimator (see the discussion).
@@ -463,11 +458,11 @@ http://en.wikipedia.org/wiki/M-estimator
isContourConvex
-------------------
.. c:function:: bool isContourConvex( const InputArray& contour )
.. cpp:function:: bool isContourConvex( InputArray contour )
Tests a contour convexity.
:param contour: Tested contour, a matrix of type ``CV_32SC2`` or ``CV_32FC2`` , or ``vector<Point>`` or ``vector<Point2f>``.
:param contour: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
The function tests whether the input contour is convex or not. The contour must be simple, that is, without self-intersections. Otherwise, the function output is undefined.
@@ -475,11 +470,11 @@ The function tests whether the input contour is convex or not. The contour must
minAreaRect
---------------
.. c:function:: RotatedRect minAreaRect( const InputArray& points )
.. cpp:function:: RotatedRect minAreaRect( InputArray points )
Finds a rotated rectangle of the minimum area enclosing the input 2D point set.
:param points: Input 2D point set represented either by ``CV_32SC2`` or ``CV_32FC2`` matrix, or by ``vector<Point>`` or ``vector<Point2f>``.
:param points: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a specified point set. See the OpenCV sample ``minarea.cpp`` .
@@ -487,11 +482,11 @@ The function calculates and returns the minimum-area bounding rectangle (possibl
minEnclosingCircle
----------------------
.. c:function:: void minEnclosingCircle( const InputArray& points, Point2f& center, float& radius )
.. cpp:function:: void minEnclosingCircle( InputArray points, Point2f& center, float& radius )
Finds a circle of the minimum area enclosing a 2D point set.
:param points: Input 2D point set represented either by ``CV_32SC2`` or ``CV_32FC2`` matrix, or by ``vector<Point>`` or ``vector<Point2f>``.
:param points: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
:param center: Output center of the circle.
@@ -503,7 +498,7 @@ The function finds the minimal enclosing circle of a 2D point set using an itera
matchShapes
---------------
.. c:function:: double matchShapes( const InputArray& object1, const InputArray& object2, int method, double parameter=0 )
.. cpp:function:: double matchShapes( InputArray object1, InputArray object2, int method, double parameter=0 )
Compares two shapes.
@@ -517,7 +512,7 @@ matchShapes
:param parameter: Method-specific parameter (not supported now).
The function compares two shapes. All three implemented methods use the Hu invariants (see
:func:`HuMoments` ) as follows (
:cpp:func:`HuMoments` ) as follows (
:math:`A` denotes ``object1``,:math:`B` denotes ``object2`` ):
* method=CV\_CONTOUR\_MATCH\_I1
@@ -553,7 +548,7 @@ and
pointPolygonTest
--------------------
.. c:function:: double pointPolygonTest( const InputArray& contour, Point2f pt, bool measureDist )
.. cpp:function:: double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist )
Performs a point-in-contour test.