我正在使用Ubuntu 14.04。我试图在openCV 3上运行FLANN,但是出现了错误。
在使用AKAZE和ORB的所有尝试都失败后,下面的代码是我尝试使用ORB时出现的。
我使用ORB方法来查找描述符和关键点。
Ptr<ORB> detector = ORB::create();
std::vector<KeyPoint> keypoints_1, keypoints_2;
Mat descriptors_1, descriptors_2;
detector->detectAndCompute( img_1, noArray(), keypoints_1, descriptors_1 );
detector->detectAndCompute( img_2, noArray(), keypoints_2, descriptors_2 );
使用 ORB 后,我使用以下代码来查找匹配项:
FlannBasedMatcher matcher;
std::vector<DMatch> matches;
matcher.match(descriptors_1, descriptors_2, matches);
代码可以正常编译。但是运行代码时,我遇到了这个错误:
OpenCV Error: Unsupported format or combination of formats (type=0
) in buildIndex_, file /home/jim/opencv/modules/flann/src/miniflann.cpp, line 315
terminate called after throwing an instance of 'cv::Exception'
what(): /home/jim/opencv/modules/flann/src/miniflann.cpp:315: error: (-210) type=0
in function buildIndex_
Aborted (core dumped)
有人能告诉我为什么吗?这是因为OpenCV 3处于BETA状态吗?除了BFMatcher之外,是否有替代FLANN的选择?