11.12
头文件中不要加任何命名空间,会存在很多重定义问题
11.13 surf特征点提取写法
cv::Ptr<cv::xfeatures2d::SurfFeatureDetector> surfDetector = cv::xfeatures2d::SurfFeatureDetector::create(10);
surfDetector->detect(center_img, tmp_center);
surfDetector->detect(Best_img_i, tmp_image);
cv::Ptr<cv::xfeatures2d::SurfDescriptorExtractor> detector = cv::xfeatures2d::SurfDescriptorExtractor::create();
detector->detect(image1, tmp_center, descriptor_center);
detector->detect(image2, tmp_image, descriptor_image);
和下面的写法不能混淆
cv::Ptr<cv::xfeatures2d::SURF> detector = cv::xfeatures2d::SURF::create(10, 4, 3, true, true);
std::vector<cv::KeyPoint> keypoints1, keypoints2;
cv::Mat src_vector, temp_vector;//用来存放特征点的描述向量
//找到特征点并计算特征描述子(向量)
detector->detectAndCompute(img1, cv::Mat(), keypoints1, src_vector);
detector->detectAndCompute(img2, cv::Mat(), keypoints2, temp_vector);