Fixed hundreds of documentation problems

This commit is contained in:
Andrey Kamaev
2012-05-28 07:36:14 +00:00
parent 7e698726e4
commit eb2f1f81ed
65 changed files with 1708 additions and 1680 deletions

View File

@@ -13,7 +13,7 @@ Finds centers of clusters and groups input samples around the clusters.
.. ocv:cfunction:: int cvKMeans2(const CvArr* samples, int clusterCount, CvArr* labels, CvTermCriteria criteria, int attempts=1, CvRNG* rng=0, int flags=0, CvArr* centers=0, double* compactness=0)
.. ocv:pyoldfunction:: cv.KMeans2(samples, clusterCount, labels, criteria)-> None
.. ocv:pyoldfunction:: cv.KMeans2(samples, nclusters, labels, termcrit, attempts=1, flags=0, centers=None) -> float
:param samples: Floating-point matrix of input samples, one row per sample.

View File

@@ -64,9 +64,9 @@ Clips the line against the image rectangle.
.. ocv:pyfunction:: cv2.clipLine(imgRect, pt1, pt2) -> retval, pt1, pt2
.. ocv:cfunction:: int cvClipLine( CvSize imgSize, CvPoint* pt1, CvPoint* pt2 )
.. ocv:pyoldfunction:: cv.ClipLine(imgSize, pt1, pt2) -> (clippedPt1, clippedPt2)
.. ocv:pyoldfunction:: cv.ClipLine(imgSize, pt1, pt2) -> (point1, point2)
:param imgSize: Image size. The image rectangle is ``Rect(0, 0, imgSize.width, imgSize.height)`` .
:param imgSize: Image size. The image rectangle is ``Rect(0, 0, imgSize.width, imgSize.height)`` .
:param imgRect: Image rectangle.
@@ -89,7 +89,7 @@ Draws a simple or thick elliptic arc or fills an ellipse sector.
.. ocv:pyfunction:: cv2.ellipse(img, box, color[, thickness[, lineType]]) -> None
.. ocv:cfunction:: void cvEllipse( CvArr* img, CvPoint center, CvSize axes, double angle, double startAngle, double endAngle, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: cv.Ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness=1, lineType=8, shift=0)-> None
.. ocv:pyoldfunction:: cv.Ellipse(img, center, axes, angle, start_angle, end_angle, color, thickness=1, lineType=8, shift=0)-> None
.. ocv:cfunction:: void cvEllipseBox( CvArr* img, CvBox2D box, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: cv.EllipseBox(img, box, color, thickness=1, lineType=8, shift=0)-> None
@@ -136,10 +136,10 @@ Approximates an elliptic arc with a polyline.
:param center: Center of the arc.
:param axes: Half-sizes of the arc. See the :ocv:func:`ellipse` for details.
:param angle: Rotation angle of the ellipse in degrees. See the :ocv:func:`ellipse` for details.
:param axes: Half-sizes of the arc. See the :ocv:func:`ellipse` for details.
:param angle: Rotation angle of the ellipse in degrees. See the :ocv:func:`ellipse` for details.
:param startAngle: Starting angle of the elliptic arc in degrees.
:param endAngle: Ending angle of the elliptic arc in degrees.
@@ -227,11 +227,11 @@ Calculates the width and height of a text string.
:param text: Input text string.
:param fontFace: Font to use. See the :ocv:func:`putText` for details.
:param fontFace: Font to use. See the :ocv:func:`putText` for details.
:param fontScale: Font scale. See the :ocv:func:`putText` for details.
:param fontScale: Font scale. See the :ocv:func:`putText` for details.
:param thickness: Thickness of lines used to render the text. See :ocv:func:`putText` for details.
:param thickness: Thickness of lines used to render the text. See :ocv:func:`putText` for details.
:param baseLine: Output parameter - y-coordinate of the baseline relative to the bottom-most text point.
@@ -275,49 +275,49 @@ Initializes font structure (OpenCV 1.x API).
.. ocv:cfunction:: void cvInitFont( CvFont* font, int fontFace, double hscale, double vscale, double shear=0, int thickness=1, int lineType=8 )
:param font: Pointer to the font structure initialized by the function
:param font: Pointer to the font structure initialized by the function
:param fontFace: Font name identifier. Only a subset of Hershey fonts http://sources.isc.org/utils/misc/hershey-font.txt are supported now:
* **CV_FONT_HERSHEY_SIMPLEX** normal size sans-serif font
* **CV_FONT_HERSHEY_SIMPLEX** normal size sans-serif font
* **CV_FONT_HERSHEY_PLAIN** small size sans-serif font
* **CV_FONT_HERSHEY_PLAIN** small size sans-serif font
* **CV_FONT_HERSHEY_DUPLEX** normal size sans-serif font (more complex than ``CV_FONT_HERSHEY_SIMPLEX`` )
* **CV_FONT_HERSHEY_DUPLEX** normal size sans-serif font (more complex than ``CV_FONT_HERSHEY_SIMPLEX`` )
* **CV_FONT_HERSHEY_COMPLEX** normal size serif font
* **CV_FONT_HERSHEY_COMPLEX** normal size serif font
* **CV_FONT_HERSHEY_TRIPLEX** normal size serif font (more complex than ``CV_FONT_HERSHEY_COMPLEX`` )
* **CV_FONT_HERSHEY_TRIPLEX** normal size serif font (more complex than ``CV_FONT_HERSHEY_COMPLEX`` )
* **CV_FONT_HERSHEY_COMPLEX_SMALL** smaller version of ``CV_FONT_HERSHEY_COMPLEX``
* **CV_FONT_HERSHEY_COMPLEX_SMALL** smaller version of ``CV_FONT_HERSHEY_COMPLEX``
* **CV_FONT_HERSHEY_SCRIPT_SIMPLEX** hand-writing style font
* **CV_FONT_HERSHEY_SCRIPT_SIMPLEX** hand-writing style font
* **CV_FONT_HERSHEY_SCRIPT_COMPLEX** more complex variant of ``CV_FONT_HERSHEY_SCRIPT_SIMPLEX``
* **CV_FONT_HERSHEY_SCRIPT_COMPLEX** more complex variant of ``CV_FONT_HERSHEY_SCRIPT_SIMPLEX``
The parameter can be composited from one of the values above and an optional ``CV_FONT_ITALIC`` flag, which indicates italic or oblique font.
The parameter can be composited from one of the values above and an optional ``CV_FONT_ITALIC`` flag, which indicates italic or oblique font.
:param hscale: Horizontal scale. If equal to ``1.0f`` , the characters have the original width depending on the font type. If equal to ``0.5f`` , the characters are of half the original width.
:param hscale: Horizontal scale. If equal to ``1.0f`` , the characters have the original width depending on the font type. If equal to ``0.5f`` , the characters are of half the original width.
:param vscale: Vertical scale. If equal to ``1.0f`` , the characters have the original height depending on the font type. If equal to ``0.5f`` , the characters are of half the original height.
:param vscale: Vertical scale. If equal to ``1.0f`` , the characters have the original height depending on the font type. If equal to ``0.5f`` , the characters are of half the original height.
:param shear: Approximate tangent of the character slope relative to the vertical line. A zero value means a non-italic font, ``1.0f`` means about a 45 degree slope, etc.
:param shear: Approximate tangent of the character slope relative to the vertical line. A zero value means a non-italic font, ``1.0f`` means about a 45 degree slope, etc.
:param thickness: Thickness of the text strokes
:param thickness: Thickness of the text strokes
:param lineType: Type of the strokes, see :ocv:func:`line` description
:param lineType: Type of the strokes, see :ocv:func:`line` description
The function initializes the font structure that can be passed to text rendering functions.
.. seealso:: :ocv:cfunc:`PutText`
.. _Line:
.. _Line:
line
--------
@@ -416,7 +416,7 @@ Draws a simple, thick, or filled up-right rectangle.
:param pt1: Vertex of the rectangle.
:param pt2: Vertex of the rectangle opposite to ``pt1`` .
:param r: Alternative specification of the drawn rectangle.
:param color: Rectangle color or brightness (grayscale image).
@@ -441,7 +441,7 @@ Draws several polygonal curves.
.. ocv:cfunction:: void cvPolyLine( CvArr* img, CvPoint** pts, int* npts, int contours, int isClosed, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: cv.PolyLine(img, polys, isClosed, color, thickness=1, lineType=8, shift=0)-> None
.. ocv:pyoldfunction:: cv.PolyLine(img, polys, is_closed, color, thickness=1, lineType=8, shift=0) -> None
:param img: Image.
@@ -471,7 +471,7 @@ Draws a text string.
.. ocv:function:: void putText( Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
.. ocv:pyfunction:: cv2.putText(img, text, org, fontFace, fontScale, color[, thickness[, linetype[, bottomLeftOrigin]]]) -> None
.. ocv:pyfunction:: cv2.putText(img, text, org, fontFace, fontScale, color[, thickness[, lineType[, bottomLeftOrigin]]]) -> None
.. ocv:cfunction:: void cvPutText( CvArr* img, const char* text, CvPoint org, const CvFont* font, CvScalar color )
.. ocv:pyoldfunction:: cv.PutText(img, text, org, font, color)-> None

File diff suppressed because it is too large Load Diff

View File

@@ -11,15 +11,15 @@ Computes an absolute value of each matrix element.
.. ocv:function:: MatExpr abs(const MatExpr& src)
:param src: Matrix or matrix expression.
``abs`` is a meta-function that is expanded to one of :ocv:func:`absdiff` forms:
* ``C = abs(A-B)`` is equivalent to ``absdiff(A, B, C)``
* ``C = abs(A-B)`` is equivalent to ``absdiff(A, B, C)``
* ``C = abs(A)`` is equivalent to ``absdiff(A, Scalar::all(0), C)``
* ``C = abs(A)`` is equivalent to ``absdiff(A, Scalar::all(0), C)``
* ``C = Mat_<Vec<uchar,n> >(abs(A*alpha + beta))`` is equivalent to :ocv:funcx:`convertScaleAbs` (A, C, alpha, beta)
The output matrix has the same size and the same type as the input one except for the last case, where ``C`` is ``depth=CV_8U`` .
.. seealso:: :ref:`MatrixExpressions`, :ocv:func:`absdiff`
@@ -39,11 +39,11 @@ Computes the per-element absolute difference between two arrays or between an ar
.. ocv:pyoldfunction:: cv.AbsDiffS(src, dst, value)-> None
:param src1: First input array or a scalar.
:param src2: Second input array or a scalar.
:param dst: Destination array that has the same size and type as ``src1`` (or ``src2``).
The function ``absdiff`` computes:
*
@@ -91,11 +91,11 @@ Computes the per-element sum of two arrays or an array and a scalar.
:param src1: First source array or a scalar.
:param src2: Second source array or a scalar.
:param dst: Destination array that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``src1``/``src2``.
:param mask: Optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
:param dtype: Optional depth of the output array. See the discussion below.
The function ``add`` computes:
@@ -133,7 +133,7 @@ The input arrays and the destination array can all have the same or different de
.. note:: Saturation is not applied when the output array has the depth ``CV_32S``. You may even get result of an incorrect sign in the case of overflow.
.. seealso::
:ocv:func:`subtract`,
:ocv:func:`addWeighted`,
:ocv:func:`scaleAdd`,
@@ -158,13 +158,13 @@ Computes the weighted sum of two arrays.
:param alpha: Weight for the first array elements.
:param src2: Second source array of the same size and channel number as ``src1`` .
:param beta: Weight for the second array elements.
:param dst: Destination array that has the same size and number of channels as the input arrays.
:param gamma: Scalar added to each sum.
:param dtype: Optional depth of the destination array. When both input arrays have the same depth, ``dtype`` can be set to ``-1``, which will be equivalent to ``src1.depth()``.
The function ``addWeighted`` calculates the weighted sum of two arrays as follows:
@@ -209,7 +209,7 @@ Calculates the per-element bit-wise conjunction of two arrays or an array and a
:param src2: Second source array or a scalar.
:param dst: Destination array that has the same size and type as the input array(s).
:param mask: Optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
The function computes the per-element bit-wise logical conjunction for:
@@ -254,7 +254,7 @@ Inverts every bit of an array.
:param src: Source array.
:param dst: Destination array that has the same size and type as the input array.
:param mask: Optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
The function computes per-element bit-wise inversion of the source array:
@@ -313,7 +313,7 @@ The function computes the per-element bit-wise logical disjunction for:
In case of floating-point arrays, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel arrays, each channel is processed independently. In the second and third cases above, the scalar is first converted to the array type.
bitwise_xor
-----------
@@ -361,7 +361,7 @@ The function computes the per-element bit-wise logical "exclusive-or" operation
In case of floating-point arrays, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel arrays, each channel is processed independently. In the 2nd and 3rd cases above, the scalar is first converted to the array type.
calcCovarMatrix
---------------
@@ -391,7 +391,7 @@ Calculates the covariance matrix of a set of vectors.
.. math::
\texttt{scale} \cdot [ \texttt{vects} [0]- \texttt{mean} , \texttt{vects} [1]- \texttt{mean} ,...]^T \cdot [ \texttt{vects} [0]- \texttt{mean} , \texttt{vects} [1]- \texttt{mean} ,...],
The covariance matrix will be ``nsamples x nsamples``. Such an unusual covariance matrix is used for fast PCA of a set of very large vectors (see, for example, the EigenFaces technique for face recognition). Eigenvalues of this "scrambled" matrix match the eigenvalues of the true covariance matrix. The "true" eigenvectors can be easily calculated from the eigenvectors of the "scrambled" covariance matrix.
* **CV_COVAR_NORMAL** The output covariance matrix is calculated as:
@@ -399,7 +399,7 @@ Calculates the covariance matrix of a set of vectors.
.. math::
\texttt{scale} \cdot [ \texttt{vects} [0]- \texttt{mean} , \texttt{vects} [1]- \texttt{mean} ,...] \cdot [ \texttt{vects} [0]- \texttt{mean} , \texttt{vects} [1]- \texttt{mean} ,...]^T,
``covar`` will be a square matrix of the same size as the total number of elements in each input vector. One and only one of ``CV_COVAR_SCRAMBLED`` and ``CV_COVAR_NORMAL`` must be specified.
* **CV_COVAR_USE_AVG** If the flag is specified, the function does not calculate ``mean`` from the input vectors but, instead, uses the passed ``mean`` vector. This is useful if ``mean`` has been pre-computed or known in advance, or if the covariance matrix is calculated by parts. In this case, ``mean`` is not a mean vector of the input sub-set of vectors but rather the mean vector of the whole set.
@@ -434,9 +434,9 @@ Calculates the magnitude and angle of 2D vectors.
:param x: Array of x-coordinates. This must be a single-precision or double-precision floating-point array.
:param y: Array of y-coordinates that must have the same size and same type as ``x`` .
:param magnitude: Destination array of magnitudes of the same size and type as ``x`` .
:param angle: Destination array of angles that has the same size and type as ``x`` . The angles are measured in radians (from 0 to 2*Pi) or in degrees (0 to 360 degrees).
:param angleInDegrees: Flag indicating whether the angles are measured in radians, which is the default mode, or in degrees.
@@ -460,7 +460,7 @@ Checks every element of an input array for invalid values.
.. ocv:function:: bool checkRange(InputArray src, bool quiet=true, Point* pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX)
.. ocv:pyfunction:: cv2.checkRange(a[, quiet[, minVal[, maxVal]]]) -> retval, pt
.. ocv:pyfunction:: cv2.checkRange(a[, quiet[, minVal[, maxVal]]]) -> retval, pos
:param src: Array to check.
@@ -493,23 +493,23 @@ Performs the per-element comparison of two arrays or an array and scalar value.
.. ocv:cfunction:: void cvCmpS(const CvArr* src1, double src2, CvArr* dst, int cmpOp)
.. ocv:pyoldfunction:: cv.CmpS(src1, src2, dst, cmpOp)-> None
.. ocv:pyoldfunction:: cv.CmpS(src, value, dst, cmpOp)-> None
:param src1: First source array or a scalar (in the case of ``cvCmp``, ``cv.Cmp``, ``cvCmpS``, ``cv.CmpS`` it is always an array). When it is array, it must have a single channel.
:param src2: Second source array or a scalar (in the case of ``cvCmp`` and ``cv.Cmp`` it is always an array; in the case of ``cvCmpS``, ``cv.CmpS`` it is always a scalar). When it is array, it must have a single channel.
:param dst: Destination array that has the same size as the input array(s) and type= ``CV_8UC1`` .
:param cmpop: Flag specifying the relation between the elements to be checked.
* **CMP_EQ** ``src1`` equal to ``src2``.
* **CMP_GT** ``src1`` greater than ``src2``.
* **CMP_GE** ``src1`` greater than or equal to ``src2``.
* **CMP_LT** ``src1`` less than ``src2``.
* **CMP_LE** ``src1`` less than or equal to ``src2``.
* **CMP_LT** ``src1`` less than ``src2``.
* **CMP_LE** ``src1`` less than or equal to ``src2``.
* **CMP_NE** ``src1`` not equal to ``src2``.
The function compares:
@@ -535,7 +535,7 @@ The function compares:
\texttt{dst} (I) = \texttt{src1} \,\texttt{cmpop}\, \texttt{src2} (I)
When the comparison result is true, the corresponding element of destination array is set to 255.
When the comparison result is true, the corresponding element of destination array is set to 255.
The comparison operations can be replaced with the equivalent matrix expressions: ::
Mat dst1 = src1 >= src2;
@@ -570,11 +570,11 @@ The function ``completeSymm`` copies the lower half of a square matrix to its an
*
:math:`\texttt{mtx}_{ij}=\texttt{mtx}_{ji}` for
:math:`i > j` if ``lowerToUpper=false``
*
:math:`\texttt{mtx}_{ij}=\texttt{mtx}_{ji}` for
:math:`i < j` if ``lowerToUpper=true``
.. seealso::
:ocv:func:`flip`,
@@ -661,7 +661,7 @@ Converts ``CvMat``, ``IplImage`` , or ``CvMatND`` to ``Mat``.
.. ocv:function:: Mat cvarrToMat(const CvArr* src, bool copyData=false, bool allowND=true, int coiMode=0)
:param src: Source ``CvMat``, ``IplImage`` , or ``CvMatND`` .
:param copyData: When it is false (default value), no data is copied and only the new header is created. In this case, the original array should not be deallocated while the new matrix header is used. If the parameter is true, all the data is copied and you may deallocate the original array right after the conversion.
:param allowND: When it is true (default value), ``CvMatND`` is converted to 2-dimensional ``Mat``, if it is possible (see the discussion below). If it is not possible, or when the parameter is false, the function will report an error.
@@ -715,7 +715,7 @@ The last parameter, ``coiMode`` , specifies how to deal with an image with COI s
:ocv:cfunc:`cvGetMat`,
:ocv:func:`extractImageCOI`,
:ocv:func:`insertImageCOI`,
:ocv:func:`mixChannels`
:ocv:func:`mixChannels`
dct
-------
@@ -731,7 +731,7 @@ Performs a forward or inverse discrete Cosine transform of 1D or 2D array.
:param src: Source floating-point array.
:param dst: Destination array of the same size and type as ``src`` .
:param flags: Transformation flags as a combination of the following values:
* **DCT_INVERSE** performs an inverse 1D or 2D transform instead of the default forward transform.
@@ -754,7 +754,7 @@ The function ``dct`` performs a forward or inverse discrete Cosine transform (DC
C^{(N)}_{jk}= \sqrt{\alpha_j/N} \cos \left ( \frac{\pi(2k+1)j}{2N} \right )
and
:math:`\alpha_0=1`, :math:`\alpha_j=2` for *j > 0*.
*
@@ -798,7 +798,7 @@ The function chooses the mode of operation by looking at the flags and size of t
If none of the above is true, the function performs a 2D transform.
.. note::
Currently ``dct`` supports even-size arrays (2, 4, 6 ...). For data analysis and approximation, you can pad the array when necessary.
Also, the function performance depends very much, and not monotonically, on the array size (see
@@ -825,12 +825,12 @@ Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-
:param src: Source array that could be real or complex.
:param dst: Destination array whose size and type depends on the ``flags`` .
:param flags: Transformation flags representing a combination of the following values:
* **DFT_INVERSE** performs an inverse 1D or 2D transform instead of the default forward transform.
* **DFT_SCALE** scales the result: divide it by the number of array elements. Normally, it is combined with ``DFT_INVERSE`` .
* **DFT_SCALE** scales the result: divide it by the number of array elements. Normally, it is combined with ``DFT_INVERSE`` .
* **DFT_ROWS** performs a forward or inverse transform of every individual row of the input matrix. This flag enables you to transform multiple vectors simultaneously and can be used to decrease the overhead (which is sometimes several times larger than the processing itself) to perform 3D and higher-dimensional transforms and so forth.
* **DFT_COMPLEX_OUTPUT** performs a forward transformation of 1D or 2D real array. The result, though being a complex array, has complex-conjugate symmetry (*CCS*, see the function description below for details). Such an array can be packed into a real array of the same size as input, which is the fastest option and which is what the function does by default. However, you may wish to get a full complex array (for simpler spectrum analysis, and so on). Pass the flag to enable the function to produce a full-size complex output array.
@@ -852,7 +852,7 @@ The function performs one of the following:
where
:math:`F^{(N)}_{jk}=\exp(-2\pi i j k/N)` and
:math:`i=\sqrt{-1}`
*
Inverse the Fourier transform of a 1D vector of ``N`` elements:
@@ -863,7 +863,7 @@ The function performs one of the following:
where
:math:`F^*=\left(\textrm{Re}(F^{(N)})-\textrm{Im}(F^{(N)})\right)^T`
*
*
Forward the 2D Fourier transform of a ``M x N`` matrix:
.. math::
@@ -976,18 +976,18 @@ Performs per-element division of two arrays or a scalar by an array.
.. ocv:pyfunction:: cv2.divide(scale, src2[, dst[, dtype]]) -> dst
.. ocv:cfunction:: void cvDiv(const CvArr* src1, const CvArr* src2, CvArr* dst, double scale=1)
.. ocv:pyoldfunction:: cv.Div(src1, src2, dst, scale)-> None
.. ocv:pyoldfunction:: cv.Div(src1, src2, dst, scale=1) -> None
:param src1: First source array.
:param src2: Second source array of the same size and type as ``src1`` .
:param scale: Scalar factor.
:param dst: Destination array of the same size and type as ``src2`` .
:param dtype: Optional depth of the destination array. If it is ``-1``, ``dst`` will have depth ``src2.depth()``. In case of an array-by-array division, you can only pass ``-1`` when ``src1.depth()==src2.depth()``.
The functions ``divide`` divide one array by another:
.. math::
@@ -1022,7 +1022,7 @@ Returns the determinant of a square floating-point matrix.
.. ocv:pyfunction:: cv2.determinant(mtx) -> retval
.. ocv:cfunction:: double cvDet(const CvArr* mtx)
.. ocv:pyoldfunction:: cv.Det(mtx)-> double
.. ocv:pyoldfunction:: cv.Det(mat) -> float
:param mtx: Input matrix that must have ``CV_32FC1`` or ``CV_64FC1`` type and square size.
@@ -1043,21 +1043,20 @@ For symmetric positively-determined matrices, it is also possible to use :ocv:fu
eigen
-----
Computes eigenvalues and eigenvectors of a symmetric matrix.
.. ocv:function:: bool eigen(InputArray src, OutputArray eigenvalues, int lowindex=-1, int highindex=-1)
.. ocv:function:: bool eigen(InputArray src, OutputArray eigenvalues, OutputArray eigenvectors, int lowindex=-1,int highindex=-1)
.. ocv:pyfunction:: cv2.eigen(src, computeEigenvectors[, eigenvalues[, eigenvectors]]) -> retval, eigenvalues, eigenvectors
.. ocv:cfunction:: void cvEigenVV( CvArr* src, CvArr* eigenvectors, CvArr* eigenvalues, double eps=0, int lowindex=-1, int highindex=-1)
.. ocv:pyoldfunction:: cv.EigenVV(src, eigenvectors, eigenvalues, eps, lowindex=-1, highindex=-1)-> None
Computes eigenvalues and eigenvectors of a symmetric matrix.
.. ocv:pyfunction:: cv2.eigen(src, computeEigenvectors[, eigenvalues[, eigenvectors[, lowindex[, highindex]]]]) -> retval, eigenvalues, eigenvectors
.. ocv:pyoldfunction:: cv.EigenVV(mat, evects, evals, eps, lowindex=-1, highindex=-1)-> None
:param src: Input matrix that must have ``CV_32FC1`` or ``CV_64FC1`` type, square size and be symmetrical (``src`` :sup:`T` == ``src``).
:param eigenvalues: Output vector of eigenvalues of the same type as ``src`` . The eigenvalues are stored in the descending order.
:param eigenvectors: Output matrix of eigenvectors. It has the same size and type as ``src`` . The eigenvectors are stored as subsequent matrix rows, in the same order as the corresponding eigenvalues.
@@ -1110,9 +1109,9 @@ Extracts the selected image channel.
.. ocv:function:: void extractImageCOI(const CvArr* src, OutputArray dst, int coi=-1)
:param src: Source array. It should be a pointer to ``CvMat`` or ``IplImage`` .
:param dst: Destination array with a single channel and the same size and depth as ``src`` .
:param coi: If the parameter is ``>=0`` , it specifies the channel to extract. If it is ``<0`` and ``src`` is a pointer to ``IplImage`` with a valid COI set, the selected COI is extracted.
The function ``extractImageCOI`` is used to extract an image COI from an old-style array and put the result to the new-style C++ matrix. As usual, the destination matrix is reallocated using ``Mat::create`` if needed.
@@ -1170,7 +1169,7 @@ Flips a 2D array around vertical, horizontal, or both axes.
:param src: Source array.
:param dst: Destination array of the same size and type as ``src`` .
:param flipCode: Flag to specify how to flip the array. 0 means flipping around the x-axis. Positive value (for example, 1) means flipping around y-axis. Negative value (for example, -1) means flipping around both axes. See the discussion below for the formulas.
The function ``flip`` flips the array in one of three different ways (row and column indices are 0-based):
@@ -1218,13 +1217,13 @@ Performs generalized matrix multiplication.
:param src1: First multiplied input matrix that should have ``CV_32FC1`` , ``CV_64FC1`` , ``CV_32FC2`` , or ``CV_64FC2`` type.
:param src2: Second multiplied input matrix of the same type as ``src1`` .
:param alpha: Weight of the matrix product.
:param src3: Third optional delta matrix added to the matrix product. It should have the same type as ``src1`` and ``src2`` .
:param beta: Weight of ``src3`` .
:param dst: Destination matrix. It has the proper size and the same type as input matrices.
:param flags: Operation flags:
@@ -1232,7 +1231,7 @@ Performs generalized matrix multiplication.
* **GEMM_1_T** transpose ``src1``
* **GEMM_2_T** transpose ``src2``
* **GEMM_3_T** transpose ``src3``
The function performs generalized matrix multiplication similar to the ``gemm`` functions in BLAS level 3. For example, ``gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T)`` corresponds to
.. math::
@@ -1319,9 +1318,9 @@ Computes the inverse Discrete Cosine Transform of a 1D or 2D array.
:param src: Source floating-point single-channel array.
:param dst: Destination array of the same size and type as ``src`` .
:param flags: Operation flags.
``idct(src, dst, flags)`` is equivalent to ``dct(src, dst, flags | DCT_INVERSE)``.
.. seealso::
@@ -1344,11 +1343,11 @@ Computes the inverse Discrete Fourier Transform of a 1D or 2D array.
:param src: Source floating-point real or complex array.
:param dst: Destination array whose size and type depend on the ``flags`` .
:param flags: Operation flags. See :ocv:func:`dft` .
:param nonzeroRows: Number of ``dst`` rows to compute. The rest of the rows have undefined content. See the convolution sample in :ocv:func:`dft` description.
``idft(src, dst, flags)`` is equivalent to ``dft(src, dst, flags | DFT_INVERSE)`` .
See :ocv:func:`dft` for details.
@@ -1381,9 +1380,9 @@ Checks if array elements lie between the elements of two other arrays.
:param src: First source array.
:param lowerb: Inclusive lower boundary array or a scalar.
:param upperb: Inclusive upper boundary array or a scalar.
:param dst: Destination array of the same size as ``src`` and ``CV_8U`` type.
The function checks the range as follows:
@@ -1417,12 +1416,12 @@ Finds the inverse or pseudo-inverse of a matrix.
.. ocv:cfunction:: double cvInvert(const CvArr* src, CvArr* dst, int flags=CV_LU)
.. ocv:pyoldfunction:: cv.Invert(src, dst, flags=CV_LU)-> double
.. ocv:pyoldfunction:: cv.Invert(src, dst, method=CV_LU) -> float
:param src: Source floating-point ``M x N`` matrix.
:param dst: Destination matrix of ``N x M`` size and the same type as ``src`` .
:param flags: Inversion method :
* **DECOMP_LU** Gaussian elimination with the optimal pivot element chosen.
@@ -1461,7 +1460,7 @@ Calculates the natural logarithm of every array element.
:param src: Source array.
:param dst: Destination array of the same size and type as ``src`` .
The function ``log`` calculates the natural logarithm of the absolute value of every element of the input array:
.. math::
@@ -1499,7 +1498,7 @@ Performs a look-up table transform of an array.
:param lut: Look-up table of 256 elements. In case of multi-channel source array, the table should either have a single channel (in this case the same table is used for all channels) or the same number of channels as in the source array.
:param dst: Destination array of the same size and the same number of channels as ``src`` , and the same depth as ``lut`` .
The function ``LUT`` fills the destination array with values from the look-up table. Indices of the entries are taken from the source array. That is, the function processes each element of ``src`` as follows:
.. math::
@@ -1530,9 +1529,9 @@ Calculates the magnitude of 2D vectors.
:param x: Floating-point array of x-coordinates of the vectors.
:param y: Floating-point array of y-coordinates of the vectors. It must have the same size as ``x`` .
:param magnitude: Destination array of the same size and type as ``x`` .
The function ``magnitude`` calculates the magnitude of 2D vectors formed from the corresponding elements of ``x`` and ``y`` arrays:
.. math::
@@ -1558,7 +1557,7 @@ Calculates the Mahalanobis distance between two vectors.
.. ocv:cfunction:: double cvMahalanobis( const CvArr* vec1, const CvArr* vec2, CvArr* icovar)
.. ocv:pyoldfunction:: cv.Mahalanobis(vec1, vec2, icovar)-> None
.. ocv:pyoldfunction:: cv.Mahalonobis(vec1, vec2, mat) -> None
:param vec1: First 1D source vector.
@@ -1604,11 +1603,11 @@ Calculates per-element maximum of two arrays or an array and a scalar.
:param src1: First source array.
:param src2: Second source array of the same size and type as ``src1`` .
:param value: Real scalar value.
:param dst: Destination array of the same size and type as ``src1`` .
The functions ``max`` compute the per-element maximum of two arrays:
.. math::
@@ -1644,7 +1643,7 @@ Calculates an average (mean) of array elements.
.. ocv:pyfunction:: cv2.mean(src[, mask]) -> retval
.. ocv:cfunction:: CvScalar cvAvg(const CvArr* src, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: cv.Avg(src, mask=None)-> CvScalar
.. ocv:pyoldfunction:: cv.Avg(arr, mask=None) -> scalar
:param src: Source array that should have from 1 to 4 channels so that the result can be stored in :ocv:class:`Scalar_` .
@@ -1676,7 +1675,7 @@ Calculates a mean and standard deviation of array elements.
.. ocv:pyfunction:: cv2.meanStdDev(src[, mean[, stddev[, mask]]]) -> mean, stddev
.. ocv:cfunction:: void cvAvgSdv(const CvArr* src, CvScalar* mean, CvScalar* stdDev, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: cv.AvgSdv(src, mask=None)-> (mean, stdDev)
.. ocv:pyoldfunction:: cv.AvgSdv(arr, mask=None) -> (mean, stdDev)
:param src: Source array that should have from 1 to 4 channels so that the results can be stored in :ocv:class:`Scalar_` 's.
@@ -1765,11 +1764,11 @@ Calculates per-element minimum of two arrays or array and a scalar.
:param src1: First source array.
:param src2: Second source array of the same size and type as ``src1`` .
:param value: Real scalar value.
:param dst: Destination array of the same size and type as ``src1`` .
The functions ``min`` compute the per-element minimum of two arrays:
.. math::
@@ -1807,15 +1806,15 @@ Finds the global minimum and maximum in an array
:param minVal: Pointer to the returned minimum value. ``NULL`` is used if not required.
:param maxVal: Pointer to the returned maximum value. ``NULL`` is used if not required.
:param minIdx: Pointer to the returned minimum location (in nD case). ``NULL`` is used if not required. Otherwise, it must point to an array of ``src.dims`` elements. The coordinates of the minimum element in each dimension are stored there sequentially.
.. note::
When ``minIdx`` is not NULL, it must have at least 2 elements (as well as ``maxIdx``), even if ``src`` is a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2 dimensions, i.e. single-row matrix is ``Mx1`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(i1,0)``/``(i2,0)``) and single-column matrix is ``1xN`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(0,j1)``/``(0,j2)``).
:param maxIdx: Pointer to the returned maximum location (in nD case). ``NULL`` is used if not required.
The function ``minMaxIdx`` finds the minimum and maximum element values and their positions. The extremums are searched across the whole array or, if ``mask`` is not an empty array, in the specified array region.
The function does not work with multi-channel arrays. If you need to find minimum or maximum elements across all the channels, use
@@ -1871,7 +1870,7 @@ The functions do not work with multi-channel arrays. If you need to find minimum
:ocv:func:`extractImageCOI`,
:ocv:func:`mixChannels`,
:ocv:func:`split`,
:ocv:func:`Mat::reshape`
:ocv:func:`Mat::reshape`
@@ -1891,17 +1890,17 @@ Copies specified channels from input arrays to the specified channels of output
:param src: Input array or vector of matrices. All the matrices must have the same size and the same depth.
:param nsrc: Number of matrices in ``src`` .
:param dst: Output array or vector of matrices. All the matrices *must be allocated* . Their size and depth must be the same as in ``src[0]`` .
:param ndst: Number of matrices in ``dst`` .
:param fromTo: Array of index pairs specifying which channels are copied and where. ``fromTo[k*2]`` is a 0-based index of the input channel in ``src`` . ``fromTo[k*2+1]`` is an index of the output channel in ``dst`` . The continuous channel numbering is used: the first input image channels are indexed from ``0`` to ``src[0].channels()-1`` , the second input image channels are indexed from ``src[0].channels()`` to ``src[0].channels() + src[1].channels()-1``, and so on. The same scheme is used for the output image channels. As a special case, when ``fromTo[k*2]`` is negative, the corresponding output channel is filled with zero .
:param npairs: Number of index pairs in ``fromTo``.
The functions ``mixChannels`` provide an advanced mechanism for shuffling image channels.
:ocv:func:`split` and
:ocv:func:`merge` and some forms of
:ocv:func:`cvtColor` are partial cases of ``mixChannels`` .
@@ -1945,9 +1944,9 @@ Performs the per-element multiplication of two Fourier spectrums.
:param src1: First source array.
:param src2: Second source array of the same size and type as ``src1`` .
:param dst: Destination array of the same size and type as ``src1`` .
:param flags: Operation flags. Currently, the only supported flag is ``DFT_ROWS``, which indicates that each row of ``src1`` and ``src2`` is an independent 1D Fourier spectrum.
:param conj: Optional flag that conjugates the second source array before the multiplication (true) or not (false).
@@ -1970,14 +1969,14 @@ Calculates the per-element scaled product of two arrays.
.. ocv:pyfunction:: cv2.multiply(src1, src2[, dst[, scale[, dtype]]]) -> dst
.. ocv:cfunction:: void cvMul(const CvArr* src1, const CvArr* src2, CvArr* dst, double scale=1)
.. ocv:pyoldfunction:: cv.Mul(src1, src2, dst, scale)-> None
.. ocv:pyoldfunction:: cv.Mul(src1, src2, dst, scale=1) -> None
:param src1: First source array.
:param src2: Second source array of the same size and the same type as ``src1`` .
:param dst: Destination array of the same size and type as ``src1`` .
:param scale: Optional scale factor.
The function ``multiply`` calculates the per-element product of two arrays:
@@ -2019,7 +2018,7 @@ Calculates the product of a matrix and its transposition.
.. ocv:pyfunction:: cv2.mulTransposed(src, aTa[, dst[, delta[, scale[, dtype]]]]) -> dst
.. ocv:cfunction:: void cvMulTransposed(const CvArr* src, CvArr* dst, int order, const CvArr* delta=NULL, double scale=1.0)
.. ocv:pyoldfunction:: cv.MulTransposed(src, dst, order, delta=None, scale)-> None
.. ocv:pyoldfunction:: cv.MulTransposed(src, dst, order, delta=None, scale=1.0) -> None
:param src: Source single-channel matrix. Note that unlike :ocv:func:`gemm`, the function can multiply not only floating-point matrices.
@@ -2032,7 +2031,7 @@ Calculates the product of a matrix and its transposition.
:param scale: Optional scale factor for the matrix product.
:param rtype: Optional type of the destination matrix. When it is negative, the destination matrix will have the same type as ``src`` . Otherwise, it will be ``type=CV_MAT_DEPTH(rtype)`` that should be either ``CV_32F`` or ``CV_64F`` .
The function ``mulTransposed`` calculates the product of ``src`` and its transposition:
.. math::
@@ -2070,12 +2069,12 @@ Calculates an absolute array norm, an absolute difference norm, or a relative di
.. ocv:pyfunction:: cv2.norm(src1, src2[, normType[, mask]]) -> retval
.. ocv:cfunction:: double cvNorm(const CvArr* arr1, const CvArr* arr2=NULL, int normType=CV_L2, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: cv.Norm(arr1, arr2, normType=CV_L2, mask=None)-> double
.. ocv:pyoldfunction:: cv.Norm(arr1, arr2, normType=CV_L2, mask=None) -> float
:param src1: First source array.
:param src2: Second source array of the same size and the same type as ``src1`` .
:param normType: Type of the norm. See the details below.
:param mask: Optional operation mask. It must have the same size as ``src1`` and ``CV_8UC1`` type.
@@ -2125,7 +2124,7 @@ Normalizes the norm or value range of an array.
:param src: Source array.
:param dst: Destination array of the same size as ``src`` .
:param alpha: Norm value to normalize to or the lower range boundary in case of the range normalization.
:param beta: Upper range boundary in case of the range normalization. It is not used for the norm normalization.
@@ -2133,7 +2132,7 @@ Normalizes the norm or value range of an array.
:param normType: Normalization type. See the details below.
:param rtype: When the parameter is negative, the destination array has the same type as ``src``. Otherwise, it has the same number of channels as ``src`` and the depth ``=CV_MAT_DEPTH(rtype)`` .
:param mask: Optional operation mask.
@@ -2279,7 +2278,7 @@ Projects vector(s) to the principal component subspace.
.. ocv:function:: void PCA::project(InputArray vec, OutputArray result) const
.. ocv:pyfunction:: cv2.PCAProject(vec, mean, eigenvectors[, result]) -> result
.. ocv:pyfunction:: cv2.PCAProject(data, mean, eigenvectors[, result]) -> result
:param vec: Input vector(s). They must have the same dimensionality and the same layout as the input data used at PCA phase. That is, if ``CV_PCA_DATA_AS_ROW`` are specified, then ``vec.cols==data.cols`` (vector dimensionality) and ``vec.rows`` is the number of vectors to project. The same is true for the ``CV_PCA_DATA_AS_COL`` case.
@@ -2297,7 +2296,7 @@ Reconstructs vectors from their PC projections.
.. ocv:function:: void PCA::backProject(InputArray vec, OutputArray result) const
.. ocv:pyfunction:: cv2.PCABackProject(vec, mean, eigenvectors[, result]) -> result
.. ocv:pyfunction:: cv2.PCABackProject(data, mean, eigenvectors[, result]) -> result
:param vec: Coordinates of the vectors in the principal component subspace. The layout and size are the same as of ``PCA::project`` output vectors.
@@ -2322,7 +2321,7 @@ Performs the perspective matrix transformation of vectors.
:param src: Source two-channel or three-channel floating-point array. Each element is a 2D/3D vector to be transformed.
:param dst: Destination array of the same size and type as ``src`` .
:param mtx: ``3x3`` or ``4x4`` floating-point transformation matrix.
The function ``perspectiveTransform`` transforms every element of ``src`` by treating it as a 2D or 3D vector, in the following way:
@@ -2366,10 +2365,10 @@ Calculates the rotation angle of 2D vectors.
:param x: Source floating-point array of x-coordinates of 2D vectors.
:param y: Source array of y-coordinates of 2D vectors. It must have the same size and the same type as ``x`` .
:param y: Source array of y-coordinates of 2D vectors. It must have the same size and the same type as ``x`` .
:param angle: Destination array of vector angles. It has the same size and same type as ``x`` .
:param angleInDegrees: When it is true, the function computes the angle in degrees. Otherwise, they are measured in radians.
The function ``phase`` computes the rotation angle of each 2D vector that is formed from the corresponding elements of ``x`` and ``y`` :
@@ -2393,13 +2392,13 @@ Computes x and y coordinates of 2D vectors from their magnitude and angle.
.. ocv:pyoldfunction:: cv.PolarToCart(magnitude, angle, x, y, angleInDegrees=0)-> None
:param magnitude: Source floating-point array of magnitudes of 2D vectors. It can be an empty matrix ( ``=Mat()`` ). In this case, the function assumes that all the magnitudes are =1. If it is not empty, it must have the same size and type as ``angle`` .
:param angle: Source floating-point array of angles of 2D vectors.
:param x: Destination array of x-coordinates of 2D vectors. It has the same size and type as ``angle``.
:param y: Destination array of y-coordinates of 2D vectors. It has the same size and type as ``angle``.
:param angleInDegrees: When it is true, the input angles are measured in degrees. Otherwise. they are measured in radians.
The function ``polarToCart`` computes the Cartesian coordinates of each 2D vector represented by the corresponding elements of ``magnitude`` and ``angle`` :
@@ -2602,11 +2601,11 @@ Fills arrays with random numbers.
:param mat: 2D or N-dimensional matrix. Currently matrices with more than 4 channels are not supported by the methods. Use :ocv:func:`Mat::reshape` as a possible workaround.
:param distType: Distribution type, ``RNG::UNIFORM`` or ``RNG::NORMAL`` .
:param a: First distribution parameter. In case of the uniform distribution, this is an inclusive lower boundary. In case of the normal distribution, this is a mean value.
:param b: Second distribution parameter. In case of the uniform distribution, this is a non-inclusive upper boundary. In case of the normal distribution, this is a standard deviation (diagonal of the standard deviation matrix or the full standard deviation matrix).
:param saturateRange: Pre-saturation flag; for uniform distribution only. If it is true, the method will first convert a and b to the acceptable value range (according to the mat datatype) and then will generate uniformly distributed random numbers within the range ``[saturate(a), saturate(b))``. If ``saturateRange=false``, the method will generate uniformly distributed random numbers in the original range ``[a, b)`` and then will saturate them. It means, for example, that ``theRNG().fill(mat_8u, RNG::UNIFORM, -DBL_MAX, DBL_MAX)`` will likely produce array mostly filled with 0's and 255's, since the range ``(0, 255)`` is significantly smaller than ``[-DBL_MAX, DBL_MAX)``.
Each of the methods fills the matrix with the random values from the specified distribution. As the new numbers are generated, the RNG state is updated accordingly. In case of multiple-channel images, every channel is filled independently, which means that RNG cannot generate samples from the multi-dimensional Gaussian distribution with non-diagonal covariance matrix directly. To do that, the method generates samples from multi-dimensional standard Gaussian distribution with zero mean and identity covariation matrix, and then transforms them using :ocv:func:`transform` to get samples from the specified Gaussian distribution.
@@ -2640,7 +2639,7 @@ The second non-template variant of the function fills the matrix ``mtx`` with un
:ocv:class:`RNG`,
:ocv:func:`randn`,
:ocv:func:`theRNG`
:ocv:func:`theRNG`
@@ -2673,7 +2672,7 @@ Shuffles the array elements randomly.
.. ocv:function:: void randShuffle(InputOutputArray mtx, double iterFactor=1., RNG* rng=0)
.. ocv:pyfunction:: cv2.randShuffle(src[, dst[, iterFactor]]) -> dst
.. ocv:pyfunction:: cv2.randShuffle(dst[, iterFactor]) -> None
:param mtx: Input/output numerical 1D array.
@@ -2718,7 +2717,7 @@ Reduces a matrix to a vector.
* **CV_REDUCE_MIN** The output is the minimum (column/row-wise) of all rows/columns of the matrix.
:param dtype: When it is negative, the destination vector will have the same type as the source matrix. Otherwise, its type will be ``CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), mtx.channels())`` .
The function ``reduce`` reduces the matrix to a vector by treating the matrix rows/columns as a set of 1D vectors and performing the specified operation on the vectors until a single row/column is obtained. For example, the function can be used to compute horizontal and vertical projections of a raster image. In case of ``CV_REDUCE_SUM`` and ``CV_REDUCE_AVG`` , the output may have a larger element bit-depth to preserve accuracy. And multi-channel arrays are also supported in these two reduction modes.
.. seealso:: :ocv:func:`repeat`
@@ -2741,7 +2740,7 @@ Fills the destination array with repeated copies of the source array.
:param src: Source array to replicate.
:param dst: Destination array of the same type as ``src`` .
:param ny: Flag to specify how many times the ``src`` is repeated along the vertical axis.
:param nx: Flag to specify how many times the ``src`` is repeated along the horizontal axis.
@@ -2754,7 +2753,7 @@ The functions
\texttt{dst} _{ij}= \texttt{src} _{i\mod src.rows, \; j\mod src.cols }
The second variant of the function is more convenient to use with
:ref:`MatrixExpressions` .
:ref:`MatrixExpressions` .
.. seealso::
@@ -2779,9 +2778,9 @@ Calculates the sum of a scaled array and another array.
:param scale: Scale factor for the first array.
:param src2: Second source array of the same size and type as ``src1`` .
:param dst: Destination array of the same size and type as ``src1`` .
The function ``scaleAdd`` is one of the classical primitive linear algebra operations, known as ``DAXPY`` or ``SAXPY`` in `BLAS <http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms>`_. It calculates the sum of a scaled array and another array:
.. math::
@@ -2874,7 +2873,7 @@ Solves one or more linear systems or least-squares problems.
* **DECOMP_QR** QR factorization. The system can be over-defined and/or the matrix ``src1`` can be singular.
* **DECOMP_NORMAL** While all the previous flags are mutually exclusive, this flag can be used together with any of the previous. It means that the normal equations :math:`\texttt{src1}^T\cdot\texttt{src1}\cdot\texttt{dst}=\texttt{src1}^T\texttt{src2}` are solved instead of the original system :math:`\texttt{src1}\cdot\texttt{dst}=\texttt{src2}` .
The function ``solve`` solves a linear system or least-squares problem (the latter is possible with SVD or QR methods, or by specifying the flag ``DECOMP_NORMAL`` ):
.. math::
@@ -2960,7 +2959,7 @@ Sorts each row or each column of a matrix.
:param src: Source single-channel array.
:param dst: Destination array of the same size and type as ``src`` .
:param flags: Operation flags, a combination of the following values:
* **CV_SORT_EVERY_ROW** Each matrix row is sorted independently.
@@ -2991,7 +2990,7 @@ Sorts each row or each column of a matrix.
:param src: Source single-channel array.
:param dst: Destination integer array of the same size as ``src`` .
:param flags: Operation flags that could be a combination of the following values:
* **CV_SORT_EVERY_ROW** Each matrix row is sorted independently.
@@ -3026,7 +3025,7 @@ Divides a multi-channel array into several single-channel arrays.
.. ocv:function:: void split(const Mat& mtx, vector<Mat>& mv)
.. ocv:pyfunction:: cv2.split(m, mv) -> None
.. ocv:pyfunction:: cv2.split(m[, mv]) -> mv
.. ocv:cfunction:: void cvSplit(const CvArr* src, CvArr* dst0, CvArr* dst1, CvArr* dst2, CvArr* dst3)
.. ocv:pyoldfunction:: cv.Split(src, dst0, dst1, dst2, dst3)-> None
@@ -3066,7 +3065,7 @@ Calculates a square root of array elements.
:param src: Source floating-point array.
:param dst: Destination array of the same size and type as ``src`` .
The functions ``sqrt`` calculate a square root of each source array element. In case of multi-channel arrays, each channel is processed independently. The accuracy is approximately the same as of the built-in ``std::sqrt`` .
.. seealso::
@@ -3088,18 +3087,18 @@ Calculates the per-element difference between two arrays or array and a scalar.
.. ocv:cfunction:: void cvSubRS(const CvArr* src1, CvScalar src2, CvArr* dst, const CvArr* mask=NULL)
.. ocv:cfunction:: void cvSubS(const CvArr* src1, CvScalar src2, CvArr* dst, const CvArr* mask=NULL)
.. ocv:pyoldfunction:: cv.Sub(src1, src2, dst, mask=None)-> None
.. ocv:pyoldfunction:: cv.SubRS(src1, src2, dst, mask=None)-> None
.. ocv:pyoldfunction:: cv.SubS(src1, src2, dst, mask=None)-> None
.. ocv:pyoldfunction:: cv.Sub(src1, src2, dst, mask=None) -> None
.. ocv:pyoldfunction:: cv.SubRS(src, value, dst, mask=None) -> None
.. ocv:pyoldfunction:: cv.SubS(src, value, dst, mask=None) -> None
:param src1: First source array or a scalar.
:param src2: Second source array or a scalar.
:param dst: Destination array of the same size and the same number of channels as the input array.
:param dst: Destination array of the same size and the same number of channels as the input array.
:param mask: Optional operation mask. This is an 8-bit single channel array that specifies elements of the destination array to be changed.
:param dtype: Optional depth of the output array. See the details below.
The function ``subtract`` computes:
@@ -3124,10 +3123,10 @@ The function ``subtract`` computes:
.. math::
\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1} - \texttt{src2}(I) ) \quad \texttt{if mask}(I) \ne0
*
The reverse difference between a scalar and an array in the case of ``SubRS``:
.. math::
\texttt{dst}(I) = \texttt{saturate} ( \texttt{src2} - \texttt{src1}(I) ) \quad \texttt{if mask}(I) \ne0
@@ -3224,25 +3223,25 @@ Performs SVD of a matrix
.. ocv:cfunction:: void cvSVD( CvArr* src, CvArr* w, CvArr* u=NULL, CvArr* v=NULL, int flags=0)
.. ocv:pyoldfunction:: cv.SVD(src, w, u=None, v=None, flags=0)-> None
.. ocv:pyoldfunction:: cv.SVD(A, W, U=None, V=None, flags=0) -> None
:param src: Decomposed matrix
:param w: Computed singular values
:param u: Computed left singular vectors
:param v: Computed right singular vectors
:param vt: Transposed matrix of right singular values
:param flags: Operation flags - see :ocv:func:`SVD::SVD`.
The methods/functions perform SVD of matrix. Unlike ``SVD::SVD`` constructor and ``SVD::operator()``, they store the results to the user-provided matrices. ::
Mat A, w, u, vt;
SVD::compute(A, w, u, vt);
SVD::solveZ
-----------
@@ -3254,7 +3253,7 @@ Solves an under-determined singular linear system.
:param dst: Found solution.
The method finds a unit-length solution ``x`` of a singular linear system
The method finds a unit-length solution ``x`` of a singular linear system
``A*x = 0``. Depending on the rank of ``A``, there can be no solutions, a single solution or an infinite number of solutions. In general, the algorithm solves the following problem:
.. math::
@@ -3274,18 +3273,18 @@ Performs a singular value back substitution.
.. ocv:cfunction:: void cvSVBkSb( const CvArr* w, const CvArr* u, const CvArr* v, const CvArr* rhs, CvArr* dst, int flags)
.. ocv:pyoldfunction:: cv.SVBkSb(w, u, v, rhs, dst, flags)-> None
.. ocv:pyoldfunction:: cv.SVBkSb(W, U, V, B, X, flags) -> None
:param w: Singular values
:param u: Left singular vectors
:param v: Right singular vectors
:param vt: Transposed matrix of right singular vectors.
:param rhs: Right-hand side of a linear system ``(u*w*v')*dst = rhs`` to be solved, where ``A`` has been previously decomposed.
:param dst: Found solution of the system.
The method computes a back substitution for the specified right-hand side:
@@ -3294,7 +3293,7 @@ The method computes a back substitution for the specified right-hand side:
\texttt{x} = \texttt{vt} ^T \cdot diag( \texttt{w} )^{-1} \cdot \texttt{u} ^T \cdot \texttt{rhs} \sim \texttt{A} ^{-1} \cdot \texttt{rhs}
Using this technique you can either get a very accurate solution of the convenient linear system, or the best (in the least-squares terms) pseudo-solution of an overdetermined linear system.
Using this technique you can either get a very accurate solution of the convenient linear system, or the best (in the least-squares terms) pseudo-solution of an overdetermined linear system.
.. note:: Explicit SVD with the further back substitution only makes sense if you need to solve many linear systems with the same left-hand side (for example, ``src`` ). If all you need is to solve a single system (possibly with multiple ``rhs`` immediately available), simply call :ocv:func:`solve` add pass ``DECOMP_SVD`` there. It does absolutely the same thing.
@@ -3306,10 +3305,10 @@ Calculates the sum of array elements.
.. ocv:function:: Scalar sum(InputArray arr)
.. ocv:pyfunction:: cv2.sumElems(arr) -> retval
.. ocv:pyfunction:: cv2.sumElems(src) -> retval
.. ocv:cfunction:: CvScalar cvSum(const CvArr* arr)
.. ocv:pyoldfunction:: cv.Sum(arr)-> CvScalar
.. ocv:pyoldfunction:: cv.Sum(arr) -> scalar
:param arr: Source array that must have from 1 to 4 channels.
@@ -3350,10 +3349,10 @@ Returns the trace of a matrix.
.. ocv:function:: Scalar trace(InputArray mat)
.. ocv:pyfunction:: cv2.trace(mat) -> retval
.. ocv:pyfunction:: cv2.trace(mtx) -> retval
.. ocv:cfunction:: CvScalar cvTrace(const CvArr* mat)
.. ocv:pyoldfunction:: cv.Trace(mat)-> CvScalar
.. ocv:pyoldfunction:: cv.Trace(mat) -> scalar
:param mat: Source matrix.
@@ -3371,17 +3370,17 @@ Performs the matrix transformation of every array element.
.. ocv:function:: void transform(InputArray src, OutputArray dst, InputArray mtx )
.. ocv:pyfunction:: cv2.transform(src, mtx [, dst]) -> dst
.. ocv:pyfunction:: cv2.transform(src, m[, dst]) -> dst
.. ocv:cfunction:: void cvTransform(const CvArr* src, CvArr* dst, const CvMat* mtx, const CvMat* shiftvec=NULL)
.. ocv:pyoldfunction:: cv.Transform(src, dst, mtx, shiftvec=None)-> None
.. ocv:pyoldfunction:: cv.Transform(src, dst, transmat, shiftvec=None)-> None
:param src: Source array that must have as many channels (1 to 4) as ``mtx.cols`` or ``mtx.cols-1``.
:param dst: Destination array of the same size and depth as ``src`` . It has as many channels as ``mtx.rows`` .
:param dst: Destination array of the same size and depth as ``src`` . It has as many channels as ``mtx.rows`` .
:param mtx: Transformation ``2x2`` or ``2x3`` floating-point matrix.
:param shiftvec: Optional translation vector (when ``mtx`` is ``2x2``)
The function ``transform`` performs the matrix transformation of every element of the array ``src`` and stores the results in ``dst`` :
@@ -3430,7 +3429,7 @@ Transposes a matrix.
:param src: Source array.
:param dst: Destination array of the same type as ``src`` .
The function :ocv:func:`transpose` transposes the matrix ``src`` :
.. math::

View File

@@ -95,7 +95,7 @@ Computes the cube root of an argument.
.. ocv:cfunction:: float cvCbrt(float val)
.. ocv:pyoldfunction:: cv.Cbrt(val)-> float
.. ocv:pyoldfunction:: cv.Cbrt(value)-> float
:param val: A function argument.
@@ -151,7 +151,7 @@ Determines if the argument is Infinity.
.. ocv:cfunction:: int cvIsInf(double value)
.. ocv:pyoldfunction:: cv.IsInf(value)-> int
:param value: The input floating-point value
:param value: The input floating-point value
The function returns 1 if the argument is a plus or minus infinity (as defined by IEEE754 standard) and 0 otherwise.
@@ -162,7 +162,7 @@ Determines if the argument is Not A Number.
.. ocv:cfunction:: int cvIsNaN(double value)
.. ocv:pyoldfunction:: cv.IsNaN(value)-> int
:param value: The input floating-point value
:param value: The input floating-point value
The function returns 1 if the argument is Not A Number (as defined by IEEE754 standard), 0 otherwise.
@@ -186,8 +186,8 @@ Signals an error and raises an exception.
:param exc: Exception to throw.
:param status: Error code. Normally, it is a negative value. The list of pre-defined error codes can be found in ``cxerror.h`` .
:param status: Error code. Normally, it is a negative value. The list of pre-defined error codes can be found in ``cxerror.h`` .
:param err_msg: Text of the error message.
:param args: ``printf`` -like formatted error message in parentheses.
@@ -209,7 +209,7 @@ The macro ``CV_Error_`` can be used to construct an error message on-fly to incl
Exception
---------
.. ocv:class:: Exception
.. ocv:class:: Exception : public std::exception
Exception class passed to an error. ::
@@ -261,7 +261,7 @@ Deallocates a memory buffer.
.. ocv:cfunction:: void cvFree( void** pptr )
:param ptr: Pointer to the allocated buffer.
:param pptr: Double pointer to the allocated buffer
The function deallocates the buffer allocated with :ocv:func:`fastMalloc` . If NULL pointer is passed, the function does nothing. C version of the function clears the pointer ``*pptr`` to avoid problems with double memory deallocation.
@@ -286,10 +286,10 @@ Returns true if the specified feature is supported by the host hardware.
.. ocv:function:: bool checkHardwareSupport(int feature)
.. ocv:cfunction:: int cvCheckHardwareSupport(int feature)
.. ocv:pyfunction:: checkHardwareSupport(feature) -> Bool
.. ocv:pyfunction:: cv2.checkHardwareSupport(feature) -> retval
:param feature: The feature of interest, one of:
* ``CV_CPU_MMX`` - MMX
* ``CV_CPU_SSE`` - SSE
* ``CV_CPU_SSE2`` - SSE 2
@@ -312,7 +312,7 @@ The function returns the number of threads that is used by OpenCV.
.. seealso::
:ocv:func:`setNumThreads`,
:ocv:func:`getThreadNum`
:ocv:func:`getThreadNum`
@@ -411,7 +411,7 @@ The function sets the number of threads used by OpenCV in parallel OpenMP region
.. seealso::
:ocv:func:`getNumThreads`,
:ocv:func:`getThreadNum`
:ocv:func:`getThreadNum`