SaDVIO
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
isae::AFeatureDetector Class Referenceabstract

Abstract class for feature detectors. More...

#include <aFeatureDetector.h>

Inheritance diagram for isae::AFeatureDetector:
Inheritance graph
[legend]

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW AFeatureDetector ()
 
 AFeatureDetector (int n, int n_per_cell)
 
 ~AFeatureDetector ()
 
virtual void init ()=0
 Virtual function to initialize the feature detector. More...
 
virtual void detectAndCompute (const cv::Mat &img, const cv::Mat &mask, std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors, int n_points=0)=0
 Virtual function to detect and compute features in an image. More...
 
virtual void computeDescriptor (const cv::Mat &img, std::vector< std::shared_ptr< AFeature >> &features)=0
 Virtual function to compute descriptors for a set of features. More...
 
virtual std::vector< std::shared_ptr< AFeature > > detectAndComputeGrid (const cv::Mat &img, const cv::Mat &mask, std::vector< std::shared_ptr< AFeature >> existing_features=std::vector< std::shared_ptr< AFeature >>())=0
 Virtual function to detect and compute features in a grid (bucketting). More...
 
virtual double computeDist (const cv::Mat &desc1, const cv::Mat &desc2) const =0
 Virtual function to compute the distance between two feature descriptors. More...
 
size_t getNbDesiredFeatures ()
 
double getMaxMatchingDist () const
 
bool getFeaturesInBox (int x, int y, int w, int h, const std::vector< std::shared_ptr< AFeature >> &features, std::vector< std::shared_ptr< AFeature >> &features_in_box) const
 Get features from a feature set in a bounding box defined by (x, y, w, h). More...
 
void deleteUndescribedFeatures (std::vector< std::shared_ptr< AFeature >> &features)
 

Static Public Member Functions

static void KeypointToFeature (std::vector< cv::KeyPoint > keypoints, cv::Mat descriptors, std::vector< std::shared_ptr< AFeature >> &features, const std::string &featurelabel="pointxd")
 Convert OpenCV keypoints and descriptors to a vector of AFeature pointers. More...
 
static void FeatureToKeypoint (std::vector< std::shared_ptr< AFeature >> features, std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors)
 Convert a vector of AFeature pointers to OpenCV keypoints and descriptors. More...
 
static void FeatureToP2f (std::vector< std::shared_ptr< AFeature >> features, std::vector< cv::Point2f > &p2fs)
 Convert a vector of AFeature pointers to a vector of cv::Point2f. More...
 

Protected Attributes

int _n_total
 the maximum amount of features the detector should find for any given image More...
 
int _n_per_cell
 the number of features per cell More...
 
double _max_matching_dist
 distance threshold for matching More...
 

Detailed Description

Abstract class for feature detectors.

This class defines the interface for feature detection and descriptor computation.

Constructor & Destructor Documentation

◆ AFeatureDetector() [1/2]

EIGEN_MAKE_ALIGNED_OPERATOR_NEW isae::AFeatureDetector::AFeatureDetector ( )
inline

◆ AFeatureDetector() [2/2]

isae::AFeatureDetector::AFeatureDetector ( int  n,
int  n_per_cell 
)
inline

◆ ~AFeatureDetector()

isae::AFeatureDetector::~AFeatureDetector ( )
inline

Member Function Documentation

◆ computeDescriptor()

virtual void isae::AFeatureDetector::computeDescriptor ( const cv::Mat &  img,
std::vector< std::shared_ptr< AFeature >> &  features 
)
pure virtual

Virtual function to compute descriptors for a set of features.

Parameters
imgThe input image from which to compute descriptors.
featuresA vector of features for which to compute descriptors.

Implemented in isae::ACustomFeatureDetector, isae::CsvKeypointDetector, isae::Line2DFeatureDetector, isae::semanticBBoxFeatureDetector, and isae::AOpenCVFeatureDetector.

◆ computeDist()

virtual double isae::AFeatureDetector::computeDist ( const cv::Mat &  desc1,
const cv::Mat &  desc2 
) const
pure virtual

Virtual function to compute the distance between two feature descriptors.

Parameters
desc1The first feature descriptor.
desc2The second feature descriptor.

Implemented in isae::CsvKeypointDetector, isae::Line2DFeatureDetector, isae::cvBRISKFeatureDetector, isae::cvFASTFeatureDetector, isae::cvGFTTFeatureDetector, isae::cvKAZEFeatureDetector, isae::semanticBBoxFeatureDetector, and isae::cvORBFeatureDetector.

