Hi Amin,
Area and Count are very much related. I presume you have a black/white image (not grayscale). Then Count means the number of white pixels. Area is more tricky, it will look at the neighbours of the pixels in order to determine what the 'value' is for each pixels. To be more precise it will look at a 2*2 neighbourhood then assign the following values depending on the neighbourhood:
- 0 white pixels => 0
- 1 white pixel => 1/4
- 2 white adjacent pixels => 1/2
- 2 white pixels diagonally => 3/4
- 3 white pixels (an L shape) => 7/8
- 4 white pixels => 1
to exemplify:
w1 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0,
1, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
Image[w1]
tmp = Values[
ComponentMeasurements[Image[w1], {"Image", "Area", "Count"},
"ComponentAssociation"]];
tmp[[All, 1]] = ImagePad[#, 2, Black] & /@ tmp[[All, 1]];
tmp // Grid
this will show you the parts of the image, the area and the count. As you can see, area and count are not always the same.
I break the parts of the images down into 2*2 sections:
func[img_Image] := Grid[Map[Magnify[ImagePad[#, 2, Black], 4] &, (ImagePartition[img, {2, 2}, {1, 1}]), {2}]]
Column[func /@ tmp[[All, 1]], Frame -> All, Spacings -> {3, 3}]
So in the top grid of images, we see 4 times a single pixel. Each having a 'value' of 1/4, resulting in a total of 1.
In the second, we have 6 times a single pixel. Each having a value of 1/4, totalling 3/2 and a single diagonal of 2 pixels with a value of 3/4, giving a total of 9/4 (2.25).
et cetera for the other configurations. Because Area depends on the configuration of the neighborhood one can not directly relate Count and Area. They are very much related as they both give an indication of a surface-area.
"Length" is found by fitting the shape with an ellipse, and returning the long-axis of the ellipse. This can not be directly related count.