From dd81f1444e808cb51c704df7a08cbd9573f22505 Mon Sep 17 00:00:00 2001 From: Vladyslav Usenko Date: Wed, 31 Jul 2019 10:58:59 +0200 Subject: [PATCH] fix bug in aprilgrid --- src/calibration/aprilgrid.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibration/aprilgrid.cpp b/src/calibration/aprilgrid.cpp index fd3a343..6b36d0b 100644 --- a/src/calibration/aprilgrid.cpp +++ b/src/calibration/aprilgrid.cpp @@ -60,9 +60,9 @@ AprilGrid::AprilGrid(const std::string &config_path) { aprilgrid_corner_pos_3d.resize(tagCols * tagRows * 4); - for (int y = 0; y < tagCols; y++) { - for (int x = 0; x < tagRows; x++) { - int tag_id = tagRows * y + x; + for (int y = 0; y < tagRows; y++) { + for (int x = 0; x < tagCols; x++) { + int tag_id = tagCols * y + x; double x_offset = x * tagSize * (1 + tagSpacing); double y_offset = y * tagSize * (1 + tagSpacing); @@ -132,10 +132,10 @@ AprilGrid::AprilGrid(const std::string &config_path) { double coeff = double(k + 1) / double(num_vign_points + 1); - aprilgrid_vignette_pos_3d[curr_idx + k * tagCols + i] = + aprilgrid_vignette_pos_3d[curr_idx + k * tagRows + i] = (p0 + coeff * (p3 - p0)); - aprilgrid_vignette_pos_3d[curr_idx + k * tagCols + i][0] -= + aprilgrid_vignette_pos_3d[curr_idx + k * tagRows + i][0] -= tagSize * tagSpacing / 2; } }