Open Source Computer Vision Library https://opencv.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

80 lines
2.4 KiB

Matrix Reductions
=============================
.. highlight:: cpp
ocl::countNonZero
---------------------
Returns the number of non-zero elements in src
.. ocv:function:: int ocl::countNonZero(const oclMat &src)
:param src: Single-channel array
Counts non-zero array elements.
ocl::minMax
------------------
Returns void
.. ocv:function:: void ocl::minMax(const oclMat &src, double *minVal, double *maxVal = 0, const oclMat &mask = oclMat())
:param src: Single-channel array
:param minVal: Pointer to returned minimum value, should not be NULL
:param maxVal: Pointer to returned maximum value, should not be NULL
:param mask: The optional mask used to select a sub-array
Finds global minimum and maximum in a whole array or sub-array. Supports all data types.
ocl::minMaxLoc
------------------
Returns void
.. ocv:function:: void ocl::minMaxLoc(const oclMat &src, double *minVal, double *maxVal = 0, Point *minLoc = 0, Point *maxLoc = 0,const oclMat &mask = oclMat())
:param src: Single-channel array
:param minVal: Pointer to returned minimum value, should not be NULL
:param maxVal: Pointer to returned maximum value, should not be NULL
:param minLoc: Pointer to returned minimum location (in 2D case), should not be NULL
:param maxLoc: Pointer to returned maximum location (in 2D case) should not be NULL
:param mask: The optional mask used to select a sub-array
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
------------------
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.
.. ocv:function:: Scalar ocl::absSum(const oclMat &m)
:param m: The Source image of all depth.
Counts the abs sum of matrix elements for each channel.
ocl::sqrSum
------------------
Returns the squared sum of matrix elements for each channel
.. ocv:function:: Scalar ocl::sqrSum(const oclMat &m)
:param m: The Source image of all depth.
Counts the squared sum of matrix elements for each channel.