decomposeHomographyMat function

(int, VecMat, VecMat, VecMat) decomposeHomographyMat(
  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

(int rval, VecMat rotations, VecMat translations, VecMat normals) decomposeHomographyMat(
  Mat H,
  Mat K, {
  VecMat? rotations,
  VecMat? translations,
  VecMat? normals,
}) {
  rotations ??= VecMat();
  translations ??= VecMat();
  normals ??= VecMat();
  final prval = calloc<ffi.Int>();
  cvRun(
    () => ccalib3d.cv_decomposeHomographyMat(
      H.ref,
      K.ref,
      rotations!.ref,
      translations!.ref,
      normals!.ref,
      prval,
      ffi.nullptr,
    ),
  );
  final rval = prval.value;
  calloc.free(prval);
  return (rval, rotations, translations, normals);
}