【发布时间】:2016-03-24 04:18:31
【问题描述】:
我正在尝试使用 GPUImage 框架的 GPUImage3x3ConvolutionFilter 但不起作用。
这是我的代码,我只得到一张白色的图像。
- (UIImage *)convolution:(UIImage *)inputImage{
GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:inputImage];
GPUImage3x3ConvolutionFilter *filter = [[GPUImage3x3ConvolutionFilter alloc] init];
[filter setConvolutionKernel:(GPUMatrix3x3){
{-1.0f, 0.0f, 1.0f},
{-2.0f, 0.0f, 2.0f},
{-1.0f, 0.0f, 1.0f}
}];
[stillImageSource addTarget:filter];
[stillImageSource processImage];
return stillImageSource.imageFromCurrentlyProcessedOutput;
}
我也在尝试改变:
return stillImageSource.imageFromCurrentlyProcessedOutput;
为:
return filter.imageFromCurrentlyProcessedOutput;
【问题讨论】:
标签: ios image-processing convolution gpuimage