predict method

Mat predict(
  1. Mat samples, {
  2. int flags = 0,
})

Predicts the response for each row of samples, one row of the returned Mat per sample.

Each row of the result holds the posterior probabilities of the mixture components, flags is ignored.

Implementation

Mat predict(Mat samples, {int flags = 0}) {
  final p = calloc<ffi.Float>();
  final results = Mat.empty();
  try {
    cvRun(() => cml.cv_ml_EM_predict(ref, samples.ref, results.ref, flags, p, ffi.nullptr));
    return results;
  } catch (_) {
    results.dispose();
    rethrow;
  } finally {
    calloc.free(p);
  }
}