Skip to content

gapi_mul

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

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

ARGUMENTSsrc1, src2, scale, ddepth
FUNCTIONgapi_mul
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 scaled product of two matrices.

The function mul calculates the per-element product of two matrices:

\texttt{dst} (I)= \texttt{saturate} ( \texttt{scale} \cdot \texttt{src1} (I)  \cdot \texttt{src2} (I))

If src1.depth() == src2.depth(), ddepth can be set to the default -1. In this case, the output matrix will have the same depth as the input matrices. The matrices can be single or multi channel. Output matrix must have the same size 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.math.mul"

See: add, sub, div, addWeighted

gapi_mul(src1: GMat, src2: GMat, scale: number, ddepth: number): GMat;
3 available overloads
gapi_mul(src1: GMat, src2: GMat): GMat;
gapi_mul(src1: GMat, src2: GMat, scale: number): GMat;
gapi_mul(src1: GMat, src2: GMat, scale: number, ddepth: number): GMat;
src1

first input matrix.

src2

second input matrix of the same size and the same depth as src1.

scale

optional scale factor.

ddepth

optional depth of the output 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.