SurfDescriptorExtractor/featureDetector - iOS 中的 OpenCv
我正在开发一个 iphone 项目,该项目使用 openCV 进行一些图像匹配。最初我使用 cvMatchTemplate(),但输出不是我们期望的。所以我现在正在尝试使用 FLANN 实现 SURF 检测器。
我尝试将以下 .cpp 代码移植到 Objective C,
//-- Step 2: Calculate descriptors (feature vectors)
SurfDescriptorExtractor extractor;
Mat descriptors_1, descriptors_2;
extractor.compute( img_1, keypoints_1, descriptors_1 );
extractor.compute( img_2, keypoints_2, descriptors_2 );
//-- Step 3: Matching descriptor vectors using FLANN matcher
FlannBasedMatcher matcher;
std::vector< DMatch > matches;
matcher.match( descriptors_1, descriptors_2, matches );
但无法编译它,即使我包含了所有必需的库和头文件。自动完成也没有为
#include "opencv2/features2d/features2d.hpp"
“探测器在头文件中定义为
class CV_EXPORTS FeatureDetector
{
...
}
我在这里做错了什么?” 中存在的任何探测器提供选项。有关如何调用检测器类(抽象基类)中的方法的任何输入?
i am working on an iphone project which uses openCV for some image matching. Initially I was using cvMatchTemplate(), but the output is not what we expected. so I am now trying to implement SURF detector using FLANN.
I tried to port the following .cpp code to objective C,
//-- Step 2: Calculate descriptors (feature vectors)
SurfDescriptorExtractor extractor;
Mat descriptors_1, descriptors_2;
extractor.compute( img_1, keypoints_1, descriptors_1 );
extractor.compute( img_2, keypoints_2, descriptors_2 );
//-- Step 3: Matching descriptor vectors using FLANN matcher
FlannBasedMatcher matcher;
std::vector< DMatch > matches;
matcher.match( descriptors_1, descriptors_2, matches );
But couldn't get it compiled, even though I have all the required libraries and header files included. The auto-complete is also not giving options for the any detectors present in
#include "opencv2/features2d/features2d.hpp"
The detector is defined in the header file as
class CV_EXPORTS FeatureDetector
{
...
}
What am I doing wrong here? Any input on how to call methods in the detector class(Abstract base class)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有在 iPhone 上专门使用过 openCV,所以无法提供帮助,但是当我使用特征检测器/描述符/匹配器时,我使用了以下语法(最终可能与您编写的相同) ...):
这种风格适合你吗?
I've not used openCV on the iphone specifically so can't help there, but when I've used feature detector/descriptor/matcher I've used the following syntax (which may end up being the same as what you've written...):
Does that style work for you?