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

mmdflatzone - Flat-zone image simplification by connected filtering.


Description
This experiment illustrates the flat zone extension property of connected filters. The flat zones of an image is the set of the largest connected components with identical intensity values. The main property of the connected filter is that every flat zone of the input image is included in a flat zone of the output image.

This example was kindly provided by Prof. Jose Crespo from Facultad de Informatica of Universidad Politecnica de Madrid and adapted from [CSS98] .

Reading

The input image is read.

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

Flat zone computation

Obtain the flat zones (8-connectivity) and compute its number. The number of flat zones is determined by the maximum labeling value ( starting from flat zone one).

b = mmlabelflat(a,mmsebox);
nfz=mmstats(b,'max')

nfz =
       43268
mmshow(a);
mmlblshow(b);
image
(a)
image
(b)

Flat zone extension using connected filter

Apply the alternating sequential filter by reconstruction with increasing sizes. They constitute a connected pyramid.

c=mmasfrec(a,'CO',mmsebox,mmsebox,2);
d=mmasfrec(a,'CO',mmsebox,mmsebox,4);
e=mmasfrec(a,'CO',mmsebox,mmsebox,16);
mmshow(c);
mmshow(d);
mmshow(e);
image
(c)
image
(d)
image
(e)

Flat zone visualization and counting

These figures show the image simplification in a connected pyramid. Notice how the shapes are well preserved along the scale space. The number of flat zones at each level of the pyramid are computed to illustrate the flat zone number reduction.

c_lab=mmlabelflat(c,mmsebox);
d_lab=mmlabelflat(d,mmsebox);
e_lab=mmlabelflat(e,mmsebox);
mmstats(c_lab,'max')

ans =
       15509
mmstats(d_lab,'max')

ans =
       11990
mmstats(e_lab,'max')

ans =
        5648
mmlblshow(c_lab);
mmlblshow(d_lab);
mmlblshow(e_lab);
image
(c_lab)
image
(d_lab)
image
(e_lab)

Flat zone inclusion property

In this experiment we select a particular flat zone, the flat zone to which the pixel (90,60) belongs, and display it at each level of the connected pyramid. Notice the flat zone inclusion property.

c_v=c_lab(90,60);
c_flat=mmcmp(c_lab,'==',c_v);
d_v=d_lab(90,60);
d_flat=mmcmp(d_lab,'==',d_v);
e_v=e_lab(90,60);
e_flat=mmcmp(e_lab,'==',e_v);
mmshow(a,e_flat,d_flat,c_flat);
image
(a,e_flat,d_flat,c_flat)

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