In analogy to the boundary statistical moments defined in Equations (9.8) to (9.10) and the statistical moments used to describe texture (see Section 8.1), statistical moments can be defined to describe shape. Here the pixel value of the feature is assumed to be unity, and intensity variations do not influence the shape moments. Statistical moments are computed from all pixels of a feature, as opposed to the metrics in the previous section, which are computed form the boundary points only. The kth moment Mk is defined as
where x,y e F indicates the of Equation (9.12), the statistical moments are generally not rotation-invariant. Also, it can be seen that
M0 = 1 and M1 = 0 due tx- and y-coordinates of all pixels that belong to feature F. Furthermore, NF is the size (the number of pixels) of feature F, and xc and yc are the centroid coordinates. By computing the moment Mk relative to the centroid, the value of the moment becomes translation-invariant. The normalization by NF makes the Mk scale-invariant. However, under the definition o the normalization. Statistical moments tend to become larger in more irregular shapes. A more general approach was introduced by Hu18 and later extended to invariance under general affine transformations by Flusser and Suk.12 To obtain the moment invariants (i.e., metrics that are scale-, translation-, and rotation-invariant), Equation (9.12) is generalized to allow different powers p,q e N for the two dimensions:
throughform a feature vector that can be used to classify the shape.
Similar to M1 in Equation (9.12), M1,0 = M0,1 = M1,1 = 0. Furthermore, M0,0 is the area of the shape (the number of pixels). Therefore, scaling-invariant moments can be computed by normalizing the moment by the area,
where p + q > 2, and [■] denotes the truncation of the decimals (integer operation). Hu18 has defined seven feature metrics, through that are rotation-invariant and by merit of the , also translation- and scaling-invariant. through are defined as
Although the definitions in Equation (9.15) are most commonly used, and can be simplified by using = 0, which leads to33 Mertzios and Tsirikolias25 propose a different definition of the statistical moments. This definition contains a normalization by the standard deviation. The centroid coordinates xc and yc are defined
where x,y e F indicates the x- and y-coordinates of all pixels that belong to feature F, and NF is the size (the number of pixels) of feature F. The standard deviation of both coordinates, ax and ay can be computed with
According to Mertzios and Tsirikolias,25 the normalized moments defined in Equation (9.19) appear to have a better classification performance than the moments as defined in Equation (9.13) and are less sensitive to noise.
To implement the computation of moment invariants, Algorithms 9.1 and 9.2 can be used. The second pass in Algorithm 9.1 (the second double loop) can be extended by performing the summation of each pixel that belongs to the cluster according to Equation (9.13). At the end of Algorithm 9.1, the invariants ^ through according to Equation (9.15) would be computed and finally stored in tables similar to size, compactness, aspect ratio, and irregularity in Algorithm 9.2.