Skip to content

randShuffle

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

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

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

Shuffles the array elements randomly.

The function cv::randShuffle shuffles the specified 1D array by randomly choosing pairs of elements and swapping them. The number of such swap operations will be dst.rows*dst.cols*iterFactor .

See: RNG, sort

randShuffle(dst: Mat, iterFactor: number): void;
2 available overloads
randShuffle(dst: Mat): void;
randShuffle(dst: Mat, iterFactor: number): void;
dst

Input/output value, modified by the native operation. input/output numerical 1D array.

iterFactor

scale factor that determines the number of random swap operations (see the details below).

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.