2011-02-22 21:43:26 +01:00
|
|
|
Operations on Matrices
|
|
|
|
======================
|
|
|
|
|
|
|
|
.. highlight:: cpp
|
|
|
|
|
|
|
|
.. index:: gpu::transpose
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::transpose
|
2011-02-22 21:43:26 +01:00
|
|
|
------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::transpose(const GpuMat& src, GpuMat& dst)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Transposes a matrix.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param src: Source matrix. 1, 4, 8 bytes element sizes are supported for now.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param dst: Destination matrix.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
See Also:
|
2011-06-08 00:51:31 +02:00
|
|
|
:c:cpp:func:`transpose`
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::flip
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::flip
|
2011-02-22 21:43:26 +01:00
|
|
|
-------------
|
2011-03-29 01:05:42 +02:00
|
|
|
.. cpp:function:: void gpu::flip(const GpuMat& src, GpuMat& dst, int flipCode)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
Flips a 2D matrix around vertical, horizontal, or both axes.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param src: Source matrix. Only ``CV_8UC1`` and ``CV_8UC4`` matrices are supported for now.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param dst: Destination matrix.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param flipCode: Flip mode for the source:
|
2011-02-28 22:26:43 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
* ``0`` Flips around x-axis.
|
2011-02-28 22:26:43 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
* ``>0`` Flips around y-axis.
|
|
|
|
|
|
|
|
* ``<0`` Flips around both axes.
|
2011-02-28 22:26:43 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
See Also:
|
2011-06-08 00:51:31 +02:00
|
|
|
:c:cpp:func:`flip`
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::LUT
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::LUT
|
2011-02-22 21:43:26 +01:00
|
|
|
------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::LUT(const GpuMat& src, const Mat& lut, GpuMat& dst)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
Transforms the source matrix into the destination matrix using the given look-up table: ``dst(I) = lut(src(I))``
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param src: Source matrix. ``CV_8UC1`` and ``CV_8UC3`` matrices are supported for now.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-04-01 00:07:17 +02:00
|
|
|
:param lut: Look-up table of 256 elements. It is a continuous ``CV_8U`` matrix.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-04-01 00:07:17 +02:00
|
|
|
:param dst: Destination matrix with the same depth as ``lut`` and the same number of channels as ``src``.
|
2011-03-29 01:05:42 +02:00
|
|
|
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-06-08 00:51:31 +02:00
|
|
|
See Also: :c:cpp:func:`LUT`
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::merge
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::merge
|
2011-02-22 21:43:26 +01:00
|
|
|
--------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::merge(const GpuMat* src, size_t n, GpuMat& dst)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::merge(const GpuMat* src, size_t n, GpuMat& dst, const Stream& stream)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::merge(const vector<GpuMat>& src, GpuMat& dst)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::merge(const vector<GpuMat>& src, GpuMat& dst, const Stream& stream)
|
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
Makes a multi-channel matrix out of several single-channel matrices.
|
2011-03-23 11:56:20 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param src: Array/vector of source matrices.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param n: Number of source matrices.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param dst: Destination matrix.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param stream: Stream for the asynchronous version.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-06-08 00:51:31 +02:00
|
|
|
See Also: :c:cpp:func:`merge`
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::split
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::split
|
2011-02-22 21:43:26 +01:00
|
|
|
--------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::split(const GpuMat& src, GpuMat* dst)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::split(const GpuMat& src, GpuMat* dst, const Stream& stream)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::split(const GpuMat& src, vector<GpuMat>& dst)
|
|
|
|
|
|
|
|
.. cpp:function:: void gpu::split(const GpuMat& src, vector<GpuMat>& dst, const Stream& stream)
|
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
Copies each plane of a multi-channel matrix into an array.
|
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param src: Source matrix.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param dst: The destination array/vector of single-channel matrices.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param stream: Stream for the asynchronous version.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-06-08 00:51:31 +02:00
|
|
|
See Also: :c:cpp:func:`split`
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::magnitude
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::magnitude
|
2011-02-22 21:43:26 +01:00
|
|
|
------------------
|
2011-03-29 01:05:42 +02:00
|
|
|
.. cpp:function:: void gpu::magnitude(const GpuMat& xy, GpuMat& magnitude)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::magnitude(const GpuMat& x, const GpuMat& y, GpuMat& magnitude)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::magnitude(const GpuMat& x, const GpuMat& y, GpuMat& magnitude, const Stream& stream)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
Computes magnitudes of complex matrix elements.
|
|
|
|
|
|
|
|
:param xy: Source complex matrix in the interleaved format (``CV_32FC2``).
|
|
|
|
|
2011-04-01 00:07:17 +02:00
|
|
|
:param x: Source matrix containing real components (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-04-01 00:07:17 +02:00
|
|
|
:param y: Source matrix containing imaginary components (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param magnitude: Destination matrix of float magnitudes (``CV_32FC1``).
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
See Also:
|
2011-06-08 00:51:31 +02:00
|
|
|
:c:cpp:func:`magnitude`
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::magnitudeSqr
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::magnitudeSqr
|
2011-02-22 21:43:26 +01:00
|
|
|
---------------------
|
2011-03-29 01:05:42 +02:00
|
|
|
.. cpp:function:: void gpu::magnitudeSqr(const GpuMat& xy, GpuMat& magnitude)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::magnitudeSqr(const GpuMat& x, const GpuMat& y, GpuMat& magnitude)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::magnitudeSqr(const GpuMat& x, const GpuMat& y, GpuMat& magnitude, const Stream& stream)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
Computes squared magnitudes of complex matrix elements.
|
|
|
|
|
|
|
|
:param xy: Source complex matrix in the interleaved format (``CV_32FC2``).
|
|
|
|
|
2011-04-01 00:07:17 +02:00
|
|
|
:param x: Source matrix containing real components (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-04-01 00:07:17 +02:00
|
|
|
:param y: Source matrix containing imaginary components (``CV_32FC1``).
|
2011-03-23 11:56:20 +01:00
|
|
|
|
|
|
|
:param magnitude: Destination matrix of float magnitude squares (``CV_32FC1``).
|
|
|
|
|
|
|
|
:param stream: Stream for the asynchronous version.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::phase
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::phase
|
2011-02-22 21:43:26 +01:00
|
|
|
--------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::phase(const GpuMat& x, const GpuMat& y, GpuMat& angle, bool angleInDegrees=false)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::phase(const GpuMat& x, const GpuMat& y, GpuMat& angle, bool angleInDegrees, const Stream& stream)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Computes polar angles of complex matrix elements.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param x: Source matrix containing real components (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param y: Source matrix containing imaginary components (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param angle: Destionation matrix of angles (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param angleInDegress: Flag for angles that must be evaluated in degress.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param stream: Stream for the asynchronous version.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
See Also:
|
2011-06-08 00:51:31 +02:00
|
|
|
:c:cpp:func:`phase`
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::cartToPolar
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::cartToPolar
|
2011-02-22 21:43:26 +01:00
|
|
|
--------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::cartToPolar(const GpuMat& x, const GpuMat& y, GpuMat& magnitude, GpuMat& angle, bool angleInDegrees=false)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::cartToPolar(const GpuMat& x, const GpuMat& y, GpuMat& magnitude, GpuMat& angle, bool angleInDegrees, const Stream& stream)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Converts Cartesian coordinates into polar.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param x: Source matrix containing real components (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param y: Source matrix containing imaginary components (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param magnitude: Destination matrix of float magnitudes (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param angle: Destionation matrix of angles (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param angleInDegress: Flag for angles that must be evaluated in degress.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param stream: Stream for the asynchronous version.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
See Also:
|
2011-06-08 00:51:31 +02:00
|
|
|
:c:cpp:func:`cartToPolar`
|
2011-02-22 21:43:26 +01:00
|
|
|
|
|
|
|
.. index:: gpu::polarToCart
|
|
|
|
|
2011-03-03 08:29:55 +01:00
|
|
|
gpu::polarToCart
|
2011-02-22 21:43:26 +01:00
|
|
|
--------------------
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::polarToCart(const GpuMat& magnitude, const GpuMat& angle, GpuMat& x, GpuMat& y, bool angleInDegrees=false)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
.. cpp:function:: void gpu::polarToCart(const GpuMat& magnitude, const GpuMat& angle, GpuMat& x, GpuMat& y, bool angleInDegrees, const Stream& stream)
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
Converts polar coordinates into Cartesian.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param magnitude: Source matrix containing magnitudes (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param angle: Source matrix containing angles (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param x: Destination matrix of real components (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-23 11:56:20 +01:00
|
|
|
:param y: Destination matrix of imaginary components (``CV_32FC1``).
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
:param angleInDegress: Flag that indicates angles in degress.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-02-26 12:05:10 +01:00
|
|
|
:param stream: Stream for the asynchronous version.
|
2011-02-22 21:43:26 +01:00
|
|
|
|
2011-03-29 01:05:42 +02:00
|
|
|
See Also:
|
2011-06-08 00:51:31 +02:00
|
|
|
:c:cpp:func:`polarToCart`
|