decomposeHomographyMatAsync function

Future<(int, VecMat, VecMat, VecMat)> decomposeHomographyMatAsync(
  1. Mat H,
  2. Mat K, {
  3. VecMat? rotations,
  4. VecMat? translations,
  5. VecMat? normals,
})

Decompose a homography matrix to rotation(s), translation(s) and plane normal(s).

int cv::decomposeHomographyMat (InputArray H, InputArray K, OutputArrayOfArrays rotations, OutputArrayOfArrays translations, OutputArrayOfArrays normals)

https://docs.opencv.org/4.11.0/d9/d0c/group__calib3d.html#ga7f60bdff78833d1e3fd6d9d0fd538d92

Implementation

Future<(int rval, VecMat rotations, VecMat translations, VecMat normals)> decomposeHomographyMatAsync(
  Mat H,
  Mat K, {
  VecMat? rotations,
  VecMat? translations,
  VecMat? normals,
}) async {
  rotations ??= VecMat();
  translations ??= VecMat();
  normals ??= VecMat();
  final prval = calloc<ffi.Int>();
  return cvRunAsync0(
    (callback) => ccalib3d.cv_decomposeHomographyMat(
      H.ref,
      K.ref,
      rotations!.ref,
      translations!.ref,
      normals!.ref,
      prval,
      callback,
    ),
    (c) {
      final rval = prval.value;
      calloc.free(prval);
      return c.complete((rval, rotations!, translations!, normals!));
    },
  );
}