| [Top] [Up] [Prev] [Next] | [Up] [Basic Concepts] [Demonstrations] [Functions] | SDC Morphology Toolbox V1.1 15Jan02 |
y = mmgrain( fr, f, measurement, option ) fr: Gray-scale (uint8 or uint16) image. Labeled image, to define the regions. Label 0 is the background region. f: Gray-scale (uint8 or uint16) image. To extract the measuremens. measurement: String. Choose the measure to compute: 'max', 'min', 'mean', 'sum', 'std', 'std1'. option: String. Output format: 'image': results as a gray-scale mosaic image (uint16); 'data': results a column vector of measurements (double). Default: "image".y: Gray-scale (uint8 or uint16) image. Or a column vector (double) with gray-scale statistics per region.fr and the gray-scale information is specified by the image f. The statistics to compute is specified by the parameter measurement, which has the same options as in function mmstats. The parameter option defines: ('image') if the output is an uint16 image where each label value is changed to the measurement value, or ('data') a double column vector. In this case, the first element (index 1) is the measurement of region 1. The region with label zero is not measure as it is normally the background.
f=uint8([0:5;0:5;0:5])
f =
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
fr=mmlabelflat(f)
fr =
1 2 3 4 5 6
1 2 3 4 5 6
1 2 3 4 5 6
mmgrain(fr,f,'sum','data')
ans =
0
3
6
9
12
15
mmgrain(fr,f,'sum')
ans =
0 3 6 9 12 15
0 3 6 9 12 15
0 3 6 9 12 15
|
f=imread('astablet.tif');
g=mmgradm(f);
marker=mmregmin(mmclose(g));
ws=mmcwatershed(g,marker,mmsebox,'regions');
g=mmgrain(ws,f,'mean');
mmshow(f);
mmshow(g);
|
| [Top] [Up] [Prev] [Next] | [Up] [Basic Concepts] [Demonstrations] [Functions] |
|
| Copyright (c) 1998-2002 by SDC Information Systems | ||