gapi_convertTo
import { gapi_convertTo } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;srcinput matrix to be converted from.
rdepthdesired 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.
alphaoptional scale factor.
betaoptional delta added to the scaled values.
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.