#include2.官方文档#include // 添加SURF #include using namespace std; using namespace cv; using namespace cv::xfeatures2d; // 添加SURF相关命名空间 int main(int argc, char** argv) { Mat src = imread("test.jpg", IMREAD_COLOR); imshow("src", src); int minHessian = 5000; Ptr detector = SURF::create(minHessian); vector keypoints1; detector->detect(src, keypoints1); Mat img_keypoints1; drawKeypoints(src, keypoints1, img_keypoints1, Scalar::all(-1), DrawMatchesFlags::DRAW_RICH_KEYPOINTS); imshow("DrawMatchesFlags", img_keypoints1); waitKey(0); return 0; }
Public Types
enum {
DEFAULT = 0,
DRAW_OVER_OUTIMG = 1,
NOT_DRAW_SINGLE_POINTS = 2,
DRAW_RICH_KEYPOINTS = 4
}
3. 代码测试



