2011-02-22 21:43:26 +01:00
|
|
|
Matrix Reductions
|
|
|
|
=================
|
|
|
|
|
|
|
|
.. highlight:: cpp
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
|
|
|
|
|
2011-02-22 21:43:26 +01:00
|
|
|
.. index:: gpu::meanStdDev
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::meanStdDev
|
2011-02-22 21:43:26 +01:00
|
|
|
-------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::meanStdDev(const GpuMat& mtx, Scalar& mean, Scalar& stddev)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Computes mean value and standard deviation of matrix elements.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param mtx: Source matrix. ``CV_8UC1`` matrices are supported for now.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param mean: Mean value.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param stddev: Standard deviation value.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
See also: :c:func:`meanStdDev`.
|
|
|
|
|
|
|
|
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::norm
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::norm
|
2011-02-22 21:43:26 +01:00
|
|
|
-------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: double gpu::norm(const GpuMat& src, int normType=NORM_L2)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Returns norm of matrix (or of two matrices difference).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param src: Source matrix. Any matrices except 64F are supported.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param normType: Norm type. ``NORM_L1``, ``NORM_L2`` and ``NORM_INF`` are supported for now.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: double gpu::norm(const GpuMat& src, int normType, GpuMat& buf)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src: Source matrix. Any matrices except 64F are supported.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param normType: Norm type. ``NORM_L1``, ``NORM_L2`` and ``NORM_INF`` are supported for now.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param buf: Optional buffer to avoid extra memory allocations. It's resized automatically.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: double gpu::norm(const GpuMat& src1, const GpuMat& src2, int normType=NORM_L2)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src1: First source matrix. ``CV_8UC1`` matrices are supported for now.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src2: Second source matrix. Must have the same size and type as ``src1``.
|
|
|
|
|
|
|
|
:param normType: Norm type. ``NORM_L1``, ``NORM_L2`` and ``NORM_INF`` are supported for now.
|
|
|
|
|
|
|
|
See also: :c:func:`norm`.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::sum
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::sum
|
2011-02-22 21:43:26 +01:00
|
|
|
------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: Scalar gpu::sum(const GpuMat& src)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: Scalar gpu::sum(const GpuMat& src, GpuMat& buf)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Returns sum of matrix elements.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src: Source image of any depth except ``CV_64F``.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param buf: Optional buffer to avoid extra memory allocations. It's resized automatically.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
See also: :c:func:`sum`.
|
|
|
|
|
|
|
|
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::absSum
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::absSum
|
2011-02-22 21:43:26 +01:00
|
|
|
---------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: Scalar gpu::absSum(const GpuMat& src)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: Scalar gpu::absSum(const GpuMat& src, GpuMat\& buf)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Returns sum of matrix elements absolute values.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src: Source image of any depth except ``CV_64F``.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param buf: Optional buffer to avoid extra memory allocations. It's resized automatically.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
|
|
|
|
|
2011-02-22 21:43:26 +01:00
|
|
|
.. index:: gpu::sqrSum
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::sqrSum
|
2011-02-22 21:43:26 +01:00
|
|
|
---------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: Scalar gpu::sqrSum(const GpuMat& src)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: Scalar gpu::sqrSum(const GpuMat& src, GpuMat\& buf)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Returns squared sum of matrix elements.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src: Source image of any depth except ``CV_64F``.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param buf: Optional buffer to avoid extra memory allocations. It's resized automatically.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
|
|
|
|
|
2011-02-22 21:43:26 +01:00
|
|
|
.. index:: gpu::minMax
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::minMax
|
2011-02-22 21:43:26 +01:00
|
|
|
---------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::minMax(const GpuMat& src, double* minVal, double* maxVal=0, const GpuMat& mask=GpuMat())
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const GpuMat& mask, GpuMat& buf)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Finds global minimum and maximum matrix elements and returns their values.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param src: Single-channel source image.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param minVal: Pointer to returned minimum value. ``NULL`` if not required.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param maxVal: Pointer to returned maximum value. ``NULL`` if not required.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param mask: Optional mask to select a sub-matrix.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param buf: Optional buffer to avoid extra memory allocations. It's resized automatically.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
Function doesn't work with ``CV_64F`` images on GPU with compute capability :math:`<` 1.3.
|
|
|
|
|
|
|
|
See also: :c:func:`minMaxLoc`.
|
|
|
|
|
|
|
|
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::minMaxLoc
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::minMaxLoc
|
2011-02-22 21:43:26 +01:00
|
|
|
------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, const GpuMat& mask=GpuMat())
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point* minLoc, Point* maxLoc, const GpuMat& mask, GpuMat& valbuf, GpuMat& locbuf)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Finds global minimum and maximum matrix elements and returns their values with locations.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param src: Single-channel source image.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param minVal: Pointer to returned minimum value. ``NULL`` if not required.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param maxVal: Pointer to returned maximum value. ``NULL`` if not required.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param minValLoc: Pointer to returned minimum location. ``NULL`` if not required.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param maxValLoc: Pointer to returned maximum location. ``NULL`` if not required.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param mask: Optional mask to select a sub-matrix.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param valbuf: Optional values buffer to avoid extra memory allocations. It's resized automatically.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param locbuf: Optional locations buffer to avoid extra memory allocations. It's resized automatically.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
Function doesn't work with ``CV_64F`` images on GPU with compute capability :math:`<` 1.3.
|
|
|
|
|
|
|
|
See also: :c:func:`minMaxLoc`.
|
|
|
|
|
|
|
|
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
.. index:: gpu::countNonZero
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::countNonZero
|
2011-02-22 21:43:26 +01:00
|
|
|
---------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: int gpu::countNonZero(const GpuMat& src)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: int gpu::countNonZero(const GpuMat& src, GpuMat& buf)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Counts non-zero matrix elements.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param src: Single-channel source image.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param buf: Optional buffer to avoid extra memory allocations. It's resized automatically.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
Function doesn't work with ``CV_64F`` images on GPU with compute capability :math:`<` 1.3.
|
|
|
|
|
|
|
|
See also: :c:func:`countNonZero`.
|