2011-06-19 04:19:03 +08:00
|
|
|
Per-element Operations
|
2011-03-06 05:26:13 +08:00
|
|
|
=======================
|
|
|
|
|
|
|
|
.. highlight:: cpp
|
|
|
|
|
2011-03-23 18:56:20 +08:00
|
|
|
|
|
|
|
|
2011-03-06 05:26:13 +08:00
|
|
|
.. index:: gpu::add
|
|
|
|
|
|
|
|
gpu::add
|
|
|
|
------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::add(const GpuMat& src1, const GpuMat& src2, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::add(const GpuMat& src1, const Scalar& src2, GpuMat& dst)
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
Computes a matrix-matrix or matrix-scalar sum.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-04-01 06:07:17 +08:00
|
|
|
:param src1: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1``, and ``CV_32FC1`` matrices are supported for now.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src2: Second source matrix or a scalar to be added to ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso::
|
|
|
|
:ocv:func:`add`
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
.. index:: gpu::subtract
|
|
|
|
|
|
|
|
gpu::subtract
|
|
|
|
-----------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::subtract(const GpuMat& src1, const GpuMat& src2, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::subtract(const GpuMat& src1, const Scalar& src2, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-04-01 06:07:17 +08:00
|
|
|
Computes a matrix-matrix or matrix-scalar difference.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-04-01 06:07:17 +08:00
|
|
|
:param src1: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1``, and ``CV_32FC1`` matrices are supported for now.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src2: Second source matrix or a scalar to be subtracted from ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso::
|
|
|
|
:ocv:func:`subtract`
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::multiply
|
|
|
|
|
|
|
|
gpu::multiply
|
|
|
|
-----------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::multiply(const GpuMat& src1, const GpuMat& src2, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::multiply(const GpuMat& src1, const Scalar& src2, GpuMat& dst)
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
Computes a matrix-matrix or matrix-scalar per-element product.
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-04-01 06:07:17 +08:00
|
|
|
:param src1: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1``, and ``CV_32FC1`` matrices are supported for now.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src2: Second source matrix or a scalar to be multiplied by ``src1`` elements.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso::
|
|
|
|
:ocv:func:`multiply`
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::divide
|
|
|
|
|
|
|
|
gpu::divide
|
|
|
|
---------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::divide(const GpuMat& src1, const GpuMat& src2, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::divide(const GpuMat& src1, const Scalar& src2, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
Computes a matrix-matrix or matrix-scalar sum.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-04-01 06:07:17 +08:00
|
|
|
:param src1: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1``, and ``CV_32FC1`` matrices are supported for now.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src2: Second source matrix or a scalar. The ``src1`` elements are divided by it.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
This function, in contrast to :ocv:func:`divide`, uses a round-down rounding mode.
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso::
|
|
|
|
:ocv:func:`divide`
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::exp
|
|
|
|
|
|
|
|
gpu::exp
|
|
|
|
------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::exp(const GpuMat& src, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
Computes an exponent of each matrix element.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src: Source matrix. ``CV_32FC1`` matrixes are supported for now.
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src``.
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso::
|
|
|
|
:ocv:func:`exp`
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::log
|
|
|
|
|
|
|
|
gpu::log
|
|
|
|
------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::log(const GpuMat& src, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
Computes a natural logarithm of absolute value of each matrix element.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src: Source matrix. ``CV_32FC1`` matrixes are supported for now.
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src``.
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso:: :ocv:func:`log`
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::absdiff
|
|
|
|
|
|
|
|
gpu::absdiff
|
|
|
|
----------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::absdiff(const GpuMat& src1, const GpuMat& src2, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::absdiff(const GpuMat& src1, const Scalar& src2, GpuMat& dst)
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
Computes per-element absolute difference of two matrices (or of a matrix and scalar).
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src1: First source matrix. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1`` and ``CV_32FC1`` matrices are supported for now.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src2: Second source matrix or a scalar to be added to ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso::
|
|
|
|
:ocv:func:`absdiff`
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
.. index:: gpu::compare
|
|
|
|
|
|
|
|
gpu::compare
|
|
|
|
----------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::compare(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, int cmpop)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
Compares elements of two matrices.
|
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src1: First source matrix. ``CV_8UC4`` and ``CV_32FC1`` matrices are supported for now.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param src2: Second source matrix with the same size and type as ``a``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size as ``a`` and the ``CV_8UC1`` type.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param cmpop: Flag specifying the relation between the elements to be checked:
|
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
* **CMP_EQ:** ``src1(.) == src2(.)``
|
|
|
|
* **CMP_GT:** ``src1(.) < src2(.)``
|
|
|
|
* **CMP_GE:** ``src1(.) <= src2(.)``
|
|
|
|
* **CMP_LT:** ``src1(.) < src2(.)``
|
|
|
|
* **CMP_LE:** ``src1(.) <= src2(.)``
|
|
|
|
* **CMP_NE:** ``src1(.) != src2(.)``
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso::
|
|
|
|
:ocv:func:`compare`
|
2011-03-23 18:56:20 +08:00
|
|
|
|
|
|
|
|
2011-03-06 05:26:13 +08:00
|
|
|
.. index:: gpu::bitwise_not
|
|
|
|
|
|
|
|
gpu::bitwise_not
|
|
|
|
--------------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::bitwise_not(const GpuMat& src, GpuMat& dst, const GpuMat& mask=GpuMat())
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::bitwise_not(const GpuMat& src, GpuMat& dst, const GpuMat& mask, const Stream& stream)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-04-01 06:07:17 +08:00
|
|
|
Performs a per-element bitwise inversion.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param src: Source matrix.
|
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param mask: Optional operation mask. 8-bit single channel image.
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
|
|
|
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-03-06 05:26:13 +08:00
|
|
|
.. index:: gpu::bitwise_or
|
|
|
|
|
|
|
|
gpu::bitwise_or
|
|
|
|
-------------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::bitwise_or(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask=GpuMat())
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::bitwise_or(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask, const Stream& stream)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-04-01 06:07:17 +08:00
|
|
|
Performs a per-element bitwise disjunction of two matrices.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param src2: Second source matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param mask: Optional operation mask. 8-bit single channel image.
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
2011-03-23 18:56:20 +08:00
|
|
|
|
|
|
|
|
2011-03-06 05:26:13 +08:00
|
|
|
.. index:: gpu::bitwise_and
|
|
|
|
|
|
|
|
gpu::bitwise_and
|
|
|
|
--------------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::bitwise_and(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask=GpuMat())
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::bitwise_and(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask, const Stream& stream)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-04-01 06:07:17 +08:00
|
|
|
Performs a per-element bitwise conjunction of two matrices.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param src2: Second source matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param mask: Optional operation mask. 8-bit single channel image.
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
|
|
|
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-03-06 05:26:13 +08:00
|
|
|
.. index:: gpu::bitwise_xor
|
|
|
|
|
|
|
|
gpu::bitwise_xor
|
|
|
|
--------------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::bitwise_xor(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask=GpuMat())
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::bitwise_xor(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask, const Stream& stream)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
Performs a per-element bitwise ``exclusive or`` operation of two matrices.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param src2: Second source matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param mask: Optional operation mask. 8-bit single channel image.
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
|
|
|
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-03-06 05:26:13 +08:00
|
|
|
.. index:: gpu::min
|
|
|
|
|
|
|
|
gpu::min
|
|
|
|
------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::min(const GpuMat& src1, const GpuMat& src2, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::min(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const Stream& stream)
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::min(const GpuMat& src1, double src2, GpuMat& dst)
|
2011-03-23 18:56:20 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::min(const GpuMat& src1, double src2, GpuMat& dst, const Stream& stream)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
Computes the per-element minimum of two matrices (or a matrix and a scalar).
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param src2: Second source matrix or a scalar to compare ``src1`` elements with.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-23 18:56:20 +08:00
|
|
|
:param stream: Stream for the asynchronous version.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso::
|
|
|
|
:ocv:func:`min`
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. index:: gpu::max
|
|
|
|
|
|
|
|
gpu::max
|
|
|
|
------------
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::max(const GpuMat& src1, const GpuMat& src2, GpuMat& dst)
|
2011-03-09 06:22:24 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::max(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const Stream& stream)
|
2011-03-09 06:22:24 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::max(const GpuMat& src1, double src2, GpuMat& dst)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-06-16 20:48:23 +08:00
|
|
|
.. ocv:function:: void gpu::max(const GpuMat& src1, double src2, GpuMat& dst, const Stream& stream)
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
Computes the per-element maximum of two matrices (or a matrix and a scalar).
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param src1: First source matrix.
|
|
|
|
|
2011-03-29 07:05:42 +08:00
|
|
|
:param src2: Second source matrix or a scalar to compare ``src1`` elements with.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
2011-03-30 05:48:36 +08:00
|
|
|
:param dst: Destination matrix with the same size and type as ``src1``.
|
2011-03-06 05:26:13 +08:00
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
|
|
|
|
2011-06-19 04:19:03 +08:00
|
|
|
.. seealso::
|
|
|
|
:ocv:func:`max`
|