User`s guide

Image Compression
Image Compression
The examples in this section illustrate how to b uild a Simulink model that is
capable of image compression. For image compression algorithms, the input
image is divided into blocks and the two-dimensional DCT is computed for
each block. The DCT coefficients are then quantized, coded, and transmitted.
The receiver decodes the q uantize d D CT coefficients, computes the inver se
two-dimensional D CT of each block, and then puts the blocks back together
into a single image. Although there is som e loss of quality in the reconstructed
image, it is recognizable as an approximation of the original image.
This section includes the following topics:
“Compressing an Image” on page 8-11 -- Use the 2-D DCT block to compress
a m atrix of image coefficients
“Viewing the Compressed Image” on page8-18--Usethe2-DIDCTblockto
transform the image back to the time domain so it can be viewed
Compressing an Image
You can use image com pression to reduce the size of an image before you
transmit it. The compressed image retains many of the original image’s
features but requires less bandwidth. In this topic, you use the 2-D DCT and
Selector blocks to compress an intensity image:
1 Define an intensity image in the MATLAB workspace. To read in an
intensity image from a TIF file and convert it to do uble-precisio n, at th e
MATLAB command prompt, type
I= imread('cameraman.tif');
I is a 256-by-256 matrix of 8-bit unsigned integer values.
2 To view the image this matrix represents, at the MATLAB command
prompt, type
imshow(I)
8-11