Homework 1 Instructions
lena: The image "lena" in "pgm" format may be obtained by clicking
here.
Other images may be found
here. You may also find images at /usr/caen/misc/images .
If you wish to know more about the pgm image format click
here.
JPEG:
(1) Log onto a SUN workstation (alternatively, you may "rlog" onto a
SUN from some other workstation, but the workstation needs to have
"X-Windows"). If you are not familiar with such workstations, I
suggest asking a knowledgeable friend to give you a hand, or
consulting CAEN to learn how to get started.
(2) You may run the JPEG algorithm by running the UNIX program "xv",
which is a general purpose image display and processing utility. Just
"load" the image, and "save" it with the "JPEG" format. This does the
encoding. You will be prompted for a "quality factor" which you may
vary to change the quality of the compressed image and the encoding
rate.
Use "ls -l " on the original and compressed representations to
determine the sizes of the files. From these you can compute encoding
rate in bits/pixel. You can then "load" the compressed image to look
at it. This does the decoding. Then you "save" the compressed image
in "pgm" format in order to compute the squared error, as described
below.
Hint: It is helpful to put "xv" into the background (type "control-z",
then "bg") and then start another instance of "xv" so with one
instance you display the original image and with the other you display
the decoded compressed image. By repeating this process you can
simultaneously display a number of decoded compressed images.
(3) To compute the signal-to-noise ratio, run the program "lmse" which
you may find by clicking
here. For a SUN workstation running the Solaris operating system
(which CAEN SUN's use). Download the executable "lmse" by clicking on
it. To run, simply type "lmse lena.pgm compressed.pgm" (replace
"compressed.pgm" with whatever you named the decoded image saved in
pgm format), and it will compute the variance, mean squared error and
signal-to-noise ratio.