From 3d6b9c0d3497eee46a57e0145e5552a68626fb0e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jul 2017 02:25:50 +0200 Subject: cv/calibrator: return distinct sample count for all DOF --- cv/translation-calibrator.cpp | 9 ++++----- cv/translation-calibrator.hpp | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'cv') diff --git a/cv/translation-calibrator.cpp b/cv/translation-calibrator.cpp index cdd573bc..fb150bf9 100644 --- a/cv/translation-calibrator.cpp +++ b/cv/translation-calibrator.cpp @@ -54,12 +54,10 @@ void TranslationCalibrator::update(const cv::Matx33d& R_CM_k, const cv::Vec3d& t y += H_k_T * t_CM_k; } -std::tuple TranslationCalibrator::get_estimate() +std::tuple TranslationCalibrator::get_estimate() { cv::Vec6f x = P.inv() * y; - qDebug() << "calibrator:" << nsamples << "samples total"; - unsigned values[3] {}; vec* in[] { &used_yaw_poses, &used_pitch_poses, &used_roll_poses }; @@ -71,12 +69,13 @@ std::tuple TranslationCalibrator::get_estimate() values[k]++; } - qDebug() << "samples" + qDebug() << "samples total" << nsamples << "yaw" << values[0] << "pitch" << values[1] << "roll" << values[2]; - return std::make_tuple(cv::Vec3f(-x[0], -x[1], -x[2]), nsamples); + return std::make_tuple(cv::Vec3f(-x[0], -x[1], -x[2]), + cv::Vec3i(values[0], values[1], values[2])); } bool TranslationCalibrator::check_bucket(const cv::Matx33d& R_CM_k) diff --git a/cv/translation-calibrator.hpp b/cv/translation-calibrator.hpp index ae2ed844..d908496a 100644 --- a/cv/translation-calibrator.hpp +++ b/cv/translation-calibrator.hpp @@ -29,7 +29,7 @@ public: void update(const cv::Matx33d& R_CM_k, const cv::Vec3d& t_CM_k); // get the current estimate for t_MH - std::tuple get_estimate(); + std::tuple get_estimate(); private: bool check_bucket(const cv::Matx33d& R_CM_k); -- cgit v1.2.3