merged all the latest changes from 2.4 to trunk
This commit is contained in:
@@ -195,7 +195,7 @@ DenseFeatureDetector::DenseFeatureDetector( float _initFeatureScale, int _featur
|
||||
|
||||
void DenseFeatureDetector::detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask ) const
|
||||
{
|
||||
float curScale = initFeatureScale;
|
||||
float curScale = static_cast<float>(initFeatureScale);
|
||||
int curStep = initXyStep;
|
||||
int curBound = initImgBound;
|
||||
for( int curLevel = 0; curLevel < featureScaleLevels; curLevel++ )
|
||||
@@ -208,7 +208,7 @@ void DenseFeatureDetector::detectImpl( const Mat& image, vector<KeyPoint>& keypo
|
||||
}
|
||||
}
|
||||
|
||||
curScale = curScale * featureScaleMul;
|
||||
curScale = static_cast<float>(curScale * featureScaleMul);
|
||||
if( varyXyStepWithScale ) curStep = static_cast<int>( curStep * featureScaleMul + 0.5f );
|
||||
if( varyImgBoundWithScale ) curBound = static_cast<int>( curBound * featureScaleMul + 0.5f );
|
||||
}
|
||||
@@ -359,5 +359,161 @@ void PyramidAdaptedFeatureDetector::detectImpl( const Mat& image, vector<KeyPoin
|
||||
if( !mask.empty() )
|
||||
KeyPointsFilter::runByPixelsMask( keypoints, mask );
|
||||
}
|
||||
|
||||
|
||||
/////////////////////// AlgorithmInfo for various detector & descriptors ////////////////////////////
|
||||
|
||||
/* NOTE!!!
|
||||
All the AlgorithmInfo-related stuff should be in the same file as initModule_features2d().
|
||||
Otherwise, linker may throw away some seemingly unused stuff.
|
||||
*/
|
||||
|
||||
static Algorithm* createBRIEF() { return new BriefDescriptorExtractor; }
|
||||
static AlgorithmInfo& brief_info()
|
||||
{
|
||||
static AlgorithmInfo brief_info_var("Feature2D.BRIEF", createBRIEF);
|
||||
return brief_info_var;
|
||||
}
|
||||
|
||||
static AlgorithmInfo& brief_info_auto = brief_info();
|
||||
|
||||
AlgorithmInfo* BriefDescriptorExtractor::info() const
|
||||
{
|
||||
static volatile bool initialized = false;
|
||||
if( !initialized )
|
||||
{
|
||||
BriefDescriptorExtractor brief;
|
||||
brief_info().addParam(brief, "bytes", brief.bytes_);
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
return &brief_info();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static Algorithm* createFAST() { return new FastFeatureDetector; }
|
||||
static AlgorithmInfo& fast_info()
|
||||
{
|
||||
static AlgorithmInfo fast_info_var("Feature2D.FAST", createFAST);
|
||||
return fast_info_var;
|
||||
}
|
||||
|
||||
static AlgorithmInfo& fast_info_auto = fast_info();
|
||||
|
||||
AlgorithmInfo* FastFeatureDetector::info() const
|
||||
{
|
||||
static volatile bool initialized = false;
|
||||
if( !initialized )
|
||||
{
|
||||
FastFeatureDetector obj;
|
||||
fast_info().addParam(obj, "threshold", obj.threshold);
|
||||
fast_info().addParam(obj, "nonmaxSuppression", obj.nonmaxSuppression);
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
return &fast_info();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static Algorithm* createStarDetector() { return new StarDetector; }
|
||||
static AlgorithmInfo& star_info()
|
||||
{
|
||||
static AlgorithmInfo star_info_var("Feature2D.STAR", createStarDetector);
|
||||
return star_info_var;
|
||||
}
|
||||
|
||||
static AlgorithmInfo& star_info_auto = star_info();
|
||||
|
||||
AlgorithmInfo* StarDetector::info() const
|
||||
{
|
||||
static volatile bool initialized = false;
|
||||
if( !initialized )
|
||||
{
|
||||
StarDetector obj;
|
||||
star_info().addParam(obj, "maxSize", obj.maxSize);
|
||||
star_info().addParam(obj, "responseThreshold", obj.responseThreshold);
|
||||
star_info().addParam(obj, "lineThresholdProjected", obj.lineThresholdProjected);
|
||||
star_info().addParam(obj, "lineThresholdBinarized", obj.lineThresholdBinarized);
|
||||
star_info().addParam(obj, "suppressNonmaxSize", obj.suppressNonmaxSize);
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
return &star_info();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static Algorithm* createMSER() { return new MSER; }
|
||||
static AlgorithmInfo& mser_info()
|
||||
{
|
||||
static AlgorithmInfo mser_info_var("Feature2D.MSER", createMSER);
|
||||
return mser_info_var;
|
||||
}
|
||||
|
||||
static AlgorithmInfo& mser_info_auto = mser_info();
|
||||
|
||||
AlgorithmInfo* MSER::info() const
|
||||
{
|
||||
static volatile bool initialized = false;
|
||||
if( !initialized )
|
||||
{
|
||||
MSER obj;
|
||||
mser_info().addParam(obj, "delta", obj.delta);
|
||||
mser_info().addParam(obj, "minArea", obj.minArea);
|
||||
mser_info().addParam(obj, "maxArea", obj.maxArea);
|
||||
mser_info().addParam(obj, "maxVariation", obj.maxVariation);
|
||||
mser_info().addParam(obj, "minDiversity", obj.minDiversity);
|
||||
mser_info().addParam(obj, "maxEvolution", obj.maxEvolution);
|
||||
mser_info().addParam(obj, "areaThreshold", obj.areaThreshold);
|
||||
mser_info().addParam(obj, "minMargin", obj.minMargin);
|
||||
mser_info().addParam(obj, "edgeBlurSize", obj.edgeBlurSize);
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
return &mser_info();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static Algorithm* createORB() { return new ORB; }
|
||||
static AlgorithmInfo& orb_info()
|
||||
{
|
||||
static AlgorithmInfo orb_info_var("Feature2D.ORB", createORB);
|
||||
return orb_info_var;
|
||||
}
|
||||
|
||||
static AlgorithmInfo& orb_info_auto = orb_info();
|
||||
|
||||
AlgorithmInfo* ORB::info() const
|
||||
{
|
||||
static volatile bool initialized = false;
|
||||
if( !initialized )
|
||||
{
|
||||
ORB obj;
|
||||
orb_info().addParam(obj, "nFeatures", obj.nfeatures);
|
||||
orb_info().addParam(obj, "scaleFactor", obj.scaleFactor);
|
||||
orb_info().addParam(obj, "nLevels", obj.nlevels);
|
||||
orb_info().addParam(obj, "firstLevel", obj.firstLevel);
|
||||
orb_info().addParam(obj, "edgeThreshold", obj.edgeThreshold);
|
||||
orb_info().addParam(obj, "patchSize", obj.patchSize);
|
||||
orb_info().addParam(obj, "WTA_K", obj.WTA_K);
|
||||
orb_info().addParam(obj, "scoreType", obj.scoreType);
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
return &orb_info();
|
||||
}
|
||||
|
||||
bool initModule_features2d(void)
|
||||
{
|
||||
Ptr<Algorithm> brief = createBRIEF(), orb = createORB(),
|
||||
star = createStarDetector(), fastd = createFAST(), mser = createMSER();
|
||||
return brief->info() != 0 && orb->info() != 0 && star->info() != 0 &&
|
||||
fastd->info() != 0 && mser->info() != 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user