IT-højskolen /Kurser F2003 /Introduktion til multimediesystemer
 
Image handling in MATLAB

Edges

We will make a simple edge detector in this exercise. Given an image, I, we will make a new image, K, of the same size as I, which displays the edges of I. This new image is defined in the following way: Pixel K(r,c) is white if the corresponding pixel I(r,c) in the original image is lying on an edge, otherwise it is black.

How do we go about finding K? We will make the assumption that edges occur whenever there is a rapid change in intensity in the image. Hence, we are looking for all the pixels whose neighbours have greatly differing intensities ( differential calculus is often used to represent this ). What do we mean by ‘greatly differing’? This will depend on the image in question. We’ll use the term threshold value to indicate when we deem the difference large enough to be important.

Problem 1:

Make a function edges(I,t) which takes a matrix containing a gray-scale image and a threshold value, and returns a matrix containing a black and white image according to the criteria stated above.
Find edges in the images ‘rice.tif’, ‘blood1.tif’, and ‘cameraman.tif’ using your function. Display the edges alongside with the original image and the threshold value used to obtain the edge image. Discuss why different images seem to need different thresholds.


Updated 2003-02-07

til top