Bookmark and Share

ARM Guide to OpenCL Optimizing Canny Edge Detection: Introduction

Register or sign in to access the Embedded Vision Academy's free technical training content.

The training materials provided by the Embedded Vision Academy are offered free of charge to everyone. All we ask in return is that you register, and tell us a little about yourself so that we can understand a bit about our audience. As detailed in our Privacy Policy, we will not share your registration information, nor contact you, except with your consent.

Registration is free and takes less than one minute. Click here to register, and get full access to the Embedded Vision Academy's unique technical training content.

If you've already registered, click here to sign in.

See a sample of this page's content below:


This chapter introduces OpenCL, edge detection, assumptions that have been made when writing the sample code this document refers to, and the suitability of Canny edge detection for GPU compute.

GPU compute and Canny edge detection

This guide provides an example optimization process for running Canny edge detection operations using an ARM®Mali™ Midgard GPU. This process can improve performance significantly.

ARM®Mali™ Midgard GPUs support the OpenCL Full Profile specification for General Purpose computing on GPU (GPGPU) processing, also known as GPU compute.

This guide provides advice and information on the principals of GPU compute to software developers who want to improve the use of the available hardware in platforms that perform Canny edge detection. It is not a comprehensive guide to optimization and GPU compute for all situations, although many principles in this guide can be applied to other tasks. The performance gains are given as examples, your results might vary.

What is Canny edge detection?

Canny edge detection is a tunable algorithm that extracts edges from images. This particular algorithm is popular because it produces high-quality edges. The algorithm focuses on the following characteristics:

  • Low error rate
    This algorithm produces few false edges.
  • Good localization
    The location of the output edges closely resembles the locations of the real edges in the original image.
  • Minimal response
    Edges are marked once, producing a thin and defined output edges.

The following figure shows an example input image and output result from Canny edge detection.


Figure 1-1 Canny edge input and output

The following are some applications that use edge detection:

  • Feature extraction.
  • Image processing.
  • Image segmentation.
  • Automotive application.

Which techniques are used in Canny edge detection?

Canny edge detection is a multistage process that uses the following stages:

  • Gaussian blur filter.
  • Sobel filter.
  • Nonmaximum suppression.
  • Hysteresis threshold application.

The following figure shows representations of each stage in an example edge detection process.


Figure 1-2 Basic Canny edge flow

When is the task suitable for...