ios - large - xcode 9 navigation item



ios圖像文字和顏色增強過濾器 (1)

在這裡輸入代碼//希望這有助於它的快速3:

        var aCIImage = CIImage();
        var contrastFilter: CIFilter!;
        var brightnessFilter: CIFilter!;
        var gaussianBlurFilter: CIFilter!;
        var pointFilter: CIFilter!;
        var vignettFilter : CIFilter!;
        var context = CIContext();
        var outputImage = CIImage();
        var newUIImage = UIImage();
        var finalImage = UIImage()

       DispatchQueue.main.async
                        {
                            self.gaussianBlurFilter = CIFilter(name: "CIExposureAdjust");
                            self.gaussianBlurFilter.setValue(self.aCIImage, forKey: "inputImage")

                            self.gaussianBlurFilter.setValue(NSNumber(value: sender.value), forKey: "inputEV");

                            self.outputImage = self.gaussianBlurFilter.outputImage!;

                            let imageRef = self.context.createCGImage(self.outputImage, from: self.outputImage.extent)

                            self.newUIImage = UIImage(cgImage: imageRef!)
                            self.testView?.image = self.newUIImage;
                    }


 // 

https://i.stack.imgur.com/s1STp.png

https://i.stack.imgur.com/uU0Oz.png

鏈接:對於演示項目。

https://drive.google.com/open?id=0B-EIC_4IXtA9UjFwT3o0dXI1OTA

我正在嘗試CIFilter和GPUImage過濾器在圖像上應用各種效果(亮度,對比度,飽和度等),但是我正在努力,需要像下圖所示的增強:

增強過濾器之前

增強過濾器之後

我試過的CIFilter代碼:

NSDictionary *options = @{ CIDetectorImageOrientation :
                               [[resultImage properties] valueForKey:kCGImagePropertyOrientation] };
NSArray *adjustments = [resultImage autoAdjustmentFiltersWithOptions:options];
for (CIFilter *filter in adjustments) {
    [filter setValue:resultImage forKey:kCIInputImageKey];
    resultImage = filter.outputImage;
}

GPUImage過濾器:

UIImage *inputImage = [UIImage imageNamed:@"Msource.png"];
GPUImageAdaptiveThresholdFilter *stillImageFilter = [[GPUImageAdaptiveThresholdFilter alloc] init];
stillImageFilter.blurRadiusInPixels = 10.0;// adjust this to tweak the blur radius of the filter, defaults to 4.0

UIImage *filteredImage = [stillImageFilter imageByFilteringImage:inputImage];




uiimage