Image Processing Reference
In-Depth Information
that consists of pixel values 1, indicating connected components (object regions),
and 0, indicating the background. The first two labels, m =0and m =1,areas-
signed to the background and to the first object as soon as the first 0-valued pixel and
the first 1-valued pixel, respectively, are encountered in the forward raster direction
(reading direction). These pixels will obtain the labels 0 and 1, which is the same as
their pixel values. Then the following operations in the forward raster scan order are
performed using the neighborhood filter, as is shown in Eq. (17.11) for 8-connected
neighborhoods. The filter is to be interpreted as a mask, i.e., the 0 elements mark the
“don't care” pixels, which do not participate into the min operation below:
0 ,
if
F ( r i )=0 ,
L ( r i )=
m ;
m = m +1 ,
if
{
for all k : L ( r i−k ) G ( r k )=0 },
(17.11)
min k L ( r i−k ) G ( r k ) ,
otherwise.
where the mask G for the forward scan (right-down direction) yields:
G = 111
1 0 0
(17.12)
Here the 0 elements of the mask mark the “don't care” pixels, that is, they are not
meant to be multiplied with the (label) values of L in Eq. (17.11). Conversely, the
ones of the mask mark the points to be formally multiplied by one, although this
may be replaced by other instructions for efficiency. The boldfaced zero element
represents the current point, r i when moving the mask over the label image L . Notice
that the mask is only moved over the label image being constructed. Consequently,
the current point as well as the future point in the scan direction are “don't care”
values since they are marked with zero.
The top condition of Eq. (17.11) is usually the one that is most frequently entered.
This is because it can be activated by the current point r i being a background point,
without any regard to the values of the neighboring pixels within the G ( r i−k ). This
branch aims to keep a background pixel as a background pixel in the scan direction.
A necessity for the second condition to be active is that the current pixel value in
the binary image, F ( r i ) , be nonzero, even if this is not tested in this branch. This
is because if the current pixel is zero then it is caught by the condition of the first
branch. Accordingly, the second condition is active if and only if the current pixel
value is an object pixel, and all of the neighboring pixels in the mask marked with 1,
are already assigned to the background. When this happens the current point gets the
label m , which is immediately incremented so that every time this branch is entered,
the output label is a new label. The third condition is active when we have that the
current pixel is an object pixel and one of the neighboring pixels, marked with 1
by the mask, has an (old) object label , i.e., m> 1. In this case no new labels are
generated for the current point, but the minimum label of the neighboring pixels is
assigned to the current point. Accordingly, the smaller labels invade the connected
component.
After the forward pass, the following operations in the backward raster scan order
are applied:
Search WWH ::




Custom Search