O'Reilly logo

OpenCL Programming Guide by Dan Ginsburg, James Fung, Timothy G. Mattson, Benedict R. Gaster, Aaftab Munshi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. Sobel Edge Detection Filter

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.

What Is a Sobel Edge Detection Filter?

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:

image

The gradient magnitude is computed as

image

Implementing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required