我已经下载了一个模板here
我有XCode 4.6,当我运行它时,我得到了以下结果:
+ (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat orientation:(UIImageOrientation)orientation
{
return [[UIImage alloc] initWithCVMat:cvMat orientation:orientation];
}
+ (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat
{
return [[UIImage alloc] initWithCVMat:cvMat orientation:0];
}我得到了一个错误
Cannot initialize a parameter of type 'UIImageOrientation' with an value of type 'int'我该怎么解决呢?也许有人知道
发布于 2013-02-26 22:27:04
该错误与在第二个方便的方法中使用0值有关
在未指定任何方向时选择默认方向
+ (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat {
return [[UIImage alloc] initWithCVMat:cvMat orientation:UIImageOrientationUp];
}发布于 2013-02-26 22:24:18
此方法
+ (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat
{
return [[UIImage alloc] initWithCVMat:cvMat orientation:0];
}你不能有orientation:0,因为它需要一个UIImageOrientation类型的对象。也许可以尝试将其设置为nil (不确定是否允许这样做),或者给它一个新的默认UIImageOrientation
https://stackoverflow.com/questions/15091436
复制相似问题