trace
import { trace } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
ARGUMENTSmtx
FUNCTIONtrace
RETURN TYPEScalar
Returns the trace of a matrix.
The function cv::trace returns the sum of the diagonal elements of the matrix mtx .
\mathrm{tr} ( \texttt{mtx} ) = \sum _i \texttt{mtx} (i,i)
trace(mtx: Mat): Scalar;mtxinput matrix.
Returns
The Scalar result.
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.