2011-03-05 22:26:13 +01:00
|
|
|
Per-element Operations.
|
|
|
|
=======================
|
|
|
|
|
|
|
|
.. highlight:: cpp
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
|
|
|
|
|
2011-03-05 22:26:13 +01:00
|
|
|
.. index:: gpu::add
|
|
|
|
|
|
|
|
gpu::add
|
|
|
|
------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::add(const GpuMat& a, const GpuMat& b, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Computes matrix-matrix or matrix-scalar sum.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1`` and ``CV_32FC1`` matrices are supported for now.
|
|
|
|
|
|
|
|
:param b: Second source matrix. Must have the same size and type as ``a``.
|
|
|
|
|
|
|
|
:param c: Destination matrix. Will have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::add(const GpuMat& a, const Scalar& sc, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param b: Source scalar to be added to the source matrix.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param c: Destination matrix. Will have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
See also: :c:func:`add`.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::subtract
|
|
|
|
|
|
|
|
gpu::subtract
|
|
|
|
-----------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::subtract(const GpuMat& a, const GpuMat& b, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Subtracts matrix from another matrix (or scalar from matrix).
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1`` and ``CV_32FC1`` matrices are supported for now.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param b: Second source matrix. Must have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param c: Destination matrix. Will have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::subtract(const GpuMat& a, const Scalar& sc, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param b: Scalar to be subtracted from the source matrix elements.
|
|
|
|
|
|
|
|
:param c: Destination matrix. Will have the same size and type as ``a``.
|
|
|
|
|
|
|
|
See also: :c:func:`subtract`.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::multiply
|
|
|
|
|
|
|
|
gpu::multiply
|
|
|
|
-----------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::multiply(const GpuMat& a, const GpuMat& b, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Computes per-element product of two matrices (or of matrix and scalar).
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1`` and ``CV_32FC1`` matrices are supported for now.
|
|
|
|
|
|
|
|
:param b: Second source matrix. Must have the same size and type as ``a``.
|
|
|
|
|
|
|
|
:param c: Destionation matrix. Will have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::multiply(const GpuMat& a, const Scalar& sc, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param b: Scalar to be multiplied by.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param c: Destination matrix. Will have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
See also: :c:func:`multiply`.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::divide
|
|
|
|
|
|
|
|
gpu::divide
|
|
|
|
---------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::divide(const GpuMat& a, const GpuMat& b, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Performs per-element division of two matrices (or division of matrix by scalar).
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1`` and ``CV_32FC1`` matrices are supported for now.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param b: Second source matrix. Must have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param c: Destionation matrix. Will have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::divide(const GpuMat& a, const Scalar& sc, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param b: Scalar to be divided by.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param c: Destination matrix. Will have the same size and type as ``a``.
|
|
|
|
|
|
|
|
This function in contrast to :func:`divide` uses round-down rounding mode.
|
|
|
|
|
|
|
|
See also: :c:func:`divide`.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::exp
|
|
|
|
|
|
|
|
gpu::exp
|
|
|
|
------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::exp(const GpuMat& a, GpuMat& b)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Computes exponent of each matrix element.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: Source matrix. ``CV_32FC1`` matrixes are supported for now.
|
|
|
|
|
|
|
|
:param b: Destination matrix. Will have the same size and type as ``a``.
|
|
|
|
|
|
|
|
See also: :c:func:`exp`.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::log
|
|
|
|
|
|
|
|
gpu::log
|
|
|
|
------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::log(const GpuMat& a, GpuMat& b)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Computes natural logarithm of absolute value of each matrix element.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: Source matrix. ``CV_32FC1`` matrixes are supported for now.
|
|
|
|
|
|
|
|
:param b: Destination matrix. Will have the same size and type as ``a``.
|
|
|
|
|
|
|
|
See also: :c:func:`log`.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::absdiff
|
|
|
|
|
|
|
|
gpu::absdiff
|
|
|
|
----------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::absdiff(const GpuMat& a, const GpuMat& b, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Computes per-element absolute difference of two matrices (or of matrix and scalar).
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1`` and ``CV_32FC1`` matrices are supported for now.
|
|
|
|
|
|
|
|
:param b: Second source matrix. Must have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param c: Destionation matrix. Will have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::absdiff(const GpuMat& a, const Scalar& s, GpuMat& c)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: Source matrix. ``CV_32FC1`` matrixes are supported for now.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param b: Scalar to be subtracted from the source matrix elements.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param c: Destination matrix. Will have the same size and type as ``a``.
|
|
|
|
|
|
|
|
See also: :c:func:`absdiff`.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::compare
|
|
|
|
|
|
|
|
gpu::compare
|
|
|
|
----------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::compare(const GpuMat& a, const GpuMat& b, GpuMat& c, int cmpop)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Compares elements of two matrices.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param a: First source matrix. ``CV_8UC4`` and ``CV_32FC1`` matrices are supported for now.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param b: Second source matrix. Must have the same size and type as ``a``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param c: Destination matrix. Will have the same size as ``a`` and be ``CV_8UC1`` type.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
:param cmpop: Flag specifying the relation between the elements to be checked:
|
|
|
|
|
|
|
|
* **CMP_EQ** :math:`=`
|
|
|
|
* **CMP_GT** :math:`>`
|
|
|
|
* **CMP_GE** :math:`\ge`
|
|
|
|
* **CMP_LT** :math:`<`
|
|
|
|
* **CMP_LE** :math:`\le`
|
|
|
|
* **CMP_NE** :math:`\ne`
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
See also: :c:func:`compare`.
|
|
|
|
|
|
|
|
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
.. index:: gpu::bitwise_not
|
|
|
|
|
|
|
|
gpu::bitwise_not
|
|
|
|
--------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::bitwise_not(const GpuMat& src, GpuMat& dst, const GpuMat& mask=GpuMat())
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::bitwise_not(const GpuMat& src, GpuMat& dst, const GpuMat& mask, const Stream& stream)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Performs per-element bitwise inversion.
|
|
|
|
|
|
|
|
:param src: Source matrix.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param dst: Destination matrix. Will have the same size and type as ``src``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
:param mask: Optional operation mask. 8-bit single channel image.
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
|
2011-03-05 22:26:13 +01:00
|
|
|
.. index:: gpu::bitwise_or
|
|
|
|
|
|
|
|
gpu::bitwise_or
|
|
|
|
-------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::bitwise_or(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask=GpuMat())
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::bitwise_or(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask, const Stream& stream)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Performs per-element bitwise disjunction of two matrices.
|
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src2: Second source matrix. It must have the same size and type as ``src1``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param dst: Destination matrix. Will have the same size and type as ``src1``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
:param mask: Optional operation mask. 8-bit single channel image.
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
|
|
|
|
|
2011-03-05 22:26:13 +01:00
|
|
|
.. index:: gpu::bitwise_and
|
|
|
|
|
|
|
|
gpu::bitwise_and
|
|
|
|
--------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::bitwise_and(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask=GpuMat())
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::bitwise_and(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask, const Stream& stream)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Performs per-element bitwise conjunction of two matrices.
|
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src2: Second source matrix. It must have the same size and type as ``src1``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param dst: Destination matrix. Will have the same size and type as ``src1``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
:param mask: Optional operation mask. 8-bit single channel image.
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
|
2011-03-05 22:26:13 +01:00
|
|
|
.. index:: gpu::bitwise_xor
|
|
|
|
|
|
|
|
gpu::bitwise_xor
|
|
|
|
--------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::bitwise_xor(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask=GpuMat())
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::bitwise_xor(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask, const Stream& stream)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
Performs per-element bitwise "exclusive or" of two matrices.
|
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src2: Second source matrix. It must have the same size and type as ``src1``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param dst: Destination matrix. Will have the same size and type as ``src1``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
:param mask: Optional operation mask. 8-bit single channel image.
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
|
2011-03-05 22:26:13 +01:00
|
|
|
.. index:: gpu::min
|
|
|
|
|
|
|
|
gpu::min
|
|
|
|
------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::min(const GpuMat& src1, const GpuMat& src2, GpuMat& dst)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::min(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const Stream& stream)
|
|
|
|
|
|
|
|
.. cpp:function:: void gpu::min(const GpuMat& src1, double value, GpuMat& dst)
|
|
|
|
|
|
|
|
.. cpp:function:: void gpu::min(const GpuMat& src1, double value, GpuMat& dst, const Stream& stream)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-08 23:22:24 +01:00
|
|
|
Computes per-element minimum of two matrices (or a matrix and a scalar).
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
|
|
|
:param src2: Second source matrix.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param value: Scalar value to compare ``src1`` elements with.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param dst: Destination matrix. Will have the same size and type as ``src1``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param stream: Stream for the asynchronous version.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
See also: :c:func:`min`.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::max
|
|
|
|
|
|
|
|
gpu::max
|
|
|
|
------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::max(const GpuMat& src1, const GpuMat& src2, GpuMat& dst)
|
2011-03-08 23:22:24 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::max(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const Stream& stream)
|
2011-03-08 23:22:24 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::max(const GpuMat& src1, double value, GpuMat& dst)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::max(const GpuMat& src1, double value, GpuMat& dst, const Stream& stream)
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-08 23:22:24 +01:00
|
|
|
Computes per-element maximum of two matrices (or a matrix and a scalar).
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
|
|
|
:param src2: Second source matrix.
|
2011-03-08 23:22:24 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param value: Scalar value to compare ``src1`` elements with.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param dst: Destination matrix. Will have the same size and type as ``src1``.
|
2011-03-05 22:26:13 +01:00
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
See also: :c:func:`max`.
|