Lab 4
Lab 4
Lab 4
• Rapporten för denna laboration får lämnas in senast torsdagen den 21a december 2006.
• Inlämningen av labbrapporterna sker genom att omvandla filerna till pdf-format och skicka
dem med e-post till: [email protected]
• Labbhandledning ges under det schemalagda labbtillfället samt via e-post därefter.
Lab Exercise 4
1. Global & local thresholding
• Load the image img1.jpg into the MATLAB workspace.
• Segment the image using global thresholding. (2p)
• Segment the image using at least one local thresholding method. (2p)
• Present the results and describe the used methods. (2p)
• Show also how the MATLAB code looks like in each case. (2p)
1
of objects in these images. (1p)
• Use the supervised approach to segment and classify the objects in each of the images by
combining each image with the corresponding filtering results which have the same sizes
as the corresponding original images. These filtering results are added as additional bands
to the corresponding original images before performing the supervised segmentation and
classification tasks. (6p)
• Estimate the area of each object in these images; e.g. the number of pixels belonging to the
region representing the object in the image. (6p)
• Present the results and describe the used methods. (3p)
• Show also how the used MATLAB code looks like for each case. (3p)
2
• Idist=bwdist(I,’type’); Distance transform a binary image using different types of
metrics. Here, in each object-pixel, we get the distance to the closest background-pixel. To
view the result, use imshow(mat2gray(Idist));
• watershed(I); Watershed segmentation. Can be applied to the distance transform.
Think of the grey-level image as a landscape. Let water rise from the bottom of each valley
(the water from each valley is given its own label). As soon as the water from two valleys
meet, build a dam, or watershed. These watersheds will then define the borders between
different regions. Example of watershed on a binary image with “round” objects: (a)
original image, (b) distance transformed image, (c) distance coded as intensity, (d) Result of
watershed segmentation.