First time here? Check out the FAQ!

Ask Your Question
1

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

asked May 1 '13

zhfkt gravatar image

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?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered May 2 '13

Guanta gravatar image

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.

Preview: (hide)

Comments

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

Paco_87 gravatar imagePaco_87 (Dec 13 '16)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.

Guanta gravatar imageGuanta (Dec 27 '16)edit

Question Tools

Stats

Asked: May 1 '13

Seen: 922 times

Last updated: May 02 '13