| [mmLabel] [Up] [mmGrain] | Measurements |
| User Feedback |
| fr | Image
[ Gray-scale (uint8 or uint16) image
]
Labeled image. |
| measurement | String
Choice from 'AREA', 'AREA32', 'CENTROID', or 'BOUNDINGBOX'. The 'AREA32' option is similar to 'AREA' except that it returns an int32 image. |
| option | String
Output format: 'image': results as a binary image; 'data': results a column vector of measurements. Default: |
| y | Image [ Gray-scale (uint8 or uint16) or binary image ] |
Take measurements from the labeled image fr. The measurements are:
area, centroid, or bounding rectangle. The parameter option controls
the output format: 'IMAGE': the result is an image; 'DATA': the result is a
double column vector with the measurement for each blob. The region with label
zero is not measured as it is normally the background. The measurement of region
with label 1 appears at the first row of the output.
unsigned char fr_raster[] = { 1,1,1,0,0,0,1,1,1,0,0,2,1,1,1,0,2,2 };
Image fr(6, 3, 1, "uint8", (char *)fr_raster);
printf("image:\n%s", (char *)fr.str());
Image f_area = mmBlob(fr, "area");
printf("area:\n%s", (char *)f_area.str());
Image f_cent = mmBlob(fr, "centroid");
printf("centroid:\n%s", (char *)f_cent.str());
Image f_bb = mmBlob(fr, "boundingbox");
printf("boundingbox:\n%s", (char *)f_bb.str());
Image d_area = mmBlob(fr, "area", "data");
printf("area:\n%s", (char *)d_area.str());
Image d_cent = mmBlob(fr, "centroid", "data");
printf("centroid:\n%s", (char *)d_cent.str());
Image d_bb = mmBlob(fr, "boundingbox", "data");
printf("boundingbox:\n%s", (char *)d_bb.str());
image:
1 1 1 0 0 0
1 1 1 0 0 2
1 1 1 0 2 2
area:
9 9 9 0 0 0
9 9 9 0 0 3
9 9 9 0 3 3
centroid:
0 0 0 0 0 0
0 1 0 0 1 0
0 0 0 0 0 0
boundingbox:
1 1 1 0 0 0
1 0 1 0 1 1
1 1 1 0 1 1
area:
9
3
centroid:
1 1
4 1
boundingbox:
0 0 2 2
4 1 5 2
Image f2 = mmReadgray("blob3.tif"); Image fr2 = mmLabel(f2); Image g = mmBlob(fr2, "area"); mmShow(f2); mmShow(g);
![]() |
![]() |
|
| f2 | g |
Image f3 = mmReadgray("blob3.tif"); Image fr3 = mmLabel(f3); Image centr = mmBlob(fr3, "centroid"); mmShow(f3, mmDil(centr));
![]() |
|
| f3, mmDil(centr) |
Image f4 = mmReadgray("blob3.tif"); Image fr4 = mmLabel(f4); Image box = mmBlob(fr4, "boundingbox"); mmShow(f4, box);
![]() |
|
| f4, box |
| mmLabel | Label a binary image. |
| mmGrain | Gray-scale statistics for each labeled region. |
| mmLabelflat | Label the flat zones of gray-scale images. |
| mmStats | Find global image statistics. |
| mmDrawv | Superpose points, rectangles and lines on an image. |
| [mmLabel] [Up] [mmGrain] | |
| User Feedback | |
| Copyright (c) 1998-2008 by SDC Information Systems |