After applying Red Eye filter, get bad output image
输出图像每次都不同。 这是我的红眼校正滤镜的代码
UIImage *img = self.imageInput;
CIImage *image = [[CIImage alloc]initWithImage:img];
NSLog(@"after ciimage: %@", kCIImageAutoAdjustEnhance);
NSDictionary *options = [NSDictionary dictionaryWithObject:@"NO" forKey:kCIImageAutoAdjustEnhance];
NSLog(@"options: %@", options);
NSArray *adjustments = [image autoAdjustmentFiltersWithOptions:options];
NSLog(@"adjustments: %@ ", adjustments);
for (CIFilter * filter in adjustments)
{
[filter setValue:image forKey:kCIInputImageKey];
image = filter.outputImage;
}
CIContext *context = [CIContext contextWithOptions:nil];
CGImageRef cgImage = [context createCGImage:image fromRect:image.extent];
UIImage *enhancedImage = [[UIImage alloc] initWithCGImage:cgImage];
CGImageRelease(cgImage);
self.imageViewSource.image = enhancedImage;