RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
rtabmap::Feature2D Class Referenceabstract

Abstract 2D feature detector and descriptor extractor for visual SLAM. More...

#include <Features2d.h>

Inheritance diagram for rtabmap::Feature2D:

Public Types

enum  Type {
  kFeatureUndef =-1 , kFeatureSurf =0 , kFeatureSift =1 , kFeatureOrb =2 ,
  kFeatureFastFreak =3 , kFeatureFastBrief =4 , kFeatureGfttFreak =5 , kFeatureGfttBrief =6 ,
  kFeatureBrisk =7 , kFeatureGfttOrb =8 , kFeatureKaze =9 , kFeatureOrbOctree =10 ,
  kFeatureSuperPointTorch =11 , kFeatureSurfFreak =12 , kFeatureGfttDaisy =13 , kFeatureSurfDaisy =14 ,
  kFeaturePyDetector =15 , kFeatureSuperPointRpautrat =16 , kFeatureEnd
}
 Built-in detector/descriptor strategy (Kp/DetectorStrategy). More...
 

Public Member Functions

int getMaxFeatures () const
 
bool getSSC () const
 
float getMinDepth () const
 
float getMaxDepth () const
 
int getGridRows () const
 
int getGridCols () const
 
std::vector< cv::KeyPoint > generateKeypoints (const cv::Mat &image, const cv::Mat &mask=cv::Mat())
 Detects keypoints in a grayscale image (CV_8UC1); optional depth or 8U mask.
 
cv::Mat generateDescriptors (const cv::Mat &image, std::vector< cv::KeyPoint > &keypoints) const
 Computes descriptors for keypoints (may shrink the list in some detectors).
 
std::vector< cv::Point3f > generateKeypoints3D (const SensorData &data, const std::vector< cv::KeyPoint > &keypoints) const
 Back-projects keypoints to 3D using depth or stereo in data.
 
virtual void parseParameters (const ParametersMap &parameters)
 
virtual const ParametersMapgetParameters () const
 
virtual Feature2D::Type getType () const =0
 
virtual bool isGpuAvailable () const
 Returns true when a GPU/CUDA code path could be used by this detector on this host: i.e. the build was compiled with the matching GPU support AND a CUDA-capable device is detected at runtime. This is a capability probe – it does NOT reflect whether the current instance is actually configured to run on GPU (that depends on per-detector parameters like SURF/GpuVersion). Defaults to false; subclasses with a GPU backend override it.
 

Static Public Member Functions

static std::string typeName (Type type)
 
static Feature2Dcreate (const ParametersMap &parameters=ParametersMap())
 Creates a detector from Kp/DetectorStrategy in parameters. Caller owns the pointer.
 
static Feature2Dcreate (Feature2D::Type type, const ParametersMap &parameters=ParametersMap())
 Creates a detector of the given type. Caller owns the pointer.
 
static bool isAvailable (Feature2D::Type type)
 Returns true if type is available (RTAB-Map is built with it).
 
static void filterKeypointsByDepth (std::vector< cv::KeyPoint > &keypoints, const cv::Mat &depth, float minDepth, float maxDepth)
 Keeps keypoints whose depth at (u,v) is in (minDepth, maxDepth).
 
static void filterKeypointsByDepth (std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors, const cv::Mat &depth, float minDepth, float maxDepth)
 
static void filterKeypointsByDepth (std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors, std::vector< cv::Point3f > &keypoints3D, float minDepth, float maxDepth)
 
static void filterKeypointsByDisparity (std::vector< cv::KeyPoint > &keypoints, const cv::Mat &disparity, float minDisparity)
 Keeps keypoints with stereo disparity ≥ minDisparity.
 
static void filterKeypointsByDisparity (std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors, const cv::Mat &disparity, float minDisparity)
 
static void limitKeypoints (std::vector< cv::KeyPoint > &keypoints, int maxKeypoints, const cv::Size &imageSize=cv::Size(), bool ssc=false)
 Reduces keypoint count (by response or SSC spatial distribution).
 
static void limitKeypoints (std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors, int maxKeypoints, const cv::Size &imageSize=cv::Size(), bool ssc=false)
 
