Skip to content

randu

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

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

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

Generates a single uniformly-distributed random number or an array of random numbers.

Non-template variant of the function fills the matrix dst with uniformly-distributed random numbers from the specified range:

\texttt{low} _c  \leq \texttt{dst} (I)_c <  \texttt{high} _c

See: RNG, randn, theRNG

randu(dst: Mat, low: Mat, high: Mat): void;
dst

Input/output value, modified by the native operation. output array of random numbers; the array must be pre-allocated.

low

inclusive lower boundary of the generated random numbers.

high

exclusive upper boundary of the generated random numbers.

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.