14.9 SEGMENTATION
ؕؓAn image can be broken into regions that can then be used for later calculations. In effect this method looks for different self contained regions, and uses region numbers instead of pixel intensities.
A simple segmentation algorithm might be,
4. If a pixel value of 1 is found, and the pixel is 0 in the segmented image, do a flood fill for the pixel onto the new image using segment number variable.
7. If a pixel is found to be fully contained in any segment, flood fill it with a new segment as in steps 4 and 5.
14.9.1 Segment Mass Properties
When objects are rotated in the vision plane it may become difficult to use simple measures to tell them apart. At this point global attributes, such as perimeter lengths, length/width ratios, or areas can be used.
The centroid of a mass can be determined with the expression for the x direction (y is identical)
Area is simply the sum of all pixels in the segment,
Perimeter is the number of pixels that can be counted around the outside of an object.
Compactness can be a measure of mass distribution,
Another measure of mass distribution is thickness,