solvePolyAsync function

Future<(double, Mat)> solvePolyAsync(
  1. InputArray coeffs, {
  2. OutputArray? roots,
  3. int maxIters = 300,
})

SolvePoly finds the real or complex roots of a polynomial equation.

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

Implementation

Future<(double rval, Mat roots)> solvePolyAsync(
  InputArray coeffs, {
  OutputArray? roots,
  int maxIters = 300,
}) async {
  roots ??= Mat.empty();
  final p = calloc<ffi.Double>();
  return cvRunAsync0(
    (callback) => ccore.cv_solvePoly(coeffs.ref, roots!.ref, maxIters, p, callback),
    (c) {
      final rval = p.value;
      calloc.free(p);
      return c.complete((rval, roots!));
    },
  );
}