【发布时间】:2017-09-05 08:33:42
【问题描述】:
我使用了来自IOS examples 的this code。并试图从相机中保存图像。问题是图像正在保存,但带有如下蓝色调。
下面是我用来保存图片的代码。
- (void)processImagecv::Mat&image
{
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
UIImage * convertedImage = [ViewController imageWithCVMat:image];
[library writeImageToSavedPhotosAlbumconvertedImage CGImage] orientationALAssetOrientation)[convertedImage imageOrientation] completionBlock:^(NSURL *assetURL, NSError *error){
if (error)
{
// TODO: error handling
}
else
{
// TODO: success handling
NSLog(@"Success";
}
}];
TS(DetectAndAnimateFaces);
faceAnimator->detectAndAnimateFaces(image);
TE(DetectAndAnimateFaces);
}
【问题讨论】:
-
您发布的图像的通道是相反的,即不是RGB顺序,而是BGR,即交换绿色红色和蓝色通道。
-
@marol 感谢您的回复。这解决了这个问题。请发布它作为答案。以后会对其他人有所帮助。
标签: ios iphone objective-c opencv ios5