AliceVision
Photogrammetric Computer Vision Framework
AKAZE.hpp
1 // This file is part of the AliceVision project.
2 // Copyright (c) 2016 AliceVision contributors.
3 // Copyright (c) 2012 openMVG contributors.
4 // This Source Code Form is subject to the terms of the Mozilla Public License,
5 // v. 2.0. If a copy of the MPL was not distributed with this file,
6 // You can obtain one at https://mozilla.org/MPL/2.0/.
7 
8 #pragma once
9 
10 #ifdef _MSC_VER
11  #pragma warning(once : 4244)
12 #endif
13 
14 #include <aliceVision/image/Image.hpp>
15 #include <aliceVision/numeric/numeric.hpp>
16 #include <aliceVision/numeric/MathTrait.hpp>
17 #include <aliceVision/feature/PointFeature.hpp>
18 #include <aliceVision/feature/Descriptor.hpp>
19 
20 namespace aliceVision {
21 namespace feature {
22 
44 {
46  int nbOctaves = 4;
50  float sigma0 = 1.6f;
52  float threshold = 0.0008f;
54  float descFactor = 1.0f;
56  std::size_t gridSize = 4;
58  std::size_t maxTotalKeypoints = 1000;
59 };
60 
62 {
64  float x = 0.f;
66  float y = 0.f;
68  float size = 0.f;
72  float angle = 0.f;
74  float response = 0.f;
76  unsigned char octave = 0;
78  unsigned char class_id = 0;
79 };
80 
84 class AKAZE
85 {
86  public:
87  struct TEvolution
88  {
97  };
98 
104  AKAZE(const image::Image<float>& image, const AKAZEOptions& options);
105 
109  void computeScaleSpace();
110 
115  void featureDetection(std::vector<AKAZEKeypoint>& keypoints) const;
116 
121  void gridFiltering(std::vector<AKAZEKeypoint>& keypoints) const;
122 
127  void subpixelRefinement(std::vector<AKAZEKeypoint>& keypoints) const;
128 
133  bool subpixelRefinement(AKAZEKeypoint& keypoint, const image::Image<float>& Ldet) const;
134 
143  void computeMainOrientation(AKAZEKeypoint& keypoint, const image::Image<float>& Lx, const image::Image<float>& Ly) const;
144 
149  inline const std::vector<TEvolution>& getSlices() const { return _evolution; }
150 
151  private:
153  image::Image<float> _input;
155  AKAZEOptions _options;
157  std::vector<TEvolution> _evolution;
158 };
159 
160 } // namespace feature
161 } // namespace aliceVision
aliceVision::feature::AKAZE
AKAZE Class Declaration.
Definition: AKAZE.hpp:84
aliceVision::feature::AKAZEKeypoint::class_id
unsigned char class_id
object class (if the keypoints need to be clustered by an object they belong to)
Definition: AKAZE.hpp:78
aliceVision::feature::AKAZE::TEvolution::Ly
image::Image< float > Ly
current y derivatives
Definition: AKAZE.hpp:94
aliceVision::feature::AKAZEKeypoint::x
float x
coordinate x of the keypoints
Definition: AKAZE.hpp:64
aliceVision::feature::AKAZE::computeMainOrientation
void computeMainOrientation(AKAZEKeypoint &keypoint, const image::Image< float > &Lx, const image::Image< float > &Ly) const
This method computes the main orientation for a given keypoint.
Definition: AKAZE.cpp:405
aliceVision::feature::AKAZEOptions
Definition: AKAZE.hpp:43
aliceVision::feature::AKAZE::TEvolution
Definition: AKAZE.hpp:87
aliceVision::feature::AKAZE::AKAZE
AKAZE(const image::Image< float > &image, const AKAZEOptions &options)
Constructor.
Definition: AKAZE.cpp:157
aliceVision::feature::AKAZE::TEvolution::cur
image::Image< float > cur
current gaussian image
Definition: AKAZE.hpp:90
aliceVision::feature::AKAZEKeypoint::angle
float angle
Definition: AKAZE.hpp:72
aliceVision::feature::AKAZEOptions::nbSlicePerOctave
int nbSlicePerOctave
levels per octave
Definition: AKAZE.hpp:48
aliceVision
Definition: checkerDetector.cpp:32
aliceVision::feature::AKAZE::featureDetection
void featureDetection(std::vector< AKAZEKeypoint > &keypoints) const
Detect feature in the AKAZE scale space.
Definition: AKAZE.cpp:227
aliceVision::feature::AKAZE::computeScaleSpace
void computeScaleSpace()
Compute the AKAZE non linear diffusion scale space per slice.
Definition: AKAZE.cpp:168
aliceVision::feature::AKAZEOptions::nbOctaves
int nbOctaves
octave to process
Definition: AKAZE.hpp:46
aliceVision::feature::AKAZEKeypoint::response
float response
the response by which the most strong keypoints have been selected. Can be used for the further sorti...
Definition: AKAZE.hpp:74
aliceVision::image::Image< float >
aliceVision::feature::AKAZEOptions::descFactor
float descFactor
magnifier used to describe an interest point
Definition: AKAZE.hpp:54
aliceVision::feature::AKAZEKeypoint
Definition: AKAZE.hpp:61
aliceVision::feature::AKAZEKeypoint::y
float y
coordinate y of the keypoints
Definition: AKAZE.hpp:66
aliceVision::feature::AKAZE::subpixelRefinement
void subpixelRefinement(std::vector< AKAZEKeypoint > &keypoints) const
Sub-pixel refinement of the detected keypoints.
Definition: AKAZE.cpp:379
aliceVision::feature::AKAZE::gridFiltering
void gridFiltering(std::vector< AKAZEKeypoint > &keypoints) const
Grid filtering of the detected keypoints.
Definition: AKAZE.cpp:292
aliceVision::feature::AKAZE::TEvolution::Lx
image::Image< float > Lx
current x derivatives
Definition: AKAZE.hpp:92
aliceVision::feature::AKAZEOptions::maxTotalKeypoints
std::size_t maxTotalKeypoints
maximum number of keypoints
Definition: AKAZE.hpp:58
aliceVision::feature::AKAZEKeypoint::size
float size
diameter of the meaningful keypoint neighborhood
Definition: AKAZE.hpp:68
aliceVision::feature::AKAZEOptions::sigma0
float sigma0
initial sigma offset (used to suppress low level noise)
Definition: AKAZE.hpp:50
aliceVision::feature::AKAZEKeypoint::octave
unsigned char octave
octave (pyramid layer) from which the keypoint has been extracted
Definition: AKAZE.hpp:76
aliceVision::feature::AKAZE::TEvolution::Lhess
image::Image< float > Lhess
current Determinant of Hessian
Definition: AKAZE.hpp:96
aliceVision::feature::AKAZEOptions::gridSize
std::size_t gridSize
grid size for filtering
Definition: AKAZE.hpp:56
aliceVision::feature::AKAZEOptions::threshold
float threshold
hessian determinant threshold
Definition: AKAZE.hpp:52
aliceVision::feature::AKAZE::getSlices
const std::vector< TEvolution > & getSlices() const
Get scale space slices.
Definition: AKAZE.hpp:149