compute static method
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<cvg.Mat>();
final pu = u?.ptr ?? calloc<cvg.Mat>();
final pvt = vt?.ptr ?? calloc<cvg.Mat>();
cvRun(() => cffi.SVD_Compute(src.ref, pw, pu, pvt, flags));
return (w ?? Mat.fromPointer(pw), u ?? Mat.fromPointer(pu), vt ?? Mat.fromPointer(pvt));
}