* **CMP_LE** ``src1`` is less than or equal to ``src2``.
* **CMP_NE** ``src1`` is unequal to ``src2``.
- :param cmp_op: a flag, that specifies correspondence between the arrays (specific to C syntax; for possible values see 'cmpop above).
+ :param cmp_op: a flag, that specifies correspondence between the arrays (specific to C syntax; for possible values see 'cmpop' above).
The function compares:
divide
-----------
+------
Performs per-element division of two arrays or a scalar by an array.
.. ocv:function:: void divide(InputArray src1, InputArray src2, OutputArray dst, double scale=1, int dtype=-1)
:param mtx: input matrix that must have ``CV_32FC1`` or ``CV_64FC1`` type and square size.
+ :param mat: input matrix (C-specific; see 'mtx' for details).
+
The function ``determinant`` calculates and returns the determinant of the specified matrix. For small matrices ( ``mtx.cols=mtx.rows<=3`` ),
the direct method is used. For larger matrices, the function uses LU factorization with partial pivoting.
:param src: input matrix that must have ``CV_32FC1`` or ``CV_64FC1`` type, square size and be symmetrical (``src`` :sup:`T` == ``src``).
+ :param mat: input matrix (see 'src' above for details).
+
:param eigenvalues: output vector of eigenvalues of the same type as ``src``; the eigenvalues are stored in the descending order.
+ :param evals: output vector of eigenvalues (see 'eigenvalies' above for details).
+
: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.
+ :param evects: output matrix of eigenvectors (see 'eigenvectors' above for details).
+
:param lowindex: optional index of largest eigenvalue/-vector to calculate; the parameter is ignored in the current implementation.
:param highindex: optional index of smallest eigenvalue/-vector to calculate; the parameter is ignored in the current implementation.
flip
---------
+----
Flips a 2D array around vertical, horizontal, or both axes.
.. ocv:function:: void flip(InputArray src, OutputArray dst, int flipCode)
:param dst: output array of the same size and type as ``src``.
- :param flipCode: a flag to specify how to flip the array; 0 means flipping around the x-axis and 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).
+ :param flipCode: a flag, that specifies the mode of the flip; 0 means flipping around the x-axis and 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).
+
+ :param flip_mode: a flag, that specifies the mode of the flip (see 'flipCode' above for details);
The function ``flip`` flips the array in one of three different ways (row and column indices are 0-based):
* **GEMM_2_T** transposes ``src2``.
* **GEMM_3_T** transposes ``src3``.
+ :param tABC: operation flags (see 'flags' above for details).
+
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::
:param vecsize: vector size.
+ :param size0: vector size (see 'vecsize' above for details).
+
DFT performance is not a monotonic function of a vector size. Therefore, when you calculate convolution of two arrays or perform the spectral analysis of an array, it usually makes sense to pad the input data with zeros to get a bit larger array that can be transformed much faster than the original one.
Arrays whose size is a power-of-two (2, 4, 8, 16, 32, ...) are the fastest to process. Though, the arrays whose size is a product of 2's, 3's, and 5's (for example, 300 = 5*5*3*2*2) are also processed quite efficiently.
:param lowerb: inclusive lower boundary array or a scalar.
+ :param lower: inclusive lower boundary array or a scalar (see 'lowerb' above).
+
:param upperb: inclusive upper boundary array or a scalar.
+ :param upper: inclusive upper boundary array or a scalar (see 'upperb' above).
+
:param dst: output array of the same size as ``src`` and ``CV_8U`` type.
The function checks the range as follows:
* **DECOMP_CHOLESKY** Cholesky decomposition; the matrix must be symmetrical and positively defined.
+ :param method: inversion method (see 'flags' above for possible values).
+
The function ``invert`` inverts the matrix ``src`` and stores the result in ``dst`` .
When the matrix ``src`` is singular or non-square, the function calculates the pseudo-inverse matrix (the ``dst`` matrix) so that ``norm(src*dst - I)`` is minimal, where I is an identity matrix.
:param vec1: first 1D input vector.
+ :param v1: first 1D input vector (see 'vec1' above).
+
:param vec2: second 1D input vector.
+ :param v2: first 1D input vector (see 'vec2' above).
+
:param icovar: inverse covariance matrix.
+ :param mat: inverse covariance matrix (see 'icovar' above).
+
The function ``Mahalanobis`` calculates and returns the weighted distance between two vectors:
.. math::
:param src1: first input array.
- :param src2: second input array of the same size and type as ``src1`` .
+ :param src2: second input array of the same size and type as ``src1``.
+
+ :param src: single input array.
:param value: real scalar value.
.. ocv:pyoldfunction:: cv.Avg(arr, mask=None) -> scalar
- :param src: input array that should have from 1 to 4 channels so that the result can be stored in :ocv:class:`Scalar_` .
+ :param src: input array that should have from 1 to 4 channels so that the result can be stored in :ocv:class:`Scalar_`.
+
+ :param arr: input array (see 'src' above).
:param mask: optional operation mask.
:param src: input array that should have from 1 to 4 channels so that the results can be stored in :ocv:class:`Scalar_` 's.
- :param mean: output parameter: calculated mean value.
+ :param arr: input array (see 'src' above).
+
+ :param mean: calculated mean value.
+
+ :param stddev: calculateded standard deviation.
- :param stddev: output parameter: calculateded standard deviation.
+ :param std_dev: calculateded standard deviation (see 'stddev' above).
:param mask: optional operation mask.
:param mv: input array or vector of matrices to be merged; all the matrices in ``mv`` must have the same size and the same depth.
+ :param src0: first input array or vector of matrix to be merged.
+
+ :param src1: second input array or vector of matrix to be merged.
+
+ :param src2: third input array or vector of matrix to be merged.
+
+ :param src3: fourth input array or vector of matrix to be merged.
+
:param count: number of input matrices when ``mv`` is a plain C array; it must be greater than zero.
:param dst: output array of the same size and the same depth as ``mv[0]``; The number of channels will be the total number of channels in the matrix array.
:param src2: second input array of the same size and type as ``src1``.
+ :param src: single input array.
+
:param value: real scalar value.
:param dst: output array of the same size and type as ``src1``.
:param src: input single-channel array.
+ :param arr: input single-channel array (see 'src' above).
+
:param minVal: pointer to the returned minimum value; ``NULL`` is used if not required.
+ :param min_val: pointer to the returned minimum value (see 'minVal' above).
+
:param maxVal: pointer to the returned maximum value; ``NULL`` is used if not required.
+ :param max_val: pointer to the returned minimum value (see 'maxVal' above).
+
:param minLoc: pointer to the returned minimum location (in 2D case); ``NULL`` is used if not required.
+ :param min_loc: pointer to the returned minimum value (see 'minLoc' above).
+
:param maxLoc: pointer to the returned maximum location (in 2D case); ``NULL`` is used if not required.
+ :param max_loc: pointer to the returned minimum value (see 'maxLoc' above).
+
:param mask: optional mask used to select a sub-array.
The functions ``minMaxLoc`` find the minimum and maximum element values and their positions. The extremums are searched across the whole array or,
:param nsrcs: number of matrices in ``src``.
+ :param src_count: number of matrices in ``src`` (see 'nsrcs' above).
+
: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 ndsts: number of matrices in ``dst``.
+ :param dst_count: number of matrices in ``dst`` (see 'ndsts' above).
+
: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 from_to: array of index pairs specifying which channels are copied and where (see 'fromTo' above for details).
+
:param npairs: number of index pairs in ``fromTo``.
+ :param pair_count: number of index pairs in ``fromTo`` (see 'npairs' above).
+
The functions ``mixChannels`` provide an advanced mechanism for shuffling image channels.
:ocv:func:`split` and
:param src1: first input array.
- :param src2: second input array of the same size and type as ``src1`` .
+ :param a: first input array (see 'src1' above).
- :param dst: output array of the same size and type as ``src1`` .
+ :param src2: second input array of the same size and type as ``src1``.
+
+ :param b: second input array (see 'src2' above).
+
+ :param dst: output array of the same size and type as ``src1``.
+
+ :param c: output array (see 'dst' above).
: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 scale: optional scale factor.
+ :param dtype: Optional type of the output matrix.
+
The function ``multiply`` calculates the per-element product of two arrays:
.. math::
:param dst: output square matrix.
- :param aTa: Flag specifying the multiplication ordering. See the description below.
+ :param aTa: a flag, specifying the multiplication ordering (see the description below).
+
+ :param order: a flag, specifying the multiplication ordering (see 'aTa' above).
:param delta: Optional delta matrix subtracted from ``src`` before the multiplication. When the matrix is empty ( ``delta=noArray()`` ), it is assumed to be zero, that is, nothing is subtracted. If it has the same size as ``src`` , it is simply subtracted. Otherwise, it is "repeated" (see :ocv:func:`repeat` ) to cover the full ``src`` and then subtracted. Type of the delta matrix, when it is not empty, must be the same as the type of created output matrix. See the ``dtype`` parameter description below.
:param scale: Optional scale factor for the matrix product.
- :param dtype: Optional type of the output matrix. When it is negative, the output matrix will have the same type as ``src`` . Otherwise, it will be ``type=CV_MAT_DEPTH(dtype)`` that should be either ``CV_32F`` or ``CV_64F`` .
+ :param dtype: Optional type of the output matrix. When it is negative, the output matrix will have the same type as ``src`` . Otherwise, it will be ``type=CV_MAT_DEPTH(dtype)`` that should be either ``CV_32F`` or ``CV_64F``.
The function ``mulTransposed`` calculates the product of ``src`` and its transposition:
:param src1: first input array.
+ :param: arr1: first input array (see 'src1' above).
+
:param src2: second input array of the same size and the same type as ``src1``.
+ :param: arr2: second input array (see 'src2' above).
+
+ :param src: single input array.
+
:param normType: type of the norm (see the details below).
+ :param norm_type: type of the norm (see 'normType' above).
+
:param mask: optional operation mask; it must have the same size as ``src1`` and ``CV_8UC1`` type.
The functions ``norm`` calculate an absolute norm of ``src1`` (when there is no ``src2`` ):
:param normType: normalization type (see the details below).
+ :param norm_type: normalization type (see 'normType' above).
+
:param dtype: when negative, the output array has the same type as ``src``; otherwise, it has the same number of channels as ``src`` and the depth ``=CV_MAT_DEPTH(dtype)``.
:param mask: optional operation mask.
PCA::PCA
-------------
+--------
PCA constructors
.. ocv:function:: PCA::PCA()
:param m: ``3x3`` or ``4x4`` floating-point transformation matrix.
+ :param mat: ``3x3`` or ``4x4`` floating-point transformation matrix (see 'm' above).
+
The function ``perspectiveTransform`` transforms every element of ``src`` by treating it as a 2D or 3D vector, in the following way:
.. math::
:param angleInDegrees: when true, the input angles are measured in degrees, otherwise, they are measured in radians.
+ :param angles_in_degrees: when true, the input angles are measured in degrees, otherwise, they are measured in radians (see 'angleInDegrees' above).
+
The function ``polarToCart`` calculates the Cartesian coordinates of each 2D vector represented by the corresponding elements of ``magnitude`` and ``angle`` :
.. math::
:param mtx: matrix to initialize (not necessarily square).
- :param value: value to assign to diagonal elements.
+ :param mat: matrix to initialize (see 'mtx' above).
+
+ :param value: scalar value to assign to diagonal elements.
+
+ :param s: scalar value to assign to diagonal elements (see 'value' above).
The function
:ocv:func:`setIdentity` initializes a scaled identity matrix:
* **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}` .
+ * **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}`.
+
+ :param method: solution (matrix inversion) method.
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`` ):
solveCubic
---------------
+----------
Finds the real roots of a cubic equation.
.. ocv:function:: int solveCubic( InputArray coeffs, OutputArray roots )
:param src: input multi-channel array.
+ :param m: input multi-channel array (see 'src' above).
+
+ :param dst0: first output array.
+
+ :param dst1: second output array.
+
+ :param dst2: third output array.
+
+ :param dst3: fourth output array.
+
:param mv: output array or vector of arrays; in the first variant of the function the number of arrays must match ``src.channels()``; the arrays themselves are reallocated, if needed.
+ :param mvbegin: output array or vector of arrays (see 'mv' above for details).
+
The functions ``split`` split a multi-channel array into separate single-channel arrays:
.. math::
:param src2: second input array or a scalar.
+ :param src: single input array.
+
:param dst: output 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 output array to be changed.
:param arr: input array that must have from 1 to 4 channels.
+ :param src: input array that must have from 1 to 4 channels (see 'arr' above).
+
The functions ``sum`` calculate and return the sum of array elements, independently for each channel.
.. seealso::
:param mat: input matrix.
+ :param mtx: input matrix (see 'mat' above).
+
The function ``trace`` returns the sum of the diagonal elements of the matrix ``mtx`` .
.. math::
:param m: transformation ``2x2`` or ``2x3`` floating-point matrix.
+ :param transmat: transformation ``2x2`` or ``2x3`` floating-point matrix (see 'm' above).
+
:param shiftvec: optional translation vector (when ``m`` is ``2x2``)
The function ``transform`` performs the matrix transformation of every element of the array ``src`` and stores the results in ``dst`` :