mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
quickly corrected the previous refactoring of features2d: moved from set(SOME_PROP, val) to setSomeProp(val)
This commit is contained in:
@@ -77,6 +77,27 @@ namespace cv
|
||||
|
||||
}
|
||||
|
||||
void setDescriptorType(int dtype) { descriptor = dtype; }
|
||||
int getDescriptorType() const { return descriptor; }
|
||||
|
||||
void setDescriptorSize(int dsize) { descriptor_size = dsize; }
|
||||
int getDescriptorSize() const { return descriptor_size; }
|
||||
|
||||
void setDescriptorChannels(int dch) { descriptor_channels = dch; }
|
||||
int getDescriptorChannels() const { return descriptor_channels; }
|
||||
|
||||
void setThreshold(double threshold_) { threshold = threshold_; }
|
||||
double getThreshold() const { return threshold; }
|
||||
|
||||
void setNOctaves(int octaves_) { octaves = octaves_; }
|
||||
int getNOctaves() const { return octaves; }
|
||||
|
||||
void setNOctaveLayers(int octaveLayers_) { sublevels = octaveLayers_; }
|
||||
int getNOctaveLayers() const { return sublevels; }
|
||||
|
||||
void setDiffusivity(int diff_) { diffusivity = diff_; }
|
||||
int getDiffusivity() const { return diffusivity; }
|
||||
|
||||
// returns the descriptor size in bytes
|
||||
int descriptorSize() const
|
||||
{
|
||||
|
||||
@@ -2099,7 +2099,7 @@ BriskLayer::BriskLayer(const BriskLayer& layer, int mode)
|
||||
void
|
||||
BriskLayer::getAgastPoints(int threshold, std::vector<KeyPoint>& keypoints)
|
||||
{
|
||||
fast_9_16_->set(FastFeatureDetector::THRESHOLD, threshold);
|
||||
fast_9_16_->setThreshold(threshold);
|
||||
fast_9_16_->detect(img_, keypoints);
|
||||
|
||||
// also write scores
|
||||
|
||||
@@ -407,6 +407,15 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
void setThreshold(int threshold_) { threshold = threshold_; }
|
||||
int getThreshold() const { return threshold; }
|
||||
|
||||
void setNonmaxSuppression(bool f) { nonmaxSuppression = f; }
|
||||
bool getNonmaxSuppression() const { return nonmaxSuppression; }
|
||||
|
||||
void setType(int type_) { type = type_; }
|
||||
int getType() const { return type; }
|
||||
|
||||
int threshold;
|
||||
bool nonmaxSuppression;
|
||||
int type;
|
||||
|
||||
@@ -55,23 +55,23 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void set(int prop, double value)
|
||||
{
|
||||
if( prop == USE_HARRIS_DETECTOR )
|
||||
useHarrisDetector = value != 0;
|
||||
else
|
||||
CV_Error(Error::StsBadArg, "");
|
||||
}
|
||||
void setMaxFeatures(int maxFeatures) { nfeatures = maxFeatures; }
|
||||
int getMaxFeatures() const { return nfeatures; }
|
||||
|
||||
double get(int prop) const
|
||||
{
|
||||
double value = 0;
|
||||
if( prop == USE_HARRIS_DETECTOR )
|
||||
value = useHarrisDetector;
|
||||
else
|
||||
CV_Error(Error::StsBadArg, "");
|
||||
return value;
|
||||
}
|
||||
void setQualityLevel(double qlevel) { qualityLevel = qlevel; }
|
||||
double getQualityLevel() const { return qualityLevel; }
|
||||
|
||||
void setMinDistance(double minDistance_) { minDistance = minDistance_; }
|
||||
double getMinDistance() const { return minDistance; }
|
||||
|
||||
void setBlockSize(int blockSize_) { blockSize = blockSize_; }
|
||||
int getBlockSize() const { return blockSize; }
|
||||
|
||||
void setHarrisDetector(bool val) { useHarrisDetector = val; }
|
||||
bool getHarrisDetector() const { return useHarrisDetector; }
|
||||
|
||||
void setK(double k_) { k = k_; }
|
||||
double getK() const { return k; }
|
||||
|
||||
void detect( InputArray _image, std::vector<KeyPoint>& keypoints, InputArray _mask )
|
||||
{
|
||||
|
||||
@@ -69,6 +69,24 @@ namespace cv
|
||||
|
||||
virtual ~KAZE_Impl() {}
|
||||
|
||||
void setExtended(bool extended_) { extended = extended_; }
|
||||
bool getExtended() const { return extended; }
|
||||
|
||||
void setUpright(bool upright_) { upright = upright_; }
|
||||
bool getUpright() const { return upright; }
|
||||
|
||||
void setThreshold(double threshold_) { threshold = threshold_; }
|
||||
double getThreshold() const { return threshold; }
|
||||
|
||||
void setNOctaves(int octaves_) { octaves = octaves_; }
|
||||
int getNOctaves() const { return octaves; }
|
||||
|
||||
void setNOctaveLayers(int octaveLayers_) { sublevels = octaveLayers_; }
|
||||
int getNOctaveLayers() const { return sublevels; }
|
||||
|
||||
void setDiffusivity(int diff_) { diffusivity = diff_; }
|
||||
int getDiffusivity() const { return diffusivity; }
|
||||
|
||||
// returns the descriptor size in bytes
|
||||
int descriptorSize() const
|
||||
{
|
||||
|
||||
@@ -86,35 +86,17 @@ public:
|
||||
|
||||
virtual ~MSER_Impl() {}
|
||||
|
||||
void set(int propId, double value)
|
||||
{
|
||||
if( propId == DELTA )
|
||||
params.delta = cvRound(value);
|
||||
else if( propId == MIN_AREA )
|
||||
params.minArea = cvRound(value);
|
||||
else if( propId == MAX_AREA )
|
||||
params.maxArea = cvRound(value);
|
||||
else if( propId == PASS2_ONLY )
|
||||
params.pass2Only = value != 0;
|
||||
else
|
||||
CV_Error(CV_StsBadArg, "Unknown parameter id");
|
||||
}
|
||||
void setDelta(int delta) { params.delta = delta; }
|
||||
int getDelta() const { return params.delta; }
|
||||
|
||||
double get(int propId) const
|
||||
{
|
||||
double value = 0;
|
||||
if( propId == DELTA )
|
||||
value = params.delta;
|
||||
else if( propId == MIN_AREA )
|
||||
value = params.minArea;
|
||||
else if( propId == MAX_AREA )
|
||||
value = params.maxArea;
|
||||
else if( propId == PASS2_ONLY )
|
||||
value = params.pass2Only;
|
||||
else
|
||||
CV_Error(CV_StsBadArg, "Unknown parameter id");
|
||||
return value;
|
||||
}
|
||||
void setMinArea(int minArea) { params.minArea = minArea; }
|
||||
int getMinArea() const { return params.minArea; }
|
||||
|
||||
void setMaxArea(int maxArea) { params.maxArea = maxArea; }
|
||||
int getMaxArea() const { return params.maxArea; }
|
||||
|
||||
void setPass2Only(bool f) { params.pass2Only = f; }
|
||||
bool getPass2Only() const { return params.pass2Only; }
|
||||
|
||||
enum { DIR_SHIFT = 29, NEXT_MASK = ((1<<DIR_SHIFT)-1) };
|
||||
|
||||
|
||||
@@ -660,55 +660,32 @@ public:
|
||||
scoreType(_scoreType), patchSize(_patchSize), fastThreshold(_fastThreshold)
|
||||
{}
|
||||
|
||||
void set(int prop, double value)
|
||||
{
|
||||
if( prop == NFEATURES )
|
||||
nfeatures = cvRound(value);
|
||||
else if( prop == SCALE_FACTOR )
|
||||
scaleFactor = value;
|
||||
else if( prop == NLEVELS )
|
||||
nlevels = cvRound(value);
|
||||
else if( prop == EDGE_THRESHOLD )
|
||||
edgeThreshold = cvRound(value);
|
||||
else if( prop == FIRST_LEVEL )
|
||||
firstLevel = cvRound(value);
|
||||
else if( prop == WTA_K )
|
||||
wta_k = cvRound(value);
|
||||
else if( prop == SCORE_TYPE )
|
||||
scoreType = cvRound(value);
|
||||
else if( prop == PATCH_SIZE )
|
||||
patchSize = cvRound(value);
|
||||
else if( prop == FAST_THRESHOLD )
|
||||
fastThreshold = cvRound(value);
|
||||
else
|
||||
CV_Error(Error::StsBadArg, "");
|
||||
}
|
||||
void setMaxFeatures(int maxFeatures) { nfeatures = maxFeatures; }
|
||||
int getMaxFeatures() const { return nfeatures; }
|
||||
|
||||
double get(int prop) const
|
||||
{
|
||||
double value = 0;
|
||||
if( prop == NFEATURES )
|
||||
value = nfeatures;
|
||||
else if( prop == SCALE_FACTOR )
|
||||
value = scaleFactor;
|
||||
else if( prop == NLEVELS )
|
||||
value = nlevels;
|
||||
else if( prop == EDGE_THRESHOLD )
|
||||
value = edgeThreshold;
|
||||
else if( prop == FIRST_LEVEL )
|
||||
value = firstLevel;
|
||||
else if( prop == WTA_K )
|
||||
value = wta_k;
|
||||
else if( prop == SCORE_TYPE )
|
||||
value = scoreType;
|
||||
else if( prop == PATCH_SIZE )
|
||||
value = patchSize;
|
||||
else if( prop == FAST_THRESHOLD )
|
||||
value = fastThreshold;
|
||||
else
|
||||
CV_Error(Error::StsBadArg, "");
|
||||
return value;
|
||||
}
|
||||
void setScaleFactor(double scaleFactor_) { scaleFactor = scaleFactor_; }
|
||||
double getScaleFactor() const { return scaleFactor; }
|
||||
|
||||
void setNLevels(int nlevels_) { nlevels = nlevels_; }
|
||||
int getNLevels() const { return nlevels; }
|
||||
|
||||
void setEdgeThreshold(int edgeThreshold_) { edgeThreshold = edgeThreshold_; }
|
||||
int getEdgeThreshold() const { return edgeThreshold; }
|
||||
|
||||
void setFirstLevel(int firstLevel_) { firstLevel = firstLevel_; }
|
||||
int getFirstLevel() const { return firstLevel; }
|
||||
|
||||
void setWTA_K(int wta_k_) { wta_k = wta_k_; }
|
||||
int getWTA_K() const { return wta_k; }
|
||||
|
||||
void setScoreType(int scoreType_) { scoreType = scoreType_; }
|
||||
int getScoreType() const { return scoreType; }
|
||||
|
||||
void setPatchSize(int patchSize_) { patchSize = patchSize_; }
|
||||
int getPatchSize() const { return patchSize; }
|
||||
|
||||
void setFastThreshold(int fastThreshold_) { fastThreshold = fastThreshold_; }
|
||||
int getFastThreshold() const { return fastThreshold; }
|
||||
|
||||
// returns the descriptor size in bytes
|
||||
int descriptorSize() const;
|
||||
|
||||
Reference in New Issue
Block a user