Skip to content

mulTransposed

Core and matricesfunctionOpenCV 5.0.0
import { mulTransposed } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSsrc, dst, aTa, delta
FUNCTIONmulTransposed
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Calculates the product of a matrix and its transposition.

The function cv::mulTransposed calculates the product of src and its transposition:

\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} )^T ( \texttt{src} - \texttt{delta} )

if aTa=true, and

\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} ) ( \texttt{src} - \texttt{delta} )^T

otherwise. The function is used to calculate the covariance matrix. With zero delta, it can be used as a faster substitute for general matrix product A*B when B=A'

See: calcCovarMatrix, gemm, repeat, reduce

mulTransposed(src: Mat, dst: Mat, aTa: boolean, delta: Mat, scale: number, dtype: number): void;
4 available overloads
mulTransposed(src: Mat, dst: Mat, aTa: boolean): void;
mulTransposed(src: Mat, dst: Mat, aTa: boolean, delta: Mat): void;
mulTransposed(src: Mat, dst: Mat, aTa: boolean, delta: Mat, scale: number): void;
mulTransposed(src: Mat, dst: Mat, aTa: boolean, delta: Mat, scale: number, dtype: number): void;
src

input single-channel matrix. Note that unlike gemm, the function can multiply not only floating-point matrices.

dst

Output destination, filled by the native operation. output square matrix.

aTa

Flag specifying the multiplication ordering. See the description below.

delta

Optional delta matrix subtracted from src before the multiplication. When the matrix is empty ( delta=noArray() ), it is assumed to be zero, that is, nothing is subtracted. If it has the same size as src, it is simply subtracted. Otherwise, it is "repeated" (see repeat ) to cover the full src and then subtracted. Type of the delta matrix, when it is not empty, must be the same as the type of created output matrix. See the dtype parameter description below.

scale

Optional scale factor for the matrix product.

dtype

Optional type of the output matrix. When it is negative, the output matrix will have the same type as src . Otherwise, it will be type=CV_MAT_DEPTH(dtype) that should be either CV_32F or CV_64F .

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.