Morphological Decomposition of 2-D Binary

IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 16, NO. 2, FEBRUARY 2007
337
Morphological Decomposition of 2-D Binary Shapes
Into Modestly Overlapped Octagonal
and Disk Components
Jianning Xu
Abstract—One problem with several leading morphological
shape representation algorithms is the heavy overlapping among
the representative disks of the same size. A shape component
formed by grouping connected disk centers may use many heavily
overlapping disks to represent a simple shape part. Sometimes,
these representative disks form complicated structures. A generalized skeleton transform was recently introduced which allows
a shape to be represented as a collection of modestly overlapped
octagonal shape parts. However, the generalized skeleton transform needs to be applied many times. Furthermore, an octagonal
component is not easily matched up with another octagonal
component. In this paper, we describe a octagon-fitting algorithm
which identifies a special maximal octagon for each image point
in a given shape. This transform leads to the development of
two new shape decomposition algorithms. These algorithms are
more efficient to implement; the octagon-fitting algorithm only
needs to be applied once. The components generated are better
characterized mathematically. The disk components used in the
second decomposition algorithm are more primitive than octagons
and easily matched up with other disk components from another
shape. The experiments show that the new decomposition algorithms produce as efficient representations as the old algorithm
for both exact and approximate cases. A simple shape-matching
algorithm using disk components is also demonstrated.
Index Terms—Mathematical morphology, shape approximation, shape components, shape decomposition, shape matching,
shape representation, skeleton transform, structural shape
representation.
I. INTRODUCTION
HAPE representation is an important issue in image processing and computer vision. Efficient shape representation
provides the foundation for the development of efficient algorithms for many shape-related processing tasks, such as
image coding [1], [2], shape matching and object recognition
[3]–[7], content-based video processing [8], [9], and image data
retrieval [10], [11]. Mathematical morphology is a shape-based
approach to image processing [12], [13]. Basic morphological operations can be given interpretations using geometric
terms of shape, size, and distance. Therefore, mathematical
morphology is especially suited for handling shape-related
processing and operations. Mathematical morphology also has
a well-developed mathematical structure, which facilitates the
S
Manuscript received October 17, 2005; revised July 11, 2006. The associate
editor coordinating the review of this manuscript and approving it for publication was Dr. Ercan E. Kuruoglu.
The author is with the Computer Science Department, Rowan University,
Glassboro, NJ 08028 USA (e-mail: [email protected]).
Digital Object Identifier 10.1109/TIP.2006.888328
development and analysis of morphological image processing
algorithms. A number of morphological shape representation
schemes have been proposed [1], [2], [14]–[28]. Many of them
use the structural approach. That is, a given shape is described
in terms of its simpler shape components and the relationships
among the components.
The morphological skeleton transform (MST) is a leading
morphological shape representation algorithm [14]. In the MST,
a given shape is represented as a union of all maximal disks
contained in the shape. In general, there is much overlapping
among the maximal disks. The morphological shape decomposition (MSD) is another important morphological shape representation scheme [15], in which a given shape is represented
as a union of certain disks contained in the shape. The overlapping among representative disks of different sizes is eliminated. Another morphological shape representation algorithm
that can be viewed as a compromise between the MST and the
MSD was recently proposed [23]. In this scheme, overlapping
among representative disks of different sizes is allowed, but
severe overlapping among such disks is avoided. We can call
this algorithm overlapped morphological shape decomposition
(OMSD). The advantages of these basic algorithms include that
they have simple and well-defined mathematical characterizations and they are easy and efficient to implement.
There is a common problem shared by all three algorithms.
In general, there is a lot of overlapping among representative
disks of the same size. The MST is not typically considered as
a shape decomposition algorithm because of the heavy overlapping among the representative disks. For the MSD and OMSD,
there is a simple scheme for grouping representative disks into
shape components. Each component is a maximal set of representative disks of the same size with connecting centers. In
general, a component may contain many overlapping representative disks. Sometimes, a large number of such disks are used to
represent a simple shape component. At other times these disks
form complicated structures.
In a recent paper [24], we introduced a generalized skeleton
transform that derives generalized skeleton points for a given
shape image. Each skeleton point represents a generalized maximal “disk,” which, in general, is an octagon. The main advantage of the generalized skeleton transform is that it leads to an
efficient shape decomposition scheme. In this scheme, a given
shape is decomposed into a collection of modestly overlapping
octagonal shape components. These octagonal components are
more primitive than the components obtained from the MSD or
OMSD. Each octagonal component is represented by a single
center point and the overlapping level is reduced. However, one
1057-7149/$25.00 © 2006 IEEE
338
IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 16, NO. 2, FEBRUARY 2007
problem with this decomposition scheme is that the generalized skeleton transform needs to be applied multiple times. Another problem is that although it is easier to compare two octagons than to compare two shape components from the MSD
or OMSD, it is still not a trivial task to define a meaningful similarity measure for such octagonal components.
In this paper, we will first develop an octagon-fitting algorithm (OFA) which will find a special maximal octagon for each
image point of a given shape. The OFA will allow us to develop
two new shape decomposition algorithms. The first decomposition algorithm will use octagonal shape components. However,
the OFA will only need to be applied once. In the second decomposition algorithm, a given shape will be decomposed into
a collection of modestly overlapping disk components. Once
again, the single application of the OFA will provide enough
information to allow an efficient collection of disk components
to be selected for both exact and approximate representations of
the given shape. It is much easier to compare two disk components—we only need to notice their size difference. Therefore,
this decomposition algorithm will provide strong support for
the development of shape matching algorithms. In Section II,
we will review some basic definitions, the generalized skeleton
transform, and the associated decomposition algorithm. The
OFA will be introduced in Section III. Some properties of the
transform will be discussed in Section IV. In Section V, we will
describe the two new decomposition algorithms. Decomposition experiments will be reported in Section VI. Section VII
will demonstrate a shape matching algorithm and conclusions
will be presented in Section VIII.
II. BACKGROUND
In binary morphological image analysis, a 2-D image is
or its
defined as a subset of the 2-D Euclidean space
. In this paper, we deal only with
digitized equivalent
. For an
digital images that are defined as subsets of
image
and a point
, the translation of
by is defined
(1)
The four most fundamental morphological operations are dilation, erosion, opening and closing. They are defined as follows,
respectively:
(2)
(3)
(4)
(5)
The generalized skeleton algorithm [24] can be viewed as
a recursive process of applying erosion operations with eight
shown in Fig. 1, to reduce
structuring elements
a set of image points to many small skeleton subsets. For a
nonempty image that is not a set of isolated points, let
(6)
(7)
Fig. 1. Eight two-point structuring elements.
Fig. 2. Shape parts generated by the generalized skeleton transform
and the old decomposition algorithm: (a) X ; (b) Y (Y (Y (X )))
B B B ; (c) Z (Y (Y (X ))) B B ; (d) Z (Y (X ))
B ; (e) X (Y (Y (Y (X ))) B B B ).
8
n
8
8
8
8 8
8
8
8
where “ ” represents the set difference operation. We call
the set from the erosion step and
the set. If
is a nonempty set with adjacent points, then we apply
the same reduction process to it using the next structuring
to produce
and
. We do the
element
same for
to get
and
. The same
process is repeated. After a finite number of such reductions,
is always reduced to a collection of skeleton subsets each of
which contains only isolated points. Each point in a skeleton
subset represents a shape part whose shape, in general, is an
octagon. The union of all such octagonal shape parts is the
original shape.
In fact, each nonskeleton image point also represents a shape
part identified by the generalized skeleton transform. Such a
shape part also has a general shape of an octagon. In the associated decomposition algorithm, we use these octagonal shape
parts represented by either skeleton or nonskeleton points to
construct an efficient structural representation for a given image.
The first shape component in the structural representation is
the largest shape part represented by a skeleton point. To determine the second shape component, we first find the largest
shape part represented by a skeleton or nonskeleton point that
is outside the first shape component. If a shape part represented
by a skeleton point is selected, then the shape part is our second
shape component. If a nonskeleton point and its shape part are
selected, then there can be other neighboring nonskeleton points
outside the first component that represent octagonal shape parts
of the same shape and size. We need to apply the generalized
skeleton transform on such points to identify larger octagonal
shape parts and their representative points. The skeleton point
with the largest shape part from the second application of the
generalized skeleton transform is selected. The same process is
repeated to select other shape components. The process terminates when all the points in the given shape are covered.
A major drawback of this algorithm is the repeated applications of the generalized skeleton transform. Consider the image
in Fig. 2(a). Fig. 2(b)–(d) shows three final skeleton points and
the corresponding maximal octagonal shape parts. In the decomposition algorithm, the largest octagonal shape part in Fig. 2(b)
will be selected as the first shape component. After that, one of
the points in Fig. 2(e) will be selected because they are outside
the first shape component. The two points in Fig. 2(e) are not
skeleton points. When they were eliminated from the reduction
process, they were representing size-zero shape parts or themselves. The generalized skeleton transform needs to be applied
XU: MORPHOLOGICAL DECOMPOSITION OF 2-D BINARY SHAPES
339
Fig. 3. Two shapes and their components generated by the old decomposition
algorithm.
to combine these two points into a single shape part which will
then be selected as the second shape component.
Another difficulty with the algorithm is that the shape components generated are still not primitive enough to allow easy
matching between shape components from two different shape
images. It is not a trivial task to define a meaningful similarity
measure for such octagonal components. It is even harder to establish correspondence among such components. Consider the
two shapes in Fig. 3(a) and (b). The shape in Fig. 3(a) contains only one component generated by the decomposition algorithm—the given shape itself. The shape in Fig. 3(b) will be
decomposed into three components by the algorithm. They are
shown in Fig. 3(c)–(e). Obviously, it is not easy to match up
these components from the two shapes. If we could break the
first shape up into a number of modestly overlapping components of more primitive shapes, then the matching up between
the two shapes would be easier.
III. OCTAGON-FITTING ALGORITHM
In this section, we describe an algorithm that associates
each image point with a special maximal shape part, or shape
element. The size of the shape element is assigned to the point.
In this algorithm, we derive our shape elements by repeatedly
applying erosion operations using the eight structuring ele,
ments shown in Fig. 1 in the following order:
,
That is, these eight structuring
elements will be applied in a cyclic sequence. A given shape
image can be seen as a set of image points. Our algorithm
can be viewed as a process of applying erosion operations to
repeatedly divide a set of image points into two disjoint subsets.
For a nonempty image that is not a set of isolated points, let
Therefore, represents a shape element of the form
in
and represents a shape element of the form
in . A point in
represents a shape element
of the form
in
and a point in
represents itself in
. Therefore, represents a shape
in and represents itself in .
element of the form
The same process is repeated until no further divide is possible.
is always divided into a collection of disjoint final subsets by
this process. Each nonempty final subset contains only isolated
points. Each image point belongs to exact one final subset.
be a or set determined after divide steps. Each
Let
point in
represents a shape element of the form
in
, where is formed by combining the sequence of structuring
from . When we speak of the seelements used to derive
from , we
quence of structuring elements used to derive
only include those structuring elements that correspond to the
sets in the sequence of subsets derived from
and leading
. After an
to . The point is considered the center of
on , each point in
represents a
erosion step with
larger shape element of the form
in . Each point
in
still represents a shape element of the form
in
. An erosion step can also be viewed as a step of determining
larger shape elements from the given set of shape elements. The
set contains the centers of the larger shape elements each of
which is formed by combining two current-size shape elements
with adjacent center points. The set contains the centers of
the current-size shape elements that cannot be expanded in this
is successful in expanding the shape
step. In other words,
elements represented by the points in the set, but it fails to
expand the shape elements represented by the points in the
set. The final shape elements represented by the points in the
final subsets are maximal shape elements in the sense that they
cannot be expanded any further following the sequence of expansion steps used in the algorithm. Clearly, this process assigns
an unique maximal shape element to each image point.
The sequence of basic structuring elements used to derive a
final subset is recorded in the expression of the subset. In general, a final subset has the form
(8)
(9)
(10)
is divided into two disjoint subsets
and
In general,
by this erosion step. Again, we call
the set from
the set. It is clear that
the erosion step and
. When
is not empty, we must have
.
So, is divided into two strictly smaller subsets. When
is empty, we have
. In this case, no real divide
is achieved in the current erosion step. The difference between
and
is that each point in
represents a
in
and
shape part or shape element of the form
each point in
only represents itself in . In other
is a subset of
and , but
words,
is not. If
is a nonempty set with adjacent points, then we
apply the same divide process to it using the next structuring
to produce
and
. Similarly,
element
and
from
. Now, a point
we get
in
represents a shape element of the form
in
and a point in
represents itself in
.
in (10) is either a
or a
and this
or
correEach
sponds to a structuring element
, which was used in the
erosion step to generate or . A point in this final subset
with
represents a shape element that is formed by dilating
the group of structuring elements each of which corresponds
in the expression of the subset. For example, a point
to a
in
represents a shape element of the form
. Note that the structuring elements that correspond to the sets are not used. Each final shape element
is, in general, an octagon with four pairs of parallel opposing
boundary sides. The two sides in each opposing pair also have
the same length. Some special line segments, parallelograms,
and hexagons are included as the special cases of such general
octagons. Fig. 4 shows a number of such possible shape elements. There is a simple relationship between the shape of a
shape element and the numbers of different structuring elements
or
used to construct a shape element
used. The number of
340
IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 16, NO. 2, FEBRUARY 2007
Fig. 4. Shape elements generated using two-point structuring elements: (a) B ;
B ; (c) B B ; (d) B B B ; (e) B B B ; (f) B
(b) B
B B B ; (g)B B B B .
8
8
8
8
8
8
8 8
8
8
8
8
are shown in Fig. 5(p)–(s). Finally, the five final shape elements
in Fig. 5(c) are shown in Fig. 5(t)–(x).
derived from
In the generalized skeleton algorithm, only a small number of
image points and the associated maximal octagons are identified
to represent the original image. In the associated decomposition
algorithm, however, it is too limiting to use only the skeleton
points. An octagon represented by a nonskeleton point can often
have neighboring octagons of the same size. The generalized
skeleton algorithm needs to be applied again to combine them.
In the new OFA, a maximal octagon is assigned to each image
point.
IV. SOME PROPERTIES OF THE OFA
A. Symmetry Property
Fig. 5. Example of OFA: (a) X ; (b) Y (X ); (c) Z (X ); (d)Y (Y (X ));
(e)
Z (Y (X )); (f) Y (Y (Y (X ))); (g) Z (Y (Y (X )));
(h)Y (Z (Y (Y (Y (X )))));
(i)
Z (Z (Y (Y (Y (X )))));
B
B
B
B ; (k)–(l) final
(j)Y (Z (Y (Y (Y (X )))))
shape elements derived from Z (Z (Y (Y (Y (X ))))) in (i); (m)–(o) final
shape elements derived from Z (Y (Y (X ))) in (g); (p)–(s) final shape
elements derived from Z (Y (X )) in (e); (t)–(x) final shape elements derived
from Z (X ) in (c).
8
8
8
8
equals the size of the shape element’s two horizontal sides. The
or
used is same as the size of two vertical
number of
sides. The numbers of other two pairs of structuring elements
used determine the sizes of two pairs of diagonal sides.
be the shape image
Let us look at a simple example. Let
is used in the first erosion step.
is
in Fig. 5(a).
is in Fig. 5(c). The next structuring
in Fig. 5(b) and
element to be used is
. We divide
first.
is in Fig. 5(d) and
is in Fig. 5(e). Now we apply
to
.
is in
the divide step with
is in Fig. 5(g). After another
Fig. 5(f) and
erosion step with
on the set from the previous step, we
and
have
. No real divide is achieved in this step.
is applied to divide
Now, the next structuring element
the
set from the previous step.
is in Fig. 5(h) and
is in Fig. 5(i).
set from this step has a single point. Therefore,
The
this is a final subset and we have a final shape element
, which
is in Fig. 5(j). Following similar steps, two final shape elein
ments are derived from the subset
Fig. 5(i). The shape elements and their centers are shown in
Fig. 5(k)–(l). The three final shape elements derived from the
in Fig. 5(g) are shown in Fig. 5(m)–(o).
subset
in Fig. 5(e) will eventually be divided
The subset
into four final subsets. The corresponding final shape elements
In an erosion step in our algorithm, the corresponding structuring element contributes only to the growth of the shape elements represented by the points in the set. The structuring
element does not contribute to the final shapes of the shape elements represented by the points in the set. The eight structuring elements used in our algorithm form four pairs. The first
and
are both two-point horizontal line segments. In
pair
deriving a final subset and the corresponding final shape eleand
or use one
ments, we either use the same number of
than . Consider the expression of a nonempty final
extra
. If
is a
image subset
set corresponding to either
or , then from the definition of
are all sets. In other
the erosion step
contains no horizontal line segments, any atwords, since
or
in later steps will fail as well.
tempts to divide using
Similar situations exist for other three pairs of structuring elements. In this sense, our shape elements are symmetric in horizontal, vertical, and two diagonal directions. Because of this
symmetry property, each shape element can be completely specified using six integers: two for the position of its center and four
for the sizes of its four pairs of boundary sides.
B. Lower Bounds
A disk can be thought of as being formed by expanding
a point uniformly in all directions. The shape elements determined by our algorithm can be considered as generalized
“disks” in the sense that we try to expand them as symmetrically as possible. We now use the eight two-point structuring
elements to define our own version of “standard” discrete disks
of different sizes. Let size-zero disk be defined as {(0, 0)}. The
and the size-two disk
is defined
unit disk is defined as
as
. In general, the size- disk
is defined as
(11)
The eight shapes in Fig. 6 are discrete disks of sizes one through
eight. In general, these disks are the results of “uniform” periodic expansions of a point in eight directions.
For each image point , there is an associated maximal
disk. This is the largest disk in the given image centered at
. This maximal disk is contained in the final shape element
determined by our algorithm at . Assume that the size of this
. Clearly,
maximal disk is . This maximal disk is
XU: MORPHOLOGICAL DECOMPOSITION OF 2-D BINARY SHAPES
341
represents
in . The point is also
in subsequent
identified to represent a shape part in
erosion steps. Therefore, an upper bound for the final shape
.
element represented by is
This bound can be further improved. The point is also in
Fig. 6. Discrete disks generated using two-point structuring elements.
is in the subset
not in
and is
. Therefore, must be in
and in one of the final subsets
derived from this set. It is clear that must represent a final
shape element of the form
where is formed
by combining all the structuring elements used to derive the
.
final subset containing from
as a
Clearly, this final shape element contains
subimage. Therefore, each final shape element contains the
corresponding maximal disk of the original shape image as
a subimage. This maximal disk is in fact a lower bound for
the corresponding final shape element. Our algorithm always
tries to expand shape elements as symmetrically as possible.
Only after the efforts to create larger disk shape elements fail,
noncircular shape elements can be generated. In the example in
Fig. 5, the final shape element in Fig. 5(j) actually contains two
size-three disks. One of them shares the center with the shape
element. The final shape elements in Fig. 5(k)–(l) also contain
size-three disks. Each shape element shares its center with one
of the disks. All the final shape elements in Fig. 5(m)–(o) contain size-two disks and all the shape elements in Fig. 5(p)–(s)
contain size-one disks.
C. Upper Bounds
A final shape element represented by an image point is symmetric and is maximal in the sense that it is the maximal shape
element determined by the sequence of erosion and divide steps
used in the algorithm. However, it is, in general, not a maximal
symmetric octagon contained in the original shape image centered at the given image point. Let
be a subset generated by
be a subset derived from
an erosion step in our algorithm and
. Then a point in
represents a shape part of the form
in , where is formed by combining the sequence
of structuring elements used to derive
from . Clearly, the
limit the size and shape of . When
size and shape of
is a set from an erosion step, its shape is determined by a
set-difference operation and generally considered to be “small”
in the sense that the corresponding structuring element will not
fit into it. The point also represents a shape part of the form
in the original shape , where is the combination of the sequence of the structuring elements used to derive
from . The restrictions on will also limit the shape and
.
size of
We can provide some simple upper bounds for the
final shape elements derived in the algorithm. Consider
in a final
a shape element represented by a point
. Let
be
subset
set in the expression. That is,
for
the first
and
. Clearly, is a point
in
. Each point in
The point is only identified in the subsequent erosion steps to
. Each point
represent a shape part in
in
still represents
in
. Therefore, a tighter upper bound for the final shape element
represented by is
. Tighter
and more complicated upper bounds can be derived following
similar steps. Now, we go back to the example in Fig. 5. Conin Fig. 5(g). This is not
sider the image subset
a final subset. However, the expressions of all the final subsets
will contain the
derived from
part. For a final shape element represented by a point in a final
subset derived from
, an upper bound is
, which has the same shape as the final
shape element in Fig. 5(m). The three final shape elements in
Fig. 5(m)–(o) share this upper bound.
D. Implementation
We now consider implementation issues. For a given shape
, all the and sets produced by the algorithm form a binary tree. The image is at the root. The node has zero or
and
. Each of
and
two child nodes
has zero or two child nodes and so on. All the nodes on the
same level in this binary tree are divided using the same strucis divided using
;
and
are
turing element.
;
,
,
, and
divided using
are divided using
, and so on. It is easy to see
that all the nodes on the same level form a partition of the given
shape image. Each node corresponds to a subset of the original
shape points and the points in the subset represent shape elements of the same shape and size. Some nodes represent empty
sets. Fig. 7 shows the nodes in the top four levels of the binary
tree for the image in Fig. 5(a).
To implement the algorithm on a conventional computer, we
can perform all the erosion steps on all the nodes on the same
level using a single scan through all the pixel points in the given
shape image. In each scan, we only need to examine adjacent
pairs of image points along a certain direction for possible combination of two shape elements of the same shape and size.
When a larger shape element is identified, one of the size numbers stored at the center of a newly formed shape element should
by incremented accordingly. The points that are not changed
in the current scan can still be combined in future steps. Such
scans are repeated to combine shape elements along all eight directions according to the order specified in the algorithm. If no
combination of two shape elements of the same shape and size
is possible along any direction, then the process terminates.
. It is easy
We assume that the image array size is
erosions with
or
, none of
to see that after at most
the subsets derived in the OFA will contain horizontal line segments. Similar arguments can be made about other three pairs of
342
IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 16, NO. 2, FEBRUARY 2007
Fig. 8. Examples of shape components.
Fig. 7. Binary tree generated by the OFA.
structuring elements. Therefore, after, at most,
image scans,
none of the subsets can contain connected points. They have all
become final subsets. Thus, the time complexity of the OFA is
scans.
V. NEW DECOMPOSITION ALGORITHMS
In this section, we first define a size ordering among the final
shape elements derived in the OFA before we introduce our new
decomposition algorithms. Consider the first erosion step performed on a given image . In general, the set of the step
in shape and size (when
tends to bear more resemblance to
the set is not empty). The shape elements identified from the
set tend to represent “larger” shape elements in the original
. The set of the step typically contains some “small” extraneous parts and peripheral points. Further erosion steps are
used to group them into “small” shape elements for the set
and for the original shape. The recursive application of this divide process actually imposes a natural size ordering on all the
final shape elements generated by the OFA.
We now define a size relationship between any two final shape
elements represented by two image points. If the two points belong to the same final subset, then they represent two final shape
elements of the same shape. Obviously, they have the same size
and the two image points cannot be adjacent to each other. If
they belong to two different final subsets, then there must be an
erosion step in which one point was placed into the set and
the other one was placed into the set. The final shape element
represented by the point placed into the set in this step is considered larger than the other final shape element.
Note that the size of the largest disks contained in a final
shape element corresponds to the number of initial consecutive
sets
in the expression of the corresponding final subset. If a final shape element is larger than
another final shape element, then the largest disks contained in
the first shape element are not smaller than the largest disks contained in the second shape element. On the other hand, if the
largest disks contained in the first shape element are greater than
the largest disks in the second shape element, then the first shape
element is greater than the second shape element.
When comparing two final shape elements, the smaller shape
element is the one that first stopped growing in a direction in
which the other shape element was still growing. Consider a
shape element represented by four size numbers of its four
. They are the sizes of the
pairs of boundary sides
shape element’s horizontal sides, 45 diagonal sides, vertical
sides, and 135 diagonal sides. To compare this shape element
represented in the same fashion
with another shape element
, we find the smallest or
that belongs
by
to an unequal pair:
. If the selection is not unique, then
we pick the one with the smallest index. If the choice is , then
is smaller than . Otherwise,
is smaller. For example,
and
, is considered
when
smaller. However, when
and
,
is considered smaller.
A structural representation of an input image can be easily
constructed using some of the octagons determined in the OFA.
The procedure is similar to the one described in [24]. The first
shape component in the structural representation is the largest
final shape element. We now have a more precise definition for
size ordering among shape elements. Still the selection may not
be unique. Two final shape elements with nonadjacent centers
can have the same size. We may have to use additional criteria
such as the distance to the center of the image to make the choice
unique. The second shape component is the largest shape element with its center outside the first shape component. This
condition ensures that each shape component covers a significant new area of the given shape and only modest overlapping
is allowed. Similarly, the choice may not be unique and additional criteria may be needed. The same selection process is repeated until all the image points are covered. Consider the shape
image in Fig. 8(a), which is the same shape in Fig. 5(a). For this
shape, a total of five shape components are identified. They are
shown in Fig. 8(b)–(f). The OFA identifies all the potential shape
components and it only needs to be applied once. The shape in
Fig. 9(a) is copied from Fig. 2(a). Fig. 9(b)–(j) shows nine final
shape elements and their centers determined by the OFA. Shape
elements in Fig. 9(b) and (h) are selected to represent the original shape.
An alternative way to construct a structural representation is
to use disks as shape components. We first select the largest final
XU: MORPHOLOGICAL DECOMPOSITION OF 2-D BINARY SHAPES
343
Fig. 9. Shape elements generated by the OFA.
Fig. 10. Two shapes and their components generated by the new decomposition
algorithms.
shape element derived in the OFA. The largest disk contained
in this shape element that shares the center with the shape element is chosen as the first shape component. This is the largest
disk or one of the largest disks contained in the original shape
image. To determine the second shape component, we first find
the largest final shape element whose center is outside the first
disk shape component. The largest disk in this second shape element that shares the center with the shape element is our second
shape component. The second shape component corresponds
to a prominent shape part that may overlap modestly with the
first shape component. The same process is repeated until all
the points in the given shape are covered. Each shape component determined in this process is a maximal disk in the input
image; it is the lower bound disk for the selected shape element.
The shape image in Fig. 8(a) has seven disk shape components.
They are shown in Fig. 8(g)–(m).
We call the first algorithm octagon-generating (OG) decomposition algorithm and the second disk-generating (DG) decomposition algorithm. In either the MSD or the OMSD, a shape
component corresponds to a group of connected disk centers of
the same size. The shape of such a shape component can still
be very complicated and there is much overlapping among the
disks contained in the component. The algorithm in [24] and
the new OG decomposition scheme are attempts to derive more
primitive shape components and reduce redundancy. The disk
components used in the DG decomposition algorithm are more
primitive than octagons. The size of a disk is represented by a
single integer. It is easier to match a disk component from one
shape to another disk component from a second shape. Consider
the two shape images in Fig. 10(a) and (f). They are copied over
from Fig. 3(a) and (b). When we apply the decomposition algorithm described in [24] or the new OG decomposition algorithm
to the shape in Fig. 10(a), only one shape component is identified—the given shape itself. For the shape in Fig. 10(f), these
two algorithms produce three shape components. They are in
Fig. 10(g)–(i). It is not easy to match these two shapes using the
current components. Our new DG decomposition algorithm decomposes the shape in Fig. 10(a) into three components, which
are shown in Fig. 10(b)–(d). For the shape in Fig. 10(f), the same
three components in Fig. 10(g)–(i) are produced by the new DG
decomposition algorithm. It is now much easier to match up the
components from these two shapes.
Fig. 11. Representative points generated by the decomposition algorithms.
The real role played by the OFA in the DG decomposition
algorithm is to impose a size ordering on all the maximal disks
contained in a shape image. This ordering guides the selection of
the final set of disk components. The shape in Fig. 10(a) contains
five size-three disks. Their centers are shown in Fig. 10(e). The
OFA assigns different size numbers to them. Based on the shape
information contained in these numbers, only three of them are
selected to represent the given image.
We now consider the time complexities of both algorithms.
Selecting the largest octagon requires one image scan. Determining the maximal disk contained in a selected octagon for
time. It takes another scan to rethe DG algorithm takes
move those image points contained in the selected shape compoto represent the number of components gennent. If we use
erated by either algorithm, then the time complexity for either
scans. Therefore, the overall complexity inalgorithm is
scans. The time complexity
cluding the OFA part is
of the old decomposition algorithm is higher. The time comscans.
plexity of the generalized skeleton transform is
In the associated decomposition algorithm, when a nonskeleton
point is selected, the generalized skeleton transform is applied
to the set of image points that represent the same size octagons
as the chosen nonskeleton point. Clearly, we will have no more
such points, where
again represents the number
than
of final shape components used to represent the shape. Thus, the
scans.
time complexity of this algorithm is
VI. DECOMPOSITION EXPERIMENTS
We first apply the two new decomposition algorithms to three
64 64 shape images. Fig. 11(a)–(c) shows the three shapes
and the representative points generated by the old decomposition algorithm based on the generalized skeleton transform.
These three shapes are scaled down versions of the first three
344
IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 16, NO. 2, FEBRUARY 2007
TABLE II
DATA VOLUMES USED BY DIFFERENT DECOMPOSITION ALGORITHMS
TO REPRESENT NINE 128 128 SHAPE IMAGES
2
TABLE III
COMPUTATION TIMES (IN SECONDS) USED BY
THREE DECOMPOSITION ALGORITHMS
Fig. 12. Shape images used in the experiments: (a) teapot; (b) lamp; (c) telephone; (d) butterfly; (e) dog; (f) fish; (g) puzzle piece; (h) letters; (i) digits.
TABLE I
NUMBERS OF COMPONENTS USED BY DIFFERENT DECOMPOSITION
ALGORITHMS TO REPRESENT NINE 128 128 SHAPE IMAGES
2
shapes in Fig. 12. Fig. 11(d)–(f) shows the representative points
generated by the new OG decomposition algorithm. The representative points generated by the new DG decomposition algorithm are shown in Fig. 11(g)–(i). The distribution patterns
of the representative points generated by these three algorithms
are similar. Most of the representative points are near the edges.
They correspond to small shape components representing local
details.
Now we apply the two new decomposition algorithms along
with the old decomposition algorithm to nine 128 128 shape
images shown in Fig. 12. Table I shows the numbers of components used by these three algorithms. In all but one case, our new
OG algorithm uses the lowest numbers of components. It seems
that our new OG algorithm is at least as efficient as the old algorithm in representing different shape structures. The new DG
algorithm uses the highest numbers of components. Octagonal
components are obviously more flexible than disk components.
However, we need to use four integers to represent the shape of
a special octagon used by our algorithms, while we only need a
single integer to represent the shape of a disk—its size number.
To compare the data volumes used by different algorithms, we
assume that each component center point in the old algorithm
and the new OG algorithm is stored as six integers, two for the
location and four for the shape. We also assume that each disk
center point in the new DG algorithm is stored as three integers, two for the location and one for the size. The data volumes
used by these three algorithms to represent these nine shapes
are given in Table II. When compared with the old algorithm,
the new DG algorithm uses less data volumes for seven out of
nine shapes. In the case of dog shape, the data volume reduces
from 894 to 663. When compared with the new OG algorithm,
the new DG algorithm uses less data volumes in six out of nine
cases. These results seem to indicate that the new DG algorithm
is at least as efficient as the old algorithm. Our experiments were
run on a Sun E450. Table III shows the times (in second) used
by the three algorithms. The two new algorithms require much
less computation times than the old algorithm.
Fig. 13 shows the approximations of the teapot shape using
different number of shape components generated by the old decomposition algorithm. The approximations using components
generated by the new OG and DG decomposition algorithms
are in Figs. 14 and 15. These approximations are constructed
using 1, 5, 10, 15, 20, 30, 40, and 50 largest shape components.
The error rates of these approximations are given in Table IV.
The error rate is defined as the ratio between the number of
image point not represented and the number of points in the original shape. The visual qualities of the approximations generated
by the new OG algorithm are similar to those by the old algorithm. The approximations generated by the old algorithm using
smaller numbers of components seem to look a little better than
XU: MORPHOLOGICAL DECOMPOSITION OF 2-D BINARY SHAPES
345
Fig. 13. Shape approximations using different numbers of components generated by the old decomposition algorithm: (a) 1, (b) 5, (c) 10, (d) 15, (e) 20, (f) 30,
(g) 40, and (h) 50.
Fig. 14. Shape approximations using different numbers of components generated by the new OG decomposition algorithm: (a) 1, (b) 5, (c) 10, (d) 15, (e) 20,
(f) 30, (g) 40, and (h) 50.
Fig. 15. Shape approximations using different numbers of components generated by the new DG decomposition algorithm: (a) 1, (b) 5, (c) 10, (d) 15, (e) 20,
(f) 30, (g) 40, and (h) 50.
the ones produced by the new OG algorithm. Our new definition for component size favors rounder or more circular components over more elongated ones. The more elongated components seem to be more effective in covering new shape area
in initial approximations using very small number of compo-
nents. The error rates generated by these two algorithms are
also very similar. For approximations using smaller numbers
of components, the error rates generated by the old algorithm
are slightly lower. For approximations using larger numbers of
components, the error rates generated by the new OG algorithm
346
IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 16, NO. 2, FEBRUARY 2007
TABLE IV
REPRESENTATION ERRORS (%) IN THE APPROXIMATIONS GENERATED BY DIFFERENT DECOMPOSITION ALGORITHMS
are slightly lower. The qualities of the approximations generated
by the new DG algorithm seem to be poorer in both visual and
numerical sense when compared to other two algorithms using
the same number of components. The new DG algorithm uses
disk components which lack the flexibility of octagonal components. However, the data volume used by the new DG algorithm
is only half of those used by the other two algorithms. If we
compare an approximation generated by the new DG algorithm
with an approximation generated by either of the other two algorithms using half as many components, then we can see that
the new DG algorithm actually produces better approximations
in both the visual and numerical sense. Note that the topological
structure of a shape can be altered by our approximations.
if no other components exist in the corresponding directional
interval. If the size of the closest component in the interval is
greater than or equal to the size of the reference component, we
.
set to 1; otherwise, we set to
Now consider a component center point from one shape and
another center point from another shape. Let and be the
sizes of the two components. The similarity between the sizes
is defined as
(12)
The similarity between the two size distribution vectors is defined as
VII. SHAPE MATCHING ALGORITHM
In this section, we describe a simple shape matching algorithm based on the new DG decomposition algorithm. We only
want to demonstrate that a shape matching algorithm can be
easily constructed utilizing the disk components generated by
our decomposition algorithm. A comprehensive study of shape
matching based on morphological shape decomposition is beyond the scope of this paper.
The DG decomposition algorithm represents each shape
image as a collection of modestly overlapping disk components. Each disk component is represented by its center and its
size. To avoid the difficulty with zero-size disks, we increment
all size numbers by 1. We also normalized all size numbers by
dividing each of them with the size of the largest disk component. To facilitate matching among disk components from two
shapes, we first associate each disk center with a number of distribution vectors that describe the relative sizes and positioning
of other disk components in the same shape. The distance
between a reference disk and another disk is defined to be the
distance between the two disk centers. The relative direction of
the second disk with respect to the reference disk is the angle
between the vector from the reference disk center to the second
disk center and the axis. We define 16 directional intervals by
into 16 equal-sized sections:
,
dividing
.
Each disk component center is associated with three
set of distribution values. The first set of 16 values
describes the size distribution of all
other disk components in the shape. Value is the sum of all
the sizes of the disk components falling into the directional in. The second set
terval
describes the distance distribution. This time,
is the sum
of all the distances of the disk components falling into the
corresponding directional interval. Each of the two sets is
normalized so that the sum of 16 values in each set is 1. The
is used to describe the
last set of values
size relationship between the reference component and the
closest components in all directional intervals. We set to 0,
(13)
The similarity between the two distance distribution vectors is
defined as
(14)
Let be the number of identical pairs
vectors. The matching score is defined as
from the two
(15)
The similarity between the two components represented by
and is defined as
(16)
We match two shapes and
by matching their components. In general, the two shapes will have different numbers
of disk components. Therefore, we will not enforce one-to-one
matching among components. We first match each component
of to the best-matching component
of . The similarity score for matching to is the weighted sum of all the
individual matching scores for ’s components
(17)
for component is the ratio of the component
The weight
size over the sum of all the component sizes in the shape. The
for matching to is defined similarly.
matching score
is the average of the two
The overall matching score
(18)
XU: MORPHOLOGICAL DECOMPOSITION OF 2-D BINARY SHAPES
347
TABLE V
MATCHING SCORES AMONG TEN SHAPES
Fig. 16. Five additional shapes used in the matching experiment: (a) pot2,
(b) lamp2, (c) phone2, (d) butterfly2, and (e) dog2.
Fig. 16 shows five new shape images. These five and the first
five shapes in Fig. 12 are used in the matching experiments.
Table V shows the matching scores among these ten shapes. The
best matches are always found between two shapes representing
identical type of object. Since we use normalized size and distance distributions, our shape representations should not be too
sensitive to scale changes.
Many different shape representation and matching techniques
have been developed [29], [30]. Some of them use boundarybased approaches, which include chain code, polygonal approximation, boundary curvature scale space, and Fourier descriptors. The boundary-based schemes do not describe a shape’s
interior regions directly. Therefore, spatial reasoning in terms
of relative sizes, proximity, and symmetry cannot be easily carried out. Another difficulty is that many boundary-based techniques use only external boundaries. Even when internal boundaries are included, such representations can be very sensitive to
small area changes to a given shape. Consider the teapot shape
in Fig. 12. If a small section of the handle is removed, then a
very different boundary sequence will be resulted.
Another group of shape representation and matching algorithms are region based. A feature vector can be used to describe a shape using features such as area, compactness, eccentricity, and Euler number. One drawback of this type of global
techniques is that much information about a given shape is lost.
It is also difficult to deal with shapes with moving or missing
parts. Moment invariants are also widely used as global shape
descriptors. Another disadvantage of such global approaches is
that they do not show correspondence between shape parts of
two matching shapes.
Recognizing a shape through its parts seems to be a natural
ability of human vision. Much research in machine vision has
been done in this direction. Graph representations based on region skeleton and its variants [7], [31], [32] is a popular structural approach to shape representation and matching. One criticism of this type of techniques is that both the extraction of
shape components and the structural matching are computationally expensive. Another criticism is that a small change to a
shape can cause major structural changes in the graph representation of the shape.
Our shape decomposition algorithm uses a simple and welldefined process to generate an efficient set of representative
disks. No ad hoc parameters are needed. These representative
disks can be seen as the most primitive shape components. The
original shape can be reconstructed at any level of accuracy.
Therefore, the shape matching can also be conducted at different
levels of approximations. It seems that our collection of representative disks is not as sensitive to small boundary changes as
skeleton-based representations. In the matching algorithm, we
use the representative disk centers as an unorganized collection
of key shape feature points. Our matching algorithm can be seen
as a process of accumulating evidence to establish a fit between
two shapes. This version of the matching algorithm is very preliminary. The information collected and used in the matching is
mostly geometric and little structural information is utilized. For
example, the connectivity information is not represented explicitly. Additional work is needed to explore the ways of applying
structural information in the shape matching process. We may
want to consider combining disk components into higher level
components. The rotational effects on the matching are not discussed in the current algorithm. These and other issues need to
be addressed in future work.
VIII. CONCLUSION
In this paper, we have first introduced an octagon-fitting algorithm which assigns a special maximal octagon to each image
point in a given shape. These maximal octagons are derived
using simple and well-defined operations and they represent
meaningful and well-characterized shape parts of the original
shape. Two new shape decomposition algorithms have also been
described that use some of the maximal octagons to produce
efficient structural representations for the given shape. These
decomposition algorithms are more efficient to implement than
the one described in [24]. The use of disk components also allows easier matching up among the shape components from two
348
IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 16, NO. 2, FEBRUARY 2007
shapes. The experiments show that the new decomposition algorithms produce as efficient shape representations as the earlier
algorithm [24] for both exact and approximate representation
purposes. A simple shape matching algorithm based on the new
DG decomposition algorithm has also been demonstrated.
REFERENCES
[1] Y. M. Y. Hasan and L. J. Karam, “Morphological reversible contour
representation,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 22, no. 3,
pp. 227–240, Mar. 2000.
[2] R. Kresch and D. Malah, “Skeleton-based morphological coding
of binary images,” IEEE Trans. Image Process., vol. 7, no. 10, pp.
1387–1399, Oct. 1998.
[3] I. Pitas and A. Maglara, “Range image analysis using morphological
signal decomposition,” Pattern Recognit., vol. 24, no. 2, pp. 165–181,
1991.
[4] P. E. Trahanias, “Binary shape recognition using the morphological
skeleton transform,” Pattern Recognit., vol. 25, no. 11, pp. 1277–1288,
1992.
[5] E. A. Ei-Kwae and M. R. Kabuka, “Binary object representation and
recognition using the Hilbert morphological skeleton transform,” Pattern Recognit., vol. 33, pp. 1621–1636, 2000.
[6] S. Belongie, J. Malik, and J. Puzicha, “Shape matching and object
recognition using shape contexts,” IEEE Trans. Pattern Anal. Mach.
Intell., vol. 24, no. 4, pp. 509–522, Apr. 2002.
[7] K. Siddiqi, A. Shokoufandeh, S. J. Dickinson, and S. W. Zucker,
“Shock graphs and shape matching,” Intl. J. Comput. Vis., vol. 35, no.
1, pp. 13–32, 1999.
[8] P. Salembier, P. Brigger, J. R. Casas, and M. Pardas, “Morphological operators for image and video compression,” IEEE Trans. Image
Process., vol. 5, no. 6, pp. 881–897, Jun. 1996.
[9] R. S. Jasinschi and J. M. F. Moura, “Content-based video sequence representation,” presented at the IEEE Int. Conf. Image Processing, Washington, DC, 1995.
[10] D. Sharvit, J. Chan, H. Tek, and B. Kimia, “Symmetry-based indexing
of image databases,” J. Vis. Comm. Image Represent., vol. 9, no. 4, pp.
366–380, 1998.
[11] L. J. Latecki and R. Lakamper, “Application of planar shape comparison to object retrieval in image databases,” Pattern Recognit., vol. 35,
pp. 15–29, 2002.
[12] J. Serra, Image Analysis and Mathematical Morphology. London,
U.K.: Academic, 1982.
[13] R. M. Haralick, S. R. Sternberg, and X. Zhuang, “Image analysis using
mathematical morphology,” IEEE Trans. Pattern Anal. Mach. Intell.,
vol. 9, no. 4, pp. 532–550, Apr. 1987.
[14] P. A. Maragos and R. W. Schafer, “Morphological skeleton representation and coding of binary images,” IEEE Trans. Acoust. Speech Signal
Process., vol. ASSP-34, no. 5, pp. 1228–1244, Oct. 1986.
[15] I. Pitas and A. N. Venetsanopoulos, “Morphological shape decomposition,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 12, no. 1, pp. 38–45,
Jan. 1990.
[16] J. M. Reinhardt and W. E. Higgins, “Comparison between the morphological skeleton and morphological shape decomposition,” IEEE Trans.
Pattern Anal. Mach. Intell., vol. 18, no. 9, pp. 951–957, Sep. 1996.
[17] P. Maragos, “Morphology-based symbolic image modeling,
multi-scale nonlinear smoothing, and pattern spectrum,” in Proc.
IEEE Comput. Soc. Conf. Computer Vision Pattern Recognition, 1988,
pp. 766–773.
[18] I. Pitas and A. N. Venetsanopoulos, “Morphological shape representation,” Pattern Recognit., vol. 25, no. 6, pp. 555–565, 1992.
[19] J. M. Reinhardt and W. E. Higgins, “Efficient morphological shape
representation,” IEEE Trans. Image Process., vol. 5, no. 6, pp. 89–101,
Jun. 1996.
[20] J. Xu, “Morphological decomposition of 2-D binary shapes into conditionally maximal convex polygons,” Pattern Recognit., vol. 29, no. 7,
pp. 1075–1104, 1996.
[21] ——, “Morphological representation of 2-D binary shapes using rectangular components,” Pattern Recognit,, vol. 34, no. 2, pp. 277–286,
2001.
[22] ——, “Morphological decomposition of 2-D binary shapes into convex
polygons: A heuristic algorithm,” IEEE Trans. Image Process., vol. 10,
no. 1, pp. 61–71, Jan. 2001.
[23] ——, “Efficient morphological shape representation with overlapping
disk components,” IEEE Trans. Image Process., vol. 10, no. 9, pp.
1346–1356, Sep. 2001.
[24] ——, “A generalized discrete morphological skeleton transform
with multiple structuring elements for the extraction of structural
shape components,” IEEE Trans. Image Process., vol. 12, no. 12, pp.
1677–1686, Dec. 2003.
[25] ——, “Efficient morphological shape representation by varying overlapping levels among representative disks,” Pattern Recognit., vol. 36,
no. 2, pp. 429–437, 2003.
[26] A. Held and K. Abe, “On the decomposition of binary shapes into
meaningful parts,” Pattern Recognit., vol. 27, no. 5, pp. 637–647, 1994.
[27] C. Ronse and B. Macq, “Morphological shape and region description,”
Signal Process., vol. 25, pp. 91–106, 1991.
[28] J. Goutsias and D. Schonfeld, “Morphological representation of discrete and binary images,” IEEE Trans. Signal Process., vol. 39, no. 6,
pp. 1369–1379, Jun. 1991.
[29] D. Zhang and G. Lu, “Review of shape representation and description
techniques,” Pattern Recognit., vol. 37, no. 1, pp. 1–19, 2004.
[30] S. Loncaric, “A survey of shape analysis techniques,” Pattern
Recognit., vol. 31, no. 8, pp. 983–1001, 1998.
[31] D. Geiger, T. Liu, and R. Kohn, “Representation and self-similarity of
shapes,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 25, no. 1, pp.
86–99, Jan. 2003.
[32] T. Sebastian, P. Klein, and B. Kimia, “Recognition of shapes by editing
their shock graphs,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 26,
no. 5, pp. 550–571, May 2004.
Jianning Xu received the B.S. degree in computer
engineering from the Harbin Institute of Technology,
Harbin, China, in 1982, and the M.S. and Ph.D. degrees in computer science from the Stevens Institute
of Technology, Hoboken, NJ, in 1984 and 1988,
respectively.
In 1988, he joined the faculty of the Computer
Science Department, Rowan University (formerly
Glassboro State College), Glassboro, NJ, where
he currently is a Professor. His research interests
include image processing, pattern recognition, and
mathematical morphology.