Calculations for features are performed on the blob identifier image. If the feature you want calculated requires a grayscale image (the feature contains Gray in its name), you need to specify the Gray image mode property to SourceImage, BlobIdentifierImage, or LinkedImage.
Additionally, features in the Statistics category also require a gray image.
Some of the most common features you might want to calculate are the area and perimeter of a blob.
Calculating the Area will count the number of foreground pixels in a blob while discarding holes (background pixels) inside the blob.
The Perimeter is a measure of the total length of edges in a blob (including the edges of any holes). Whereas, the Convex Perimeter feature will calculate the perimeter of the convex hull:
If a blob is enclosed in a rectangular box, then the contact points are the (x, y) coordinates where the blob makes contact with the box. You can use these coordinates to determine the blob location in the image.
You can use the blob location to determine if a blob touches any sides of the image border. If there are any such blobs, you might want to move or adjust your camera's field of view to have all the blobs present in the image, or you might want to exclude these blobs using a filter (for more information, see previous section).
You can determine the following contact points by adding them to the Feature list: First Point X, First Point Y, X at Y Maximum, X at Y Minimum, Y at X Maximum, and Y at X Minimum.
Besides the area, perimeter and blob points coordinates, you might want to calculate the dimension of the blobs. Since blobs are not always rectangular in shape, you will probably have to take the length of the blobs at various angles from the horizontal axis. This type of measure is often called an index caliper. This is actually one of the many definitions of the blob length, called the Feret diameter. For example, the following shows the Feret diameter of a blob taken at various angles.
You can automatically determine the minimum, maximum, and average Feret diameters of the blob. These diameters will be determined by testing the diameter of the blobs at several angles.
You can use the Number of Ferets property to change the number of angles; these angles will start at 0° and increase in increments of 180°/n , where n is the number of Feret diameters. The default value for this property is 8. Increasing the number of angles that are tested increases the accuracy of the results, but also increases processing time.
The following diagram illustrates Ferets. Note, the angle at which the Feret diameter is taken (relative to the horizontal axis) is specified as a subscript to the F.
Matrox Design Assistant provides several Feret measurements features you can calculate:
The maximum and minimum Feret angle and diameter.
The average Feret diameter for a specified number of Ferets. The default value is 8.
The dimensions of the minimum bounding box of a box in the horizontal or vertical direction.
The Feret at a specified angle.
The measure of the shape of a blob. That is, the maximum Feret diameter / minimum Feret diameter.
In some cases, you will not want to make time-consuming feature extractions for every single blob in the blob identifier image. You might choose to preprocess blobs that do not meet certain criteria out of your image, but you might lose a significant amount of information by doing so. In some other cases, some blobs might have been incorrectly segmented as 2 or more blobs. You would want to group those blobs together and calculate their features as one blob. You might also want to do a blob calculation on the whole image but excluding the noise particles.
When you set a filter, blobs that do not meet the criteria of that filter are added to either an included, excluded or deleted list. Results for the excluded or deleted blobs will not be returned. Excluded blobs will be ignored in future calculations, while deleted blobs will be removed from the blob analysis result buffer altogether.
Determining the shape of a blob can be useful in the process of classifying blobs. For example, 2 blobs can have similar sizes, but different shapes because of a different number of holes, curves, or edges.
To distinguish shapes, Matrox Design Assistant provides a number of features that you can calculate. For example, if your application needs to differentiate a bolt from a nut, you can use the Number of Holes feature to count blob holes.
The features available are: Breadth, Compactness, Elongation, Euler Number, Length, Number of Holes, Number of Runs, and Roughness.
Statistical measurements available in Matrox Design Assistant include: the maximum, minimum, and mean pixel value, standard deviation, the sum and sum of the square of pixels.
The Intercept category of features calculate the number of times a background pixel transitions to a foreground pixel (not vice versa) at the specified angle. You can calculate the number of intercepts at angles of 0, 45, 90, and 135 degrees.
You can calculate the central and ordinary moments of a blob.
The Central Moment Xn Ym is only valid for the following combinations of the pair (n, m): (0, 2), (2, 0), or (1, 1).
In the case of ordinary Moment Xn Ym, the pair (n, m) is only valid for the following combinations: (0, 1), (1, 0), (1, 1), (0, 2), or (2, 0).
If you need to calculate the angle at which a blob has the least moment of inertia, Matrox Design Assistant provides the Principal Axis Angle feature. The result returned will always be between -90 and +90 degrees, measured in a counter-clockwise direction from the positive X-axis.
You can also choose to calculate the Secondary Axis Angle which is the angle perpendicular to the principal axis angle.