我运行的是 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 状态吗? FLANN 是否有替代方案(BFMatcher 除外)