surf和sift算法都是在头文件#include <opencv2/features2d/features2d.hpp>中,但在新的opencv版本出来后,如果仍然使用这个头文件就会出现编译错误如下: 'SurfFeatureDetector' : is not a member of 'cv'
原因:没有加入两个头文件。
include <opencv2/nonfree/features2d.hpp>
include <opencv2/nonfree/nonfree.hpp>