I'm trying to use GPUImage3x3ConvolutionFilter of GPUImage framework but is not working.
This is my code, I only get a white image.
- (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;
}
I'm also try changing:
return stillImageSource.imageFromCurrentlyProcessedOutput;
for:
return filter.imageFromCurrentlyProcessedOutput;