我用过这段代码来自iOS 示例。并尝试保存相机中的图像。问题是图像正在保存,但带有蓝色色调,如下所示。
下面是我用来保存图像的代码。
- (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 表示,而不是 opencv 默认表示 BGR,即红色通道和蓝色通道被交换。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)