AKAZEFeatures.h 2.19 KB
Newer Older
wester committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/**
 * @file AKAZE.h
 * @brief Main class for detecting and computing binary descriptors in an
 * accelerated nonlinear scale space
 * @date Mar 27, 2013
 * @author Pablo F. Alcantarilla, Jesus Nuevo
 */

#ifndef __OPENCV_FEATURES_2D_AKAZE_FEATURES_H__
#define __OPENCV_FEATURES_2D_AKAZE_FEATURES_H__

/* ************************************************************************* */
// Includes
#include "AKAZEConfig.h"
a  
Kai Westerkamp committed
15
#include "TEvolution.h"
wester committed
16 17 18 19 20 21 22 23 24 25 26

namespace cv
{

/* ************************************************************************* */
// AKAZE Class Declaration
class AKAZEFeatures {

private:

  AKAZEOptions options_;                ///< Configuration options for AKAZE
a  
Kai Westerkamp committed
27
  std::vector<TEvolution> evolution_;        ///< Vector of nonlinear diffusion evolution
wester committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

  /// FED parameters
  int ncycles_;                  ///< Number of cycles
  bool reordering_;              ///< Flag for reordering time steps
  std::vector<std::vector<float > > tsteps_;  ///< Vector of FED dynamic time steps
  std::vector<int> nsteps_;      ///< Vector of number of steps per cycle

  /// Matrices for the M-LDB descriptor computation
  cv::Mat descriptorSamples_;  // List of positions in the grids to sample LDB bits from.
  cv::Mat descriptorBits_;
  cv::Mat bitMask_;

public:

  /// Constructor with input arguments
  AKAZEFeatures(const AKAZEOptions& options);

  /// Scale Space methods
  void Allocate_Memory_Evolution();
a  
Kai Westerkamp committed
47
  int Create_Nonlinear_Scale_Space(const cv::Mat& img);
wester committed
48 49
  void Feature_Detection(std::vector<cv::KeyPoint>& kpts);
  void Compute_Determinant_Hessian_Response(void);
a  
Kai Westerkamp committed
50 51 52
  void Compute_Multiscale_Derivatives(void);
  void Find_Scale_Space_Extrema(std::vector<cv::KeyPoint>& kpts);
  void Do_Subpixel_Refinement(std::vector<cv::KeyPoint>& kpts);
wester committed
53 54

  /// Feature description methods
a  
Kai Westerkamp committed
55 56
  void Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat& desc);
  static void Compute_Main_Orientation(cv::KeyPoint& kpt, const std::vector<TEvolution>& evolution_);
wester committed
57 58 59 60 61 62 63 64 65 66
};

/* ************************************************************************* */
/// Inline functions
void generateDescriptorSubsample(cv::Mat& sampleList, cv::Mat& comparisons,
                                 int nbits, int pattern_size, int nchannels);

}

#endif