我试图使用带有ORB描述符的FLANN,但opencv崩溃了这个简单的代码:
vector<vector<KeyPoint> > dbKeypoints;
vector<Mat> dbDescriptors;
vector<Mat> objects;
/*
load Descriptors from images (with OrbDescriptorExtractor())
*/
FlannBasedMatcher matcher;
matcher.add(dbDescriptors);
matcher.train() //> Crash!
Run Code Online (Sandbox Code Playgroud)
如果我使用SurfDescriptorExtractor()它效果很好.
我怎么解决这个问题?
OpenCV说:
OpenCV Error: Unsupported format or combination of formats (type=0
) in unknown function, file D:\Value\Personal\Parthenope\OpenCV\modules\flann\sr
c\miniflann.cpp, line 299
Run Code Online (Sandbox Code Playgroud) 我正在运行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 );
Run Code Online (Sandbox Code Playgroud)
使用ORB后,我使用以下代码查找匹配项:
FlannBasedMatcher matcher;
std::vector<DMatch> matches;
matcher.match(descriptors_1, descriptors_2, matches);
Run Code Online (Sandbox Code Playgroud)
代码构建良好和一切.当我运行代码时,我收到此错误:
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)
Run Code Online (Sandbox Code Playgroud)
谁能告诉我为什么?这是OpenCV 3处于BETA状态的问题吗?是否有替代FLANN(BFMatcher除外)
我正在研究FLANN,一个用于近似最近邻搜索的库.
对于LSH方法,它们表示一个对象(搜索空间中的点),作为unsigned int的数组.我不确定他们为什么这样做,并且不能简单地将一个点表示为双数组(这将代表多维向量空间中的一个点).也许是因为LSH用于二进制功能?在这种情况下,有人可以分享更多关于unsigned int的可能用途吗?为什么unsigned int如果每个功能只需要0和1?
谢谢