我正在尝试在opencv中使用ocl模块。我正在使用2012
我从使用surf进行特征检测的示例代码开始。守则如下:
SURF detector;
SURF extractor;
BFMatcher matcher;
std::vector<KeyPoint> keypoints_1, keypoints_2;
detector.detect( image1, keypoints_1 );
detector.detect( image2, keypoints_2 );
//-- Step 2: Calculate descriptors (feature vectors)
Mat descriptors_1, descriptors_2;
extractor.compute( image1, keypoints_1, descriptors_1 );
extractor.compute( image2, keypoints_2, descriptors_2 );
//-- Step 3: Matching descriptor vectors using FLANN matcher
std::vector< DMatch > matches;
matcher.match( descriptors_1, descriptors_2, matches);代码工作得很好,现在我想使用SURF_OCL而不是冲浪。我该怎么办?
以下代码不起作用:
ocl::SURF_OCL detector;
ocl::SURF_OCL extractor;生成编译时错误:
'ocl' : is not a class or namespace name
'SURF_OCL' : undeclared identifier如何才能使用ocl库中的函数?
发布于 2013-10-17 11:32:47
您缺少了一个#include <...>,可能是#include <opencv2/nonfree/ocl.hpp>。有关示例,请参见这里。
https://stackoverflow.com/questions/19424538
复制相似问题