Main Content

Construct Laplacian Pyramid Image

This example shows you how to construct a Laplacian pyramid image.

Example Model

Open the Simulink® model.

modelname = "ex_blklaplasianpyramid.slx";
open_system(modelname);

This model reads an input image using an Image From File block with the File name parameter set to cameraman.tif and Output data type parameter set to single.

To construct a Laplacian pyramid the Resize block resizes the input image to 253-by-253 pixels, and performs reduce and expand opertions using Gaussian Pyramid blocks. At the initial level, the Laplacian pyramid reduces the resized input image, expands the reduced image, and then subtracts the output from the resized input image. At the next level, the Laplacian pyramid performs a reduce operation on the already reduced image, expands this second-order reduction, and then subtracts it from the first-order reduced image.

The Video Viewer blocks display the input image and output images from each level of the Laplacian pyramid.

Simulate the Model

Run the model. The Video Viewer blocks display the input image and the Laplacian pyramid output images.

sim(modelname);