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

Class for custom feature detection and computation. More...

#include <aCustomFeatureDetector.h>

Inheritance diagram for isae::ACustomFeatureDetector:
Inheritance graph
[legend]
Collaboration diagram for isae::ACustomFeatureDetector:
Collaboration graph
[legend]

Public Member Functions

 ACustomFeatureDetector (int n, int n_per_cell)
 
void detectAndCompute (const cv::Mat &img, const cv::Mat &mask, std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors, int n_points=0)
 Virtual function to detect and compute features in an image. More...
 
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 >>())
 Virtual function to detect and compute features in a grid (bucketting). More...
 
virtual void customDetectAndCompute (const cv::Mat &img, const cv::Mat &mask, std::vector< std::shared_ptr< AFeature >> &features)=0
 
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...
 
- Public Member Functions inherited from isae::AFeatureDetector
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 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)
 

Protected Member Functions

const int getDefaultNorm () const
 

Protected Attributes

int _defaultNorm
 
- Protected Attributes inherited from isae::AFeatureDetector
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from isae::AFeatureDetector
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...
 

Detailed Description

Class for custom feature detection and computation.

This class extends the AFeatureDetector class and provides a framework for handcrafted feature detection and descriptor computation. It allows for grid-based detection and computation of features.

Constructor & Destructor Documentation

◆ ACustomFeatureDetector()

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

Member Function Documentation

◆ computeDescriptor()

virtual void isae::ACustomFeatureDetector::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.

Implements isae::AFeatureDetector.

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

◆ customDetectAndCompute()

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

◆ detectAndCompute()

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

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).

Implements isae::AFeatureDetector.

◆ detectAndComputeGrid()

std::vector< std::shared_ptr< AFeature > > isae::ACustomFeatureDetector::detectAndComputeGrid ( const cv::Mat &  img,
const cv::Mat &  mask,
std::vector< std::shared_ptr< AFeature >>  existing_features = std::vector< std::shared_ptr< AFeature >>() 
)
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).

Implements isae::AFeatureDetector.

◆ getDefaultNorm()

const int isae::ACustomFeatureDetector::getDefaultNorm ( ) const
inlineprotected

Member Data Documentation

◆ _defaultNorm

int isae::ACustomFeatureDetector::_defaultNorm
protected

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