Skip to content

scaleAdd

Core and matricesfunctionOpenCV 5.0.0
import { scaleAdd } from '@banou/opencv-wasm'

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

ARGUMENTSsrc1, alpha, src2, dst
FUNCTIONscaleAdd
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Calculates the sum of a scaled array and another array.

The function scaleAdd is one of the classical primitive linear algebra operations, known as DAXPY or SAXPY in BLAS. It calculates the sum of a scaled array and another array:

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

The function can also be emulated with a matrix expression, for example:

    Mat A(3, 3, CV_64F);
    ...
    A.row(0) = A.row(1)*2 + A.row(2);

See: add, addWeighted, subtract, Mat::dot, Mat::convertTo

scaleAdd(src1: Mat, alpha: number, src2: Mat, dst: Mat): void;
src1

first input array.

alpha

scale factor for the first array.

src2

second input array of the same size and type as src1.

dst

Output destination, filled by the native operation. output array of the same size and type as src1.

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.