2011-01-17 14:57:57 +08:00
\section { Operations on Matrices}
\cvCppFunc { gpu::transpose}
2011-01-17 19:34:20 +08:00
Transposes a matrix.
2011-01-17 14:57:57 +08:00
\cvdefCpp { void transpose(const GpuMat\& src, GpuMat\& dst);}
\begin { description}
2011-01-17 17:27:01 +08:00
\cvarg { src} { Source matrix. 1, 4, 8 bytes element sizes are supported for now.}
2011-01-17 14:57:57 +08:00
\cvarg { dst} { Destination matrix.}
\end { description}
See also: \cvCppCross { transpose} .
\cvCppFunc { gpu::flip}
Flips a 2D matrix around vertical, horizontal or both axes.
\cvdefCpp { void flip(const GpuMat\& a, GpuMat\& b, int flipCode);}
\begin { description}
2011-01-18 16:09:47 +08:00
\cvarg { a} { Source matrix. Only \texttt { CV\_ 8UC1} and \texttt { CV\_ 8UC4} matrices are supported for now.}
2011-01-17 14:57:57 +08:00
\cvarg { b} { Destination matrix.}
\cvarg { flipCode} { Specifies how to flip the source:
\begin { description}
\cvarg { 0} { Flip around x-axis.}
\cvarg { $ > $ 0} { Flip around y-axis.}
\cvarg { $ < $ 0} { Flip around both axes.}
\end { description} }
\end { description}
See also: \cvCppCross { flip} .
2011-01-17 17:27:01 +08:00
\cvCppFunc { gpu::LUT}
2011-01-18 16:09:47 +08:00
Transforms the source matrix into the destination matrix using given look-up table:
\[ dst ( I ) = lut ( src ( I ) ) \]
2011-01-17 17:27:01 +08:00
\cvdefCpp { void LUT(const GpuMat\& src, const Mat\& lut, GpuMat\& dst);}
\begin { description}
2011-01-17 20:09:47 +08:00
\cvarg { src} { Source matrix. \texttt { CV\_ 8UC1} and \texttt { CV\_ 8UC3} matrixes are supported for now.}
\cvarg { lut} { Look-up table. Must be continuous, \texttt { CV\_ 8U} depth matrix. Its area must satisfy to \texttt { lut.rows} $ \times $ \texttt { lut.cols} = 256 condition.}
2011-01-17 17:27:01 +08:00
\cvarg { dst} { Destination matrix. Will have the same depth as \texttt { lut} and the same number of channels as \texttt { src} .}
\end { description}
See also: \cvCppCross { LUT} .
2011-01-17 14:57:57 +08:00
\cvCppFunc { gpu::merge}
2011-01-17 19:34:20 +08:00
Makes a multi-channel matrix out of several single-channel matrices.
2011-01-17 14:57:57 +08:00
\cvdefCpp { void merge(const GpuMat* src, size\_ t n, GpuMat\& dst);\newline
void merge(const GpuMat* src, size\_ t n, GpuMat\& dst,\par
2011-01-17 17:27:01 +08:00
const Stream\& stream);\newline }
\begin { description}
\cvarg { src} { Pointer to array of the source matrices.}
\cvarg { n} { Number of source matrices.}
\cvarg { dst} { Destination matrix.}
\cvarg { stream} { Stream for the asynchronous version.}
\end { description}
\cvdefCpp { void merge(const vector$ < $ GpuMat$ > $ \& src, GpuMat\& dst);\newline
2011-01-17 14:57:57 +08:00
void merge(const vector$ < $ GpuMat$ > $ \& src, GpuMat\& dst,\par
const Stream\& stream);}
\begin { description}
2011-01-17 17:27:01 +08:00
\cvarg { src} { Vector of the source matrices.}
2011-01-17 14:57:57 +08:00
\cvarg { dst} { Destination matrix.}
2011-01-17 17:27:01 +08:00
\cvarg { stream} { Stream for the asynchronous version.}
2011-01-17 14:57:57 +08:00
\end { description}
See also: \cvCppCross { merge} .
\cvCppFunc { gpu::split}
Copies each plane of a multi-channel matrix into an array.
\cvdefCpp { void split(const GpuMat\& src, GpuMat* dst);\newline
2011-01-17 17:27:01 +08:00
void split(const GpuMat\& src, GpuMat* dst, const Stream\& stream);}
\begin { description}
\cvarg { src} { Source matrix.}
\cvarg { dst} { Pointer to array of single-channel matrices.}
\cvarg { stream} { Stream for the asynchronous version.}
\end { description}
\cvdefCpp { void split(const GpuMat\& src, vector$ < $ GpuMat$ > $ \& dst);\newline
2011-01-17 14:57:57 +08:00
void split(const GpuMat\& src, vector$ < $ GpuMat$ > $ \& dst,\par
const Stream\& stream);}
\begin { description}
\cvarg { src} { Source matrix.}
2011-01-17 17:27:01 +08:00
\cvarg { dst} { Destination vector of single-channel matrices.}
\cvarg { stream} { Stream for the asynchronous version.}
2011-01-17 14:57:57 +08:00
\end { description}
See also: \cvCppCross { split} .
\cvCppFunc { gpu::magnitude}
2011-01-17 19:34:20 +08:00
Computes magnitudes of complex matrix elements.
2011-01-17 14:57:57 +08:00
\cvdefCpp { void magnitude(const GpuMat\& x, GpuMat\& magnitude);}
\begin { description}
2011-01-17 20:09:47 +08:00
\cvarg { x} { Source complex matrix in the interleaved format (\texttt { CV\_ 32FC2} ). }
\cvarg { magnitude} { Destination matrix of float magnitudes (\texttt { CV\_ 32FC1} ).}
2011-01-17 14:57:57 +08:00
\end { description}
\cvdefCpp { void magnitude(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude);\newline
void magnitude(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,\par
const Stream\& stream);}
\begin { description}
2011-01-17 20:09:47 +08:00
\cvarg { x} { Source matrix, containing real components (\texttt { CV\_ 32FC1} ).}
\cvarg { y} { Source matrix, containing imaginary components (\texttt { CV\_ 32FC1} ).}
\cvarg { magnitude} { Destination matrix of float magnitudes (\texttt { CV\_ 32FC1} ).}
2011-01-18 16:09:47 +08:00
\cvarg { stream} { Stream for the asynchronous version.}
2011-01-17 14:57:57 +08:00
\end { description}
See also: \cvCppCross { magnitude} .
\cvCppFunc { gpu::magnitudeSqr}
2011-01-17 19:34:20 +08:00
Computes squared magnitudes of complex matrix elements.
2011-01-17 14:57:57 +08:00
\cvdefCpp { void magnitudeSqr(const GpuMat\& x, GpuMat\& magnitude);}
\begin { description}
2011-01-17 20:09:47 +08:00
\cvarg { x} { Source complex matrix in the interleaved format (\texttt { CV\_ 32FC2} ). }
\cvarg { magnitude} { Destination matrix of float magnitude squares (\texttt { CV\_ 32FC1} ).}
2011-01-17 14:57:57 +08:00
\end { description}
\cvdefCpp { void magnitudeSqr(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude);\newline
void magnitudeSqr(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,\par
const Stream\& stream);}
\begin { description}
2011-01-17 20:09:47 +08:00
\cvarg { x} { Source matrix, containing real components (\texttt { CV\_ 32FC1} ).}
\cvarg { y} { Source matrix, containing imaginary components (\texttt { CV\_ 32FC1} ).}
\cvarg { magnitude} { Destination matrix of float magnitude squares (\texttt { CV\_ 32FC1} ).}
2011-01-18 16:09:47 +08:00
\cvarg { stream} { Stream for the asynchronous version.}
2011-01-17 14:57:57 +08:00
\end { description}
\cvCppFunc { gpu::phase}
2011-01-17 19:34:20 +08:00
Computes polar angles of complex matrix elements.
2011-01-17 14:57:57 +08:00
\cvdefCpp { void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle,\par
bool angleInDegrees=false);\newline
void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle,\par
bool angleInDegrees, const Stream\& stream);}
\begin { description}
2011-01-17 20:09:47 +08:00
\cvarg { x} { Source matrix, containing real components (\texttt { CV\_ 32FC1} ).}
\cvarg { y} { Source matrix, containing imaginary components (\texttt { CV\_ 32FC1} ).}
\cvarg { angle} { Destionation matrix of angles (\texttt { CV\_ 32FC1} ).}
2011-01-17 14:57:57 +08:00
\cvarg { angleInDegress} { Flag which indicates angles must be evaluated in degress.}
2011-01-18 16:09:47 +08:00
\cvarg { stream} { Stream for the asynchronous version.}
2011-01-17 14:57:57 +08:00
\end { description}
See also: \cvCppCross { phase} .
\cvCppFunc { gpu::cartToPolar}
Converts Cartesian coordinates into polar.
\cvdefCpp { void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,\par
GpuMat\& angle, bool angleInDegrees=false);\newline
void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,\par
GpuMat\& angle, bool angleInDegrees, const Stream\& stream);}
\begin { description}
2011-01-17 20:09:47 +08:00
\cvarg { x} { Source matrix, containing real components (\texttt { CV\_ 32FC1} ).}
\cvarg { y} { Source matrix, containing imaginary components (\texttt { CV\_ 32FC1} ).}
\cvarg { magnitude} { Destination matrix of float magnituds (\texttt { CV\_ 32FC1} ).}
\cvarg { angle} { Destionation matrix of angles (\texttt { CV\_ 32FC1} ).}
2011-01-17 14:57:57 +08:00
\cvarg { angleInDegress} { Flag which indicates angles must be evaluated in degress.}
2011-01-18 16:09:47 +08:00
\cvarg { stream} { Stream for the asynchronous version.}
2011-01-17 14:57:57 +08:00
\end { description}
See also: \cvCppCross { cartToPolar} .
\cvCppFunc { gpu::polarToCart}
Converts polar coordinates into Cartesian.
\cvdefCpp { void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle,\par
GpuMat\& x, GpuMat\& y, bool angleInDegrees=false);\newline
void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle,\par
GpuMat\& x, GpuMat\& y, bool angleInDegrees,\par
const Stream\& stream);}
\begin { description}
2011-01-17 20:09:47 +08:00
\cvarg { magnitude} { Source matrix, containing magnitudes (\texttt { CV\_ 32FC1} ).}
\cvarg { angle} { Source matrix, containing angles (\texttt { CV\_ 32FC1} ).}
\cvarg { x} { Destination matrix of real components (\texttt { CV\_ 32FC1} ).}
\cvarg { y} { Destination matrix of imaginary components (\texttt { CV\_ 32FC1} ).}
2011-01-17 14:57:57 +08:00
\cvarg { angleInDegress} { Flag which indicates angles are in degress.}
2011-01-18 16:09:47 +08:00
\cvarg { stream} { Stream for the asynchronous version.}
2011-01-17 14:57:57 +08:00
\end { description}
See also: \cvCppCross { polarToCart} .