static void limitKeypoints (std::vector< cv::KeyPoint > &keypoints, std::vector< cv::Point3f > &keypoints3D, cv::Mat &descriptors, int maxKeypoints, const cv::Size &imageSize=cv::Size(), bool ssc=false)
 
static void limitKeypoints (const std::vector< cv::KeyPoint > &keypoints, std::vector< bool > &inliers, int maxKeypoints, const cv::Size &imageSize=cv::Size(), bool ssc=false)
 
static void limitKeypoints (const std::vector< cv::KeyPoint > &keypoints, std::vector< bool > &inliers, int maxKeypoints, const cv::Size &imageSize, int gridRows, int gridCols, bool ssc=false)
 
static cv::Rect computeRoi (const cv::Mat &image, const std::string &roiRatios)
 ROI from Kp/RoiRatios string ("left top right bottom" fractions).
 
static cv::Rect computeRoi (const cv::Mat &image, const std::vector< float > &roiRatios)
 

Protected Member Functions

 Feature2D (const ParametersMap &parameters=ParametersMap())
 

Detailed Description

Abstract 2D feature detector and descriptor extractor for visual SLAM.

Factory create() builds a concrete detector from Type or from Kp/DetectorStrategy in a ParametersMap. Common tuning keys include Kp/MaxFeatures, Kp/GridRows, Kp/GridCols, Kp/SSC, depth filters (Kp/MinDepth, Kp/MaxDepth), ROI (Kp/RoiRatios), and sub-pixel refinement.

Pipeline: generateKeypoints() (grid + ROI + optional mask) then generateDescriptors(). Static helpers filter or cap keypoints before/after matching. generateKeypoints3D() projects features using stereo or depth when available in SensorData.

See also
Memory
RegistrationVis

Definition at line 145 of file Features2d.h.

Member Enumeration Documentation

◆ Type

Built-in detector/descriptor strategy (Kp/DetectorStrategy).

Definition at line 148 of file Features2d.h.

Member Function Documentation

◆ typeName()

static std::string rtabmap::Feature2D::typeName ( Type  type)
inlinestatic
Returns
Human-readable name for type (e.g. "ORB", "GFTT+BRIEF").

Definition at line 169 of file Features2d.h.

◆ getMaxFeatures()

int rtabmap::Feature2D::getMaxFeatures ( ) const
inline

Definition at line 260 of file Features2d.h.

◆ getSSC()

bool rtabmap::Feature2D::getSSC ( ) const
inline

Definition at line 261 of file Features2d.h.

◆ getMinDepth()

float rtabmap::Feature2D::getMinDepth ( ) const
inline

Definition at line 262 of file Features2d.h.

◆ getMaxDepth()

float rtabmap::Feature2D::getMaxDepth ( ) const
inline

Definition at line 263 of file Features2d.h.

◆ getGridRows()

int rtabmap::Feature2D::getGridRows ( ) const
inline

Definition at line 264 of file Features2d.h.

◆ getGridCols()

int rtabmap::Feature2D::getGridCols ( ) const
inline

Definition at line 265 of file Features2d.h.

◆ getParameters()

virtual const ParametersMap & rtabmap::Feature2D::getParameters ( ) const
inlinevirtual

Definition at line 284 of file Features2d.h.

◆ isGpuAvailable()

virtual bool rtabmap::Feature2D::isGpuAvailable ( ) const
inlinevirtual

Returns true when a GPU/CUDA code path could be used by this detector on this host: i.e. the build was compiled with the matching GPU support AND a CUDA-capable device is detected at runtime. This is a capability probe – it does NOT reflect whether the current instance is actually configured to run on GPU (that depends on per-detector parameters like SURF/GpuVersion). Defaults to false; subclasses with a GPU backend override it.

Reimplemented in rtabmap::SURF, rtabmap::SIFT, rtabmap::ORB, rtabmap::FAST, rtabmap::GFTT, rtabmap::SuperPointTorch, and rtabmap::SuperPointRpautrat.

Definition at line 294 of file Features2d.h.


The documentation for this class was generated from the following file: