SaDVIO
aCustomFeatureDetector.h
Go to the documentation of this file.
1 #ifndef ACUSTOMFEATUREDETECTOR_H
2 #define ACUSTOMFEATUREDETECTOR_H
3 
4 #include <iostream>
5 #include <opencv2/core.hpp>
6 #include <opencv2/features2d.hpp>
7 
11 #include "isaeslam/typedefs.h"
12 
13 namespace isae {
14 
21  public:
22  ACustomFeatureDetector(int n, int n_per_cell) : AFeatureDetector(n, n_per_cell) {}
23 
24  void detectAndCompute(const cv::Mat &img,
25  const cv::Mat &mask,
26  std::vector<cv::KeyPoint> &keypoints,
27  cv::Mat &descriptors,
28  int n_points = 0) {}
29  std::vector<std::shared_ptr<AFeature>> detectAndComputeGrid(
30  const cv::Mat &img,
31  const cv::Mat &mask,
32  std::vector<std::shared_ptr<AFeature>> existing_features = std::vector<std::shared_ptr<AFeature>>());
33 
34  virtual void customDetectAndCompute(const cv::Mat &img,
35  const cv::Mat &mask,
36  std::vector<std::shared_ptr<AFeature>> &features) = 0;
37  virtual void computeDescriptor(const cv::Mat &img, std::vector<std::shared_ptr<AFeature>> &features) = 0;
38 
39  protected:
40  const int getDefaultNorm() const { return _defaultNorm; }
42 };
43 
44 } // namespace isae
45 
46 #endif // ACUSTOMFEATUREDETECTOR_H
isae::ACustomFeatureDetector::detectAndComputeGrid
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).
Definition: aCustomFeatureDetector.cpp:9
isae::ACustomFeatureDetector::customDetectAndCompute
virtual void customDetectAndCompute(const cv::Mat &img, const cv::Mat &mask, std::vector< std::shared_ptr< AFeature >> &features)=0
Point2D.h
isae::ACustomFeatureDetector::getDefaultNorm
const int getDefaultNorm() const
Definition: aCustomFeatureDetector.h:40
typedefs.h
isae::ACustomFeatureDetector::_defaultNorm
int _defaultNorm
Definition: aCustomFeatureDetector.h:41
aFeatureDetector.h
isae
Definition: AFeature2D.h:8
isae::ACustomFeatureDetector::ACustomFeatureDetector
ACustomFeatureDetector(int n, int n_per_cell)
Definition: aCustomFeatureDetector.h:22
isae::AFeatureDetector
Abstract class for feature detectors.
Definition: aFeatureDetector.h:22
isae::ACustomFeatureDetector
Class for custom feature detection and computation.
Definition: aCustomFeatureDetector.h:20
isae::ACustomFeatureDetector::computeDescriptor
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.
isae::ACustomFeatureDetector::detectAndCompute
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.
Definition: aCustomFeatureDetector.h:24
ASensor.h