39#ifndef __OPENCV_XFEATURES2D_HPP__
40#define __OPENCV_XFEATURES2D_HPP__
42#include "opencv2/features2d.hpp"
43#include "opencv2/xfeatures2d/nonfree.hpp"
89 static const int NB_SCALES = 64;
90 static const int NB_PAIRS = 512;
91 static const int NB_ORIENPAIRS = 45;
100 CV_WRAP
static Ptr<FREAK> create(
bool orientationNormalized =
true,
101 bool scaleNormalized =
true,
102 float patternScale = 22.0f,
104 const std::vector<int>& selectedPairs = std::vector<int>());
115 int lineThresholdProjected=10,
116 int lineThresholdBinarized=8,
117 int suppressNonmaxSize=5);
150 CV_WRAP
static Ptr<LUCID> create(
const int lucid_kernel = 1,
const int blur_kernel = 2);
179 CV_WRAP
static Ptr<LATCH> create(
int bytes = 32,
bool rotationInvariance =
true,
int half_ssd_size = 3,
double sigma = 2.0);
213 SIZE_512_BITS = 100, SIZE_256_BITS = 101,
224 CV_WRAP
static Ptr<BEBLID> create(
float scale_factor,
int n_bits = BEBLID::SIZE_512_BITS);
246 enum NormalizationType
248 NRM_NONE = 100, NRM_PARTIAL = 101, NRM_FULL = 102, NRM_SIFT = 103,
250 CV_WRAP
static Ptr<DAISY> create(
float radius = 15,
int q_radius = 3,
int q_theta = 8,
251 int q_hist = 8, DAISY::NormalizationType
norm = DAISY::NRM_NONE, InputArray H = noArray(),
252 bool interpolation =
true,
bool use_orientation =
false );
259 virtual void compute( InputArray image, std::vector<KeyPoint>& keypoints,
OutputArray descriptors ) CV_OVERRIDE = 0;
261 virtual void compute( InputArrayOfArrays images,
262 std::vector<std::vector<KeyPoint> >& keypoints,
284 virtual void GetDescriptor(
double y,
double x,
int orientation,
float* descriptor )
const = 0;
293 virtual bool GetDescriptor(
double y,
double x,
int orientation,
float* descriptor,
double* H )
const = 0;
331 static Ptr<MSDDetector> create(
int m_patch_radius = 3,
int m_search_area_radius = 5,
332 int m_nms_radius = 5,
int m_nms_scale_radius = 0,
float m_th_saliency = 250.0f,
int m_kNN = 4,
333 float m_scale_factor = 1.25f,
int m_n_scales = -1,
bool m_compute_orientation =
false);
359 VGG_120 = 100, VGG_80 = 101, VGG_64 = 102, VGG_48 = 103,
362 CV_WRAP
static Ptr<VGG> create(
int desc = VGG::VGG_120,
float isigma = 1.4f,
363 bool img_normalize =
true,
bool use_scale_orientation =
true,
364 float scale_factor = 6.25f,
bool dsc_normalize =
false );
366 CV_WRAP
virtual void setSigma(
const float isigma) = 0;
367 CV_WRAP
virtual float getSigma()
const = 0;
369 CV_WRAP
virtual void setUseNormalizeImage(
const bool img_normalize) = 0;
370 CV_WRAP
virtual bool getUseNormalizeImage()
const = 0;
372 CV_WRAP
virtual void setUseScaleOrientation(
const bool use_scale_orientation) = 0;
373 CV_WRAP
virtual bool getUseScaleOrientation()
const = 0;
375 CV_WRAP
virtual void setScaleFactor(
const float scale_factor) = 0;
376 CV_WRAP
virtual float getScaleFactor()
const = 0;
378 CV_WRAP
virtual void setUseNormalizeDescriptor(
const bool dsc_normalize) = 0;
379 CV_WRAP
virtual bool getUseNormalizeDescriptor()
const = 0;
415 BGM = 100, BGM_HARD = 101, BGM_BILINEAR = 102, LBGM = 200,
416 BINBOOST_64 = 300, BINBOOST_128 = 301, BINBOOST_256 = 302
419 CV_WRAP
static Ptr<BoostDesc> create(
int desc = BoostDesc::BINBOOST_256,
420 bool use_scale_orientation =
true,
float scale_factor = 6.25f );
422 CV_WRAP
virtual void setUseScaleOrientation(
const bool use_scale_orientation) = 0;
423 CV_WRAP
virtual bool getUseScaleOrientation()
const = 0;
425 CV_WRAP
virtual void setScaleFactor(
const float scale_factor) = 0;
426 CV_WRAP
virtual float getScaleFactor()
const = 0;
456 L0_25, L0_5,
L1,
L2, L2SQUARED, L5, L_INFINITY
498 const int initSampleCount = 2000,
499 const int initSeedCount = 400,
500 const int pointDistribution = 0);
512 const std::vector<Point2f>& initSamplingPoints,
513 const int initSeedCount);
524 const std::vector<Point2f>& initSamplingPoints,
525 const std::vector<int>& initClusterSeedIndexes);
534 CV_WRAP
virtual void computeSignature(
543 CV_WRAP
virtual void computeSignatures(
544 const std::vector<Mat>& images,
545 std::vector<Mat>& signatures)
const = 0;
559 CV_WRAP
static void drawSignature(
561 InputArray signature,
563 float radiusToShorterSideRatio = 1.0 / 8,
564 int borderThickness = 1);
574 CV_WRAP
static void generateInitPoints(
575 std::vector<Point2f>& initPoints,
577 int pointDistribution);
585 CV_WRAP
virtual int getSampleCount()
const = 0;
592 CV_WRAP
virtual int getGrayscaleBits()
const = 0;
598 CV_WRAP
virtual void setGrayscaleBits(
int grayscaleBits) = 0;
605 CV_WRAP
virtual int getWindowRadius()
const = 0;
611 CV_WRAP
virtual void setWindowRadius(
int radius) = 0;
618 CV_WRAP
virtual float getWeightX()
const = 0;
623 CV_WRAP
virtual void setWeightX(
float weight) = 0;
629 CV_WRAP
virtual float getWeightY()
const = 0;
634 CV_WRAP
virtual void setWeightY(
float weight) = 0;
640 CV_WRAP
virtual float getWeightL()
const = 0;
645 CV_WRAP
virtual void setWeightL(
float weight) = 0;
651 CV_WRAP
virtual float getWeightA()
const = 0;
656 CV_WRAP
virtual void setWeightA(
float weight) = 0;
662 CV_WRAP
virtual float getWeightB()
const = 0;
667 CV_WRAP
virtual void setWeightB(
float weight) = 0;
673 CV_WRAP
virtual float getWeightContrast()
const = 0;
678 CV_WRAP
virtual void setWeightContrast(
float weight) = 0;
684 CV_WRAP
virtual float getWeightEntropy()
const = 0;
689 CV_WRAP
virtual void setWeightEntropy(
float weight) = 0;
695 CV_WRAP
virtual std::vector<Point2f> getSamplingPoints()
const = 0;
713 CV_WRAP
virtual void setWeight(
int idx,
float value) = 0;
727 CV_WRAP
virtual void setWeights(
const std::vector<float>& weights) = 0;
743 CV_WRAP
virtual void setTranslation(
int idx,
float value) = 0;
757 CV_WRAP
virtual void setTranslations(
const std::vector<float>& translations) = 0;
764 CV_WRAP
virtual void setSamplingPoints(std::vector<Point2f> samplingPoints) = 0;
772 CV_WRAP
virtual std::vector<int> getInitSeedIndexes()
const = 0;
776 CV_WRAP
virtual void setInitSeedIndexes(std::vector<int> initSeedIndexes) = 0;
780 CV_WRAP
virtual int getInitSeedCount()
const = 0;
787 CV_WRAP
virtual int getIterationCount()
const = 0;
793 CV_WRAP
virtual void setIterationCount(
int iterationCount) = 0;
799 CV_WRAP
virtual int getMaxClustersCount()
const = 0;
804 CV_WRAP
virtual void setMaxClustersCount(
int maxClustersCount) = 0;
811 CV_WRAP
virtual int getClusterMinSize()
const = 0;
817 CV_WRAP
virtual void setClusterMinSize(
int clusterMinSize) = 0;
824 CV_WRAP
virtual float getJoiningDistance()
const = 0;
830 CV_WRAP
virtual void setJoiningDistance(
float joiningDistance) = 0;
835 CV_WRAP
virtual float getDropThreshold()
const = 0;
839 CV_WRAP
virtual void setDropThreshold(
float dropThreshold) = 0;
844 CV_WRAP
virtual int getDistanceFunction()
const = 0;
849 CV_WRAP
virtual void setDistanceFunction(
int distanceFunction) = 0;
875 const int distanceFunction = 3,
876 const int similarityFunction = 2,
877 const float similarityParameter = 1.0f);
884 CV_WRAP
virtual float computeQuadraticFormDistance(
885 InputArray _signature0,
886 InputArray _signature1)
const = 0;
895 CV_WRAP
virtual void computeQuadraticFormDistances(
896 const Mat& sourceSignature,
897 const std::vector<Mat>& imageSignatures,
898 std::vector<float>& distances)
const = 0;
933 float corn_thresh=0.01f,
934 float DOG_thresh=0.01f,
967 return create(keypoint_detector, keypoint_detector);
977 CV_OUT std::vector<Elliptic_KeyPoint>& keypoints,
978 InputArray mask=noArray() ) = 0;
988 CV_OUT std::vector<Elliptic_KeyPoint>& keypoints,
990 bool useProvidedKeypoints=
false ) = 0;
1013 CV_WRAP
static Ptr<TBMR> create(
int min_area = 60,
1014 float max_area_relative = 0.01f,
1015 float scale_factor = 1.25f,
1018 CV_WRAP
virtual void setMinArea(
int minArea) = 0;
1019 CV_WRAP
virtual int getMinArea()
const = 0;
1020 CV_WRAP
virtual void setMaxAreaRelative(
float maxArea) = 0;
1021 CV_WRAP
virtual float getMaxAreaRelative()
const = 0;
1022 CV_WRAP
virtual void setScaleFactor(
float scale_factor) = 0;
1023 CV_WRAP
virtual float getScaleFactor()
const = 0;
1024 CV_WRAP
virtual void setNScales(
int n_scales) = 0;
1025 CV_WRAP
virtual int getNScales()
const = 0;
1043CV_EXPORTS
void FASTForPointSet( InputArray image, CV_IN_OUT std::vector<KeyPoint>& keypoints,
1044 int threshold,
bool nonmaxSuppression=
true, cv::FastFeatureDetector::DetectorType type=FastFeatureDetector::TYPE_9_16);
1068CV_EXPORTS_W
void matchGMS(
const Size& size1,
const Size& size2,
const std::vector<KeyPoint>& keypoints1,
const std::vector<KeyPoint>& keypoints2,
1069 const std::vector<DMatch>& matches1to2, CV_OUT std::vector<DMatch>& matchesGMS,
const bool withRotation =
false,
1070 const bool withScale =
false,
const double thresholdFactor = 6.0);
1083CV_EXPORTS_W
void matchLOGOS(
const std::vector<KeyPoint>& keypoints1,
const std::vector<KeyPoint>& keypoints2,
1084 const std::vector<int>& nn1,
const std::vector<int>& nn2,
1085 std::vector<DMatch>& matches1to2);
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition: core.hpp:3091
Abstract base class for 2D image feature detectors and descriptor extractors
Definition: features2d.hpp:135
virtual CV_WRAP void detect(InputArray image, CV_OUT std::vector< KeyPoint > &keypoints, InputArray mask=noArray())
Detects keypoints in an image (first variant) or image set (second variant).
virtual CV_WRAP void detectAndCompute(InputArray image, InputArray mask, CV_OUT std::vector< KeyPoint > &keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)
Data structure for salient point detectors.
Definition: core/types.hpp:712
n-dimensional dense array class
Definition: mat.hpp:802
Template class for 2D rectangles
Definition: core/types.hpp:421
Class implementing affine adaptation for key points.
Definition: xfeatures2d.hpp:950
static Ptr< AffineFeature2D > create(Ptr< FeatureDetector > keypoint_detector)
Creates an instance where keypoint detector and descriptor extractor are identical.
Definition: xfeatures2d.hpp:964
static Ptr< AffineFeature2D > create(Ptr< FeatureDetector > keypoint_detector, Ptr< DescriptorExtractor > descriptor_extractor)
Creates an instance wrapping the given keypoint detector and descriptor extractor.
virtual void detectAndCompute(InputArray image, InputArray mask, CV_OUT std::vector< Elliptic_KeyPoint > &keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)=0
Detects keypoints and computes descriptors for their surrounding regions, after warping them into cir...
virtual void detect(InputArray image, CV_OUT std::vector< Elliptic_KeyPoint > &keypoints, InputArray mask=noArray())=0
Detects keypoints in the image using the wrapped detector and performs affine adaptation to augment t...
Class implementing BEBLID (Boosted Efficient Binary Local Image Descriptor), described in .
Definition: xfeatures2d.hpp:205
BeblidSize
Descriptor number of bits, each bit is a boosting weak-learner. The user can choose between 512 or 25...
Definition: xfeatures2d.hpp:212
Class implementing BoostDesc (Learning Image Descriptors with Boosting), described in and .
Definition: xfeatures2d.hpp:410
Class implementing DAISY descriptor, described in
Definition: xfeatures2d.hpp:244
virtual bool GetUnnormalizedDescriptor(double y, double x, int orientation, float *descriptor, double *H) const =0
virtual void GetDescriptor(double y, double x, int orientation, float *descriptor) const =0
virtual void compute(InputArray image, std::vector< KeyPoint > &keypoints, OutputArray descriptors) CV_OVERRIDE=0
virtual bool GetDescriptor(double y, double x, int orientation, float *descriptor, double *H) const =0
virtual void compute(InputArray image, OutputArray descriptors)=0
virtual void GetUnnormalizedDescriptor(double y, double x, int orientation, float *descriptor) const =0
virtual void compute(InputArray image, Rect roi, OutputArray descriptors)=0
Elliptic region around an interest point.
Definition: xfeatures2d.hpp:906
Matx23f transf
the transformation between image space and local patch space
Definition: xfeatures2d.hpp:910
float si
the integration scale at which the parameters were estimated
Definition: xfeatures2d.hpp:909
Size_< float > axes
the lengths of the major and minor ellipse axes
Definition: xfeatures2d.hpp:908
Class implementing the FREAK (Fast Retina Keypoint) keypoint descriptor, described in .
Definition: xfeatures2d.hpp:86
Class implementing the Harris-Laplace feature detector as described in .
Definition: xfeatures2d.hpp:920
Definition: xfeatures2d.hpp:177
Class implementing the locally uniform comparison image descriptor, described in
Definition: xfeatures2d.hpp:144
Class implementing the MSD (Maximal Self-Dissimilarity) keypoint detector, described in .
Definition: xfeatures2d.hpp:327
Class implementing PCT (position-color-texture) signature extraction as described in ....
Definition: xfeatures2d.hpp:449
PointDistribution
Point distributions supported by random point generator.
Definition: xfeatures2d.hpp:463
@ UNIFORM
Generate numbers uniformly.
Definition: xfeatures2d.hpp:464
@ REGULAR
Generate points in a regular grid.
Definition: xfeatures2d.hpp:465
SimilarityFunction
Similarity function selector.
Definition: xfeatures2d.hpp:480
@ GAUSSIAN
Definition: xfeatures2d.hpp:482
@ MINUS
Definition: xfeatures2d.hpp:481
DistanceFunction
Lp distance function selector.
Definition: xfeatures2d.hpp:455
Class implementing Signature Quadratic Form Distance (SQFD).
Definition: xfeatures2d.hpp:862
The class implements the keypoint detector introduced by , synonym of StarDetector....
Definition: xfeatures2d.hpp:111
Class implementing the Tree Based Morse Regions (TBMR) as described in extended with scaled extracti...
Definition: xfeatures2d.hpp:1011
Class implementing VGG (Oxford Visual Geometry Group) descriptor trained end to end using "Descriptor...
Definition: xfeatures2d.hpp:354
CV_EXPORTS_W double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
Calculates the absolute norm of an array.
CV_EXPORTS_W double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type)
Applies a fixed-level threshold to each array element.
CV_EXPORTS void FASTForPointSet(InputArray image, CV_IN_OUT std::vector< KeyPoint > &keypoints, int threshold, bool nonmaxSuppression=true, cv::FastFeatureDetector::DetectorType type=FastFeatureDetector::TYPE_9_16)
Estimates cornerness for prespecified KeyPoints using the FAST algorithm
CV_EXPORTS_W void matchLOGOS(const std::vector< KeyPoint > &keypoints1, const std::vector< KeyPoint > &keypoints2, const std::vector< int > &nn1, const std::vector< int > &nn2, std::vector< DMatch > &matches1to2)
LOGOS (Local geometric support for high-outlier spatial verification) feature matching strategy descr...
CV_EXPORTS_W void matchGMS(const Size &size1, const Size &size2, const std::vector< KeyPoint > &keypoints1, const std::vector< KeyPoint > &keypoints2, const std::vector< DMatch > &matches1to2, CV_OUT std::vector< DMatch > &matchesGMS, const bool withRotation=false, const bool withScale=false, const double thresholdFactor=6.0)
GMS (Grid-based Motion Statistics) feature matching strategy described in .
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: features2d.hpp:910
Definition: features2d.hpp:894
Definition: cvstd_wrapper.hpp:74