# MSER operator() is different from FeatureDetector::detect() function?

Hi,

I am using cv::MSER to get the keypoints of images in opencv. Now I have found 2 ways to do this operation of extracting keypoints from the image.

The one is operator() function in MSER class.

void operator()( const Mat& image, vector<vector<Point> >& msers, const Mat&mask ) const;


The other is virtual function in FeatureDetector::detect()

void FeatureDetector::detect( const Mat& image, vector<KeyPoint>& keypoints,const Mat& mask=Mat() ) const;


What the strange thing is the second parameters in two function are totally different.One is vector<vector<point> > type in MSER class,and the other is vector<keypoint> in FeatureDetector::detect(). In fact, I also find this in source code:

/*! Maximal Stable Extremal Regions class.*/
/*The class implements MSERalgorithm introduced by J. Matas. */
/*Unlike SIFT, SURF and many other detectorsin OpenCV, this is salient region detector, */
/*not the salient point detector.It returns the regions, each of those is encoded as a contour.*/


It seems that MSERalgorithm returns the area other than the point of a image.And I think the type vector<vector<point> > can represent the area of the image,not the type vector<keypoint>,which just stands.for the vector array of a image.

So my question is: Is virtual function detect() in FeatureDetector Class compatible with operator() in MSER Class?

edit retag close merge delete

Sort by » oldest newest most voted

Yes, operator() is actually be used in detect(). Note that detect() of the FeatureDetector class effectively calls detectImpl(). So, having a look at MserFeatureDetector::detectImpl() of mser.cpp, you will see how the contourpoints are translated to keypoints: basically an ellipse is fitted to the contour, the center is used as the point of the keypoint and its diameter gets its size. The keypoint orientation and response is obviously not encoded.

more

I don't understand how SIFT::detectImpl method works. Can anyone explain me, please?

( 2016-12-13 04:39:34 -0500 )edit

Please read Lowe's SIFT paper for an explanation, another nice explanation is on vlfeat.org, but I guess there are plenty more out there.

( 2016-12-27 17:00:21 -0500 )edit

Official site

GitHub

Wiki

Documentation