| [Top] [Up] [Prev] [Next] | [Up] [Basic Concepts] [Demonstrations] [Functions] | SDC Morphology Toolbox V1.1 15Jan02 |
This example was kindly provided by Prof. Jose Crespo from Facultad de Informatica of Universidad Politecnica de Madrid and adapted from [CSS98] .
The input image is read.
a = mmreadgray('cameraman.tif'); mmshow(a);
|
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);
|
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);
|
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);
|
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);
|
| [Top] [Up] [Prev] [Next] | [Up] [Basic Concepts] [Demonstrations] [Functions] |
|
| Copyright (c) 1998-2002 by SDC Information Systems | ||