ARM Guide to OpenCL Optimizing Pyramid: Theory
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 describes the theory of image pyramid creation.
The pyramid process
The main type of image pyramid algorithm is called Gaussian pyramid. It uses the following steps:
- A smoothing filter is applied to the previous image level. For the first iteration, this is the base image. This often uses a Gaussian 5x5 convolution matrix.
- To compute the next level the result is subsampled by a factor of two along the x and y directions.
These operations are repeated until you have the required number of levels.
When this smoothing technique is used, the resulting image pyramid is called a Gaussian pyramid.
The following figure shows the iterative process that produces an image pyramid.
Figure 2-1 Simple image pyramid generation
Image sizes created during Gaussian pyramid creation
To understand the effect of the Gaussian convolution and subsampling, it is helpful to consider an image with dimensions 2Nx2N.
The resultant image levels have the following sizes:
This is the original image with dimensions 2nx2n.
These are the resultant sizes because the subsampling halves the number of pixels in the x and y directions to achieve the result for the next image level.
The Gaussian blur prevents image aliasing from occurring during the subsampling process.
Image border handling
The ARM® Guide to OpenCL Optimizing Convolution provides an example optimization process for convolution. It explains the challenge of safely handling image borders. Without extra strategies to handle edges, some convolution steps try to read outside of the image border. For example, a 5x5 convolution matrix attempts to read two pixels outside the source image in all directions.
Reads from outside the image border return data that is either unrelated to the image, or from a different image line. This means that the result of calculations which use these out-of-border reads, might be spurious.
The following figure shows one convolution step that is attempting to read outside of the source image.