Skip to content

Latest Page Update: 23-09-2026

Exercise 4 - Image Filtering

The purpose of this exercise is to illustrate different image filtering techniques.

Learning Objectives

After completing this exercise, the student should be able to do the following:

  1. Compute the correlation between an image and a filter using the scipy.ndimage.correlate function.
  2. Use different border handling strategies when using filtering an image, including constant and reflection.
  3. Implement and apply a mean filter to an image.
  4. Implement and apply a median filter to an image (skimage.filters.median).
  5. Implement and apply a Gaussian filter to an image (skimage.filters.gaussian)
  6. Describe the effects of applying the mean, the Gaussian and the median filter to images containing Gaussian and outlier noise.
  7. Describe the concept on an image edge.
  8. Describe the concept of image gradients.
  9. Use the Prewitt filter to extract horizontal and vertical edges and their combined magnitude (skimage.filters.prewitt_h, skimage.filters.prewitt_v, skimage.filters.prewitt).
  10. Estimate a threshold in an edge image to create a binary image reflecting the significant edges in an image.
  11. Implement, test, adapt and evaluate a function that can automatically detect important edges in an image.
  12. Implement and test a program that apply filters to a video stream.
  13. Test the impact of a video processing frame rate when applying different filters to the video stream.

Installing Python packages

In this exercise, we will be using both scikit-image, OpenCV and SciPy. You should have these libraries installed, else instructions can be found in the previous exercises.

We will use the virtual environment from the previous exercise (course02503).

Exercise data and material

Download the data you'll need for this exercise by clicking here: Data

Alternatively, you can also fetch the data for the whole course through the Image Analysis GitHub repository. See the Data and GitHub section for more information. If you're using Git, it may be wise run:

git pull

As this will fetch updates to the material, which may happen throughout the course.