Skip to content

ml_TrainData_getSubMatrix

mlfunctionOpenCV 5.0.0
import { ml_TrainData_getSubMatrix } from '@banou/opencv-wasm'

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

ARGUMENTSmatrix, idx, layout
FUNCTIONml_TrainData_getSubMatrix
RETURN TYPEMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Extract from matrix rows/cols specified by passed indexes.

ml_TrainData_getSubMatrix(matrix: Mat, idx: Mat, layout: number): Mat;
matrix

input matrix (supported types: CV_32S, CV_32F, CV_64F)

idx

1D index vector

layout

specifies to extract rows (cv::ml::ROW_SAMPLES) or to extract columns (cv::ml::COL_SAMPLES)

Returns

The Mat result. Release returned native handles with using or delete(), including handles nested in results.

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.