July 2011
Intermediate to advanced
648 pages
13h 2m
English
In this chapter, we use an OpenCL kernel to implement the Sobel edge detection filter as a simple example of how kernels work with images in OpenCL.
The Sobel edge filter is a directional edge detector filter because it computes the image gradients along the x- and y-axes. These image gradients along the x- and y-axes (described as Gx and Gy) are computed by convolving the source image with the following convolution kernels:

The gradient magnitude is computed as
![]()
Read now
Unlock full access