From c8e88d898437f43c714c89e752189b2873a5a4bf Mon Sep 17 00:00:00 2001 From: Maxim Smolskiy Date: Wed, 2 Apr 2025 21:21:56 +0300 Subject: [PATCH] Merge pull request #27185 from MaximSmolskiy:specify_dls_and_upnp_mappings_to_epnp_in_all_places_for_solvepnp_tests Specify DLS and UPnP mappings to EPnP in all places for solvePnP* tests #27185 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake --- modules/calib3d/test/test_solvepnp_ransac.cpp | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/calib3d/test/test_solvepnp_ransac.cpp b/modules/calib3d/test/test_solvepnp_ransac.cpp index 66412bcfca..5bd2a37ca1 100644 --- a/modules/calib3d/test/test_solvepnp_ransac.cpp +++ b/modules/calib3d/test/test_solvepnp_ransac.cpp @@ -182,9 +182,9 @@ static std::string printMethod(int method) case 2: return "SOLVEPNP_P3P"; case 3: - return "SOLVEPNP_DLS (remaped to SOLVEPNP_EPNP)"; + return "SOLVEPNP_DLS (remapped to SOLVEPNP_EPNP)"; case 4: - return "SOLVEPNP_UPNP (remaped to SOLVEPNP_EPNP)"; + return "SOLVEPNP_UPNP (remapped to SOLVEPNP_EPNP)"; case 5: return "SOLVEPNP_AP3P"; case 6: @@ -207,8 +207,8 @@ public: eps[SOLVEPNP_EPNP] = 1.0e-2; eps[SOLVEPNP_P3P] = 1.0e-2; eps[SOLVEPNP_AP3P] = 1.0e-2; - eps[SOLVEPNP_DLS] = 1.0e-2; - eps[SOLVEPNP_UPNP] = 1.0e-2; + eps[SOLVEPNP_DLS] = 1.0e-2; // DLS is remapped to EPnP, so we use the same threshold + eps[SOLVEPNP_UPNP] = 1.0e-2; // UPnP is remapped to EPnP, so we use the same threshold eps[SOLVEPNP_IPPE] = 1.0e-2; eps[SOLVEPNP_IPPE_SQUARE] = 1.0e-2; eps[SOLVEPNP_SQPNP] = 1.0e-2; @@ -468,8 +468,8 @@ public: eps[SOLVEPNP_EPNP] = 1.0e-6; eps[SOLVEPNP_P3P] = 2.0e-4; eps[SOLVEPNP_AP3P] = 1.0e-4; - eps[SOLVEPNP_DLS] = 1.0e-6; //DLS is remapped to EPnP, so we use the same threshold - eps[SOLVEPNP_UPNP] = 1.0e-6; //UPnP is remapped to EPnP, so we use the same threshold + eps[SOLVEPNP_DLS] = 1.0e-6; // DLS is remapped to EPnP, so we use the same threshold + eps[SOLVEPNP_UPNP] = 1.0e-6; // UPnP is remapped to EPnP, so we use the same threshold eps[SOLVEPNP_IPPE] = 1.0e-6; eps[SOLVEPNP_IPPE_SQUARE] = 1.0e-6; eps[SOLVEPNP_SQPNP] = 1.0e-6; @@ -509,19 +509,19 @@ protected: if (mode == 0) { epsilon_trans[SOLVEPNP_EPNP] = 5.0e-3; - epsilon_trans[SOLVEPNP_DLS] = 5.0e-3; - epsilon_trans[SOLVEPNP_UPNP] = 5.0e-3; + epsilon_trans[SOLVEPNP_DLS] = 5.0e-3; // DLS is remapped to EPnP, so we use the same threshold + epsilon_trans[SOLVEPNP_UPNP] = 5.0e-3; // UPnP is remapped to EPnP, so we use the same threshold epsilon_rot[SOLVEPNP_EPNP] = 5.0e-3; - epsilon_rot[SOLVEPNP_DLS] = 5.0e-3; - epsilon_rot[SOLVEPNP_UPNP] = 5.0e-3; + epsilon_rot[SOLVEPNP_DLS] = 5.0e-3; // DLS is remapped to EPnP, so we use the same threshold + epsilon_rot[SOLVEPNP_UPNP] = 5.0e-3; // UPnP is remapped to EPnP, so we use the same threshold } else { epsilon_trans[SOLVEPNP_ITERATIVE] = 1e-4; epsilon_trans[SOLVEPNP_EPNP] = 5e-3; - epsilon_trans[SOLVEPNP_DLS] = 5e-3; - epsilon_trans[SOLVEPNP_UPNP] = 5e-3; + epsilon_trans[SOLVEPNP_DLS] = 5e-3; // DLS is remapped to EPnP, so we use the same threshold + epsilon_trans[SOLVEPNP_UPNP] = 5e-3; // UPnP is remapped to EPnP, so we use the same threshold epsilon_trans[SOLVEPNP_P3P] = 1e-4; epsilon_trans[SOLVEPNP_AP3P] = 1e-4; epsilon_trans[SOLVEPNP_IPPE] = 1e-4; @@ -529,8 +529,8 @@ protected: epsilon_rot[SOLVEPNP_ITERATIVE] = 1e-4; epsilon_rot[SOLVEPNP_EPNP] = 5e-3; - epsilon_rot[SOLVEPNP_DLS] = 5e-3; - epsilon_rot[SOLVEPNP_UPNP] = 5e-3; + epsilon_rot[SOLVEPNP_DLS] = 5e-3; // DLS is remapped to EPnP, so we use the same threshold + epsilon_rot[SOLVEPNP_UPNP] = 5e-3; // UPnP is remapped to EPnP, so we use the same threshold epsilon_rot[SOLVEPNP_P3P] = 1e-4; epsilon_rot[SOLVEPNP_AP3P] = 1e-4; epsilon_rot[SOLVEPNP_IPPE] = 1e-4;