that transforms the two given shapes into two new
shapes with isomorphic skeletons. Thus an algorithm
M should provide the following solution for any two
shapes Sh
1
and Sh
2
:
M(Sh
1
, Sh
2
) → (Sh
′
1
, Sh
′
2
) (1)
MA(Sh
′
1
)
∼
=
MA(Sh
′
2
) (2)
Moreover, new shapes Sh
′
1
and Sh
′
2
(2) should
minimally deviate from the given shapes Sh
1
and Sh
2
.
(
D
H
(Sh
1
, Sh
′
1
) → min
D
H
(Sh
2
, Sh
′
2
) → min
(3)
Where D
H
is Hausdorff distance.
This constraint (3) is very important for several
reasons. It narrows the set of solutions. We don’t need
any shapes with isomorphic skeletons. Without this
constraint any two simple shapes (not depending on
input) with isomorphic skeletons (for example, rect-
angles) could provide a solution which at least is not
correct and at most is not applicable. It defines what
we mean by ”close shapes”. It provides an opportu-
nity to estimate shape similarity as a correct distance.
Finding new shapes that satisfy both constraints
(2) and (3) among all possible plain shapes is a very
complex problem. However looking at this problem
from the skeleton side we may find an effective and
correct solution.
Let’s consider a shape representation as a set of
all maximal inscribed circles, so-called boundary-
skeletal representation (Mestetski, 1998). Using this
kind of shape representation we may directly deal
with the skeleton, change its structure and corre-
sponding radiuses. Thus we may alter the given shape
with operations affecting boundary-skeletal represen-
tation.
2.5 The Main Algorithm
We propose an algorithm M that changes the struc-
ture of two given shapes to obtain new shapes with
isomorphic skeletons (2). Two shapes are changed at
each step of the algorithm so that the distance between
the given and changed shapes is minimal (3).
The input of the main algorithm M is two
shapes Sh
1
and Sh
2
and their continuous skeletons
MA(Sh
1
) ≡ ma
1
and MA(Sh
2
) ≡ ma
2
. The output is
two new shapes Sh
′
1
and Sh
′
2
having isomorphic skele-
tons (2) and close input shapes (3).
2.5.1 Skeleton Operations
One or several operations of two types are executed at
each step of the algorithm (detailed description may
be found in (Domakhina and A.Okhlopkov, 2008)):
1. Terminal skeleton edges cutting (”cutting”). Cut-
ting means terminal edge’s deletion. When the
skeleton’s edge is cut all corresponding circles are
deleted as well. Cutting operation affects the in-
put figure ”angles round-up” (as shown in fig 5a).
2. Close skeleton knots merging (”merging”). This
operation merges two adjacent knots of the shape,
i.e. deletes an internal skeleton’s edge and all cor-
responding circles as well. We assign the radius
of the new knot’s circle as arithmetic mean of two
merged circles radiuses. Local shape’s changing
under merging operation is shown in figure 5b.
Figure 5: Figure’s changes during cutting and merging.
We describe an algorithm M in terms of isomor-
phic skeletons construction for two given skeletons
ma
1
and ma
2
. Remember that shape is changed dur-
ing each operation execution as described above.
2.5.2 Main Algorithm
1. Primary cutting (removing noise) of both skele-
tons ma
1
and ma
2
for a fixed valueε, i.e. obtaining
the base skeleton with a fixed accuracy ε (I.Reyer
and Mestetski, 2003). The level of noise may be
estimated depending on a shape. It may be as-
sumed to 1 if the shape is given as a raster object.
2. Equalizing the number of terminal vertices (graph
isomorphism necessary condition (E. M. Reingold
and Deo, 1977)) - secondary cutting. Let the first
skeleton (ma
1
) have more terminal vertices than
the second one (ma
2
). Skeleton’s ma
1
terminal
vertices are cut until both skeletons ma
1
and ma
2
have the same number of them.
3. Primary merging (removing small accidental
structure defects) for a fixed value ε. Internal
edges are deleted sequently while Hausdorff dis-
tance between new and input shape is less than
fixed value ε.
4. Equalizing the number of skeleton knots (graph
isomorphism necessary condition (E. M. Reingold
and Deo, 1977)) - secondary merging. This step
is executed like the second step but internal edges
are cut.
5. Sequent single operations (cutting and merging)
execution until skeleton graphs become isomor-
SHAPE COMPARISON BASED ON SKELETON ISOMORPHISM
239