C++ OpenCV错误:简短描述符TractorImpl中的参数错误(字节必须为16、32或64)

C++ OpenCV错误:简短描述符TractorImpl中的参数错误(字节必须为16、32或64),c++,image-processing,feature-extraction,feature-detection,opencv3.2,C++,Image Processing,Feature Extraction,Feature Detection,Opencv3.2,我正在尝试使用SURF和描述符提取器(使用BRIEF)检测特征点 cv::Ptr<Feature2D> detector = xfeatures2d::SurfFeatureDetector::create(400); Mat descriptors_img1, descriptors_img2; //-- Step 2: Calculate descriptors (feature vectors) detector->detect(img1, kp1); detecto

我正在尝试使用SURF和描述符提取器(使用BRIEF)检测特征点

cv::Ptr<Feature2D> detector = xfeatures2d::SurfFeatureDetector::create(400);
Mat descriptors_img1, descriptors_img2;


//-- Step 2: Calculate descriptors (feature vectors)
detector->detect(img1, kp1);
detector->detect(img2, kp2);

cv::Ptr<DescriptorExtractor> extractor = xfeatures2d::BriefDescriptorExtractor::create(400);

extractor->compute(img1, kp1, descriptors_img1 );
extractor->compute(img2, kp2, descriptors_img2 );
有人能解释一下这个错误以及如何解决它吗。 我正在使用OpenCV3.2

BriefDescriptorExtractor(int bytes=32,bool use_orientation = false)
第一个参数应为字节。 因此,从代码中删除参数400并重试。第一个参数应为2^,而不是400。 从更改代码

cv::Ptr<DescriptorExtractor> extractor = xfeatures2d::BriefDescriptorExtractor::create(400);
cv::Ptr extractor=xfeature2d::BriefDescriptorExtractor::create(400);

cv::Ptr extractor=xfeature2d::BriefDescriptorExtractor::create();
cv::Ptr<DescriptorExtractor> extractor = xfeatures2d::BriefDescriptorExtractor::create(400);
cv::Ptr<DescriptorExtractor> extractor = xfeatures2d::BriefDescriptorExtractor::create();