Skip to content

Commit

Permalink
Group classes in doxygen, settings for klt tracker~
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Sep 19, 2024
1 parent 9e5c1b7 commit f14d375
Show file tree
Hide file tree
Showing 26 changed files with 294 additions and 68 deletions.
63 changes: 63 additions & 0 deletions doc/mainpage.dox.in
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,69 @@ in different ways. This will motivate us to continue the efforts.
\defgroup group_mbt_xml_parser XML parsers
XML parsers dedicated to model-based trackers.
*/


/*******************************************
* Module rbt
*******************************************/
/*!
\ingroup module_tracker
\defgroup module_rbt RBT: Render-Based Tracker module
Render-Based Tracker module
*/

/*!
\ingroup module_rbt
\defgroup group_rbt_core Core Render-Based Tracking functionalities

This group contains the core classes that make Render-Based tracking work. The main interface for Render-Based tracking is vpRBTracker.
*/

/*!
\ingroup module_rbt
\defgroup group_rbt_trackers Trackable features

These classes represent features that can be tracked by the render-based tracker. All trackable features should inherit from vpRBFeatureTracker

*/

/*!
\ingroup module_rbt
\defgroup group_rbt_mask Object segmentation

These classes allow to perform object segmentaiton from rendering information. This segmentation may be used downstream by feature trackers to filter features.
*/

/*!
\ingroup module_rbt
\defgroup group_rbt_drift Drift and divergence detection

These classes allow to detect tracking drift.
*/

/*!
\ingroup module_rbt
\defgroup group_rbt_rendering Rendering

This group contains additional rendering utilities.
*/

/*!
\ingroup module_mbt
\defgroup group_mbt_features Features
Model-based trackers features.
*/
/*!
\ingroup module_mbt
\defgroup group_mbt_faces Faces management
Faces management including visibility.
*/
/*!
\ingroup module_mbt
\defgroup group_mbt_xml_parser XML parsers
XML parsers dedicated to model-based trackers.
*/

