Merge pull request #23271 from stefan523:aruco_testcase_fixes

Aruco/Charuco test case fixes for floating point for loops
This commit is contained in:
Alexander Smorkalov 2023-03-30 11:22:14 +03:00 committed by GitHub
commit 3cf367c9c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -247,7 +247,7 @@ void CV_ArucoDetectionPerspective::run(int) {
aruco::ArucoDetector detector(aruco::getPredefinedDictionary(aruco::DICT_6X6_250), params); aruco::ArucoDetector detector(aruco::getPredefinedDictionary(aruco::DICT_6X6_250), params);
// detect from different positions // detect from different positions
for(double distance = 0.1; distance < 0.7; distance += 0.2) { for(double distance : {0.1, 0.3, 0.5, 0.7}) {
for(int pitch = 0; pitch < 360; pitch += (distance == 0.1? 60:180)) { for(int pitch = 0; pitch < 360; pitch += (distance == 0.1? 60:180)) {
for(int yaw = 70; yaw <= 120; yaw += 40){ for(int yaw = 70; yaw <= 120; yaw += 40){
int currentId = iter % 250; int currentId = iter % 250;

View File

@ -51,7 +51,7 @@ void CV_ArucoBoardPose::run(int) {
aruco::DetectorParameters detectorParameters = detector.getDetectorParameters(); aruco::DetectorParameters detectorParameters = detector.getDetectorParameters();
// for different perspectives // for different perspectives
for(double distance = 0.2; distance <= 0.4; distance += 0.15) { for(double distance : {0.2, 0.35}) {
for(int yaw = -55; yaw <= 50; yaw += 25) { for(int yaw = -55; yaw <= 50; yaw += 25) {
for(int pitch = -55; pitch <= 50; pitch += 25) { for(int pitch = -55; pitch <= 50; pitch += 25) {
vector<int> tmpIds; vector<int> tmpIds;
@ -162,7 +162,7 @@ void CV_ArucoRefine::run(int) {
aruco::DetectorParameters detectorParameters = detector.getDetectorParameters(); aruco::DetectorParameters detectorParameters = detector.getDetectorParameters();
// for different perspectives // for different perspectives
for(double distance = 0.2; distance <= 0.4; distance += 0.2) { for(double distance : {0.2, 0.4}) {
for(int yaw = -60; yaw < 60; yaw += 30) { for(int yaw = -60; yaw < 60; yaw += 30) {
for(int pitch = -60; pitch <= 60; pitch += 30) { for(int pitch = -60; pitch <= 60; pitch += 30) {
aruco::GridBoard gridboard(Size(3, 3), 0.02f, 0.005f, detector.getDictionary()); aruco::GridBoard gridboard(Size(3, 3), 0.02f, 0.005f, detector.getDictionary());

View File

@ -109,7 +109,7 @@ void CV_CharucoDetection::run(int) {
Mat distCoeffs(5, 1, CV_64FC1, Scalar::all(0)); Mat distCoeffs(5, 1, CV_64FC1, Scalar::all(0));
// for different perspectives // for different perspectives
for(double distance = 0.2; distance <= 0.4; distance += 0.2) { for(double distance : {0.2, 0.4}) {
for(int yaw = -55; yaw <= 50; yaw += 25) { for(int yaw = -55; yaw <= 50; yaw += 25) {
for(int pitch = -55; pitch <= 50; pitch += 25) { for(int pitch = -55; pitch <= 50; pitch += 25) {
@ -213,7 +213,7 @@ void CV_CharucoPoseEstimation::run(int) {
Mat distCoeffs(5, 1, CV_64FC1, Scalar::all(0)); Mat distCoeffs(5, 1, CV_64FC1, Scalar::all(0));
// for different perspectives // for different perspectives
for(double distance = 0.2; distance <= 0.3; distance += 0.1) { for(double distance : {0.2, 0.25}) {
for(int yaw = -55; yaw <= 50; yaw += 25) { for(int yaw = -55; yaw <= 50; yaw += 25) {
for(int pitch = -55; pitch <= 50; pitch += 25) { for(int pitch = -55; pitch <= 50; pitch += 25) {
@ -332,7 +332,7 @@ void CV_CharucoDiamondDetection::run(int) {
detector.setCharucoParameters(charucoParameters); detector.setCharucoParameters(charucoParameters);
// for different perspectives // for different perspectives
for(double distance = 0.2; distance <= 0.3; distance += 0.1) { for(double distance : {0.2, 0.22}) {
for(int yaw = -50; yaw <= 50; yaw += 25) { for(int yaw = -50; yaw <= 50; yaw += 25) {
for(int pitch = -50; pitch <= 50; pitch += 25) { for(int pitch = -50; pitch <= 50; pitch += 25) {