I am using Core Image filters and trying to make the CIEdgeWork filter. When the filter is applied the image turns black. Am I initializing the CIFilter correctly.
CIFilter *edgeWork = [CIFilter filterWithName:@"CIEdgeWork"
keysAndValues:kCIInputImageKey,filterPreviewImage,
@"inputRadius",[NSNumber numberWithFloat:3.0],
nil];
CIEdgeWork is not available in Core Image on iOS as of iOS 5.x, so it’s no surprise that you’re seeing a black image when trying to use it.
However, you can use the GPUImageSketchFilter or GPUImageThresholdEdgeDetection from my GPUImage framework to pull off this same effect. You can see the result of the first filter in this answer. The latter filter might be closer to the actual effect that Apple supplies via CIEdgeWork, given that they seem to binarize the resulting edge detected image.