Skip to content

split

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

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

ARGUMENTSm, mv
FUNCTIONsplit
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Divides a multi-channel array into several single-channel arrays.

The function cv::split splits a multi-channel array into separate single-channel arrays:

\texttt{mv} [c](I) =  \texttt{src} (I)_c

If you need to extract a single channel or do some other sophisticated channel permutation, use mixChannels.

The following example demonstrates how to split a 3-channel matrix into 3 single channel matrices.

See: merge, mixChannels, cvtColor

split(m: Mat, mv: MatVector): void;
m

input multi-channel array.

mv

Output destination, filled by the native operation. output vector of arrays; the arrays themselves are reallocated, if needed.

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.