Skip to content

gapi_absDiff

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

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

ARGUMENTSsrc1, src2
FUNCTIONgapi_absDiff
RETURN TYPEGMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Calculates the per-element absolute difference between two matrices.

The function absDiff calculates absolute difference between two matrices of the same size and depth:

\texttt{dst}(I) =  \texttt{saturate} (| \texttt{src1}(I) -  \texttt{src2}(I)|)
where I is a multi-dimensional index of matrix elements. In case of
multi-channel matrices, each channel is processed independently.

Output matrix must have the same size and depth as input matrices.

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

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

See: abs

gapi_absDiff(src1: GMat, src2: GMat): GMat;
src1

first input matrix.

src2

second input matrix.

Returns

The GMat 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.