Table of Contents

Lab 02 : MATLAB: Segmentation

Topics:

HW02 Assignment

For the homework (HW02), follow the emphasized links to get to the detailed description.

Upload your report in PDF format to BRUTE to the assignment L02-segmentation. Please name the PDF file as hw01_<your_fel_id>.pdf. Zip both the MATLAB code and pdf report in a single file and upload to Brute.

1. Cell segmentation

Segmentation is the task of describing image areas by some context information, like finding cells in microscopy images. We want to construct an automated detection procedure. A cell is typically a roundish dark object, so we first need to separate cell-like pixels from background and other structures by thresholding with a suitable threshold level. After reading (imopen) and converting to grayscale image rgb2gray,

I = imread('5830.png');
Ig = rgb2gray(I);
figure;
imshow(I,[],'InitialMagnification','fit');
we can attempt to find optimal threshold via
level = graythresh(I_gray);
Ibw = im2bw(I_gray, level);

[pixelCount grayLevels] = imhist(I_gray);
bar(pixelCount);

We then search isolated (connected) areas in the binarized image and use regionprops to retrieve properties of each region:

[B, L] = bwboundaries(Ibw, 'noholes');
stats = regionprops('table',L,'Area');

Finally, we want to filter the detected cell regions by the retrieved measures and plot their boundary in the original input image I

imshow(I);
hold on
for k = 1:length(B)
    if stats.Area(k) > ?? 
        boundary = B{k};
        plot(boundary(:,2), boundary(:,1), 'y', 'LineWidth', 2)
    end
end

Task Find suitable criterion on region properties (like Area, Solidity etc.) to select cell-regions for each of the following data: 5140.png 5830.png histopato1.png histopato2.png

2. Some useful commands

help, rand, meshgrid, surf, imread, rgb2gray, imshow, lookfor, edit, path, addpath, format,
end, reshape, inf, nan, isempty, floor, ceil, round, abs, sign, ops,
length, linspace, sort, det, rank, load, save, fprintf, axis, title, 
contour, mesh, surf, colormap, print, for, if, while, function

Plot the resulting segmentation as boundary contour over the original image, like shown in the last picture.

MATLAB Help

Python Help