Skip to content

randn

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

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

ARGUMENTSdst, mean, stddev
FUNCTIONrandn
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Fills the array with normally distributed random numbers.

The function cv::randn fills the matrix dst with normally distributed random numbers with the specified mean vector and the standard deviation matrix. The generated random numbers are clipped to fit the value range of the output array data type.

See: RNG, randu

randn(dst: Mat, mean: Mat, stddev: Mat): void;
dst

Input/output value, modified by the native operation. output array of random numbers; the array must be pre-allocated and have 1 to 4 channels.

mean

mean value (expectation) of the generated random numbers.

stddev

standard deviation of the generated random numbers; it can be either a vector (in which case a diagonal standard deviation matrix is assumed) or a square matrix.

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.