关于角点匹配,角点检测后产生描述子后使用KNN匹配时的错误:

    cout<<"类型1:  "< matches;
 vector< vector > m_knnMatches;

 matches.clear();
 const float minRatio=1.f / 1.5f;
 matcher.knnMatch(desc1,desc2,m_knnMatches,2);

 for (int i=0; i

当使用KNN匹配时,注意它的接受的描述子的类型应该为CV_32F,所以需要转换到所需的类型上。
错误为:OpenCV Error: Unsupported format or combination of formats (type=0 ) in buildIndex_, file /tmp/buildd/ros-fuerte-opencv2-2.4.2-1precise-20130312-1306/modules/flann/src/miniflann.cpp, line 299 terminate called after throwing an instance of ‘cv::Exception’ what(): /tmp/buildd/ros-fuerte-opencv2-2.4.2-1precise-20130312-1306/modules/flann/src/miniflann.cpp:299: error: (-210) type=0 in function buildIndex_

你可能感兴趣的:(opencv)