696
A tree-edit-distance algorithm for comparing simple, closed shapes
Philip Klein * Srikanta Tirthapura * Daniel Sharvit Ben Kimia t
Abstract
We discuss a graph-algorithmic approach to comparing
shapes.
We focus in this paper on comparing simple closed
curves in the plane. Our approach is to (1) represent such a
shape by its
skeleton, which is a tree embedded in the plane,
and (2) compare two shapes by comparing their skeletons
via tree
edit-distance.
In this paper,
we define
our version of tree edit-distance
(it
differs from that previously described in the literature),
and give a polynomial-time algorithm to compute the dis-
tance between two trees.
1
Introduction
This paper arose out of a collaboration between
a computer-vision researcher and an algorithms re-
searcher. Kimia et al. [4] had previously compared
shapes by comparing their graphs using a heuristic for
general graph-comparison. The heuristic, due to Gold
and Rangarajan [3], is based on finding a local mini-
mum to a quadratic program. This approach had sev-
eral disadvantages, however, and Kimia was searching
for another approach. Klein suggested that the notion
of edit-distance might be appropriate.
The notion of edit-distance originated in a paper by
Wagner and Fischer [10] on comparing two character
strings. There are three kinds of edit operations:
deleting a character, inserting a character, and changing
one character into another. For a given assignment of
costs to all such edit operations, one can use dynamic
programming to compute the minimum-cost sequence
of operations required to convert one given string to
another.
This notion has been generalized in several ways to
apply to trees. For example, instead of characters, we
have edge-labels. There are three edit operations: con-
tracting an edge with a particular label, "uncontract-
ing" an edge and giving it a particular label, and chang-
ing the label. There are polynomial-time algorithms to
compute the minimum-cost sequence of operations re-
quired to convert one given tree to another.
~arch supported by NSF Grant CCR-9700146. Department
of Computer
Science, Brown
University, Providence, RI. Email
~ddresses
are {kle£n, snt}@cs.brown, edu.
?Department of Engineering, Brown University, Providence,
RI. kimia@lems, broTcn, edu
The vision researchers (Kimia and Sharvit) con-
cluded that these basic operations were not sufficient for
the computer-vision application, and proposed an alter-
native set of edit operations. The algorithms researchers
(Klein and Tirthapura) developed an algorithm for com-
puting the edit distance of trees under the alternative
set of edit operations.
Klein has implemented a version of this algorithm,
and Kimia is experimenting with its application to
shape comparison.
2 Edit Operations for Shape
Comparison
Object recognition is an important task in computer
vision. While many approaches have been proposed for
shape comparison for the purpose of object recognition,
we focus here on a particular approach which does not
consider the two shapes to be matched
statically,
but
rather considers them in the context of an embedding
in a shape space with a dense collection of deformation
paths,
i.e.,
morphing sequences taking one shape to
another.
In this shape from deformation framework, similar-
ity between two shapes is related to the best deforma-
tion path between them: if there exists a short and sim-
ple path, then the two shapes are similar. Clearly, a con-
tinuum of deformation paths connect any two shapes,
which renders the task of characterizing them in a com-
putational framework difficult. This problem can be
resolved by creating an equivalence class of deforma-
tions which are then represented in the discrete do-
main. Specifically, the key to establishing this equiv-
alence class is to understand how the representation of
shape changes as the shape itself changes. We digress
to describe the representation first.
We represent shape by a
shock graph,
which is
constructed from the locus of the centers of maximal
circles which are at least bitangent to the boundary.
This locus is divided into branches which are the largest
segments with monotonically increasing or decreasing
radii. Note that radius is given the interpretation of
time in a scheme where waves are propagated from the
boundary, so that the shock locus is actually given a
dynamic interpretation of the path of a moving particle.
The nodes of the graph are the end points of these shock