gapi_addWeighted
import { gapi_addWeighted } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Calculates the weighted sum of two matrices.
The function addWeighted calculates the weighted sum of two matrices as follows:
\texttt{dst} (I)= \texttt{saturate} ( \texttt{src1} (I)* \texttt{alpha} + \texttt{src2} (I)* \texttt{beta} + \texttt{gamma} )
where I is a multi-dimensional index of array elements. In case of multi-channel matrices, each channel is processed independently.
The function can be replaced with a matrix expression:
\texttt{dst}(I) = \texttt{alpha} * \texttt{src1}(I) - \texttt{beta} * \texttt{src2}(I) + \texttt{gamma}
Supported matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.
Note: Function textual ID is "org.opencv.core.matrixop.addweighted"
See: add, sub
gapi_addWeighted(src1: GMat, alpha: number, src2: GMat, beta: number, gamma: number, ddepth: number): GMat;2 available overloads
gapi_addWeighted(src1: GMat, alpha: number, src2: GMat, beta: number, gamma: number): GMat;gapi_addWeighted(src1: GMat, alpha: number, src2: GMat, beta: number, gamma: number, ddepth: number): GMat;src1first input matrix.
alphaweight of the first matrix elements.
src2second input matrix of the same size and channel number as src1.
betaweight of the second matrix elements.
gammascalar added to each sum.
ddepthoptional depth of the output matrix.
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.