Image pyramid reduction and expansion
B = impyramid(A,direction)
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.
A— Image to be reduced or expanded
Image to reduced or expanded, specified as a numeric or logical array.
direction— Reduction or expansion
Reduction or expansion, specified as one of the following values:
|Return an image, smaller than the original image.|
|Return an image that is larger than the original image.|
A is m-by-n and
the size of
Reduction and expansion take place only in the first two dimensions.
For example, if
A is 100-by-100-by-3 and
B is 50-by-50-by-3.
impyramid uses the kernel specified on page
533 of the Burt and Adelson paper:
, where . The parameter a is
0.375 so that the equivalent weighting function
is close to a Gaussian shape. In addition, the weights can be readily
applied using fixed-point arithmetic.
 Burt and Adelson, "The Laplacian Pyramid as a Compact Image Code," IEEE Transactions on Communications, Vol. COM-31, no. 4, April 1983, pp. 532-540.
 Burt, "Fast Filter Transforms for Image Processing," Computer Graphics and Image Processing, Vol. 16, 1981, pp. 20-51
Usage notes and limitations:
This function supports the generation of C code using MATLAB® Coder™. For more information, see Code Generation for Image Processing.
direction must be a compile-time