我想應用黑白濾鏡,並且我已經成功完成了同樣的濾鏡,但是在濾鏡之後我有影響整個濾鏡的陰影,所以我想去除或減淡陰影,所以是任何人有想法我該怎麼做。?使用GPUImage從黑白濾鏡中去除陰影
附着我已經實現的代碼,並輸出在相同
GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:image];
GPUImageContrastFilter * stillImageContrastFilter = [[GPUImageContrastFilter alloc]init];
stillImageContrastFilter.contrast = 1.0;
GPUImageSharpenFilter * stillImageSharpenFilter = [[GPUImageSharpenFilter alloc]init];
stillImageSharpenFilter.sharpness = 4.0;
GPUImageGaussianBlurFilter * stillImageBlurFilter = [[GPUImageGaussianBlurFilter alloc]init];
stillImageBlurFilter.blurRadiusInPixels = 1.0;
GPUImageAverageLuminanceThresholdFilter * stillImageThresFilter = [[GPUImageAverageLuminanceThresholdFilter alloc]init];
stillImageThresFilter.thresholdMultiplier = 0.88;
GPUImageChromaKeyFilter * stillImageSmoothFilter = [[GPUImageChromaKeyFilter alloc]init];
stillImageSmoothFilter.smoothing = 0.1f;
[stillImageSource addTarget:stillImageContrastFilter];
[stillImageContrastFilter addTarget:stillImageSharpenFilter];
[stillImageSharpenFilter addTarget:stillImageBlurFilter];
[stillImageBlurFilter addTarget:stillImageThresFilter];
[stillImageThresFilter addTarget:stillImageSmoothFilter];
[stillImageSmoothFilter useNextFrameForImageCapture];
[stillImageSource processImage];
UIImage *imgTmp1 = [stillImageSmoothFilter imageFromCurrentFramebuffer];
嗨,請分享代碼,如果你解決了它。 – ChanWarde
@ChanWarde請檢查https://stackoverflow.com/questions/43714561/opencv-how-to-apply-adaptive-threshold-to-an-image-on-ios/43912645#43912645 –
我用過,但我想從圖像中移除該光影。就我而言,我只想用相同的彩色背景顯示顏色。 – ChanWarde