Skip to content

gapi_convertTo

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

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

ARGUMENTSsrc, rdepth, alpha, beta
FUNCTIONgapi_convertTo
RETURN TYPEGMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Converts a matrix to another data depth with optional scaling.

The method converts source pixel values to the target data depth. saturate_cast<> is applied at the end to avoid possible overflows:

m(x,y) = saturate \_ cast<rType>( \alpha (*this)(x,y) +  \beta )

Output matrix must be of the same size as input one.

Note: Function textual ID is "org.opencv.core.transform.convertTo"

gapi_convertTo(src: GMat, rdepth: number, alpha: number, beta: number): GMat;
3 available overloads
gapi_convertTo(src: GMat, rdepth: number): GMat;
gapi_convertTo(src: GMat, rdepth: number, alpha: number): GMat;
gapi_convertTo(src: GMat, rdepth: number, alpha: number, beta: number): GMat;
src

input matrix to be converted from.

rdepth

desired output matrix depth or, rather, the depth since the number of channels are the same as the input has; if rdepth is negative, the output matrix will have the same depth as the input.

alpha

optional scale factor.

beta

optional delta added to the scaled values.

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.