33 #include <opencv2/highgui/highgui.hpp> 34 #include <opencv2/core/core.hpp> 35 #include <opencv2/features2d/features2d.hpp> 40 #if CV_MAJOR_VERSION < 3 62 namespace xfeatures2d {
65 class BriefDescriptorExtractor;
66 #if CV_MAJOR_VERSION < 3 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <= 3) || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION < 4 || (CV_MINOR_VERSION==4 && CV_SUBMINOR_VERSION<11))) 72 class FastFeatureDetector;
77 #if CV_MAJOR_VERSION < 3 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <= 3) || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION < 4 || (CV_MINOR_VERSION==4 && CV_SUBMINOR_VERSION<11))) 78 typedef cv::xfeatures2d::SIFT
CV_SIFT;
82 typedef cv::xfeatures2d::SURF
CV_SURF;
83 typedef cv::FastFeatureDetector
CV_FAST;
84 typedef cv::xfeatures2d::FREAK
CV_FREAK;
85 typedef cv::xfeatures2d::DAISY CV_DAISY;
86 typedef cv::GFTTDetector
CV_GFTT;
87 typedef cv::xfeatures2d::BriefDescriptorExtractor
CV_BRIEF;
89 typedef cv::ORB CV_ORB;
101 #if CV_MAJOR_VERSION < 3 119 kFeatureOrbOctree=10,
120 kFeatureSuperPointTorch=11,
121 kFeatureSurfFreak=12,
122 kFeatureGfttDaisy=13,
123 kFeatureSurfDaisy=14,
124 kFeaturePyDetector=15};
135 case kFeatureFastFreak:
137 case kFeatureFastBrief:
139 case kFeatureGfttFreak:
141 case kFeatureGfttBrief:
145 case kFeatureGfttOrb:
149 case kFeatureOrbOctree:
151 case kFeatureSuperPointTorch:
153 case kFeatureSurfFreak:
155 case kFeatureGfttDaisy:
157 case kFeatureSurfDaisy:
167 static void filterKeypointsByDepth(
168 std::vector<cv::KeyPoint> & keypoints,
169 const cv::Mat & depth,
172 static void filterKeypointsByDepth(
173 std::vector<cv::KeyPoint> & keypoints,
174 cv::Mat & descriptors,
175 const cv::Mat & depth,
178 static void filterKeypointsByDepth(
179 std::vector<cv::KeyPoint> & keypoints,
180 cv::Mat & descriptors,
181 std::vector<cv::Point3f> & keypoints3D,
185 static void filterKeypointsByDisparity(
186 std::vector<cv::KeyPoint> & keypoints,
187 const cv::Mat & disparity,
189 static void filterKeypointsByDisparity(
190 std::vector<cv::KeyPoint> & keypoints,
191 cv::Mat & descriptors,
192 const cv::Mat & disparity,
195 static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints,
int maxKeypoints);
196 static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, cv::Mat & descriptors,
int maxKeypoints);
197 static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, std::vector<cv::Point3f> & keypoints3D, cv::Mat & descriptors,
int maxKeypoints);
198 static void limitKeypoints(
const std::vector<cv::KeyPoint> & keypoints, std::vector<bool> & inliers,
int maxKeypoints);
199 static void limitKeypoints(
const std::vector<cv::KeyPoint> & keypoints, std::vector<bool> & inliers,
int maxKeypoints,
const cv::Size & imageSize,
int gridRows,
int gridCols);
201 static cv::Rect
computeRoi(
const cv::Mat & image,
const std::string & roiRatios);
202 static cv::Rect
computeRoi(
const cv::Mat & image,
const std::vector<float> & roiRatios);
213 std::vector<cv::KeyPoint> generateKeypoints(
214 const cv::Mat & image,
215 const cv::Mat &
mask = cv::Mat());
216 cv::Mat generateDescriptors(
217 const cv::Mat & image,
218 std::vector<cv::KeyPoint> & keypoints)
const;
219 std::vector<cv::Point3f> generateKeypoints3D(
221 const std::vector<cv::KeyPoint> & keypoints)
const;
223 virtual void parseParameters(
const ParametersMap & parameters);
231 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat()) = 0;
232 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const = 0;
256 virtual void parseParameters(
const ParametersMap & parameters);
260 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat());
261 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
283 virtual void parseParameters(
const ParametersMap & parameters);
287 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat());
288 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
307 virtual void parseParameters(
const ParametersMap & parameters);
311 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat());
312 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
338 virtual void parseParameters(
const ParametersMap & parameters);
342 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat());
374 virtual void parseParameters(
const ParametersMap & parameters);
378 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
393 virtual void parseParameters(
const ParametersMap & parameters);
397 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
415 virtual void parseParameters(
const ParametersMap & parameters);
418 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat());
437 virtual void parseParameters(
const ParametersMap & parameters);
441 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
456 virtual void parseParameters(
const ParametersMap & parameters);
460 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
478 virtual void parseParameters(
const ParametersMap & parameters);
482 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
500 virtual void parseParameters(
const ParametersMap & parameters);
504 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
517 virtual void parseParameters(
const ParametersMap & parameters);
521 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat());
522 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
539 virtual void parseParameters(
const ParametersMap & parameters);
543 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat());
544 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
554 #if CV_MAJOR_VERSION > 2 555 cv::Ptr<cv::KAZE> kaze_;
566 virtual void parseParameters(
const ParametersMap & parameters);
570 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat());
571 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
592 virtual void parseParameters(
const ParametersMap & parameters);
596 virtual std::vector<cv::KeyPoint> generateKeypointsImpl(
const cv::Mat & image,
const cv::Rect & roi,
const cv::Mat &
mask = cv::Mat());
597 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
615 virtual void parseParameters(
const ParametersMap & parameters);
619 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
627 #if CV_MAJOR_VERSION > 2 628 cv::Ptr<CV_DAISY> _daisy;
639 virtual void parseParameters(
const ParametersMap & parameters);
643 virtual cv::Mat generateDescriptorsImpl(
const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints)
const;
651 #if CV_MAJOR_VERSION > 2 652 cv::Ptr<CV_DAISY> _daisy;
GLM_FUNC_DECL genIType mask(genIType const &count)
virtual Feature2D::Type getType() const
int fastCVLastImageHeight_
float getMinDepth() const
virtual Feature2D::Type getType() const
float getMaxDepth() const
double gpuKeypointsRatio_
virtual Feature2D::Type getType() const
cv::Ptr< CV_FREAK > _freak
cv::Ptr< CV_FREAK > _freak
cv::BriefDescriptorExtractor CV_BRIEF
cv::Ptr< ORBextractor > _orb
std::map< std::string, std::string > ParametersMap
double contrastThreshold_
virtual Feature2D::Type getType() const
std::vector< float > _roiRatios
virtual Feature2D::Type getType() const
cv::Ptr< CV_BRISK > brisk_
cv::Ptr< CV_ORB_GPU > _gpuOrb
virtual Feature2D::Type getType() const
cv::FastFeatureDetector CV_FAST
bool orientationNormalized_
virtual Feature2D::Type getType() const
cv::Ptr< CV_FAST_GPU > _gpuFast
cv::Ptr< SPDetector > superPoint_
virtual Feature2D::Type getType() const
virtual Feature2D::Type getType() const
bool orientationNormalized_
cv::Ptr< CV_FREAK > _freak
cv::Rect RTABMAP_EXP computeRoi(const cv::Mat &image, const std::string &roiRatios)
virtual Feature2D::Type getType() const
bool orientationNormalized_
virtual Feature2D::Type getType() const
static std::string typeName(Type type)
cv::gpu::SURF_GPU CV_SURF_GPU
cv::Ptr< CV_BRIEF > _brief
virtual Feature2D::Type getType() const
virtual cv::Mat generateDescriptorsImpl(const cv::Mat &, std::vector< cv::KeyPoint > &) const
virtual Feature2D::Type getType() const
virtual Feature2D::Type getType() const
bool orientationNormalized_
virtual Feature2D::Type getType() const
cv::Ptr< CV_BRIEF > _brief
virtual const ParametersMap & getParameters() const
cv::gpu::ORB_GPU CV_ORB_GPU
bool orientationNormalized_
cv::gpu::FAST_GPU CV_FAST_GPU
int getMaxFeatures() const
cv::Ptr< cv::FeatureDetector > _fast
virtual Feature2D::Type getType() const
ParametersMap parameters_
cv::Ptr< CV_SURF_GPU > _gpuSurf