(xcode)(opencv)错误无法在初始化时将'obj_object *'转换为'iplimage *'

时间:2012-10-27 10:26:12

标签: ios xcode opencv

对不起,调用函数时遇到以下错误: [self createIplImageFromUIImage:img1];

这是代码:

 IplImage *imgTemplate = [self CreateIplImageFromUIImage:img1];

这是错误细节

error: cannot convert 'objc_object*' to 'IplImage*' in initialization

目前我正在使用xcode 4.4.1和ios 5.1以及来自aptogo网站的opencv ..也许2.4.2

*编辑(已解决)

 IplImage *imgTemplate =(IplImage *)[self CreateIplImageFromUIImage:img1];

1 个答案:

答案 0 :(得分:0)

也许这有帮助:

IplImage *imgTemplate = [[IplImage alloc] init];
imgTemplate = [self CreateIplImageFromUIImage:img1];