Commit 6c63139f authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

added properties setter/getter to SURF

parent 218358a5
......@@ -74,6 +74,7 @@ typedef SIFT SiftDescriptorExtractor;
class CV_EXPORTS_W SURF : public Feature2D
{
public:
enum { HESSIAN_THRESHOLD = 10000, NOCTAVES=10001, NOCTAVE_LAYERS=10002, EXTENDED=10003, UPRIGHT=10004 };
CV_WRAP static Ptr<SURF> create(double hessianThreshold=100,
int nOctaves = 4, int nOctaveLayers = 3,
bool extended = false, bool upright = false);
......
......@@ -876,6 +876,40 @@ SURF_Impl::SURF_Impl(double _threshold, int _nOctaves, int _nOctaveLayers, bool
nOctaveLayers = _nOctaveLayers;
}
void SURF_Impl::set(int prop, double value)
{
if( prop == HESSIAN_THRESHOLD )
hessianThreshold = value;
else if( prop == NOCTAVES )
nOctaves = cvRound(value);
else if( prop == NOCTAVE_LAYERS )
nOctaveLayers = cvRound(value);
else if( prop == EXTENDED )
extended = value != 0;
else if( prop == UPRIGHT )
upright = value != 0;
else
CV_Error(Error::StsBadArg, "");
}
double SURF_Impl::get(int prop) const
{
double value = 0;
if( prop == HESSIAN_THRESHOLD )
value = hessianThreshold;
else if( prop == NOCTAVES )
value = nOctaves;
else if( prop == NOCTAVE_LAYERS )
value = nOctaveLayers;
else if( prop == EXTENDED )
value = extended;
else if( prop == UPRIGHT )
value = upright;
else
CV_Error(Error::StsBadArg, "");
return value;
}
int SURF_Impl::descriptorSize() const { return extended ? 128 : 64; }
int SURF_Impl::descriptorType() const { return CV_32F; }
int SURF_Impl::defaultNorm() const { return NORM_L2; }
......
......@@ -32,6 +32,9 @@ public:
//! returns the descriptor type
CV_WRAP int defaultNorm() const;
void set(int, double);
double get(int) const;
//! finds the keypoints and computes their descriptors.
// Optionally it can compute descriptors for the user-provided keypoints
void detectAndCompute(InputArray img, InputArray mask,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment