[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] SDC Morphology Toolbox V1.1 15Jan02

mmdcookies - Detect broken rounded biscuits.


Description
The input image is a gray-scale image of two rounded-shaped biscuits. One of them is broken. The purpose is to detect the broken biscuit.

Reading

The input image is read.

a = mmreadgray('cookies.tif');
mmshow(a);
image
(a)

Thresholding

Convert to binary objects by thresholding

b = mmthreshad(a, uint8(100));
mmshow(b);
image
(b)

Open tophat with large octagon disk

The tophat of the binary image by an octagon disk with a radius fits the good biscuit but does not fit in the broken biscuit can detect the broken one.

c = mmopenth(b,mmsedisk(55,'2D','OCTAGON'));
mmshow(c);
image
(c)

Remove the residues

Clean the residues from the octagon disk and the rounded shaped biscuits by eliminating small connected regions

d = mmareaopen(c,400);
mmshow(d);
image
(d)

Final display

Display the detected broken biscuit

mmshow(a,d);
image
(a,d)

[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] Valid XHTML 1.0!
Copyright (c) 1998-2002 by SDC Information Systems