Skip to content

Commit

Permalink
AKAZE_DESCRIPTOR enum
Browse files Browse the repository at this point in the history
  • Loading branch information
cv3d committed Aug 23, 2018
1 parent c0b8614 commit adafff3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions modules/features2d/include/opencv2/features2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ class CV_EXPORTS_W AKAZE : public Feature2D
{
public:
// AKAZE descriptor type
enum
enum AKAZE_DESCRIPTOR
{
DESCRIPTOR_KAZE_UPRIGHT = 2, ///< Upright descriptors, not invariant to rotation
DESCRIPTOR_KAZE = 3,
Expand All @@ -722,12 +722,12 @@ class CV_EXPORTS_W AKAZE : public Feature2D
@param diffusivity Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or
DIFF_CHARBONNIER
*/
CV_WRAP static Ptr<AKAZE> create(int descriptor_type=AKAZE::DESCRIPTOR_MLDB,
CV_WRAP static Ptr<AKAZE> create(AKAZE::AKAZE_DESCRIPTOR descriptor_type = AKAZE::DESCRIPTOR_MLDB,
int descriptor_size = 0, int descriptor_channels = 3,
float threshold = 0.001f, int nOctaves = 4,
int nOctaveLayers = 4, int diffusivity = KAZE::DIFF_PM_G2);

CV_WRAP virtual void setDescriptorType(int dtype) = 0;
CV_WRAP virtual void setDescriptorType(AKAZE::AKAZE_DESCRIPTOR dtype) = 0;
CV_WRAP virtual int getDescriptorType() const = 0;

CV_WRAP virtual void setDescriptorSize(int dsize) = 0;
Expand Down
3 changes: 3 additions & 0 deletions modules/features2d/misc/python/pyopencv_features2d.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifdef HAVE_OPENCV_FEATURES2D
typedef SimpleBlobDetector::Params SimpleBlobDetector_Params;
typedef AKAZE::AKAZE_DESCRIPTOR AKAZE_AKAZE_DESCRIPTOR;

CV_PY_TO_ENUM(AKAZE::AKAZE_DESCRIPTOR);
#endif
10 changes: 5 additions & 5 deletions modules/features2d/src/akaze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace cv
class AKAZE_Impl : public AKAZE
{
public:
AKAZE_Impl(int _descriptor_type, int _descriptor_size, int _descriptor_channels,
AKAZE_Impl(AKAZE_DESCRIPTOR _descriptor_type, int _descriptor_size, int _descriptor_channels,
float _threshold, int _octaves, int _sublevels, int _diffusivity)
: descriptor(_descriptor_type)
, descriptor_channels(_descriptor_channels)
Expand All @@ -77,7 +77,7 @@ namespace cv

}

void setDescriptorType(int dtype) CV_OVERRIDE { descriptor = dtype; }
void setDescriptorType(AKAZE_DESCRIPTOR dtype) CV_OVERRIDE{ descriptor = dtype; }
int getDescriptorType() const CV_OVERRIDE { return descriptor; }

void setDescriptorSize(int dsize) CV_OVERRIDE { descriptor_size = dsize; }
Expand Down Expand Up @@ -218,7 +218,7 @@ namespace cv

void read(const FileNode& fn) CV_OVERRIDE
{
descriptor = (int)fn["descriptor"];
descriptor = static_cast<AKAZE_DESCRIPTOR>((int)fn["descriptor"]);
descriptor_channels = (int)fn["descriptor_channels"];
descriptor_size = (int)fn["descriptor_size"];
threshold = (float)fn["threshold"];
Expand All @@ -227,7 +227,7 @@ namespace cv
diffusivity = (int)fn["diffusivity"];
}

int descriptor;
AKAZE_DESCRIPTOR descriptor;
int descriptor_channels;
int descriptor_size;
float threshold;
Expand All @@ -236,7 +236,7 @@ namespace cv
int diffusivity;
};

Ptr<AKAZE> AKAZE::create(int descriptor_type,
Ptr<AKAZE> AKAZE::create(AKAZE_DESCRIPTOR descriptor_type,
int descriptor_size, int descriptor_channels,
float threshold, int octaves,
int sublevels, int diffusivity)
Expand Down
2 changes: 1 addition & 1 deletion modules/features2d/src/kaze/AKAZEConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct AKAZEOptions {
float dthreshold; ///< Detector response threshold to accept point
float min_dthreshold; ///< Minimum detector threshold to accept a point

int descriptor; ///< Type of descriptor
AKAZE::AKAZE_DESCRIPTOR descriptor; ///< Type of descriptor
int descriptor_size; ///< Size of the descriptor in bits. 0->Full size
int descriptor_channels; ///< Number of channels in the descriptor (1, 2, 3)
int descriptor_pattern_size; ///< Actual patch size is 2*pattern_size*point.scale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class CV_EXPORTS OrbFeaturesFinder : public FeaturesFinder
class CV_EXPORTS AKAZEFeaturesFinder : public detail::FeaturesFinder
{
public:
AKAZEFeaturesFinder(int descriptor_type = AKAZE::DESCRIPTOR_MLDB,
AKAZEFeaturesFinder(AKAZE::AKAZE_DESCRIPTOR descriptor_type = AKAZE::DESCRIPTOR_MLDB,
int descriptor_size = 0,
int descriptor_channels = 3,
float threshold = 0.001f,
Expand Down
2 changes: 1 addition & 1 deletion modules/stitching/src/matchers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ void OrbFeaturesFinder::find(InputArray image, ImageFeatures &features)
}
}

AKAZEFeaturesFinder::AKAZEFeaturesFinder(int descriptor_type,
AKAZEFeaturesFinder::AKAZEFeaturesFinder(AKAZE::AKAZE_DESCRIPTOR descriptor_type,
int descriptor_size,
int descriptor_channels,
float threshold,
Expand Down

0 comments on commit adafff3

Please sign in to comment.