Counts the abs sum of matrix elements for each channel. Supports all data types.
ocl::countNonZero
---------------------
Returns the number of non-zero elements in src
@ -11,7 +21,7 @@ Returns the number of non-zero elements in src
:param src:Single-channel array
Counts non-zero array elements.
Counts non-zero array elements. Supports all data types.
ocl::minMax
------------------
@ -49,32 +59,22 @@ Returns void
The functions minMaxLoc find 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 functions do not work with multi-channel arrays.
ocl::Sum
ocl::sqrSum
------------------
Returns the sum of matrix elements for each channel
..ocv:function:: Scalar ocl::sum(const oclMat &m)
:param m:The Source image of all depth.
Counts the sum of matrix elements for each channel.
ocl::absSum
---------------
Returns the sum of absolute values for matrix elements.
Returns the squared sum of matrix elements for each channel
:param m:the destination matrix. If it does not have a proper size or type before the operation, it will be reallocated.
:param rtype:the desired destination matrix type, or rather, the depth (since the number of channels will be the same with the source one). If rtype is negative, the destination matrix will have the same type as the source.
:param alpha:optional scale factor.
:param beta:optional delta added to the scaled values.
The method converts source pixel values to the target datatype. Saturate cast is applied in the end to avoid possible overflows. Supports all data types.
:param s:Assigned scalar, which is converted to the actual array type.
:param mask:The operation mask of the same size as ``*this`` and type ``CV_8UC1``.
Sets all or some of the array elements to the specified value. This is the advanced variant of Mat::operator=(const Scalar s) operator. Supports all data types.
ocl::absdiff
------------------
Returns void
@ -109,13 +69,13 @@ where ``I`` is a multi-dimensional index of array elements. In case of multi-cha
:param magnitude:the 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's not empty, it must have the same size and same type as ``angle``.
:param src1:the first source array.
:param angle:the source floating-point array of angles of the 2D vectors.
:param src2:the second source array; must have the same size and same type as ``src1``.
:param x:the destination array of x-coordinates of 2D vectors; will have the same size and the same type as ``angle``.
:param dst:the destination array; will have the same size as ``src1`` and type ``CV_8UC1``.
:param y:the destination array of y-coordinates of 2D vectors; will have the same size and the same type as ``angle``.
:param cmpop:the flag specifying the relation between the elements to be checked.
:param angleInDegrees:the flag indicating whether the angles are measured in radians, which is default mode, or in degrees.
Performs per-element comparison of two arrays or an array and scalar value. Supports all data types.
The function polarToCart computes the cartesian coordinates of each 2D vector represented by the corresponding elements of magnitude and angle. Supports only ``CV_32F`` and ``CV_64F`` data types.
ocl::dft
------------
Performs a forward or inverse discrete Fourier transform (1D or 2D) of the floating point matrix.
:param dft_size:size of original input, which is used for transformation from complex to real.
:param flags:optional flags:
* **DFT_ROWS** transforms each individual row of the source matrix.
* **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.
* **DFT_INVERSE** inverts DFT. Use for complex-complex cases (real-complex and complex-real cases are always forward and inverse, respectively).
* **DFT_REAL_OUTPUT** specifies the output as real. The source matrix is the result of real-complex transform, so the destination matrix must be real.
Use to handle real matrices (``CV_32FC1``) and complex matrices in the interleaved format (``CV_32FC2``).
The ``dft_size`` must be powers of ``2``, ``3`` and ``5``. Real to complex dft output is not the same with cpu version. Real to complex and complex to real does not support ``DFT_ROWS``.
:param src2:the second source array; must have the same size and same type as ``src1``.
:param src1:the first input array.
:param dst:the destination array; will have the same size as ``src1`` and type ``CV_8UC1``.
:param src2:the second input array, must be the same size and same type as ``src1``.
:param cmpop:the flag specifying the relation between the elements to be checked.
:param dst:the destination array, it will have the same size and same type as ``src1``.
Performs per-element comparison of two arrays or an array and scalar value. Supports all data types.
:param scale:scalar factor.
Computes per-element divide between two arrays or between array and a scalar. Supports all data types.
ocl::exp
------------------
@ -299,6 +233,45 @@ Returns void
The function exp calculates the exponent of every element of the input array. Supports only ``CV_32FC1`` and ``CV_64F`` data types.
ocl::flip
------------------
Returns void
..ocv:function:: void ocl::flip(const oclMat& src, oclMat& dst, int flipCode)
:param src:source image.
:param dst:destination image.
:param flipCode:specifies how to flip the array: 0 means flipping around the x-axis, positive (e.g., 1) means flipping around y-axis, and negative (e.g., -1) means flipping around both axes.
The function flip flips the array in one of three different ways (row and column indices are 0-based). Supports all data types.
:param src1:first multiplied input matrix that should be ``CV_32FC1`` 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:
* **GEMM_1_T** transpose ``src1``.
* **GEMM_2_T** transpose ``src2``.
..seealso:::ocv:func:`gemm`
ocl::log
------------------
Returns void
@ -339,20 +312,6 @@ Returns void
The function magnitude calculates magnitude of 2D vectors formed from the corresponding elements of ``x`` and ``y`` arrays. Supports only ``CV_32F`` and ``CV_64F`` data types.
ocl::flip
------------------
Returns void
..ocv:function:: void ocl::flip(const oclMat& src, oclMat& dst, int flipCode)
:param src:source image.
:param dst:destination image.
:param flipCode:specifies how to flip the array: 0 means flipping around the x-axis, positive (e.g., 1) means flipping around y-axis, and negative (e.g., -1) means flipping around both axes.
The function flip flips the array in one of three different ways (row and column indices are 0-based). Supports all data types.
ocl::meanStdDev
------------------
Returns void
@ -365,7 +324,7 @@ Returns void
:param stddev:the output parameter: computed standard deviation.
The functions meanStdDev compute the mean and the standard deviation M of array elements, independently for each channel, and return it via the output parameters. Supports all data types except ``CV_32F``, ``CV_64F``.
The functions meanStdDev compute the mean and the standard deviation M of array elements, independently for each channel, and return it via the output parameters. Supports all data types.
ocl::merge
------------------
@ -379,17 +338,21 @@ Returns void
Composes a multi-channel array from several single-channel arrays. Supports all data types.
:param dst:The destination array or vector of arrays; The number of arrays must match src.channels(). The arrays themselves will be reallocated if needed
:param src2:the second input array, must be the same size and same type as ``src1``.
The functions split split multi-channel array into separate single-channel arrays. Supports all data types.
:param dst:the destination array, it will have the same size and same type as ``src1``.
:param scale:optional scale factor.
Computes per-element multiply between two arrays or between array and a scalar. Supports all data types.
ocl::norm
------------------
@ -405,103 +368,133 @@ Returns the calculated norm
:param normType:type of the norm.
Calculates absolute array norm, absolute difference norm, or relative difference norm. Supports only ``CV_8UC1`` data type.
The functions ``norm`` calculate an absolute norm of ``src1`` (when there is no ``src2`` ):
:param angleInDegrees:when it is true, the function will compute angle in degrees, otherwise they will be measured in radians.
or
The function phase computes the rotation angle of each 2D vector that is formed from the corresponding elements of ``x`` and ``y``. Supports only ``CV_32FC1`` and ``CV_64FC1`` data type.
:param m:the destination matrix. If it does not have a proper size or type before the operation, it will be reallocated.
:param p:the exponent of power; the source floating-point array of angles of the 2D vectors.
:param rtype:the desired destination matrix type, or rather, the depth (since the number of channels will be the same with the source one). If rtype is negative, the destination matrix will have the same type as the source.
:param y:the destination array, should be the same type as the source.
:param alpha:optional scale factor.
The function pow raises every element of the input array to ``p``. Supports only ``CV_32FC1`` and ``CV_64FC1`` data types.
:param beta:optional delta added to the scaled values.
ocl::transpose
------------------
The method converts source pixel values to the target datatype. Saturate cast is applied in the end to avoid possible overflows. Supports all data types.
:param s:Assigned scalar, which is converted to the actual array type.
:param src:source matrix (real or complex).
:param mask:The operation mask of the same size as ``*this`` and type ``CV_8UC1``.
:param dst:destination matrix (real or complex).
Sets all or some of the array elements to the specified value. This is the advanced variant of Mat::operator=(const Scalar s) operator. Supports all data types.
:param dft_size:size of original input, which is used for transformation from complex to real.
* **DFT_ROWS** transforms each individual row of the source matrix.
:param x:the source floating-point array of x-coordinates of 2D vectors
* **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.
:param y:the source array of y-coordinates of 2D vectors; must have the same size and the same type as ``x``.
* **DFT_INVERSE** inverts DFT. Use for complex-complex cases (real-complex and complex-real cases are always forward and inverse, respectively).
:param angle:the destination array of vector angles; it will have the same size and same type as ``x``.
* **DFT_REAL_OUTPUT** specifies the output as real. The source matrix is the result of real-complex transform, so the destination matrix must be real.
:param angleInDegrees:when it is true, the function will compute angle in degrees, otherwise they will be measured in radians.
Use to handle real matrices (``CV_32FC1``) and complex matrices in the interleaved format (``CV_32FC2``).
The function phase computes the rotation angle of each 2D vector that is formed from the corresponding elements of ``x`` and ``y``. Supports only ``CV_32FC1`` and ``CV_64FC1`` data type.
The ``dft_size`` must be powers of ``2``, ``3`` and ``5``. Real to complex dft output is not the same with cpu version. Real to complex and complex to real does not support ``DFT_ROWS``.
:param magnitude:the 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's not empty, it must have the same size and same type as ``angle``.
:param angle:the source floating-point array of angles of the 2D vectors.
:param x:the destination array of x-coordinates of 2D vectors; will have the same size and the same type as ``angle``.
:param y:the destination array of y-coordinates of 2D vectors; will have the same size and the same type as ``angle``.
:param angleInDegrees:the flag indicating whether the angles are measured in radians, which is default mode, or in degrees.
The function polarToCart computes the cartesian coordinates of each 2D vector represented by the corresponding elements of magnitude and angle. Supports only ``CV_32F`` and ``CV_64F`` data types.
:param dst:The destination array or vector of arrays; The number of arrays must match src.channels(). The arrays themselves will be reallocated if needed.
The functions split split multi-channel array into separate single-channel arrays. Supports all data types.