我正在尝试在openCV中将描述符大小更改为128而不是64

有谁知道我怎么改变它

这是我的代码的一部分

{
    SurfFeatureDetector detector( minHessian , 1 , 1 , 1 , 0 ); // try to get most number of  keypoint for matching
std::vector<KeyPoint> keypoints_object, keypoints_scene;
detector.detect( img_object, keypoints_object );
detector.detect( img_scene, keypoints_scene );

//-- Step 2: Calculate descriptors (feature vectors)
SurfDescriptorExtractor extractor ;
Mat descriptors_object, descriptors_scene;
extractor.compute( img_object, keypoints_object, descriptors_object );
extractor.compute( img_scene, keypoints_scene, descriptors_scene );

}

提前致谢

最佳答案

扩展参数负责描述符的大小。将其设置为1(true),应计算128个元素的描述符。

SurfDescriptorExtractor extractor(hessianThreshold, nOctaves, nOctaveLayers,
                                                        ***extended***, upright);

10-08 11:11