opencv/modules/gpu/doc/operations_on_matrices.rst

249 lines
7.3 KiB
ReStructuredText
Raw Normal View History

Operations on Matrices
======================
.. highlight:: cpp
.. index:: gpu::transpose
cv::gpu::transpose
------------------
.. cfunction:: void transpose(const GpuMat\& src, GpuMat\& dst)
2011-02-26 19:05:10 +08:00
Transposes a matrix.
2011-02-26 19:05:10 +08:00
:param src: Source matrix. 1, 4, 8 bytes element sizes are supported for now.
2011-02-26 19:05:10 +08:00
:param dst: Destination matrix.
2011-02-26 19:05:10 +08:00
See also:
:func:`transpose` .
.. index:: gpu::flip
cv::gpu::flip
-------------
2011-02-26 19:05:10 +08:00
.. cfunction:: void flip(const GpuMat\& a, GpuMat\& b, int flipCode)
2011-02-26 19:05:10 +08:00
Flips a 2D matrix around vertical, horizontal or both axes.
2011-02-26 19:05:10 +08:00
:param a: Source matrix. Only ``CV_8UC1`` and ``CV_8UC4`` matrices are supported for now.
2011-02-26 19:05:10 +08:00
:param b: Destination matrix.
2011-02-26 19:05:10 +08:00
:param flipCode: Specifies how to flip the source:
* **0** Flip around x-axis.
* **:math:`>`0** Flip around y-axis.
* **:math:`<`0** Flip around both axes.
2011-02-26 19:05:10 +08:00
See also:
:func:`flip` .
.. index:: gpu::LUT
cv::gpu::LUT
------------
.. math::
2011-02-26 19:05:10 +08:00
dst(I) = lut(src(I))
.. cfunction:: void LUT(const GpuMat\& src, const Mat\& lut, GpuMat\& dst)
2011-02-26 19:05:10 +08:00
Transforms the source matrix into the destination matrix using given look-up table:
2011-02-26 19:05:10 +08:00
:param src: Source matrix. ``CV_8UC1`` and ``CV_8UC3`` matrixes are supported for now.
2011-02-26 19:05:10 +08:00
:param lut: Look-up table. Must be continuous, ``CV_8U`` depth matrix. Its area must satisfy to ``lut.rows`` :math:`\times` ``lut.cols`` = 256 condition.
2011-02-26 19:05:10 +08:00
:param dst: Destination matrix. Will have the same depth as ``lut`` and the same number of channels as ``src`` .
2011-02-26 19:05:10 +08:00
See also:
:func:`LUT` .
.. index:: gpu::merge
cv::gpu::merge
--------------
.. cfunction:: void merge(const GpuMat* src, size_t n, GpuMat\& dst)
.. cfunction:: void merge(const GpuMat* src, size_t n, GpuMat\& dst, const Stream\& stream)
2011-02-26 19:05:10 +08:00
Makes a multi-channel matrix out of several single-channel matrices.
2011-02-26 19:05:10 +08:00
:param src: Pointer to array of the source matrices.
2011-02-26 19:05:10 +08:00
:param n: Number of source matrices.
2011-02-26 19:05:10 +08:00
:param dst: Destination matrix.
2011-02-26 19:05:10 +08:00
:param stream: Stream for the asynchronous version.
.. cfunction:: void merge(const vector$<$GpuMat$>$\& src, GpuMat\& dst)
.. cfunction:: void merge(const vector$<$GpuMat$>$\& src, GpuMat\& dst, const Stream\& stream)
2011-02-26 19:05:10 +08:00
* **src** Vector of the source matrices.
2011-02-26 19:05:10 +08:00
* **dst** Destination matrix.
2011-02-26 19:05:10 +08:00
* **stream** Stream for the asynchronous version.
2011-02-26 19:05:10 +08:00
See also:
:func:`merge` .
.. index:: gpu::split
cv::gpu::split
--------------
.. cfunction:: void split(const GpuMat\& src, GpuMat* dst)
.. cfunction:: void split(const GpuMat\& src, GpuMat* dst, const Stream\& stream)
2011-02-26 19:05:10 +08:00
Copies each plane of a multi-channel matrix into an array.
2011-02-26 19:05:10 +08:00
:param src: Source matrix.
2011-02-26 19:05:10 +08:00
:param dst: Pointer to array of single-channel matrices.
2011-02-26 19:05:10 +08:00
:param stream: Stream for the asynchronous version.
.. cfunction:: void split(const GpuMat\& src, vector$<$GpuMat$>$\& dst)
.. cfunction:: void split(const GpuMat\& src, vector$<$GpuMat$>$\& dst, const Stream\& stream)
2011-02-26 19:05:10 +08:00
* **src** Source matrix.
2011-02-26 19:05:10 +08:00
* **dst** Destination vector of single-channel matrices.
2011-02-26 19:05:10 +08:00
* **stream** Stream for the asynchronous version.
2011-02-26 19:05:10 +08:00
See also:
:func:`split` .
.. index:: gpu::magnitude
cv::gpu::magnitude
------------------
.. cfunction:: void magnitude(const GpuMat\& x, GpuMat\& magnitude)
2011-02-26 19:05:10 +08:00
Computes magnitudes of complex matrix elements.
2011-02-26 19:05:10 +08:00
:param x: Source complex matrix in the interleaved format ( ``CV_32FC2`` ).
2011-02-26 19:05:10 +08:00
:param magnitude: Destination matrix of float magnitudes ( ``CV_32FC1`` ).
.. cfunction:: void magnitude(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude)
.. cfunction:: void magnitude(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, const Stream\& stream)
2011-02-26 19:05:10 +08:00
* **x** Source matrix, containing real components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
* **y** Source matrix, containing imaginary components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
* **magnitude** Destination matrix of float magnitudes ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
* **stream** Stream for the asynchronous version.
2011-02-26 19:05:10 +08:00
See also:
:func:`magnitude` .
.. index:: gpu::magnitudeSqr
cv::gpu::magnitudeSqr
---------------------
.. cfunction:: void magnitudeSqr(const GpuMat\& x, GpuMat\& magnitude)
2011-02-26 19:05:10 +08:00
Computes squared magnitudes of complex matrix elements.
2011-02-26 19:05:10 +08:00
:param x: Source complex matrix in the interleaved format ( ``CV_32FC2`` ).
2011-02-26 19:05:10 +08:00
:param magnitude: Destination matrix of float magnitude squares ( ``CV_32FC1`` ).
.. cfunction:: void magnitudeSqr(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude)
.. cfunction:: void magnitudeSqr(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, const Stream\& stream)
2011-02-26 19:05:10 +08:00
* **x** Source matrix, containing real components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
* **y** Source matrix, containing imaginary components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
* **magnitude** Destination matrix of float magnitude squares ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
* **stream** Stream for the asynchronous version.
.. index:: gpu::phase
cv::gpu::phase
--------------
2011-02-26 19:05:10 +08:00
.. cfunction:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle, bool angleInDegrees=false)
2011-02-26 19:05:10 +08:00
.. cfunction:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle, bool angleInDegrees, const Stream\& stream)
2011-02-26 19:05:10 +08:00
Computes polar angles of complex matrix elements.
2011-02-26 19:05:10 +08:00
:param x: Source matrix, containing real components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param y: Source matrix, containing imaginary components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param angle: Destionation matrix of angles ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param angleInDegress: Flag which indicates angles must be evaluated in degress.
2011-02-26 19:05:10 +08:00
:param stream: Stream for the asynchronous version.
2011-02-26 19:05:10 +08:00
See also:
:func:`phase` .
.. index:: gpu::cartToPolar
cv::gpu::cartToPolar
--------------------
2011-02-26 19:05:10 +08:00
.. cfunction:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, GpuMat\& angle, bool angleInDegrees=false)
2011-02-26 19:05:10 +08:00
.. cfunction:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, GpuMat\& angle, bool angleInDegrees, const Stream\& stream)
2011-02-26 19:05:10 +08:00
Converts Cartesian coordinates into polar.
2011-02-26 19:05:10 +08:00
:param x: Source matrix, containing real components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param y: Source matrix, containing imaginary components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param magnitude: Destination matrix of float magnituds ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param angle: Destionation matrix of angles ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param angleInDegress: Flag which indicates angles must be evaluated in degress.
2011-02-26 19:05:10 +08:00
:param stream: Stream for the asynchronous version.
2011-02-26 19:05:10 +08:00
See also:
:func:`cartToPolar` .
.. index:: gpu::polarToCart
cv::gpu::polarToCart
--------------------
2011-02-26 19:05:10 +08:00
.. cfunction:: void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle, GpuMat\& x, GpuMat\& y, bool angleInDegrees=false)
2011-02-26 19:05:10 +08:00
.. cfunction:: void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle, GpuMat\& x, GpuMat\& y, bool angleInDegrees, const Stream\& stream)
2011-02-26 19:05:10 +08:00
Converts polar coordinates into Cartesian.
2011-02-26 19:05:10 +08:00
:param magnitude: Source matrix, containing magnitudes ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param angle: Source matrix, containing angles ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param x: Destination matrix of real components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param y: Destination matrix of imaginary components ( ``CV_32FC1`` ).
2011-02-26 19:05:10 +08:00
:param angleInDegress: Flag which indicates angles are in degress.
2011-02-26 19:05:10 +08:00
:param stream: Stream for the asynchronous version.
2011-02-26 19:05:10 +08:00
See also:
:func:`polarToCart` .