From 62a372fdb485a06e153301b6a432b2bc114abf2c Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 4 Oct 2024 10:04:49 +0200 Subject: [PATCH] Remove empty lines --- modules/core/include/visp3/core/vpRGBa.h | 1 - modules/core/include/visp3/core/vpRGBf.h | 3 --- .../klt/include/visp3/klt/vpKltOpencv.h | 2 -- .../rbt/include/visp3/rbt/vpColorHistogram.h | 8 +------ .../include/visp3/rbt/vpColorHistogramMask.h | 1 - .../rbt/include/visp3/rbt/vpDynamicFactory.h | 4 +--- .../visp3/rbt/vpObjectCentricRenderer.h | 4 ++-- .../rbt/include/visp3/rbt/vpObjectMask.h | 6 +---- .../include/visp3/rbt/vpObjectMaskFactory.h | 1 + .../include/visp3/rbt/vpPanda3DDepthFilters.h | 5 ++-- .../include/visp3/rbt/vpRBDenseDepthTracker.h | 7 ++---- .../rbt/include/visp3/rbt/vpRBDriftDetector.h | 2 +- .../visp3/rbt/vpRBDriftDetectorFactory.h | 2 ++ .../include/visp3/rbt/vpRBFeatureTracker.h | 2 +- .../visp3/rbt/vpRBFeatureTrackerFactory.h | 2 ++ .../visp3/rbt/vpRBFeatureTrackerInput.h | 5 +++- .../visp3/rbt/vpRBInitializationHelper.h | 2 ++ .../rbt/include/visp3/rbt/vpRBKltTracker.h | 2 +- .../rbt/vpRBProbabilistic3DDriftDetector.h | 5 ++-- .../visp3/rbt/vpRBSilhouetteCCDTracker.h | 2 ++ .../visp3/rbt/vpRBSilhouetteControlPoint.h | 1 - .../visp3/rbt/vpRBSilhouetteMeTracker.h | 2 +- .../include/visp3/rbt/vpRBSilhouettePoint.h | 1 + .../vpRBSilhouettePointsExtractionSettings.h | 4 ---- .../rbt/include/visp3/rbt/vpRBTracker.h | 2 -- .../rbt/include/visp3/rbt/vpRBTrackerLogger.h | 2 +- .../rbt/src/core/vpRBInitializationHelper.cpp | 3 +-- .../src/core/vpRBSilhouetteControlPoint.cpp | 2 -- ...vpRBSilhouettePointsExtractionSettings.cpp | 1 - modules/tracker/rbt/src/core/vpRBTracker.cpp | 1 - .../src/drift/vpRBDriftDetectorFactory.cpp | 1 + .../vpRBProbabilistic3DDriftDetector.cpp | 24 ++++++++++--------- .../src/features/vpRBDenseDepthTracker.cpp | 6 ++--- .../rbt/src/features/vpRBKltTracker.cpp | 9 ++++--- .../src/features/vpRBSilhouetteCCDTracker.cpp | 18 ++++---------- .../src/features/vpRBSilhouetteMeTracker.cpp | 9 +++---- .../tracker/rbt/src/mask/vpColorHistogram.cpp | 5 ---- .../rbt/src/mask/vpColorHistogramMask.cpp | 11 +++------ .../src/rendering/vpObjectCentricRenderer.cpp | 4 ++-- .../src/rendering/vpPanda3DDepthFilters.cpp | 1 - modules/tracker/rbt/test/test_utils.h | 7 +++--- 41 files changed, 68 insertions(+), 112 deletions(-) diff --git a/modules/core/include/visp3/core/vpRGBa.h b/modules/core/include/visp3/core/vpRGBa.h index 5d70e4cee2..d62a1002cf 100644 --- a/modules/core/include/visp3/core/vpRGBa.h +++ b/modules/core/include/visp3/core/vpRGBa.h @@ -182,6 +182,5 @@ static_assert(std::is_trivially_assignable_v); static_assert(std::is_trivially_copyable_v); #endif - END_VISP_NAMESPACE #endif diff --git a/modules/core/include/visp3/core/vpRGBf.h b/modules/core/include/visp3/core/vpRGBf.h index 67a35372c5..adb100b89a 100644 --- a/modules/core/include/visp3/core/vpRGBf.h +++ b/modules/core/include/visp3/core/vpRGBf.h @@ -154,9 +154,6 @@ static_assert(std::is_trivially_assignable_v); static_assert(std::is_trivially_copyable_v); #endif - END_VISP_NAMESPACE - - #endif diff --git a/modules/tracker/klt/include/visp3/klt/vpKltOpencv.h b/modules/tracker/klt/include/visp3/klt/vpKltOpencv.h index f2346be825..03109c3ba9 100644 --- a/modules/tracker/klt/include/visp3/klt/vpKltOpencv.h +++ b/modules/tracker/klt/include/visp3/klt/vpKltOpencv.h @@ -56,7 +56,6 @@ #include #endif - BEGIN_VISP_NAMESPACE /*! * \class vpKltOpencv @@ -389,7 +388,6 @@ class VISP_EXPORT vpKltOpencv void suppressFeature(const int &index); #ifdef VISP_HAVE_NLOHMANN_JSON - friend void to_json(nlohmann::json &j, const vpKltOpencv &array); friend void from_json(const nlohmann::json &j, vpKltOpencv &array); #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpColorHistogram.h b/modules/tracker/rbt/include/visp3/rbt/vpColorHistogram.h index ad51c29b91..ff32d54400 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpColorHistogram.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpColorHistogram.h @@ -40,18 +40,13 @@ #include - - BEGIN_VISP_NAMESPACE template class vpImage; - class vpRGBa; - class vpRect; - class VISP_EXPORT vpColorHistogram { public: @@ -109,8 +104,7 @@ class VISP_EXPORT vpColorHistogram std::vector m_probas; unsigned int m_numPixels; }; -END_VISP_NAMESPACE - +END_VISP_NAMESPACE #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h b/modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h index 99e07f3866..d431f393b4 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h @@ -63,7 +63,6 @@ class VISP_EXPORT vpColorHistogramMask : public vpObjectMask const vpRBFeatureTrackerInput &previousFrame, vpImage &mask) VP_OVERRIDE; - /** * \name Histogram settings * @{ diff --git a/modules/tracker/rbt/include/visp3/rbt/vpDynamicFactory.h b/modules/tracker/rbt/include/visp3/rbt/vpDynamicFactory.h index abf961dade..ca5be21148 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpDynamicFactory.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpDynamicFactory.h @@ -75,19 +75,17 @@ class VISP_EXPORT vpDynamicFactory { m_keyFinder = finderFn; } - #endif protected: vpDynamicFactory() = default; - #if defined(VISP_HAVE_NLOHMANN_JSON) std::map(const nlohmann::json &)>> m_jsonBuilders; std::function m_keyFinder; //! Function to retrieve the key from a json object #endif - }; + END_VISP_NAMESPACE #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpObjectCentricRenderer.h b/modules/tracker/rbt/include/visp3/rbt/vpObjectCentricRenderer.h index b1525de595..58fc13f18b 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpObjectCentricRenderer.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpObjectCentricRenderer.h @@ -83,7 +83,6 @@ class VISP_EXPORT vpObjectCentricRenderer : public vpPanda3DRendererSet vpRect computeBoundingBox(); - template void placeRenderInto(const vpImage &render, vpImage &target, const T &clearValue) { @@ -116,8 +115,9 @@ class VISP_EXPORT vpObjectCentricRenderer : public vpPanda3DRendererSet std::vector m_bb3DPoints; bool m_shouldComputeBBPoints; vpPanda3DRenderParameters m_subRenderParams; - }; + END_VISP_NAMESPACE + #endif #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h b/modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h index 2258b39f31..a9821997f7 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h @@ -37,7 +37,6 @@ #include - #if defined(VISP_HAVE_NLOHMANN_JSON) #include #endif @@ -46,7 +45,6 @@ BEGIN_VISP_NAMESPACE template class vpImage; - class vpRBFeatureTrackerInput; /** @@ -66,10 +64,8 @@ class VISP_EXPORT vpObjectMask #if defined(VISP_HAVE_NLOHMANN_JSON) virtual void loadJsonConfiguration(const nlohmann::json &j) = 0; #endif - - }; -END_VISP_NAMESPACE +END_VISP_NAMESPACE #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h b/modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h index 61d78ab834..67321f3652 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h @@ -57,6 +57,7 @@ class VISP_EXPORT vpObjectMaskFactory : public vpDynamicFactory return factory; } }; + END_VISP_NAMESPACE #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h b/modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h index bde78f018b..a0def96ea2 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h @@ -65,8 +65,8 @@ class VISP_EXPORT vpPanda3DDepthGaussianBlur : public vpPanda3DPostProcessFilter * * The results of the canny are filtered based on a threshold value (defined between 0 and 255), checking whether there is enough gradient information. * The output of this image is a floating RGB image containing: - * - In the red channel, the value of the convolution with the sobel horizontal kernel - * - In the green channel, the value of the convolution with the sobel vertical kernel + * - In the red channel, the value of the convolution with the Sobel horizontal kernel + * - In the green channel, the value of the convolution with the Sobel vertical kernel * - In the blue channel, the angle (in radians) of the edge normal. */ class VISP_EXPORT vpPanda3DDepthCannyFilter : public vpPanda3DPostProcessFilter @@ -86,6 +86,7 @@ class VISP_EXPORT vpPanda3DDepthCannyFilter : public vpPanda3DPostProcessFilter static const char *FRAGMENT_SHADER; float m_edgeThreshold; }; + END_VISP_NAMESPACE #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBDenseDepthTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBDenseDepthTracker.h index 91aa59e4fb..b3f0c39735 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBDenseDepthTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBDenseDepthTracker.h @@ -59,7 +59,7 @@ BEGIN_VISP_NAMESPACE /** - * @brief A tracker based on dense depth point-plane alignement + * @brief A tracker based on dense depth point-plane alignment. * * \ingroup group_rbt_trackers * @@ -132,11 +132,8 @@ class VISP_EXPORT vpRBDenseDepthTracker : public vpRBFeatureTracker struct vpDepthPoint { - vpDepthPoint() : currentPoint(3), cameraNormal(3), objectNormal(3) - { - - } + { } inline void update(const vpHomogeneousMatrix &cMo, const vpRotationMatrix &cRo) { diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h b/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h index b7673357c6..82f7f75d97 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h @@ -86,7 +86,7 @@ class VISP_EXPORT vpRBDriftDetector virtual double getScore() const = 0; /** - * \brief Returns whether the tracking has diverged and should be reinitialised. + * \brief Returns whether the tracking has diverged and should be reinitialized. * This function should be called after update. * */ diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetectorFactory.h b/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetectorFactory.h index 2d4c5de638..4b3c933582 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetectorFactory.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetectorFactory.h @@ -58,5 +58,7 @@ class VISP_EXPORT vpRBDriftDetectorFactory : public vpDynamicFactory class vpImage; */ class VISP_EXPORT vpRBProbabilistic3DDriftDetector : public vpRBDriftDetector { - private: struct vpStored3DSurfaceColorPoint @@ -317,7 +316,6 @@ class VISP_EXPORT vpRBProbabilistic3DDriftDetector : public vpRBDriftDetector void loadJsonConfiguration(const nlohmann::json &) VP_OVERRIDE; #endif - /** * @} * End settings @@ -333,7 +331,8 @@ class VISP_EXPORT vpRBProbabilistic3DDriftDetector : public vpRBDriftDetector double m_score; std::vector m_points; - }; + END_VISP_NAMESPACE + #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteCCDTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteCCDTracker.h index 1564f1d5b5..4068d81ff5 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteCCDTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteCCDTracker.h @@ -275,5 +275,7 @@ class VISP_EXPORT vpRBSilhouetteCCDTracker : public vpRBFeatureTracker vpMatrix m_hessian; //! Sum of local hessians double m_temporalSmoothingFac; //! Smoothing factor used to integrate data from the previous frame. }; + END_VISP_NAMESPACE + #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteControlPoint.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteControlPoint.h index ebbd2f917f..9e1a18f173 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteControlPoint.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteControlPoint.h @@ -91,7 +91,6 @@ class VISP_EXPORT vpRBSilhouetteControlPoint double xs, ys, nxs, nys, Zs; - public: void init(); diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteMeTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteMeTracker.h index 44c41d331e..a44437d2d4 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteMeTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteMeTracker.h @@ -179,8 +179,8 @@ class VISP_EXPORT vpRBSilhouetteMeTracker : public vpRBFeatureTracker double m_singlePointConvergedThresholdPixels; //! Whether a single Control point is considered as converged bool m_useMask; float m_minMaskConfidence; - }; + END_VISP_NAMESPACE #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePoint.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePoint.h index 7933b2ae16..e0a697261f 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePoint.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePoint.h @@ -56,6 +56,7 @@ class VISP_EXPORT vpRBSilhouettePoint { } }; + END_VISP_NAMESPACE #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePointsExtractionSettings.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePointsExtractionSettings.h index 469f6e0cf9..a90faeee13 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePointsExtractionSettings.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePointsExtractionSettings.h @@ -69,7 +69,6 @@ class VISP_EXPORT vpSilhouettePointsExtractionSettings bool m_thresholdIsRelative; bool m_preferPreviousPoints; - void sampleWithoutReplacement(unsigned int count, unsigned int vectorSize, std::vector &indices, vpUniRand &random) const { count = std::min(count, vectorSize); @@ -117,7 +116,6 @@ class VISP_EXPORT vpSilhouettePointsExtractionSettings const vpCameraParameters &cam, const vpHomogeneousMatrix &cTcp, const std::vector &previousPoints, long randomSeed = 41) const; - #if defined(VISP_HAVE_NLOHMANN_JSON) inline friend void from_json(const nlohmann::json &j, vpSilhouettePointsExtractionSettings &settings); #endif @@ -136,12 +134,10 @@ inline void from_json(const nlohmann::json &j, vpSilhouettePointsExtractionSetti settings.m_preferPreviousPoints = samplingSettings.at("reusePreviousPoints"); settings.m_maxNumPoints = samplingSettings.at("numPoints"); settings.setSampleStep(samplingSettings.at("samplingRate")); - } #endif END_VISP_NAMESPACE - #endif #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBTracker.h index c71c05202a..53de5aeb49 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBTracker.h @@ -47,7 +47,6 @@ #include - #include #if defined(VISP_HAVE_NLOHMANN_JSON) @@ -168,7 +167,6 @@ class VISP_EXPORT vpRBTracker void reset(); - /** * \name Tracking * @{ diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBTrackerLogger.h b/modules/tracker/rbt/include/visp3/rbt/vpRBTrackerLogger.h index ee0461c84d..e20e004440 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBTrackerLogger.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBTrackerLogger.h @@ -83,7 +83,6 @@ class VISP_EXPORT vpRBTrackerLogger void setSilhouetteTime(double elapsed) { m_silhouetteExtractionTime = elapsed; } void setMaskTime(double elapsed) { m_maskTime = elapsed; } - void insertTrackerTime(std::map> &map, int id, double elapsed) { if (map.find(id) == map.end()) { @@ -174,4 +173,5 @@ std::ostream &operator<<(std::ostream &out, const vpRBTrackerLogger &timer) } END_VISP_NAMESPACE + #endif diff --git a/modules/tracker/rbt/src/core/vpRBInitializationHelper.cpp b/modules/tracker/rbt/src/core/vpRBInitializationHelper.cpp index db97d5ddf0..dde3a79ee1 100644 --- a/modules/tracker/rbt/src/core/vpRBInitializationHelper.cpp +++ b/modules/tracker/rbt/src/core/vpRBInitializationHelper.cpp @@ -38,7 +38,6 @@ void vpRBInitializationHelper::savePose(const std::string &filename) const finitpos.close(); } - #ifdef VISP_HAVE_MODULE_GUI template @@ -100,8 +99,8 @@ void vpRBInitializationHelper::initClick(const vpImage &I, const std::string vpDisplay::flush(I); while (!vpDisplay::getClick(I, ip, button)) { + vpTime::sleepMs(10); } - } if (!finitpos.fail() && button == vpMouseButton::button1) { diff --git a/modules/tracker/rbt/src/core/vpRBSilhouetteControlPoint.cpp b/modules/tracker/rbt/src/core/vpRBSilhouetteControlPoint.cpp index 7d3404f31d..f946d89b06 100644 --- a/modules/tracker/rbt/src/core/vpRBSilhouetteControlPoint.cpp +++ b/modules/tracker/rbt/src/core/vpRBSilhouetteControlPoint.cpp @@ -367,7 +367,6 @@ void vpRBSilhouetteControlPoint::initControlPoint(const vpImage & void vpRBSilhouetteControlPoint::detectSilhouette(const vpImage &I) { - unsigned int k = 0; int range = 4; double c = cos(theta); @@ -381,7 +380,6 @@ void vpRBSilhouetteControlPoint::detectSilhouette(const vpImage &I) m_isSilhouette = k > 2; } - /*! Compute the interaction matrix and the error vector corresponding to the line. */ diff --git a/modules/tracker/rbt/src/core/vpRBSilhouettePointsExtractionSettings.cpp b/modules/tracker/rbt/src/core/vpRBSilhouettePointsExtractionSettings.cpp index afdb5aa528..21d07af113 100644 --- a/modules/tracker/rbt/src/core/vpRBSilhouettePointsExtractionSettings.cpp +++ b/modules/tracker/rbt/src/core/vpRBSilhouettePointsExtractionSettings.cpp @@ -96,7 +96,6 @@ std::vector> vpSilhouettePointsExtractionS if (validSilhouette[nv][nu] > 0 && fabs((renderDepth[nv][nu] / p.Z) - 1.0) < 0.01) { finalCandidates.push_back(std::make_pair(nv, nu)); } - } } } diff --git a/modules/tracker/rbt/src/core/vpRBTracker.cpp b/modules/tracker/rbt/src/core/vpRBTracker.cpp index ecb343b905..3060f17940 100644 --- a/modules/tracker/rbt/src/core/vpRBTracker.cpp +++ b/modules/tracker/rbt/src/core/vpRBTracker.cpp @@ -407,7 +407,6 @@ void vpRBTracker::updateRender(vpRBFeatureTrackerInput &frame) else { m_renderer.getRenderer()->setEdgeThreshold(thresholdValue); } - } // Call Panda renderer diff --git a/modules/tracker/rbt/src/drift/vpRBDriftDetectorFactory.cpp b/modules/tracker/rbt/src/drift/vpRBDriftDetectorFactory.cpp index c98330ad1d..392008cf89 100644 --- a/modules/tracker/rbt/src/drift/vpRBDriftDetectorFactory.cpp +++ b/modules/tracker/rbt/src/drift/vpRBDriftDetectorFactory.cpp @@ -30,6 +30,7 @@ #include #include + BEGIN_VISP_NAMESPACE vpRBDriftDetectorFactory::vpRBDriftDetectorFactory() diff --git a/modules/tracker/rbt/src/drift/vpRBProbabilistic3DDriftDetector.cpp b/modules/tracker/rbt/src/drift/vpRBProbabilistic3DDriftDetector.cpp index 6f8142b9c3..1a9d211d58 100644 --- a/modules/tracker/rbt/src/drift/vpRBProbabilistic3DDriftDetector.cpp +++ b/modules/tracker/rbt/src/drift/vpRBProbabilistic3DDriftDetector.cpp @@ -42,7 +42,9 @@ BEGIN_VISP_NAMESPACE -void vpRBProbabilistic3DDriftDetector::update(const vpRBFeatureTrackerInput &previousFrame, const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cTo, const vpHomogeneousMatrix &cprevTo) +void vpRBProbabilistic3DDriftDetector::update(const vpRBFeatureTrackerInput &previousFrame, + const vpRBFeatureTrackerInput &frame, + const vpHomogeneousMatrix &cTo, const vpHomogeneousMatrix &cprevTo) { const vpTranslationVector t = cprevTo.inverse().getTranslationVector(); @@ -108,16 +110,16 @@ void vpRBProbabilistic3DDriftDetector::update(const vpRBFeatureTrackerInput &pre } if (visiblePoints.size() > 0) { - // // Compute sample weight - // double maxTrace = 0.0; - - // for (vpStored3DSurfaceColorPoint *p : visiblePoints) { - // double trace = p->stats.trace(); - // if (trace > maxTrace) { - // maxTrace = trace; - // } - // } - // maxTrace = std::max(maxTrace, 80.0); + // // Compute sample weight + // double maxTrace = 0.0; + + // for (vpStored3DSurfaceColorPoint *p : visiblePoints) { + // double trace = p->stats.trace(); + // if (trace > maxTrace) { + // maxTrace = trace; + // } + // } + // maxTrace = std::max(maxTrace, 80.0); double weightSum = 0.0; m_score = 0.0; for (vpStored3DSurfaceColorPoint *p : visiblePoints) { diff --git a/modules/tracker/rbt/src/features/vpRBDenseDepthTracker.cpp b/modules/tracker/rbt/src/features/vpRBDenseDepthTracker.cpp index ed816317e2..06e8af69ce 100644 --- a/modules/tracker/rbt/src/features/vpRBDenseDepthTracker.cpp +++ b/modules/tracker/rbt/src/features/vpRBDenseDepthTracker.cpp @@ -43,10 +43,8 @@ void fastRotationMatmul(const vpRotationMatrix &cRo, const vpRGBf &v, vpColVecto res[2] = R[6] * r + R[7] * g + R[8] * b; } - void fastProjection(const vpHomogeneousMatrix &oTc, double X, double Y, double Z, vpPoint &p) { - const double *T = oTc.data; p.set_oX(T[0] * X + T[1] * Y + T[2] * Z + T[3]); p.set_oY(T[4] * X + T[5] * Y + T[6] * Z + T[7]); @@ -151,7 +149,9 @@ void vpRBDenseDepthTracker::computeVVSIter(const vpRBFeatureTrackerInput &/*fram m_vvsConverged = false; } -void vpRBDenseDepthTracker::display(const vpCameraParameters &/*cam*/, const vpImage &/*I*/, const vpImage &/*IRGB*/, const vpImage &/*depth*/, const vpRBFeatureDisplayType /*type*/) const +void vpRBDenseDepthTracker::display(const vpCameraParameters &/*cam*/, const vpImage &/*I*/, + const vpImage &/*IRGB*/, const vpImage &/*depth*/, + const vpRBFeatureDisplayType /*type*/) const { // for (unsigned int i = 0; i < m_depthPoints.size(); ++i) { // const vpDepthPoint &p = m_depthPoints[i]; diff --git a/modules/tracker/rbt/src/features/vpRBKltTracker.cpp b/modules/tracker/rbt/src/features/vpRBKltTracker.cpp index be0575c32a..4f68172573 100644 --- a/modules/tracker/rbt/src/features/vpRBKltTracker.cpp +++ b/modules/tracker/rbt/src/features/vpRBKltTracker.cpp @@ -77,9 +77,7 @@ inline void vpRBKltTracker::tryAddNewPoint( vpRBKltTracker::vpRBKltTracker() : vpRBFeatureTracker(), m_numPointsReinit(20), m_newPointsDistanceThreshold(5.0), m_border(5), m_maxErrorOutliersPixels(10.0), m_useMask(false), m_minMaskConfidence(0.0) -{ - -} +{ } void vpRBKltTracker::extractFeatures(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput & /*previousFrame*/, const vpHomogeneousMatrix &cMo) { @@ -311,8 +309,9 @@ void vpRBKltTracker::computeVVSIter(const vpRBFeatureTrackerInput &/*frame*/, co computeJTR(m_L, m_weighted_error, m_LTR); } - -void vpRBKltTracker::display(const vpCameraParameters &cam, const vpImage &I, const vpImage &/*IRGB*/, const vpImage &/*depth*/, const vpRBFeatureDisplayType /*type*/) const +void vpRBKltTracker::display(const vpCameraParameters &cam, const vpImage &I, + const vpImage &/*IRGB*/, const vpImage &/*depth*/, + const vpRBFeatureDisplayType /*type*/) const { for (const std::pair &p : m_points) { double u = 0.0, v = 0.0; diff --git a/modules/tracker/rbt/src/features/vpRBSilhouetteCCDTracker.cpp b/modules/tracker/rbt/src/features/vpRBSilhouetteCCDTracker.cpp index c2059185dd..0eb3486cec 100644 --- a/modules/tracker/rbt/src/features/vpRBSilhouetteCCDTracker.cpp +++ b/modules/tracker/rbt/src/features/vpRBSilhouetteCCDTracker.cpp @@ -67,7 +67,6 @@ template class FastMat33 minv[6] = (data[3] * data[7] - data[6] * data[4]) * invdet; minv[7] = (data[6] * data[1] - data[0] * data[7]) * invdet; minv[8] = (data[0] * data[4] - data[3] * data[1]) * invdet; - } static void multiply(const vpMatrix &A, const FastMat33 &B, vpMatrix &C) @@ -107,8 +106,6 @@ void vpRBSilhouetteCCDTracker::extractFeatures(const vpRBFeatureTrackerInput &fr } } - - void vpRBSilhouetteCCDTracker::initVVS(const vpRBFeatureTrackerInput &/*frame*/, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix & /*cMo*/) { // Reinit all variables @@ -129,7 +126,6 @@ void vpRBSilhouetteCCDTracker::initVVS(const vpRBFeatureTrackerInput &/*frame*/, m_gradients.resize(m_controlPoints.size() * 2 * normal_points_number, vpColVector(m_gradient.getRows())); m_hessians.resize(m_controlPoints.size() * 2 * normal_points_number, vpMatrix(m_hessian.getRows(), m_hessian.getCols())); - //m_weights.resize(nerror_ccd); m_weights.resize(m_numFeatures, false); // m_weights = 1; @@ -165,7 +161,9 @@ void vpRBSilhouetteCCDTracker::computeVVSIter(const vpRBFeatureTrackerInput &fra } } -void vpRBSilhouetteCCDTracker::display(const vpCameraParameters &/*cam*/, const vpImage &/*I*/, const vpImage &IRGB, const vpImage &/*depth*/, const vpRBFeatureDisplayType type) const +void vpRBSilhouetteCCDTracker::display(const vpCameraParameters &/*cam*/, const vpImage &/*I*/, + const vpImage &IRGB, const vpImage &/*depth*/, + const vpRBFeatureDisplayType type) const { unsigned normal_points_number = floor(m_ccdParameters.h / m_ccdParameters.delta_h); unsigned nerror_per_point = 2 * normal_points_number * 3; @@ -249,10 +247,6 @@ void vpRBSilhouetteCCDTracker::updateCCDPoints(const vpHomogeneousMatrix &cMo) } } - - - - void vpRBSilhouetteCCDTracker::computeLocalStatistics(const vpImage &I, vpCCDStatistics &stats) { @@ -376,8 +370,8 @@ void vpRBSilhouetteCCDTracker::computeLocalStatistics(const vpImage &I, vic_ptr[10 * negative_normal + 9] = exp(-dist2[0] * dist2[0] / (2 * sigma * sigma)) / (sqrt(2 * CV_PI) * sigma); normalized_param[kk][1] += vic_ptr[10 * negative_normal + 7]; } - } + #ifdef VISP_HAVE_OPENMP #pragma omp parallel for #endif @@ -439,7 +433,6 @@ void vpRBSilhouetteCCDTracker::computeLocalStatistics(const vpImage &I, m2[1] += wp2 * pixel[1]; m2[2] += wp2 * pixel[2]; - // compute second order local statistics // m_{k,s} = \sum_{l} w_{kls} I_{kl}*I_{kl}^T for (unsigned int m = 0; m < 3; ++m) { @@ -491,7 +484,6 @@ void vpRBSilhouetteCCDTracker::computeLocalStatistics(const vpImage &I, cov_vic_ptr[m * 3 + m] += m_ccdParameters.kappa; cov_vic_ptr[9 + m * 3 + m] += m_ccdParameters.kappa; } - } } @@ -507,7 +499,6 @@ void vpRBSilhouetteCCDTracker::computeErrorAndInteractionMatrix() #pragma omp parallel #endif { - // vpMatrix tmp_cov(3, 3); // vpMatrix tmp_cov_inv(3, 3); FastMat33 tmp_cov, tmp_cov_inv; @@ -589,7 +580,6 @@ void vpRBSilhouetteCCDTracker::computeErrorAndInteractionMatrix() //vpMatrix::mult2Matrices(tmp_jacobian, tmp_cov_inv, tmp_jacobian_x_tmp_cov_inv); vpMatrix::mult2Matrices(tmp_jacobian_x_tmp_cov_inv, tmp_pixel_diff, m_gradients[i * 2 * normal_points_number + j]); vpMatrix::mult2Matrices(tmp_jacobian_x_tmp_cov_inv, tmp_jacobian.t(), m_hessians[i * 2 * normal_points_number + j]); - } } } diff --git a/modules/tracker/rbt/src/features/vpRBSilhouetteMeTracker.cpp b/modules/tracker/rbt/src/features/vpRBSilhouetteMeTracker.cpp index b49b57f8bd..175503f5a9 100644 --- a/modules/tracker/rbt/src/features/vpRBSilhouetteMeTracker.cpp +++ b/modules/tracker/rbt/src/features/vpRBSilhouetteMeTracker.cpp @@ -32,10 +32,8 @@ #define VISP_DEBUG_ME_TRACKER 0 - BEGIN_VISP_NAMESPACE - /** * @brief Extract the geometric features from the list of collected silhouette points */ @@ -84,7 +82,6 @@ void vpRBSilhouetteMeTracker::extractFeatures(const vpRBFeatureTrackerInput &fra m_robust.setMinMedianAbsoluteDeviation(m_robustMadMin / frame.cam.get_px()); } - void vpRBSilhouetteMeTracker::trackFeatures(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &/*previousFrame*/, const vpHomogeneousMatrix &/*cMo*/) { if (m_numCandidates <= 1) { @@ -158,7 +155,6 @@ void vpRBSilhouetteMeTracker::computeVVSIter(const vpRBFeatureTrackerInput &fram else { m_vvsConverged = true; } - } m_robust.MEstimator(vpRobust::TUKEY, m_error, m_weights); @@ -184,10 +180,11 @@ void vpRBSilhouetteMeTracker::computeVVSIter(const vpRBFeatureTrackerInput &fram } } #endif - } -void vpRBSilhouetteMeTracker::display(const vpCameraParameters &/*cam*/, const vpImage &I, const vpImage &/*IRGB*/, const vpImage &/*depth*/, const vpRBFeatureDisplayType type) const +void vpRBSilhouetteMeTracker::display(const vpCameraParameters &/*cam*/, const vpImage &I, + const vpImage &/*IRGB*/, const vpImage &/*depth*/, + const vpRBFeatureDisplayType type) const { if (type == vpRBFeatureDisplayType::SIMPLE) { diff --git a/modules/tracker/rbt/src/mask/vpColorHistogram.cpp b/modules/tracker/rbt/src/mask/vpColorHistogram.cpp index b992614092..261a2f3ab7 100644 --- a/modules/tracker/rbt/src/mask/vpColorHistogram.cpp +++ b/modules/tracker/rbt/src/mask/vpColorHistogram.cpp @@ -49,7 +49,6 @@ void vpColorHistogram::Builder::build(vpColorHistogram &histogram) histogram.m_probas[i] = static_cast(m_counts[i]) / countFloat; } histogram.m_numPixels = count; - } vpColorHistogram::vpColorHistogram() : m_N(0), m_numPixels(0) @@ -154,7 +153,6 @@ double vpColorHistogram::kl(const vpColorHistogram &other) const double vpColorHistogram::jsd(const vpColorHistogram &other) const { - vpColorHistogram mixture(m_N); for (unsigned int i = 0; i < m_probas.size(); ++i) { @@ -175,7 +173,6 @@ double vpColorHistogram::hellinger(const vpColorHistogram &other) const return sqrt(1.0 - bcoeff); } - void vpColorHistogram::computeSplitHistograms(const vpImage &image, const vpImage &mask, vpColorHistogram &insideMask, vpColorHistogram &outsideMask) { if (insideMask.m_N != outsideMask.m_N) { @@ -206,7 +203,6 @@ void vpColorHistogram::computeSplitHistograms(const vpImage &image, cons } insideMask.build(countsIn); outsideMask.build(countsOut); - } void vpColorHistogram::computeSplitHistograms(const vpImage &image, const vpImage &mask, const vpRect &bbInside, vpColorHistogram &insideMask, vpColorHistogram &outsideMask) @@ -223,7 +219,6 @@ void vpColorHistogram::computeSplitHistograms(const vpImage &image, cons const unsigned int beforeBBStart = static_cast(bbInside.getTop()) * image.getWidth() + static_cast(bbInside.getLeft()); const unsigned int afterBBEnd = static_cast(bbInside.getBottom()) * image.getWidth() + static_cast(bbInside.getRight()); - //#pragma omp parallel { std::vectorlocalCountsIn(bins, 0), localCountsOut(bins, 0); diff --git a/modules/tracker/rbt/src/mask/vpColorHistogramMask.cpp b/modules/tracker/rbt/src/mask/vpColorHistogramMask.cpp index cbb4ba5772..cf6689aaf8 100644 --- a/modules/tracker/rbt/src/mask/vpColorHistogramMask.cpp +++ b/modules/tracker/rbt/src/mask/vpColorHistogramMask.cpp @@ -40,10 +40,9 @@ BEGIN_VISP_NAMESPACE vpColorHistogramMask::vpColorHistogramMask() { } -void vpColorHistogramMask::updateMask( - const vpRBFeatureTrackerInput &frame, - const vpRBFeatureTrackerInput &previousFrame, - vpImage &mask) +void vpColorHistogramMask::updateMask(const vpRBFeatureTrackerInput &frame, + const vpRBFeatureTrackerInput &previousFrame, + vpImage &mask) { // Prefer the last frame: // we have updated the render to match the pose so we should get better object and background histogram separation. @@ -111,13 +110,9 @@ void vpColorHistogramMask::updateMask( else { mask.bitmap[i] = 0.f; } - - } - } - #if defined(VISP_HAVE_NLOHMANN_JSON) void vpColorHistogramMask::loadJsonConfiguration(const nlohmann::json &json) { diff --git a/modules/tracker/rbt/src/rendering/vpObjectCentricRenderer.cpp b/modules/tracker/rbt/src/rendering/vpObjectCentricRenderer.cpp index 57e5f6de44..69aa79b88b 100644 --- a/modules/tracker/rbt/src/rendering/vpObjectCentricRenderer.cpp +++ b/modules/tracker/rbt/src/rendering/vpObjectCentricRenderer.cpp @@ -38,7 +38,8 @@ BEGIN_VISP_NAMESPACE -vpObjectCentricRenderer::vpObjectCentricRenderer(const vpPanda3DRenderParameters &renderParameters) : vpPanda3DRendererSet(renderParameters), m_enableCrop(true), m_shouldComputeBBPoints(true) +vpObjectCentricRenderer::vpObjectCentricRenderer(const vpPanda3DRenderParameters &renderParameters) + : vpPanda3DRendererSet(renderParameters), m_enableCrop(true), m_shouldComputeBBPoints(true) { m_renderParameters = renderParameters; load_prc_file_data("", "textures-power-2 none\n" @@ -66,7 +67,6 @@ void vpObjectCentricRenderer::beforeFrameRendered() m_bb.setBottom(std::min(m_bb.getBottom() + delta, (double)m_renderParameters.getImageHeight())); m_bb.setRight(std::min(m_bb.getRight() + delta, (double)m_renderParameters.getImageWidth())); - if (m_enableCrop) { vpPanda3DRenderParameters subParams = m_renderParameters; diff --git a/modules/tracker/rbt/src/rendering/vpPanda3DDepthFilters.cpp b/modules/tracker/rbt/src/rendering/vpPanda3DDepthFilters.cpp index ac9f64c5f4..6833d83043 100644 --- a/modules/tracker/rbt/src/rendering/vpPanda3DDepthFilters.cpp +++ b/modules/tracker/rbt/src/rendering/vpPanda3DDepthFilters.cpp @@ -34,7 +34,6 @@ BEGIN_VISP_NAMESPACE - const char *vpPanda3DDepthGaussianBlur::FRAGMENT_SHADER = R"shader( #version 330 diff --git a/modules/tracker/rbt/test/test_utils.h b/modules/tracker/rbt/test/test_utils.h index 6a7fbf42ab..aea610ecca 100644 --- a/modules/tracker/rbt/test/test_utils.h +++ b/modules/tracker/rbt/test/test_utils.h @@ -14,7 +14,9 @@ struct TrajectoryData std::vector cTo; }; -TrajectoryData generateTrajectory(const vpPanda3DRenderParameters &renderingParams, const std::function &makeScene, std::vector &cTw, std::vector &oTw) +TrajectoryData generateTrajectory(const vpPanda3DRenderParameters &renderingParams, + const std::function &makeScene, + std::vector &cTw, std::vector &oTw) { vpPanda3DRendererSet renderer(renderingParams); auto rgbRenderer = std::make_shared(true); @@ -51,7 +53,4 @@ TrajectoryData generateTrajectory(const vpPanda3DRenderParameters &renderingPara return res; } - - - #endif