This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

vision.Pyramid System object

Perform Gaussian pyramid decomposition



The vision.Pyramid System object will be removed in a future release. Use the impyramid function with equivalent functionality instead.

The Pyramid object computes Gaussian pyramid reduction or expansion. The image reduction step involves lowpass filtering and downsampling the image pixels. The image expansion step involves upsampling the image pixels and lowpass filtering.


Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


gaussPyramid = vision.Pyramid returns a System object, gaussPyramid, that computes a Gaussian pyramid reduction or expansion of an image.

gaussPyramid = vision.Pyramid(Name,Value) configures the System object properties, specified as one or more name-value pair arguments. Unspecified properties have default values.

To compute a Gaussian pyramid:

  1. Define and set up your pyramid object using the constructor.

  2. Call the step method with the input image, I and the pyramid object, gaussPyramid. See the syntax below for using the step method.

J = step(gaussPyramid,I) computes J, the Gaussian pyramid decomposition of input I.



Reduce or expand the input image

Specify whether to reduce or expand the input image as Reduce or Expand. If this property is set to Reduce, the object applies a lowpass filter and then downsamples the input image. If this property is set to Expand, the object upsamples and then applies a lowpass filter to the input image.

Default: Reduce


Level of decomposition

Specify the number of times the object upsamples or downsamples each dimension of the image by a factor of 2.

Default: 1


How to specify the coefficients of low pass filter

Indicate how to specify the coefficients of the lowpass filter as Default or Custom.

Default: Default


Coefficient 'a' of default separable filter

Specify the coefficients in the default separable filter 1/4-a/2 1/4 a 1/4 1/4-a/2 as a scalar value. This property applies when you set the SeparableFilter property to Default.

Default: 0.375


Separable filter coefficients

Specify separable filter coefficients as a vector. This property applies when you set the SeparableFilter property to Custom.

Default: [0.0625 0.25 0.375 0.25 0.0625]

 Fixed-Point Properties


stepCompute Gaussian pyramid decomposition of input
Common to All System Objects

Allow System object property value changes


expand all

Read image into the workspace.

I = imread('cameraman.tif');

Perform a series of reductions. The first call reduces the original image. The other calls to impyramid use the previously reduced image.

I1 = impyramid(I, 'reduce');
I2 = impyramid(I1, 'reduce');
I3 = impyramid(I2, 'reduce');

View the original image and the reduced versions.

figure, imshow(I)

figure, imshow(I1)

figure, imshow(I2)

figure, imshow(I3)

Extended Capabilities

Introduced in R2012a