sobelGradients()
Calculates the Sobel gradients for an image.
Declaration
class func sobelGradients() -> any CIFilter & CISobelGradientsReturn Value
A CIImage containing the Sobel gradients.
Discussion
This filter applies the Sobel operator to the color components of the input image. You would typically use the Sobel filter as part of an edge-detection algorithm for performing.
inputImageA CIImage containing the image to process.
The following code applies the sobelGradients() filter to an image.
func sobelGradients(inputImage: CIImage) -> CIImage {
let sobel = CIFilter.sobelGradients()
sobel.inputImage = inputImage
return sobel.outputImage!
}[Image]