 |
AliceVision
Photogrammetric Computer Vision Framework
|
10 #include <aliceVision/config.hpp>
11 #include <aliceVision/feature/ImageDescriber.hpp>
12 #include <aliceVision/feature/imageDescriberCommon.hpp>
13 #include <aliceVision/feature/regionsFactory.hpp>
14 #include <aliceVision/feature/akaze/AKAZE.hpp>
15 #include <aliceVision/feature/akaze/descriptorLIOP.hpp>
16 #include <aliceVision/feature/akaze/descriptorMLDB.hpp>
17 #include <aliceVision/feature/akaze/descriptorMSURF.hpp>
22 enum EAKAZE_DESCRIPTOR
32 : options(akazeOptions),
33 akazeDescriptorType(eAkazeDescriptor)
38 EAKAZE_DESCRIPTOR akazeDescriptorType;
47 _isOriented(isOriented)
54 bool useCuda()
const override {
return false; }
68 switch (_params.akazeDescriptorType)
71 return EImageDescriberType::AKAZE;
73 return EImageDescriberType::AKAZE_LIOP;
75 return EImageDescriberType::AKAZE_MLDB;
77 throw std::logic_error(
"Unknown AKAZE type.");
89 std::size_t fullImgSize = width * height;
90 std::size_t memoryConsuption = 0;
91 double downscale = 1.0;
92 for (
int octave = 0; octave < _params.options.
nbOctaves; ++octave)
94 memoryConsuption += fullImgSize / (downscale * downscale);
98 return 4 * memoryConsuption + (3 * width * height *
sizeof(float)) + 1.5 * std::pow(2, 30);
105 void setUpRight(
bool upRight)
override { _isOriented = !upRight; }
113 switch (preset.descPreset)
115 case EImageDescriberPreset::LOW:
120 case EImageDescriberPreset::MEDIUM:
125 case EImageDescriberPreset::NORMAL:
131 case EImageDescriberPreset::HIGH:
137 case EImageDescriberPreset::ULTRA:
144 throw std::out_of_range(
"Invalid image describer preset enum");
146 if (!preset.gridFiltering)
166 void allocate(std::unique_ptr<Regions>& regions)
const override
168 switch (_params.akazeDescriptorType)
186 bool _isOriented =
true;
EImageDescriberType getDescriberType() const override
Get the corresponding EImageDescriberType.
Definition: ImageDescriber_AKAZE.hpp:66
void allocate(std::unique_ptr< Regions > ®ions) const override
Allocate Regions type depending of the ImageDescriber.
Definition: ImageDescriber_AKAZE.hpp:166
int nbSlicePerOctave
levels per octave
Definition: AKAZE.hpp:48
Definition: checkerDetector.cpp:32
Definition: ImageDescriber_AKAZE.hpp:29
A pure virtual class for image description computation.
Definition: ImageDescriber.hpp:159
bool useCuda() const override
Check if the image describer use CUDA.
Definition: ImageDescriber_AKAZE.hpp:54
int nbOctaves
octave to process
Definition: AKAZE.hpp:46
void setConfigurationPreset(ConfigurationPreset preset) override
Use a preset to control the number of detected regions.
Definition: ImageDescriber_AKAZE.hpp:111
bool useFloatImage() const override
Check if the image describer use float image.
Definition: ImageDescriber_AKAZE.hpp:60
std::size_t getMemoryConsumption(std::size_t width, std::size_t height) const override
Get the total amount of RAM needed for a feature extraction of an image of the given dimension.
Definition: ImageDescriber_AKAZE.hpp:87
void setUpRight(bool upRight) override
Set image describer always upRight.
Definition: ImageDescriber_AKAZE.hpp:105
bool describe(const image::Image< float > &image, std::unique_ptr< Regions > ®ions, const image::Image< unsigned char > *mask=nullptr) override
Detect regions on the float image and compute their attributes (description)
Definition: ImageDescriber_AKAZE.cpp:13
Definition: Regions.hpp:144
std::size_t maxTotalKeypoints
maximum number of keypoints
Definition: AKAZE.hpp:58
Definition: ImageDescriber.hpp:118
Definition: ImageDescriber_AKAZE.hpp:41
float threshold
hessian determinant threshold
Definition: AKAZE.hpp:52