2011-01-17 14:57:57 +08:00
|
|
|
\section{Matrix Reductions}
|
|
|
|
|
|
|
|
|
2011-01-17 16:39:08 +08:00
|
|
|
\cvCppFunc{gpu::meanStdDev}
|
|
|
|
Computes mean value and standard deviation of matrix elements.
|
|
|
|
|
|
|
|
\cvdefCpp{void meanStdDev(const GpuMat\& mtx, Scalar\& mean, Scalar\& stddev);}
|
|
|
|
\begin{description}
|
|
|
|
\cvarg{mtx}{Source matrix. 8UC1 matrices are supported for now.}
|
|
|
|
\cvarg{mean}{Mean value.}
|
|
|
|
\cvarg{stddev}{Standard deviation value.}
|
|
|
|
\end{description}
|
|
|
|
|
|
|
|
See also: \cvCppCross{meanStdDev}.
|
|
|
|
|
|
|
|
|
|
|
|
\cvCppFunc{gpu::norm}
|
|
|
|
Returns norm of matrix (or of two matrices difference).
|
|
|
|
|
|
|
|
\cvdefCpp{double norm(const GpuMat\& src1, int normType=NORM\_L2);}
|
|
|
|
\begin{description}
|
|
|
|
\cvarg{src1}{Source matrix. 8UC1 matrices are supported for now.}
|
|
|
|
\cvarg{normType}{Norm type. \texttt{NORM\_L1}, \texttt{NORM\_L2} and \texttt{NORM\_INF} are supported for now.}
|
|
|
|
\end{description}
|
|
|
|
|
2011-01-17 19:34:20 +08:00
|
|
|
\cvdefCpp{double norm(const GpuMat\& src1, const GpuMat\& src2,\par
|
|
|
|
int normType=NORM\_L2);}
|
2011-01-17 16:39:08 +08:00
|
|
|
\begin{description}
|
|
|
|
\cvarg{src1}{First source matrix. 8UC1 matrices are supported for now.}
|
|
|
|
\cvarg{src2}{Second source matrix. Must have the same size and type as \texttt{src1}}.
|
|
|
|
\cvarg{normType}{Norm type. \texttt{NORM\_L1}, \texttt{NORM\_L2} and \texttt{NORM\_INF} are supported for now.}
|
|
|
|
\end{description}
|
|
|
|
|
|
|
|
See also: \cvCppCross{norm}.
|
|
|
|
|
|
|
|
|
2011-01-17 14:57:57 +08:00
|
|
|
\cvCppFunc{gpu::sum}
|
2011-01-17 16:39:08 +08:00
|
|
|
Returns sum of matrix elements.
|
2011-01-17 14:57:57 +08:00
|
|
|
|
|
|
|
\cvdefCpp{Scalar sum(const GpuMat\& src);\newline
|
|
|
|
Scalar sum(const GpuMat\& src, GpuMat\& buf);}
|
|
|
|
|
|
|
|
\begin{description}
|
|
|
|
\cvarg{src}{Source image of any depth excepting 64F, single-channel.}
|
|
|
|
\cvarg{buf}{Optional buffer. It's resized automatically.}
|
|
|
|
\end{description}
|
|
|
|
|
|
|
|
See also: \cvCppCross{sum}.
|
|
|
|
|
|
|
|
|
|
|
|
\cvCppFunc{gpu::sqrSum}
|
2011-01-17 16:39:08 +08:00
|
|
|
Returns squared sum of matrix elements.
|
2011-01-17 14:57:57 +08:00
|
|
|
|
|
|
|
\cvdefCpp{Scalar sqrSum(const GpuMat\& src);\newline
|
|
|
|
Scalar sqrSum(const GpuMat\& src, GpuMat\& buf);}
|
|
|
|
\begin{description}
|
|
|
|
\cvarg{src}{Source image of any depth excepting 64F, single-channel.}
|
|
|
|
\cvarg{buf}{Optional buffer. It's resized automatically.}
|
|
|
|
\end{description}
|
|
|
|
|
|
|
|
|
|
|
|
\cvCppFunc{gpu::minMax}
|
2011-01-17 16:39:08 +08:00
|
|
|
Finds global minimum and maximum matrix elements and returns their values.
|
2011-01-17 14:57:57 +08:00
|
|
|
|
|
|
|
\cvdefCpp{void minMax(const GpuMat\& src, double* minVal,\par
|
|
|
|
double* maxVal=0, const GpuMat\& mask=GpuMat());\newline
|
|
|
|
void minMax(const GpuMat\& src, double* minVal, double* maxVal,\par
|
|
|
|
const GpuMat\& mask, GpuMat\& buf);}
|
|
|
|
\begin{description}
|
|
|
|
\cvarg{src}{Single-channel source image.}
|
|
|
|
\cvarg{minVal}{Pointer to returned minimum value. \texttt{NULL} if not required.}
|
|
|
|
\cvarg{maxVal}{Pointer to returned maximum value. \texttt{NULL} if not required.}
|
2011-01-17 16:39:08 +08:00
|
|
|
\cvarg{mask}{Optional mask to select a sub-matrix.}
|
2011-01-17 14:57:57 +08:00
|
|
|
\cvarg{buf}{Optional buffer. It's resized automatically.}
|
|
|
|
\end{description}
|
|
|
|
|
|
|
|
Function doesn't work with 64F images on GPU with compute capability $<$ 1.3.\newline
|
|
|
|
See also: \cvCppCross{minMaxLoc}.
|
|
|
|
|
|
|
|
|
|
|
|
\cvCppFunc{gpu::minMaxLoc}
|
2011-01-17 16:39:08 +08:00
|
|
|
Finds global minimum and maximum matrix elements and returns their values with locations.
|
2011-01-17 14:57:57 +08:00
|
|
|
|
|
|
|
\cvdefCpp{void minMaxLoc(const GpuMat\& src, double\* minVal, double* maxVal=0,\par
|
|
|
|
Point* minLoc=0, Point* maxLoc=0,\par
|
|
|
|
const GpuMat\& mask=GpuMat());\newline
|
|
|
|
void minMaxLoc(const GpuMat\& src, double* minVal, double* maxVal,\par
|
|
|
|
Point* minLoc, Point* maxLoc, const GpuMat\& mask,\par
|
|
|
|
GpuMat\& valbuf, GpuMat\& locbuf);}
|
|
|
|
\begin{description}
|
|
|
|
\cvarg{src}{Single-channel source image.}
|
|
|
|
\cvarg{minVal}{Pointer to returned minimum value. \texttt{NULL} if not required.}
|
|
|
|
\cvarg{maxVal}{Pointer to returned maximum value. \texttt{NULL} if not required.}
|
|
|
|
\cvarg{minValLoc}{Pointer to returned minimum location. \texttt{NULL} if not required.}
|
|
|
|
\cvarg{maxValLoc}{Pointer to returned maximum location. \texttt{NULL} if not required.}
|
2011-01-17 16:39:08 +08:00
|
|
|
\cvarg{mask}{Optional mask to select a sub-matrix.}
|
2011-01-17 14:57:57 +08:00
|
|
|
\cvarg{valbuf}{Optional values buffer. It's resized automatically.}
|
|
|
|
\cvarg{locbuf}{Optional location buffer. It's resized automatically.}
|
|
|
|
\end{description}
|
|
|
|
|
|
|
|
Function doesn't work with 64F images on GPU with compute capability $<$ 1.3.\newline
|
|
|
|
See also: \cvCppCross{minMaxLoc}.
|
|
|
|
|
|
|
|
|
|
|
|
\cvCppFunc{gpu::countNonZero}
|
2011-01-17 16:39:08 +08:00
|
|
|
Counts non-zero matrix elements.
|
2011-01-17 14:57:57 +08:00
|
|
|
|
|
|
|
\cvdefCpp{int countNonZero(const GpuMat\& src);\newline
|
|
|
|
int countNonZero(const GpuMat\& src, GpuMat\& buf);}
|
|
|
|
\begin{description}
|
|
|
|
\cvarg{src}{Single-channel source image.}
|
|
|
|
\cvarg{buf}{Optional buffer. It's resized automatically.}
|
|
|
|
\end{description}
|
|
|
|
|
|
|
|
Function doesn't work with 64F images on GPU with compute capability $<$ 1.3.\newline
|
|
|
|
See also: \cvCppCross{countNonZero}.
|