Skip to content

gapi_div

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

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

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

FIXME: merge with mulc Performs per-element division of two matrices.

The function divides one matrix by another:

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

For integer types when src2(I) is zero, dst(I) will also be zero. Floating point case returns Inf/NaN (according to IEEE).

Different channels of multi-channel matrices are processed independently. The matrices can be single or multi channel. Output matrix must have the same size and depth as src.

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

Note: Function textual ID is "org.opencv.core.math.div"

See: mul, add, sub

gapi_div(src1: GMat, src2: GMat, scale: number, ddepth: number): GMat;
2 available overloads
gapi_div(src1: GMat, src2: GMat, scale: number): GMat;
gapi_div(src1: GMat, src2: GMat, scale: number, ddepth: number): GMat;
src1

first input matrix.

src2

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

scale

scalar factor.

ddepth

optional depth of the output matrix; you can only pass -1 when src1.depth() == src2.depth().

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.