Skip to content

Commit

Permalink
add preset settings for the Image_describer to control the number of …
Browse files Browse the repository at this point in the history
…detections. openMVG#269
  • Loading branch information
pmoulon committed May 5, 2015
1 parent 78a33ca commit afb7df1
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/nonFree/sift/SIFT_describer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,26 @@ class SIFT_Image_describer : public Image_describer

~SIFT_Image_describer() {}

bool Set_configuration_preset(EDESCRIBER_PRESET preset)
{
switch(preset)
{
case NORMAL_PRESET:
_params._peak_threshold = 0.04f;
break;
case HIGH_PRESET:
_params._peak_threshold = 0.01f;
break;
case ULTRA_PRESET:
_params._peak_threshold = 0.01f;
_params._first_octave = -1;
break;
default:
return false;
}
return true;
}

/**
@brief Detect regions on the image and compute their attributes (description)
@param image Image.
Expand Down
13 changes: 13 additions & 0 deletions src/openMVG/features/image_describer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,26 @@
namespace openMVG {
namespace features {

enum EDESCRIBER_PRESET
{
NORMAL_PRESET,
HIGH_PRESET,
ULTRA_PRESET
};
/// A pure virtual class for image description computation
class Image_describer
{
public:
Image_describer() {}
virtual ~Image_describer() {}

/**
@brief Use a preset to control the number of detected regions
@param preset The preset configuration
@return True if configuration succeed.
*/
virtual bool Set_configuration_preset(EDESCRIBER_PRESET preset) = 0;

/**
@brief Detect regions on the image and compute their attributes (description)
@param image Image.
Expand Down
20 changes: 20 additions & 0 deletions src/openMVG/features/image_describer_akaze.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ class AKAZE_Image_describer : public Image_describer
bool bOrientation = true
):Image_describer(), _params(params), _bOrientation(bOrientation) {}


bool Set_configuration_preset(EDESCRIBER_PRESET preset)
{
switch(preset)
{
case NORMAL_PRESET:
_params._options.fThreshold = AKAZEConfig().fThreshold;
break;
case HIGH_PRESET:
_params._options.fThreshold = AKAZEConfig().fThreshold/10.;
break;
case ULTRA_PRESET:
_params._options.fThreshold = AKAZEConfig().fThreshold/100.;
break;
default:
return false;
}
return true;
}

/**
@brief Detect regions on the image and compute their attributes (description)
@param image Image.
Expand Down
File renamed without changes.

0 comments on commit afb7df1

Please sign in to comment.