diff --git a/modules/calib3d/src/usac/fundamental_solver.cpp b/modules/calib3d/src/usac/fundamental_solver.cpp index d2fb6d3d10..b3ef5b0fc0 100644 --- a/modules/calib3d/src/usac/fundamental_solver.cpp +++ b/modules/calib3d/src/usac/fundamental_solver.cpp @@ -385,7 +385,7 @@ public: Matx AtA_(AtA), U, Vt; Vec W; SVD::compute(AtA_, W, U, Vt, SVD::FULL_UV + SVD::MODIFY_A); - models = std::vector { Mat_(3, 3, Vt.val + 72 /*=8*9*/) }; + models = std::vector { Mat_(3, 3, Vt.val + 72 /*=8*9*/).clone() }; #endif } @@ -503,7 +503,7 @@ public: Matx AtA_(covariance), U, Vt; Vec W; SVD::compute(AtA_, W, U, Vt, SVD::FULL_UV + SVD::MODIFY_A); - models = std::vector { Mat_(3, 3, Vt.val + 72 /*=8*9*/) }; + models = std::vector { Mat_(3, 3, Vt.val + 72 /*=8*9*/).clone() }; #endif if (enforce_rank) FundamentalDegeneracy::recoverRank(models[0], is_fundamental); diff --git a/modules/calib3d/src/usac/homography_solver.cpp b/modules/calib3d/src/usac/homography_solver.cpp index 3be5f2dc20..fe528f59a6 100644 --- a/modules/calib3d/src/usac/homography_solver.cpp +++ b/modules/calib3d/src/usac/homography_solver.cpp @@ -253,7 +253,7 @@ public: Matx Vt; Vec D; if (! eigen(Matx(AtA), D, Vt)) return 0; - H = Mat_(3, 3, Vt.val + 72/*=8*9*/); + H = Mat_(3, 3, Vt.val + 72/*=8*9*/).clone(); #endif } const auto * const h = (double *) H.data;