3.2 Connected Operators
4.1.1 The Segmentation Outline
We choose to present the outline of a segmentation by an image containing four levels, (0 to 3). These values are determined in raster scan fashion. A value of 0 indicates that the pixels to the right and below are of the same segment, 1 indicates that the pixel to the right belongs to a different segment but the pixel below is of the same segment, 2 indicates that the pixel below is of a different segment but the pixel to the right is of the same segment and 3 indicates that both the pixel below and the pixel to the right are of different segments. Pixels lying on the right hand and lower edges of the image are given values which assume that edge of the image represents a segment boundary. It will be seen that this ensures consistency
between the sum of coding costs of all three components and the entropy of the original image. The result of the allocation (Io) is then a complete description of
the segmentation outline having the same dimensions as the original image which we shall denoteM×N.
The spatial redundancy in this full image is reduced by calculating a single 8-bit value derived from each 2×2 block ofIo. The result is an imageIorhaving dimensions
M
2 ×
N
2. The following equation describes this operation.
Ior(i, j) = Io(2i,2j) + 4Io(2i+ 1,2j) + 16Io(2i,2j+ 1) +. . . . . .64Io(2i+ 1,2j+ 1), 0< i < M 2 , 0< j < N 2 (4.2)
The values of the compressed outline image, which lie in the range 0 < Ior(i, j) <
255, are unique for any particular combination of pixels in the outline imageIo and
as such the uncompressed outline image can be perfectly reconstructed. It should be noted that the compression operation assumes that the image dimensions are even values although images with odd dimensions can be accommodated with a small loss of efficiency. The entropy of the compressed outline image Hor is calculated
according to Equation 4.3 where por(k) is the probability of a pixel having a value
value 0< k <256 and is derived from the normalised histogram.
Hor=−
255
X
0
por(k) log2por(k) (4.3)
The outline entropy is high if there are an equal number of each pixel value in the outline image, such as is the case in a segmentation with very complex boundaries and low if all pixels have the same value. In the limit as each segment represents a single pixel, the entropy of the outline image is zero (considering that the edges have been regarded as boundaries). In the opposite extreme of a single segment, the outline entropy approaches zero, but does not reach it on account of the pixel values at the right hand and lower edges.
In order to express the outline entropy in terms of the minimum number of bits required to represent each pixel of the original image, we introduce the outline coding costCor, such that
Cor =
1
4Hor (4.4)
0 20 40 60 80 100 0 0.5 1 1.5 2 λ
Coding Cost / Bits per Pixel
Cost of Coding Interim Outline Image C
o
Cost of Coding Compressed Outline Image C
or
Figure 4.1: The coding cost of the interim outline image Co and the outline image
exploiting spatial redundancy Cor for the image of ‘girl’ after segmentation using
the adaptive λ-max operator as a function of λ. probability distribution po(0< k <3). Co=Ho=− 3 X 0 po(k) log2po(k) (4.5)
Note the absence of a normalisation factor due to the fact that the interim outline image has the same dimensions as the original image and as such the entropy already has the units of bits per pixel. Figure 4.1 shows the coding costs Co and Cor, for
the segmentation outline of the image of ‘girl’ having been segmented using the adaptive λ-max open-closing operator as a function of λ. The results clearly show that the coding cost of the outline image after exploitation of the spatial redundancy
Cor is significantly lower than the coding cost of the interim outline imageCo. It is
suggested that even more efficient coding strategies such as run length encoding may be employed which further exploit spatial redundancy to reduce this cost, however a full study is not entered into here.
The cost of coding the outline of the segmentation in this way leads to a measure which is high if the segment outlines are very complex and lower for simple outlines. Indeed, the outline coding cost is zero when segments represent single pixels, but as Figure 4.1 demonstrates it rises rapidly with increasing λas segment boundaries become more complex reaching a peak while λ < 10. As segments become larger
and the boundaries become less complex, the outline coding cost falls steadily, ap- proaching zero when the segmentation has a single segment (λ= 128). Thus this component of our metric directly addresses the property of having simple bound- aries described in the introduction to this chapter. The outline coding cost is also instrumental in addressing the criteria of having no similar neighbouring segments and many holes inside regions. After the initial rise (demonstrated in Figure 4.1), the majority of pixels lie inside segments and as such have the same outline image pixel value. This leads to a peak in the probability distribution and hence a lower entropy. The entropy can be reduced further by assigning segment boundary pixels to segment interiors (merging regions) such that the outliers of the distribution join the dominant mode. Therefore, merging regions reduces the outline entropy, be these holes or neighbouring segments with similar mean grey levels.