The cv::Feature2D abstract class defines a number of member functions that are used to compute the descriptors of a list of keypoints. As most feature-based methods include both a detector and a descriptor component, the associated classes include both a detect function (to detect the interest points) and a compute function (to compute their descriptors). This is the case of the cv::xfeatures2d::SURF and cv::xfeature2d::SIFT classes.
To create a SURF feature detector, we have to follow the next steps:
- Create the SURF descriptor, as shown in the following code:
// Define feature detector // Construct the SURF feature detector object cv::Ptr<cv::Feature2D> ptrFeature2D = cv::xfeatures2d::SURF::create(2000.0);
- For each image, ...