all the tests now pass except for MSER

This commit is contained in:
Vadim Pisarevsky
2014-10-16 20:58:29 +04:00
parent 162384a838
commit 01d3848f17
13 changed files with 730 additions and 21 deletions

View File

@@ -2099,7 +2099,7 @@ BriskLayer::BriskLayer(const BriskLayer& layer, int mode)
void
BriskLayer::getAgastPoints(int threshold, std::vector<KeyPoint>& keypoints)
{
fast_9_16_ = FastFeatureDetector::create(threshold);
fast_9_16_->set(FastFeatureDetector::THRESHOLD, threshold);
fast_9_16_->detect(img_, keypoints);
// also write scores

View File

@@ -383,6 +383,30 @@ public:
KeyPointsFilter::runByPixelsMask( keypoints, mask );
}
void set(int prop, double value)
{
if(prop == THRESHOLD)
threshold = cvRound(value);
else if(prop == NONMAX_SUPPRESSION)
nonmaxSuppression = value != 0;
else if(prop == FAST_N)
type = cvRound(value);
else
CV_Error(Error::StsBadArg, "");
}
double get(int prop) const
{
if(prop == THRESHOLD)
return threshold;
if(prop == NONMAX_SUPPRESSION)
return nonmaxSuppression;
if(prop == FAST_N)
return type;
CV_Error(Error::StsBadArg, "");
return 0;
}
int threshold;
bool nonmaxSuppression;
int type;

View File

@@ -800,9 +800,12 @@ extractMSER_8uC3( const Mat& src, Mat& labels,
double emean = 0;
Mat dx( src.rows, src.cols-1, CV_32FC1 );
Mat dy( src.rows, src.cols, CV_32FC1 );
Ne = preprocessMSER_8UC3( map, edge, emean, src, dx, dy, Ne, params.edgeBlurSize );
emean = emean / (double)Ne;
std::sort(edge, edge + Ne, LessThanEdge());
MSCREdge* edge_ub = edge+Ne;
MSCREdge* edgeptr = edge;
TempMSCR* mscrptr = mscr;