ImagePyramid

ImagePyramid[image]

creates a Gaussian image pyramid formed from image.

ImagePyramid[image,pyrtype]

returns a Gaussian or Laplacian pyramid depending of the specified pyrtype.

ImagePyramid[image,pyrtype,n]

returns up to n levels of the pyramid.

ImagePyramid[image,pyrtype,{size}]

returns pyramid levels down to image dimensions given by size.

ImagePyramid[image,pyrtype,n,s]

returns a pyramid with successive levels downsampled by factor s.

Details and Options

  • Image pyramid is a multi-resolution representation of an image to facilitate efficient multiscale processing. Typical applications include noise removal, image blending, texture synthesis and efficient rendering.
  • An image pyramid consists of several images with consecutively lower resolutions. Typically, specific levels of the pyramid are processed, and the result is reconstructed using the inverse process.
  • ImagePyramid works with arbitrary 2D and 3D images.
  • Use InverseImagePyramid to reconstruct the image from an image pyramid.
  • The pyramid type pyrtype can be any of the following:
  • "Lowpass" or "Gaussian"iteratively blurs and downsamples
    "Bandpass" or "Laplacian"difference pyramid by upsampling and subtracting the lower levels from the upper levels
    {"Lowpass",ker}use ker for downsampling
    {"Bandpass",ker1,ker2}use ker1 for downsampling and ker2 for upsampling
    pyruse specifications of a reference pyramid pyr
  • Kernel specification ker can be given by an array or any valid setting for Resampling.
  • By default, ImagePyramid[image] creates a Gaussian pyramid with all possible levels using a scaling factor of 2.
  • Using pyr["Properties"], all available properties are returned.
  • Using pyr["prop"], properties or content of the constructed image pyramid can be extracted.
  • Available properties "prop" are:
  • levelsextract images as specific levels
    "ImageDimensions"dimensions of the original image
    "LevelCount"the number of levels available
    "Levels"all images
    "LowpassKernel"lowpass kernel used when creating the pyramid
    "HighpassKernel"highpass kernel used when creating the pyramid
    "Padding"padding scheme used when creating the pyramid
    "ScalingFactor"the scaling factor used when creating the pyramid
    "Type"type of the pyramid, "Lowpass" or "Bandpass"
  • Level specification levels can take any of the following settings:
  • Allall levels of the pyramid
    nthe n^(th) level
    -ncounts from the last level
    {n1,n2,}a list of level indices
    m;;nlevels m through n
    m;;n;;slevels m through n with step s
  • ImagePyramid preserves the image type when creating a lowpass pyramid and returns a pyramid of a real type when creating a bandpass pyramid.
  • By default, a "Reversed" padding is used. Use Padding option to specify other settings.

Examples

open all close all

Basic Examples  (2)

Compute a lowpass pyramid:

In[1]:=
Click for copyable input
Out[1]=

View all image levels:

In[2]:=
Click for copyable input
Out[2]=

Compute a bandpass pyramid:

In[1]:=
Click for copyable input
Out[1]=

View all image levels, adjusting the images to see the details:

In[2]:=
Click for copyable input
Out[2]=

Scope  (7)

Options  (1)

Applications  (6)

Possible Issues  (1)

Introduced in 2019
(12.0)