有一篇文章描述如何做到这一点here,似乎已经为其他人工作,但它不适合我编译。转换为&从OpenCV cv :: Mat,NSImage
这里的.h文件的副本使用的:
//
// NSImage+OpenCV.h
//
#import <AppKit/AppKit.h>
@interface NSImage (NSImage_OpenCV) {
}
+(NSImage*)imageWithCVMat:(const cv::Mat&)cvMat;
-(id)initWithCVMat:(const cv::Mat&)cvMat;
@property(nonatomic, readonly) cv::Mat CVMat;
@property(nonatomic, readonly) cv::Mat CVGrayscaleMat;
@end
我上的Xcode 4.4,使用OPENCV 2.4.2。我得到的头文件的编译器错误有以下的4倍:
Semantic issue: Use of undeclared identifier 'cv'
这个错误似乎相当明显...头文件没有定义CV ::垫是什么。 所以我把猜测的看着OpenCV的2.4教程,我需要添加
#include <opencv2/core/core.hpp>
这产生的其他20个错误,其中的编译器抱怨core.hpp文件。 其中的第一说:
Semantic issue: Non-const static data member must be initialized out of line
所以我的问题是我在做什么错?我如何获得此代码的工作?
你的答案帮助我解决了我在xcode中遇到的大多数错误,但是在我做了上面描述的之后,我仍然在lsh_table.h中发现了一个错误:“语义问题:使用未声明的标识符'use_speed_'”。你知道我该如何摆脱它吗?谢谢! – 0pcl 2012-09-22 03:01:29