/*******************************************
* Module robot
*******************************************/
Expand Down
19 changes: 2 additions & 17 deletions modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -923,15 +923,7 @@ inline void to_json(nlohmann::json &j, const vpMbGenericTracker::TrackerWrapper
//KLT tracker settings
#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO)
if (t.m_trackerType & vpMbGenericTracker::KLT_TRACKER) {
nlohmann::json klt = nlohmann::json {
{"maxFeatures", t.tracker.getMaxFeatures()},
{"windowSize", t.tracker.getWindowSize()},
{"quality", t.tracker.getQuality()},
{"minDistance", t.tracker.getMinDistance()},
{"harris", t.tracker.getHarrisFreeParameter()},
{"blockSize", t.tracker.getBlockSize()},
{"pyramidLevels", t.tracker.getPyramidLevels()}
};
nlohmann::json klt = t.tracker;
klt["maskBorder"] = t.maskBorder;
j["klt"] = klt;
}
Expand Down Expand Up @@ -1034,14 +1026,7 @@ inline void from_json(const nlohmann::json &j, vpMbGenericTracker::TrackerWrappe
#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO)
if (t.m_trackerType & vpMbGenericTracker::KLT_TRACKER) {
const nlohmann::json klt = j.at("klt");
auto &ktrack = t.tracker;
ktrack.setMaxFeatures(klt.value("maxFeatures", 10000));
ktrack.setWindowSize(klt.value("windowSize", 5));
ktrack.setQuality(klt.value("quality", 0.01));
ktrack.setMinDistance(klt.value("minDistance", 5));
ktrack.setHarrisFreeParameter(klt.value("harris", 0.01));
ktrack.setBlockSize(klt.value("blockSize", 3));
ktrack.setPyramidLevels(klt.value("pyramidLevels", 3));
t.tracker = klt;
t.setMaskBorder(klt.value("maskBorder", t.maskBorder));
t.faces.getMbScanLineRenderer().setMaskBorder(t.maskBorder);
}
Expand Down
5 changes: 5 additions & 0 deletions modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@

class vpRBFeatureTrackerInput;

/**
* \brief A color histogram based segmentation algorithm.
*
* \ingroup group_rbt_mask
*/
class VISP_EXPORT vpColorHistogramMask : public vpObjectMask
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
#include <visp3/ar/vpPanda3DRendererSet.h>
#include <visp3/core/vpRect.h>

/*!
\brief Single object focused renderer
\ingroup group_rbt_rendering
*/
class VISP_EXPORT vpObjectCentricRenderer : public vpPanda3DRendererSet
{
public:
Expand Down
5 changes: 5 additions & 0 deletions modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class vpRBFeatureTrackerInput;
#include <nlohmann/json_fwd.hpp>
#endif

/**
* \brief
*
* \ingroup group_rbt_mask
*/
class VISP_EXPORT vpObjectMask
{
public:
Expand Down
6 changes: 6 additions & 0 deletions modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
#include <visp3/rbt/vpDynamicFactory.h>
#include <visp3/rbt/vpObjectMask.h>

/**
* \brief A factory that can be used to create Object segmentation algorithms from JSON data.
*
* \ingroup group_rbt_mask
*
*/
class VISP_EXPORT vpObjectMaskFactory : public vpDynamicFactory<vpObjectMask>
{
private:
Expand Down
8 changes: 3 additions & 5 deletions modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@

/**
*
* \ingroup group_ar_renderer_panda3d_filters
* \brief Class that implements a gaussian filter on a grayscale image.
* The grayscale image should be contained in the blue channel of the image.
*
* \ingroup group_rbt_rendering
* \brief
*/
class VISP_EXPORT vpPanda3DDepthGaussianBlur : public vpPanda3DPostProcessFilter
{
Expand All @@ -63,7 +61,7 @@ class VISP_EXPORT vpPanda3DDepthGaussianBlur : public vpPanda3DPostProcessFilter
};

/**
* \ingroup group_ar_renderer_panda3d_filters
* \ingroup group_rbt_rendering
* \brief Implementation of canny filtering, using Sobel kernels.
*
* The results of the canny are filtered based on a threshold value (defined between 0 and 255), checking whether there is enough gradient information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@


/**
* @brief A base class for all features that can be used and tracker in the vpRenderBasedTracker
* @brief A tracker based on dense depth point-plane alignement
*
* \ingroup group_rbt_trackers
*
*/
class VISP_EXPORT vpRBDenseDepthTracker : public vpRBFeatureTracker
Expand Down
1 change: 1 addition & 0 deletions modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ template <typename T> class vpImage;
* - Call vpRBDriftDetector::update to update the drift detection parameters.
* - use vpRBDriftDetector::hasDiverged to detect the drift, or vpRBDriftDetector::getScore to use the estimated tracking reliability.
*
* \ingroup group_rbt_drift
*/
class VISP_EXPORT vpRBDriftDetector
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
#include <visp3/rbt/vpDynamicFactory.h>
#include <visp3/rbt/vpRBDriftDetector.h>

/**
* \brief A factory that can be used to instanciate drift detection algorithms from JSON data.
*
* \ingroup group_rbt_drift
*/
class VISP_EXPORT vpRBDriftDetectorFactory : public vpDynamicFactory<vpRBDriftDetector>
{
private:
Expand Down
41 changes: 22 additions & 19 deletions modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ enum vpRBFeatureDisplayType


/**
* @brief A base class for all features that can be used and tracked in the vpRBTracker
* \brief A base class for all features that can be used and tracked in the vpRBTracker
*
* \ingroup group_rbt_trackers
*/
class VISP_EXPORT vpRBFeatureTracker
{
Expand All @@ -70,13 +72,13 @@ class VISP_EXPORT vpRBFeatureTracker
vpRBFeatureTracker();

/**
* @brief Return the type of feature that is used by this tracker
* \brief Return the type of feature that is used by this tracker
*
* @return vpRBFeatureType
* \return vpRBFeatureType
*/

/**
* @brief Get the number of features used to compute the pose update
* \brief Get the number of features used to compute the pose update
*
*/
unsigned getNumFeatures() const { return m_numFeatures; }
Expand All @@ -87,21 +89,21 @@ class VISP_EXPORT vpRBFeatureTracker
*/

/**
* @brief Whether this tracker requires RGB image to extract features
* \brief Whether this tracker requires RGB image to extract features
*
* @return true if the tracker requires an RGB image
* @return false otherwise
* \return true if the tracker requires an RGB image
* \return false otherwise
*/
virtual bool requiresRGB() const = 0;

/**
* @brief Whether this tracker requires depth image to extract features
* \brief Whether this tracker requires depth image to extract features
*
*/
virtual bool requiresDepth() const = 0;

/**
* @brief Whether this tracker requires Silhouette candidates
* \brief Whether this tracker requires Silhouette candidates
*/
virtual bool requiresSilhouetteCandidates() const = 0;
/**
Expand All @@ -113,26 +115,27 @@ class VISP_EXPORT vpRBFeatureTracker
* \name Core Tracking methods
* @{
*/

/**
* @brief Method called when starting a tracking iteration
* \brief Method called when starting a tracking iteration
*
*/
virtual void onTrackingIterStart() = 0;

/**
* @brief Method called after the tracking iteration has finished
* \brief Method called after the tracking iteration has finished
*
*/
virtual void onTrackingIterEnd() = 0;

/**
* @brief Extract features from the frame data and the current pose estimate
* \brief Extract features from the frame data and the current pose estimate
*
*/
virtual void extractFeatures(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo) = 0;

/**
* @brief Track the features
* \brief Track the features
*/
virtual void trackFeatures(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo) = 0;

Expand All @@ -156,9 +159,9 @@ class VISP_EXPORT vpRBFeatureTracker
*/
const vpMatrix &getCovariance() const { return m_cov; }
/**
* @brief Update the covariance matrix
* \brief Update the covariance matrix
*
* @param lambda the visual servoing gain
* \param lambda the visual servoing gain
*/
virtual void updateCovariance(const double lambda);
/**
Expand All @@ -171,25 +174,25 @@ class VISP_EXPORT vpRBFeatureTracker
bool vvsHasConverged() const { return m_vvsConverged; }

/**
* @brief Get the importance of this tracker in the optimization step.
* \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.
*/
virtual double getVVSTrackerWeight() const { return sqrt(m_userVvsWeight / m_numFeatures); }
void setTrackerWeight(double weight) { m_userVvsWeight = weight; }

/**
* @brief Get the leftside term of the Gauss-Newton optimization term
* \brief Get the leftside term of the Gauss-Newton optimization term
*/
const vpMatrix &getLTL() const { return m_LTL; }

/**
* @brief Get the rightside term of the Gauss-Newton optimization term
* \brief Get the rightside term of the Gauss-Newton optimization term
*/
const vpColVector &getLTR() const { return m_LTR; }

/**
* @brief Get a weighted version of the error vector.
* \brief Get a weighted version of the error vector.
* This should not include the userVVSWeight, but may include reweighting to remove outliers, occlusions, etc.
*/
const vpColVector &getWeightedError() const { return m_weighted_error; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
#include <visp3/rbt/vpRBFeatureTracker.h>
#include <visp3/rbt/vpDynamicFactory.h>

/**
* \brief A factory to instantiate feature trackers from JSON data
*
* \ingroup group_rbt_trackers
*/
class VISP_EXPORT vpRBFeatureTrackerFactory : public vpDynamicFactory<vpRBFeatureTracker>
{
private:
Expand Down
11 changes: 11 additions & 0 deletions modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTrackerInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@

#include <visp3/rbt/vpRBSilhouettePoint.h>

/**
* \brief Render data storage
*
* \ingroup group_rbt_core
*/
struct VISP_EXPORT vpRBRenderData
{
vpImage<vpRGBf> normals; //! Image containing the per-pixel normal vector (RGB, in object space)
Expand Down Expand Up @@ -94,6 +99,12 @@ struct VISP_EXPORT vpRBRenderData

};

/**
* \brief All the data related to a single tracking frame.
* This contains both the input data (from a real camera/outside source) and renders from Panda.
*
* \ingroup group_rbt_core
*/
class VISP_EXPORT vpRBFeatureTrackerInput
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ template <typename T>
class vpImage;


/**
* \brief A set of utilities to perform initialization.
*
* \group core
*/
class VISP_EXPORT vpRBInitializationHelper
{
public:
Expand Down
Loading

0 comments on commit f14d375

Please sign in to comment.