moved sift parameters implementation from hpp file
This commit is contained in:
parent
11f9dafdca
commit
93dc0dbae5
@ -253,11 +253,8 @@ public:
|
|||||||
static const int DEFAULT_FIRST_OCTAVE = -1;
|
static const int DEFAULT_FIRST_OCTAVE = -1;
|
||||||
enum{ FIRST_ANGLE = 0, AVERAGE_ANGLE = 1 };
|
enum{ FIRST_ANGLE = 0, AVERAGE_ANGLE = 1 };
|
||||||
|
|
||||||
CommonParams() : nOctaves(DEFAULT_NOCTAVES), nOctaveLayers(DEFAULT_NOCTAVE_LAYERS),
|
CommonParams();
|
||||||
firstOctave(DEFAULT_FIRST_OCTAVE), angleMode(FIRST_ANGLE) {}
|
CommonParams( int _nOctaves, int _nOctaveLayers, int _firstOctave, int _angleMode );
|
||||||
CommonParams( int _nOctaves, int _nOctaveLayers, int _firstOctave, int _angleMode ) :
|
|
||||||
nOctaves(_nOctaves), nOctaveLayers(_nOctaveLayers),
|
|
||||||
firstOctave(_firstOctave), angleMode(_angleMode) {}
|
|
||||||
int nOctaves, nOctaveLayers, firstOctave;
|
int nOctaves, nOctaveLayers, firstOctave;
|
||||||
int angleMode;
|
int angleMode;
|
||||||
};
|
};
|
||||||
@ -267,9 +264,8 @@ public:
|
|||||||
static double GET_DEFAULT_THRESHOLD() { return 0.04 / SIFT::CommonParams::DEFAULT_NOCTAVE_LAYERS / 2.0; }
|
static double GET_DEFAULT_THRESHOLD() { return 0.04 / SIFT::CommonParams::DEFAULT_NOCTAVE_LAYERS / 2.0; }
|
||||||
static double GET_DEFAULT_EDGE_THRESHOLD() { return 10.0; }
|
static double GET_DEFAULT_EDGE_THRESHOLD() { return 10.0; }
|
||||||
|
|
||||||
DetectorParams() : threshold(GET_DEFAULT_THRESHOLD()), edgeThreshold(GET_DEFAULT_EDGE_THRESHOLD()) {}
|
DetectorParams();
|
||||||
DetectorParams( double _threshold, double _edgeThreshold ) :
|
DetectorParams( double _threshold, double _edgeThreshold );
|
||||||
threshold(_threshold), edgeThreshold(_edgeThreshold) {}
|
|
||||||
double threshold, edgeThreshold;
|
double threshold, edgeThreshold;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -278,11 +274,9 @@ public:
|
|||||||
static double GET_DEFAULT_MAGNIFICATION() { return 3.0; }
|
static double GET_DEFAULT_MAGNIFICATION() { return 3.0; }
|
||||||
static const bool DEFAULT_IS_NORMALIZE = true;
|
static const bool DEFAULT_IS_NORMALIZE = true;
|
||||||
static const int DESCRIPTOR_SIZE = 128;
|
static const int DESCRIPTOR_SIZE = 128;
|
||||||
DescriptorParams() : magnification(GET_DEFAULT_MAGNIFICATION()), isNormalize(DEFAULT_IS_NORMALIZE),
|
|
||||||
recalculateAngles(true) {}
|
DescriptorParams();
|
||||||
DescriptorParams( double _magnification, bool _isNormalize, bool _recalculateAngles ) :
|
DescriptorParams( double _magnification, bool _isNormalize, bool _recalculateAngles );
|
||||||
magnification(_magnification), isNormalize(_isNormalize),
|
|
||||||
recalculateAngles(_recalculateAngles) {}
|
|
||||||
double magnification;
|
double magnification;
|
||||||
bool isNormalize;
|
bool isNormalize;
|
||||||
bool recalculateAngles;
|
bool recalculateAngles;
|
||||||
@ -311,7 +305,8 @@ public:
|
|||||||
//! finds the keypoints using SIFT algorithm
|
//! finds the keypoints using SIFT algorithm
|
||||||
void operator()(const Mat& img, const Mat& mask,
|
void operator()(const Mat& img, const Mat& mask,
|
||||||
vector<KeyPoint>& keypoints) const;
|
vector<KeyPoint>& keypoints) const;
|
||||||
//! finds the keypoints and computes descriptors for them using SIFT algorithm. Optionally it can compute descriptors for the user-provided keypoints
|
//! finds the keypoints and computes descriptors for them using SIFT algorithm.
|
||||||
|
//! Optionally it can compute descriptors for the user-provided keypoints
|
||||||
void operator()(const Mat& img, const Mat& mask,
|
void operator()(const Mat& img, const Mat& mask,
|
||||||
vector<KeyPoint>& keypoints,
|
vector<KeyPoint>& keypoints,
|
||||||
Mat& descriptors,
|
Mat& descriptors,
|
||||||
|
@ -1978,6 +1978,34 @@ Sift::computeKeypointDescriptor
|
|||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
|
SIFT::CommonParams::CommonParams() :
|
||||||
|
nOctaves(DEFAULT_NOCTAVES), nOctaveLayers(DEFAULT_NOCTAVE_LAYERS),
|
||||||
|
firstOctave(DEFAULT_FIRST_OCTAVE), angleMode(FIRST_ANGLE)
|
||||||
|
{}
|
||||||
|
|
||||||
|
SIFT::CommonParams::CommonParams( int _nOctaves, int _nOctaveLayers, int _firstOctave, int _angleMode ) :
|
||||||
|
nOctaves(_nOctaves), nOctaveLayers(_nOctaveLayers),
|
||||||
|
firstOctave(_firstOctave), angleMode(_angleMode)
|
||||||
|
{}
|
||||||
|
|
||||||
|
SIFT::DetectorParams::DetectorParams() :
|
||||||
|
threshold(GET_DEFAULT_THRESHOLD()), edgeThreshold(GET_DEFAULT_EDGE_THRESHOLD())
|
||||||
|
{}
|
||||||
|
|
||||||
|
SIFT::DetectorParams::DetectorParams( double _threshold, double _edgeThreshold ) :
|
||||||
|
threshold(_threshold), edgeThreshold(_edgeThreshold)
|
||||||
|
{}
|
||||||
|
|
||||||
|
SIFT::DescriptorParams::DescriptorParams() :
|
||||||
|
magnification(GET_DEFAULT_MAGNIFICATION()), isNormalize(DEFAULT_IS_NORMALIZE),
|
||||||
|
recalculateAngles(true)
|
||||||
|
{}
|
||||||
|
|
||||||
|
SIFT::DescriptorParams::DescriptorParams( double _magnification, bool _isNormalize, bool _recalculateAngles ) :
|
||||||
|
magnification(_magnification), isNormalize(_isNormalize),
|
||||||
|
recalculateAngles(_recalculateAngles)
|
||||||
|
{}
|
||||||
|
|
||||||
SIFT::SIFT()
|
SIFT::SIFT()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user