invert function

(double, Mat) invert(
  1. InputArray src, {
  2. OutputArray? dst,
  3. int flags = DECOMP_LU,
})

Invert finds the inverse or pseudo-inverse of a matrix.

For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gad278044679d4ecf20f7622cc151aaaa2

Implementation

(double rval, Mat dst) invert(
  InputArray src, {
  OutputArray? dst,
  int flags = DECOMP_LU,
}) {
  dst ??= Mat.empty();
  final p = calloc<ffi.Double>();
  cvRun(() => ccore.cv_invert(src.ref, dst!.ref, flags, p, ffi.nullptr));
  final rval = p.value;
  calloc.free(p);
  return (rval, dst);
}