如何在opencv中使用ocl模块
How to use ocl module in opencv
我正在尝试在opencv中使用ocl模块。我正在使用Visual Studio 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 而不是 SURF。我该怎么办?
以下代码不起作用:
ocl::SURF_OCL detector;
ocl::SURF_OCL extractor;
生成编译时错误:
'ocl' : is not a class or namespace name
'SURF_OCL' : undeclared identifier
我应该怎么做才能使用 ocl 库中的函数?
你缺少一个#include <...>
,可能#include <opencv2/nonfree/ocl.hpp>
.有关示例,请参阅此处。
相关文章:
- 尝试导入pybind-opencv模块时出现libgtk错误
- 为什么当我解模块化时,这个C++代代码"效率较低"?
- 如果C++对象的类在另一个boost模块中声明,如何使用boost将指向该对象的指针返回到python
- 内联如何影响模块接口中的成员函数
- C++返回 Numpy 数组的 Python 扩展模块
- 当我尝试加载内核模块时,如何修复C++中的这个 malloc() 错误?
- 如何从线程中的不同模块调用函数?
- 如何使用 soong 命名空间来有条件地编译模块
- asn1c 不会从 asn.1 模块中提取八位字节字符串的默认值
- CMake - 模块 + 库混淆
- 特征 LLT 模块给出不正确的结果?
- 枚举进程模块在有效句柄上返回无效句柄
- 在 python 模块中导入子模块时PyImport_Import失败
- 将 PCL 链接到 Cython C++ 模块
- 即使直接从官方示例中复制,也找不到未知类型名称QML_ELEMENT和 QML 模块
- 电源功能模块化操作
- 如何告诉本机节点模块所需的dll存储在哪里?
- 如何为模块化应用程序实现C++插件系统
- C++ Python 模块在 Blender 中崩溃,但在 Python 控制台中不会崩溃
- 如何在opencv中使用ocl模块