| |
| |
| |
| |
| |
| |
|
|
|
|
| #ifndef __OPENCV_FEATURES_2D_AKAZE_FEATURES_H__
|
| #define __OPENCV_FEATURES_2D_AKAZE_FEATURES_H__
|
|
|
|
|
|
|
| #include "AKAZEConfig.h"
|
|
|
| namespace cv
|
| {
|
|
|
|
|
| template <typename MatType>
|
| struct Evolution
|
| {
|
| Evolution() {
|
| etime = 0.0f;
|
| esigma = 0.0f;
|
| octave = 0;
|
| sublevel = 0;
|
| sigma_size = 0;
|
| octave_ratio = 0.0f;
|
| border = 0;
|
| }
|
|
|
| template <typename T>
|
| explicit Evolution(const Evolution<T> &other) {
|
| size = other.size;
|
| etime = other.etime;
|
| esigma = other.esigma;
|
| octave = other.octave;
|
| sublevel = other.sublevel;
|
| sigma_size = other.sigma_size;
|
| octave_ratio = other.octave_ratio;
|
| border = other.border;
|
|
|
| other.Lx.copyTo(Lx);
|
| other.Ly.copyTo(Ly);
|
| other.Lt.copyTo(Lt);
|
| other.Lsmooth.copyTo(Lsmooth);
|
| other.Ldet.copyTo(Ldet);
|
| }
|
|
|
| MatType Lx, Ly;
|
| MatType Lt;
|
| MatType Lsmooth;
|
| MatType Ldet;
|
|
|
| Size size;
|
| float etime;
|
| float esigma;
|
| int octave;
|
| int sublevel;
|
| int sigma_size;
|
| float octave_ratio;
|
| int border;
|
| };
|
|
|
| typedef Evolution<Mat> MEvolution;
|
| typedef Evolution<UMat> UEvolution;
|
| typedef std::vector<MEvolution> Pyramid;
|
| typedef std::vector<UEvolution> UMatPyramid;
|
|
|
|
|
|
|
| class AKAZEFeatures {
|
|
|
| private:
|
|
|
| AKAZEOptions options_;
|
| Pyramid evolution_;
|
|
|
|
|
| int ncycles_;
|
| bool reordering_;
|
| std::vector<std::vector<float > > tsteps_;
|
| std::vector<int> nsteps_;
|
|
|
|
|
| cv::Mat descriptorSamples_;
|
| cv::Mat descriptorBits_;
|
| cv::Mat bitMask_;
|
|
|
|
|
| void Allocate_Memory_Evolution();
|
| void Find_Scale_Space_Extrema(std::vector<Mat>& keypoints_by_layers);
|
| void Do_Subpixel_Refinement(std::vector<Mat>& keypoints_by_layers,
|
| std::vector<KeyPoint>& kpts);
|
|
|
|
|
| void Compute_Keypoints_Orientation(std::vector<cv::KeyPoint>& kpts) const;
|
|
|
| public:
|
|
|
| AKAZEFeatures(const AKAZEOptions& options);
|
| void Create_Nonlinear_Scale_Space(InputArray img);
|
| void Feature_Detection(std::vector<cv::KeyPoint>& kpts);
|
| void Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, OutputArray desc);
|
| };
|
|
|
|
|
|
|
| void generateDescriptorSubsample(cv::Mat& sampleList, cv::Mat& comparisons,
|
| int nbits, int pattern_size, int nchannels);
|
|
|
| }
|
|
|
| #endif
|
|
|