Logo[ Bristol CS | Index | Teaching ]

COMSM2200 Multimedia Processing

Laboratory Sheet 1 - Image Processing

The aim of this laboratory sheet is for you to gain experience of implementing some basic image processing operations. You will need to make use of the C image processing library IPLIB. Details on all the techniques used can be found in the Course Notes

  1. Use the X application xv to have a look at the images in /usr/local/course/csadc/images.

  2. Take a copy of the file /usr/local/course/csadc/template.c. A description and listing of template.c is attached. Compile the program as described and use it to create a copy of one of the images in the directory /usr/local/course/csadc/images.

    Note: Images tend to take up large amounts of memory - keep an eye on how many you have generated, or you may quickly run out of space.

  3. Using /usr/local/course/csadc/template.c as your template, write programs to do the following tasks and look at the results using xv.

  4. Write a program that will subsample an image by a given factor along each dimension, ie for an input image x(m,n) of size M x N pixels, generate an image x_s(m,n) of size M/K x N/L pixels such that x_s(m,n)=x(Km,Ln) where K and L are integers. Use the program to subsample the image barbara256.pgm by a factor 2 along each dimension. Look at the result using xv - what has happened?

  5. Write a program that will apply a 3 x 3 averaging filter to an image. Implement the filter by assuming that beyond the boundaries the image is equal to the last pixel in the row/column. Note the effect that the convolution has on an image. Modify the program so that the filter is of size 7 x 7, ie 7 x 7 elements each having a value 1/49. Note and explain the difference with the result obtained using the 3 x 3 filter.

  6. Write a program that will compute the histogram of an image and generate a display of the histogram in the form of a binary image.

  7. Write a program to apply a 3 x 3 median filter to an image. Test your program by writing a program that adds impulse noise to an image and check the effect that the median filter has on the noisy image.

Andrew Calway, Andrew.Calway@bristol.ac.uk. Last modified on Friday 29 November 2002 at 15:44. © 2002 University of Bristol