◆ deleteUndescribedFeatures()

void isae::AFeatureDetector::deleteUndescribedFeatures ( std::vector< std::shared_ptr< AFeature >> &  features)

◆ detectAndCompute()

virtual void isae::AFeatureDetector::detectAndCompute ( const cv::Mat &  img,
const cv::Mat &  mask,
std::vector< cv::KeyPoint > &  keypoints,
cv::Mat &  descriptors,
int  n_points = 0 
)
pure virtual

Virtual function to detect and compute features in an image.

Parameters
imgThe input image in which to detect features.
maskAn optional mask to specify regions of interest in the image.
keypointsOutput vector to store detected keypoints.
descriptorsOutput matrix to store computed descriptors.
n_pointsThe number of points to detect (optional, default is 0 which means all).

Implemented in isae::ACustomFeatureDetector, and isae::AOpenCVFeatureDetector.

◆ detectAndComputeGrid()

virtual std::vector<std::shared_ptr<AFeature> > isae::AFeatureDetector::detectAndComputeGrid ( const cv::Mat &  img,
const cv::Mat &  mask,
std::vector< std::shared_ptr< AFeature >>  existing_features = std::vector< std::shared_ptr< AFeature >>() 
)
pure virtual

Virtual function to detect and compute features in a grid (bucketting).

Parameters
imgThe input image in which to detect features.
maskAn optional mask to specify regions of interest in the image.
existing_featuresA vector of existing features to consider (optional).

Implemented in isae::AOpenCVFeatureDetector, isae::ACustomFeatureDetector, and isae::cvGFTTFeatureDetector.

◆ FeatureToKeypoint()

void isae::AFeatureDetector::FeatureToKeypoint ( std::vector< std::shared_ptr< AFeature >>  features,
std::vector< cv::KeyPoint > &  keypoints,
cv::Mat &  descriptors 
)
static

Convert a vector of AFeature pointers to OpenCV keypoints and descriptors.

Parameters
featuresThe input vector of AFeature pointers.
keypointsOutput vector to store the converted OpenCV keypoints.
descriptorsOutput matrix to store the converted descriptors.

◆ FeatureToP2f()

void isae::AFeatureDetector::FeatureToP2f ( std::vector< std::shared_ptr< AFeature >>  features,
std::vector< cv::Point2f > &  p2fs 
)
static

Convert a vector of AFeature pointers to a vector of cv::Point2f.

Parameters
featuresThe input vector of AFeature pointers.
p2fsOutput vector to store the converted cv::Point2f points.

◆ getFeaturesInBox()

bool isae::AFeatureDetector::getFeaturesInBox ( int  x,
int  y,
int  w,
int  h,
const std::vector< std::shared_ptr< AFeature >> &  features,
std::vector< std::shared_ptr< AFeature >> &  features_in_box 
) const

Get features from a feature set in a bounding box defined by (x, y, w, h).

Parameters
xThe x-coordinate of the top-left corner of the bounding box.
yThe y-coordinate of the top-left corner of the bounding box.
wThe width of the bounding box.
hThe height of the bounding box.
featuresThe vector of features to search in.
features_in_boxThe vector to store the features found in the bounding box.

◆ getMaxMatchingDist()

double isae::AFeatureDetector::getMaxMatchingDist ( ) const
inline

◆ getNbDesiredFeatures()

size_t isae::AFeatureDetector::getNbDesiredFeatures ( )
inline

◆ init()

virtual void isae::AFeatureDetector::init ( )
pure virtual

◆ KeypointToFeature()

void isae::AFeatureDetector::KeypointToFeature ( std::vector< cv::KeyPoint >  keypoints,
cv::Mat  descriptors,
std::vector< std::shared_ptr< AFeature >> &  features,
const std::string &  featurelabel = "pointxd" 
)
static

Convert OpenCV keypoints and descriptors to a vector of AFeature pointers.

Parameters
keypointsThe input vector of OpenCV keypoints.
descriptorsThe input matrix of descriptors corresponding to the keypoints.
featuresOutput vector to store the converted AFeature pointers.
featurelabelOptional label for the features (default is "pointxd").

Member Data Documentation

◆ _max_matching_dist

double isae::AFeatureDetector::_max_matching_dist
protected

distance threshold for matching

◆ _n_per_cell

int isae::AFeatureDetector::_n_per_cell
protected

the number of features per cell

◆ _n_total

int isae::AFeatureDetector::_n_total
protected

the maximum amount of features the detector should find for any given image


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