Opencv SIFT需要注意的地方

1。提取的sift 描述符是float,所以要访问每一个数据的话

   			for (int r = 0;r(r);
				for(int c = 0;c

2.保存数据到txt时最好用" " 而不是std::ends;

3.提取sift特征的代码
1)

	Mat mask;
    int _nfeatures=0;
    int _nOctaveLayers=3;
    double _contrastThreshold=0.04;
    double _edgeThreshold=10;
    double _sigma=1.6;
    SIFT sift(_nfeatures,_nOctaveLayers,_contrastThreshold,_edgeThreshold,
        _sigma);
//    vector keypoints;
    bool useProvidedKeypoints=false;
   // Mat descriptors;
    sift(image, mask, keypoints, descriptors, useProvidedKeypoints);

2)

		SiftFeatureDetector detector;
		SiftDescriptorExtractor extractor;
		detector.detect(image,keypoints);
		extractor.compute(image,keypoints,descriptors);




你可能感兴趣的:(C++笔记,OpenCV,C++疑问)