Skip to content

gapi_normL2

gapifunctionOpenCV 5.0.0
import { gapi_normL2 } from '@banou/opencv-wasm'

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

ARGUMENTSsrc
FUNCTIONgapi_normL2
RETURN TYPEGScalar
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Calculates the absolute L2 norm of a matrix.

This version of normL2 calculates the absolute L2 norm of src.

As example for one array consider the function r(x)= \begin{pmatrix} x \\ 1-x \end{pmatrix}, x \in [-1;1]. The L_{2} norm for the sample value r(-1) = \begin{pmatrix} -1 \\ 2 \end{pmatrix} is calculated as follows f:{align*} | r(-1) |{L_2} &= \sqrt{(-1)^{2} + (2)^{2}} = \sqrt{5} \ f:} and for r(0.5) = \begin{pmatrix} 0.5 \\ 0.5 \end{pmatrix} the calculation is f:{align*} | r(0.5) |{L_2} &= \sqrt{(0.5)^{2} + (0.5)^{2}} = \sqrt{0.5} \ f:}

Supported matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note: Function textual ID is "org.opencv.core.matrixop.norml2"

See: normL1, normInf

gapi_normL2(src: GMat): GScalar;
src

input matrix.

Returns

The GScalar result. Release returned native handles with using or delete(), including handles nested in results.

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.