compute static method

(Mat, Mat, Mat) compute(
  1. Mat src, {
  2. Mat? w,
  3. Mat? u,
  4. Mat? vt,
  5. int flags = 0,
})

decomposes matrix and stores the results to user-provided matrices The methods/functions perform SVD of matrix.

https://docs.opencv.org/4.1.2/df/df7/classcv_1_1SVD.html#a76f0b2044df458160292045a3d3714c6

Implementation

static (Mat w, Mat u, Mat vt) compute(Mat src, {Mat? w, Mat? u, Mat? vt, int flags = 0}) {
  final pw = w?.ptr ?? calloc<ccore.Mat>();
  final pu = u?.ptr ?? calloc<ccore.Mat>();
  final pvt = vt?.ptr ?? calloc<ccore.Mat>();
  cvRun(() => ccore.SVD_Compute(src.ref, pw, pu, pvt, flags));
  return (w ?? Mat.fromPointer(pw), u ?? Mat.fromPointer(pu), vt ?? Mat.fromPointer(pvt));
}