From 87f23e3e9fd42e482130cefb7560b4e67de5d726 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 23 Oct 2024 18:22:36 +0200 Subject: [PATCH] Fix weighting to reflect what's in Antoine's thesis --- .../tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h | 4 ++-- modules/tracker/rbt/src/core/vpRBTracker.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h index 7151a5137c..dbaa4338b1 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h @@ -178,9 +178,9 @@ class VISP_EXPORT vpRBFeatureTracker /** * \brief Get the importance of this tracker in the optimization step. * The default computation is the following: - * \f$ \sqrt{w / N} \f$, where \f$ w\f$ is the weight defined by setTrackerWeight, and \f$ N \f$ is the number of features. + * \f$ w / N \f$, where \f$ w\f$ is the weight defined by setTrackerWeight, and \f$ N \f$ is the number of features. */ - virtual double getVVSTrackerWeight() const { return sqrt(m_userVvsWeight / m_numFeatures); } + virtual double getVVSTrackerWeight() const { return m_userVvsWeight / m_numFeatures; } void setTrackerWeight(double weight) { m_userVvsWeight = weight; } /** diff --git a/modules/tracker/rbt/src/core/vpRBTracker.cpp b/modules/tracker/rbt/src/core/vpRBTracker.cpp index ef7705852c..bb322fc672 100644 --- a/modules/tracker/rbt/src/core/vpRBTracker.cpp +++ b/modules/tracker/rbt/src/core/vpRBTracker.cpp @@ -496,11 +496,11 @@ std::vector vpRBTracker::extractSilhouettePoints( // double nx = cos(theta); // double ny = sin(theta); // const double Zn = Idepth[static_cast(round(n + ny * 1))][static_cast(round(m + nx * 2))]; - if (m_verbose) { - if (fabs(theta) > M_PI + 1e-6) { - throw vpException(vpException::badValue, "Theta expected to be in -Pi, Pi range but was not"); - } +#if defined(VISP_DEBUG_RB_TRACKER) + if (fabs(theta) > M_PI + 1e-6) { + throw vpException(vpException::badValue, "Theta expected to be in -Pi, Pi range but was not"); } +#endif points.push_back(vpRBSilhouettePoint(n, m, norm, theta, Z)); // if (Zn > 0) { // theta = -theta;