Example: Zooming and Scaling
Use the
zoom function to zoom or scale an image or a matrix.
For information on using this example, refer to
About Image Processing Examples.
Zooming an Image
1. Read in an image:
(pattern.bmp)
2. Set the horizontal and vertical scales then apply the zoom function to the image:
(pattern_z1.bmp)
The zooming results in halving the image width and doubling its height.
Zooming a Matrix
1. Define a 3 x 4 matrix, and then use an equation to set the value of its elements:
2. Evaluate the matrix:
3. Apply the zoom function to the matrix:
The zoom produces a 6 x 12 matrix.