PCACompute1 function

(Mat, Mat, Mat) PCACompute1(
  1. InputArray data,
  2. InputOutputArray mean,
  3. double retainedVariance, {
  4. OutputArray? eigenvectors,
  5. OutputArray? eigenvalues,
})

Implementation

(Mat mean, Mat eigenvalues, Mat eigenvectors) PCACompute1(
  InputArray data,
  InputOutputArray mean,
  double retainedVariance, {
  OutputArray? eigenvectors,
  OutputArray? eigenvalues,
}) {
  eigenvectors ??= Mat.empty();
  eigenvalues ??= Mat.empty();
  cvRun(
    () => ccore.cv_PCACompute_1(
      data.ref,
      mean.ref,
      eigenvectors!.ref,
      eigenvalues!.ref,
      retainedVariance,
      ffi.nullptr,
    ),
  );
  return (mean, eigenvalues, eigenvectors);
}