You are on page 1of 14

Approximate Matching of Digital Point Sets

Using a Novel Angular Tree


Partha Bhowmick, Ranjan K. Pradhan, and Bhargab B. Bhattacharya, Fellow, IEEE
AbstractMatching and analysis of patterns or shapes in the digital plane are of utmost importance in various problems of computer
vision and pattern recognition. A digital point set is such a pattern that corresponds to an object in the digital plane. Although there exist
several data structures that can be employed for Approximate Point Set Pattern Matching (APSPM) in the real domain, they require
substantial modification to support algorithms in the digital domain. To bridge this gap, a novel data structure called angular tree is
proposed, targeting an efficient and error-controllable circular range query in the digital plane. The farthest pair of points may be used
as the starting correspondence between the pattern set and the background set. Several classical discrete structures and
methodologies of computational geometry, as well as some topological features of circles/discs in digital geometry, have been used in
tandem, for successful realization of the proposed APSPM algorithm in the digital plane. The APSPM algorithm based on the angular
tree has been implemented and tested on various point sets and the reported results demonstrate the efficiency and versatility of the
new data structure for supporting APSPM algorithms.
Index TermsApproximate matching, circular range query, digital geometry, point set pattern matching, polygonal range query.

1 INTRODUCTION
A
PPROXIMATE Point Set Pattern Matching (APSPM) is a
challenging problem having numerous applications in
the digital plane. Some of these applications are image
registration [40], [41], [44], object recognition [9], fingerprint
matching [13], [42], bioinformatics [30], [31], medical
imaging [45], human motion representation for gait
analysis, sports studies, animation, computer games [25],
[37], digital imaging and modeling [39], [51], drug design
[23], and vehicle tracking [48].
The underlying abstract problem of APSPM may be
envisaged as follows: If a board has some pins randomly
fixed on it (background set, Q) and another has some
randomly located holes (pattern set, 1), then, using the term
board synonymously with the term point set, the
APSPM problem is to check whether the board 1 can
somehow be placed on the board Q so that, in each hole of
1, we can see exactly one pin of Q. If no transformation is
allowed, then checking for a match simply means that we
have to place the board 1 over the board Q and count the
number of holes containing one pin each (see Fig. 1a).
Finally, (approximate) matching decision can be taken
based on the number of holes containing the pins. For
matching under transformation, the board 1 has to be
translated and/or rotated appropriately so as to maximize
the number of holes containing pins (Fig. 1b).
In a discrete domain, the location of each pin in Q is
constrained by its integer coordinates and each hole in 1 is
a digital disc having integer radius and having center with
integer coordinates. Further, for faster query processing,
each digital disc may be replaced by a suitable regular (real)
polygon with its center coinciding with the center of the
corresponding disc. The regular polygon should be such
that it should not produce a matching result different from
the one obtained with the digital disc. This can be
guaranteed if and only if there exists no grid point in the
digital disc that lies outside the polygon and, conversely,
there exists no grid point outside the digital disc that lies on
or inside the polygon. Such a polygon is said to be ideal.
In this paper (a preliminary version of which appeared
earlier [14]), we have shown that an ideal regular polygon
corresponding to a digital disc is analytically possible for
some of the digital discs, especially for the ones having
lower radii; for larger digital discs, approximate polygons,
tending to ideal ones, are possible, which would have very
low error rates. The usage of a regular polygon instead of a
digital disc for range query on a digital plane simplifies and
expedites the process. Polygonal range query can be
efficiently serviced by using an angular tree, a new data
structure, which is introduced in this paper. The proposed
angular tree is marked by its admissibility to a query on the
two-dimensional (2D) plane using any convex query
polygon of arbitrary shape and size. We have also shown
that, for a query in Q containing i points using such a query
polygon having an arbitrarily large number of vertices, the
worst-case time complexity of the proposed range query is
bounded by Oi and, hence, asymptotically independent
of the complexity (that is, the number of vertices) of query
polygon. For a smaller size query polygon, of course, the
query time is less and is bounded by Olog i.
IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 31, NO. 5, MAY 2009 769
. P. Bhowmick is with the Computer Science and Engineering Department,
Indian Institute of Technology, Kharagpur, India 721302.
E-mail: pb@cse.iitkgp.ernet.in, bhowmick@gmail.com.
. R.K. Pradhan is with Tata Consultancy Services, India, Nilkunthya, East
Midnapur, India 721627. E-mail: ranjan.p@tcs.com.
. B.B. Bhattacharya is with the Advanced Computing and Microelectronics
Unit, Indian Statistical Institute (ISI), 203, B.T. Road, Kolkata, India
700108. E-mail: bhargab@isical.ac.in.
Manuscript received 17 July 2006; revised 24 Jan. 2007; accepted 23 July
2007; published online 11 Oct. 2007.
Recommended for acceptance by R. Klette.
For information on obtaining reprints of this article, please send e-mail to:
tpami@computer.org, and reference IEEECS Log Number TPAMI-0530-0706.
Digital Object Identifier no. 10.1109/TPAMI.2007.70812.
0162-8828/09/$25.00 2009 IEEE Published by the IEEE Computer Society
In this work, we have chosen a regular convex polygon
instead of a general convex polygon to approximate a
digital disc in order to substitute a circular region of query
by a polygonal range query since the former offers some
symmetry (in resemblance to the 8-axis symmetry of a
digital disc) as opposed to the latter. In fact, we have used a
regular 2/-gon / ! 2 to implement our APSPM algorithm
since each edge c of a regular 2/-gon has a symmetric
edge c
0
in the same direction as that of c. This, in effect,
reduces the dimensionality of the associated angular tree
and hence reduces subsequent computations because of
fewer transformed axes (as the directions of the axes are
given by those of the edges of the query polygon).
For a better approximation of the digital disc, the number
of vertices of the regular polygon may be increased for
improved matching. However, the space and time complex-
ities of the allied algorithms and the dimensionality of the
supporting data structures will increase significantly.
Having an approximating regular polygon with fewer
vertices (with a trade-off on the acceptable error part) will
simplify the query process and expedite the subsequent
matching process with desired accuracy. In most of the
practical applications related to digital images, the circular
ranges used in approximate matching are found to have
reasonably low radii. Thus, an approximating polygon
requires only a few vertices to achieve a desired level of
matching accuracy. For instance, in fingerprint matching
[13], [15] using the algorithms of APSPM, the circular range
query is evoked for a circular range with radius not
exceeding 10 pixels, which can be ideally replaced by a
regular polygon.
Several methods on APSPM are available in the
literature, most of which aim at matching in the real
domain. Discussions on these algorithmic techniques for
shape matching, simplification, and morphing using range
search may be found in the survey paper by Agarwal and
Erickson [1]. Typically, rectangles, half spaces, simplices, or
balls are used for range queries. Implementations of these
real-domain algorithms in the digital plane, however, pose
difficult problems because of the complexity of the under-
lying data structures, which have to be tailored appro-
priately to suit the digital domain. A few empirical methods
for geometric pattern matching algorithms in the digital
space have been reported earlier [27], [35], [44], which are
usually based on an exhaustive search of the transformation
space with suitable pruning techniques.
In this paper, we present a novel data structure called
angular tree that can be deployed in the 2D digital space (and
in the 2D real space also, if required) and whose (angular)
precision can be controlled depending on the requirement.
The angular tree can be used for (regular) polygonal
partitioning of 2D digital points to enable the circular range
query required for the algorithm on APSPM in the digital
plane. Since it has been shown [14] that a digitally circular
range query can be well-approximated by a regular (real)
polygon in 2D, a circular range query may be replaced by the
correspondingpolygonal range query, therebyproducingthe
desired results of approximate matching (of point sets) for
practical applications related to digital images. The process
has been further expedited by considering the farthest point
pair (as the first correspondence between two point sets) for
initial anchoring, whose rationale is also given in this paper.
Relevant discrete structures and methodologies of computa-
tional geometry have been used along with some geometric
features of digital discs for a successful realization of the
APSPM algorithm.
A short schematic diagram of our solution on a small
instance of the APSPM problem is shown in Fig. 2. Here, the
approximation parameter is c 3, which is the radius of the
circular region/disc centered about the concerned point of
the point set in the digital plane. The pattern set 1 contains
nine points (colored black) and the background set Q
contains 10 points (colored green). The points of both 1 and
Q have been labeled with their index numbers increasing
from left to right for the sake of easy readability. In the
actual problem, however, the points of 1 and Q are
arbitrarily numbered. After anchoring the farthest point
pair hj
1
. j
9
i of 1 with (the c-neighborhood of) the point pair
h
2
.
10
i of Q, each other point of 1 is searched in Q using a
(regularly shaped) polygonal (hexagonal in this instance)
range query that replaces the corresponding (digital)
770 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 31, NO. 5, MAY 2009
Fig. 1. Approximate matching of point sets in the real plane. (a) Without
transformation. (b) With transformation.
Fig. 2. A small instance of the proposed matching scheme in the digital
plane for approximation parameter c 3.
circular range query in the point set Q. Every circular/
polygonal range is defined with the corresponding point of
1 as center. The polygonal range query in Q is realizable by
the angular tree defined on Q proposed in this paper (not
shown in this diagram). It may be noticed that there may be
some point j
3
in 1 for which the (circular range) query
does not return any point from Q. There may be also some
point j
2
in 1 for which the query may return multiple
points (
3
and
4
) from Q, or there may be multiple points
(j
6
and j
8
) in 1 returning the same point
9
from Q. We
have considered all of these cases with proper treatments in
our algorithm.
2 APPROXIMATION OF A DIGITAL DISC BY A
REGULAR POLYGON
An efficient approximation of a real circle/disc from the
continuous domaintothedigital domainowes its origintothe
early adoption of scan-conversion techniques [8], [18], [21],
[38] and their subsequent improvements [17], [33], [43], [53].
Apart from this well-researched problem on construction of
circles/discs in digital space, the anisotropic and irregular
nature of a circle/disc in the digital space (opposed to its
infinitelysymmetrical propertyinthe real domain) shapes up
an engrossing area involving circles and circular arcs in the
digital domain. Some of these works on digital circles and
related problems are polygonal approximation of digital
circles [14], [32], characterization of digital circles [28], [52],
parameterization of circular arcs [50], [54], etc.
In a recent work [14], it has been shown that ideal
regular polygons are analytically possible to construct for
some of the digital discs, especially for the ones having
lower radii, and, for those with higher radii, ideal regular
polygons are rarely possible. However, in reality (as
revealed by exhaustive procedural results), approximate
polygons, tending to ideal ones, are possible, which would
have very low error rates. The conditions that guarantee
that an ideal regular polygon exists corresponding to a
digital disc and those without which its existence becomes
uncertain have also been reported. Furthermore, when the
complexity (that is, the number of vertices) of the ideal
regular polygon is high or when an ideal regular polygon
does not exist, a regular polygon with fewer vertices can be
considered for a useful approximation of the ideal regular
polygon. Results in Section 5.1 demonstrate the various
criteria of approximation and the associated errors.
A disc D. i in IR
2
, : r

. y

2 IR
2
and i 2 IR

being
its center and radius, respectively, can be realized in ZZ
2
by
the corresponding digital disc, namely, D. i, in
several ways [4], [5], [47], some of which are given as
follows (see Fig. 3):
D. i
Dc. , j 2 ZZ
2
: ioniddj. c ,

for Type 1.
D. , j 2 ZZ
2
: ioniddj. ,

for Type 2.
D. i j 2 ZZ
2
: dj. i

for Type 3.
8
>
<
>
:
where dj. is the euclidean distance between j and
, ionidr br 0.5c for r 2 IR, , ionidi, and
c ionidr

. ionidy

.
It is known that [4], [5], [52] when D. i is discretized
without rounding and i as mentioned above, the result
(Type 2) is not necessarily same as Type 1 digital disc.
Another procedure [52] to obtain a digital disc is to have its
center and radius i the same as those of the given real
disc such that, finally, each grid point of the digital disc
(Type 3) has distance not exceeding i as measured from .
Thus, contrary to Type 1, the center or/and radius (of the
digital discs) are not necessarily integers in Types 2 and 3.
Since, for an APSPM involving point sets in ZZ
2
, the
coordinates of the center and radius of the digital disc for
a circular range query are integers, we have considered only
Type 1 digital discs. Nevertheless, the other types may be
investigated for exploring other possible applications in the
digital plane.
The Type 1 digital disc, DO. ,, is given by the union of
the set of points defining the corresponding digital circle,
CO. ,, and the set of grid points lying inside CO. ,,
where O denotes (0, 0). The digital circle CO. ,, in turn, is
obtained from the corresponding real circle CO. , using
the 8-axis symmetry of digital circles [18], [24]. Further, each
point i. , of Dc. , with center c : r
c
. y
c
2 ZZ
2
has one-
to-one correspondence with a unique point i
0
. ,
0
of DO. ,,
which is given by i i
0
r
c
, , ,
0
y
c
. Hence, we can get
a digital disc Dc. ,, provided that DO. , is known.
A pertinent question in this context is whether there
always exists such a regular polygonal enclosure for a
digital circle Cc. , and the corresponding digital disc,
Dc. ,, thereof. As shown in [14], a regular polygonal
enclosure for Cc. , certainly exists, provided there exists a
grid point j in Cc. , such that j has simultaneously the
maximum isothetic distance, namely, c
j
, and the maximum
radial distance, namely, c
j
, from Cc. ,. Here, the isothetic
distance of j from Cc. , is given by the minimum of the
horizontal distance and the vertical distance (in euclidean
metric space on IR
2
) of j from Cc. ,, whereas its radial
distance indicates its (euclidean) distance from Cc. ,
(explained later in Fig. 11). In short, if there exists a grid
point j 2 Cc. , such that c
j
max c
i
: i 2 Cc. , f g and
c
j
max c
i
: i 2 Cc. , f g, then the existence of a regular
polygonal enclosure for Cc. , is certain; otherwise, it is
uncertain. In Section 5, we have given some experimental
results on (exact/approximate) polygonal enclosures of
digital discs, which testifies the feasibility of replacing a
(digitally) circular query by a regular polygonal range
query. This, in turn, will lead to the implementation of an
efficient APSPM algorithm in 2D digital space, as explained
in Section 3.
BHOWMICK ET AL.: APPROXIMATE MATCHING OF DIGITAL POINT SETS USING A NOVEL ANGULAR TREE 771
Fig. 3. Digital discs obtained by three different procedures on
discretization of a real disc with center 0.25. 0.00 and radius
i 4.90. (a) Type 1. (b) Type 2. (c) Type 3.
We have shown that, for all digital discs, especially for
most of the discs with radii exceeding 10 units, although
ideal enclosing polygons do not exist, it is possible to
construct very good approximate polygons with minor
error margins. The error of approximation, as testified by
the error distribution in Section 5, depends on the number
of vertices of the approximate polygon. Given the radius
, : c
1
of a digital disc and the admissible error in its
polygonal approximation, we can determine the (even)
number of vertices of the resultant polygon, as explained in
Section 3.
3 APPROXIMATE POINT SET PATTERN MATCHING IN
THE REAL PLANE
In APSPM, given two point sets 1 and Q, the problem is
to find a transformation, matching each point j 2 1 into
the c-neighborhood c ! 0 of some unique point 2 Q. It
has two broad variations: pattern matching and largest
common point set. In the pattern matching problem, given
1 and Q, j1j i, jQj i, with i i and c ! 0, it is
required to find a transformation T such that
jdT1. Qj c. The largest common point set problem
means, finding a transformation T and a set 1
0
1, such
that j1
0
j ! i
min
and jdT1
0
. Qj c. (T1 is the point set
after applying the transformation T to 1 and jdT1. Qj
denotes the maximum distance in the set of distances
between the corresponding points of T1 and Q.)
If c 0, then each of the above problems reduces to Exact
Point Set Pattern Matching (EPSPM); otherwise, it is
APSPM under c. The APSPM problem again has two
versions: decision problem and optimization problem. A
decision problem is to find whether or not 1 and Q
(approximately) match for a given value of c; the optimiza-
tion problem determines the optimized value of c so that
they match under c. This paper focuses on the APSPM
decision problem with references to EPSPM depending on
the relevance.
3.1 Existing Algorithms
Several methods have been developed in the past for solving
the pattern-matching problem. It is not difficult to designand
implement a polynomial time algorithm for EPSPM under
rigid motion, but the challenge lies in the APSPM version. A
brief overview of some existing algorithms for both types of
pattern matching is given below.
3.1.1 String Matching Algorithm
A problem on EPSPM can be reduced to string matching,
provided j1j jQj i. There exist several forms of this
class of algorithms with Oilog i time complexity [7], [20].
The polar coordinates of the points in 1 and Q with respect
to their geometric centroids are used to prepare their
lexicographically ordered lists (angle first, distance second),
L
1
and L
Q
. Then, the exact match of 1 with Q is obtained
by checking whether L
Q
is a substring of L
1
under any
cyclic shift, using a fast string matching algorithm. Thus, 1
and Q are exactly congruent if and only if the algorithm
gives a positive answer.
3.1.2 Alignment Scheme in EPSPM
Here, j1j : i and jQj : i are usually unequal. Without
loss of generality, if i i, then 1 Q is considered as a
valid match [16]. The (euclidean) distances for all point
pairs in the background set Q are stored in an ordered list,
1
Q
; moreover, for each point of Q, the distances of all
other points of Q from are stored in a separate ordered list,
1

Q
. During matching, an arbitrary point pair of 1 is
aligned with each of the / matching point pairs of Q, as
found from 1
Q
. After applying the necessary transforma-
tion T to 1, if the points of T1 are found to match with
points of Q (verified from the 1

Q
s), then Q matches with 1
under T; if no such T exists, then Q does not match with 1.
Construction of 1
Q
and 1

Q
s needs Oi
2
log i time,
whereas the (successful or unsuccessful) matching time is
bounded by O/ilog i Oii
4,3
log i since the max-
imum number / of a particular distance in Q is bounded by
di
4,3
e [49].
3.1.3 Alignment Scheme in APSPM
Different alignment schemes for APSPM problems have
been reported earlier [3], [6], [22]. Given c as the euclidean
tolerance for matching 1 and Q under arbitrary rigid
motions, a valid matching is said to exist in this scheme,
provided that each point in 1 lies in the (c-)neighborhood of
some point in Q. Mapping two points j. j
0
2 1 onto the
(circular) boundaries of .
0
2 Q leaves one degree of
freedom, which is parameterized by the angle c 2 0. 2
between the vector j and the horizontal line through . A
point j
00
2 1 n fj. j
0
g will trace an algebraic curve of
degree 6 which intersects the boundary of the disc of
radius c with center at some point
00
2 Q at most 12 times.
Thus, there can be at most six intervals of c for which j
00
lies
in the neighborhood of
00
. The parameter space 0. 2 is,
therefore, partitioned into Oi
2
intervals, each interval
corresponding to a unique point pair in 1 so that, for all c in
one interval, the points of 1 are mapped into the
neighborhoods of points in Q. All of these relationships
are represented as edges in a bipartite graph whose two
sides of nodes are 1 and Q. The decision problem has a
positive solution if there is some c for which the
corresponding graph has a perfect matching. This is
checked by finding the graph for the first subinterval of
0. 2 and constructing a maximum matching for it. Next,
while traversing the subintervals from left to right, the
maximum matching is updated until a perfect matching is
found or it turns out that none exists.
Apart from the fact that the total runtime of the above
algorithm is Oi
8
, determining the intersection points of
the curve of degree 6 with circles poses nontrivial numerical
problems. For easier variations of the one-to-one matching
problem, simpler and faster algorithms were found, for
example, for the case of translation only, geometric
arguments have been used in [22], whereas in [6],
algorithms have been proposed assuming that the
c-neighborhoods of the points are disjoint. There are also
several other algorithms based on the alignment scheme,
772 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 31, NO. 5, MAY 2009
1. , is used to represent the radius of a digital circle/disc in this section,
whereas , is replaced by c in the subsequent sections since the latter is
conventionally used to indicate the measure of approximation in an APSPM
and we use this to define the radius of a digital disc involved in the
approximation procedure.
such as Basic Alignment [26], Multiple Grid [36], a
comparative study of which appeared in [2].
3.1.4 Hausdorff Metric
A widely used metric for approximate matching of the
point set 1 with the point set Q is the Hausdorff
distance [34], [35], [44]. If j1j i, jQj i, and i i,
then the Hausdorff distance from 1 to Q is given by
/1. Q maxfminfdj. : 2 Qg : j 2 1g, where dj. is
the euclidean distance between j and . Thus, /1. Q
denotes the smallest amount by which we need to grow
the points of Q in order that all points of 1 are covered by
the grown set. Hence, given the space of transformations ,
1 is said to match with Q within a tolerance parameter c,
provided that /

1. Q minf/T1. Q : T 2 g c.
For approximate matching under arbitrary rigid motion,
the concept of dynamic Voronoi diagram is used [34],
which is the subdivision of the three-dimensional space-
time whose cross section at a time t equals the Voronoi
diagram at t. The upper bound on the complexity of the
dynamic Voronoi diagram, hence obtained from the
number of topological changes undergone by the Voronoi
diagram with passage of time, is subsequently used to show
that the time complexity of an optimal match between two
point sets using Hausdorff distance is Oi i
6
logii.
3.1.5 u-Approximate Pattern Matching
In this framework [29], for a given tolerance c 0 to
solve the approximate congruence, defined as
max /

1. Q. /

Q. 1

, between the point sets 1 and
Q, the process of approximation is further relaxed by
allowing to give up, if c is found to be too close to
c

1. Q at any point of time, which, however, may


incur a large computing time in case of no approximation.
Further, an extra parameter, namely, u 0, that corre-
sponds to the accuracy of approximation is required to
take the matching decision of 1 with Q as follows: 1) If
c

c, then return a transformation T 2 such that


/T1. Q 1 uc, 2) if c < c

1 uc, then return


the required transformation T, and 3) if c

1 uc, then
return NONE. The rationale is based on the fact that,
determining an answer close to the optimal is harder than
determining an answer that is further away. Hence, if c

lies
in the given approximation range c. 1 uc, then this
approach gives an answer close to the prescribed error
bound.
There exist several other techniques for solving APSPM
and related problems. For example, in [46], the digital
Voronoi diagram of the set is constructed using the
euclidean distances between the pairwise points/pixels of
an image. From this diagram, a certain planar graph is
constructed, which is a subgraph of the Delaunay triangu-
lation of the point set. Finally, the shape of the point set is
computed as a subgraph of the planar graph.
4 PROPOSED METHOD
We have proposed here a novel algorithm on the APSPM in
2D digital space that extends the conventional orthogonal
range query (for example, /d-tree [10], [11], [12]) to a
digitally circular range query, which in turn can be replaced
by a (regular and convex) polygonal range query, where the
polygon (in IR
2
) may be judiciously selected depending on
the value of the digital tolerance c : , since a digital disc of
radius , can be replaced by a suitable regular polygon, as
explained in Section 2.
The proposed algorithm uses a novel data structure
called angular tree, denoted as T
0
Q, defined on a point set
Q : f
1
.
2
. . . . .
i
g & ZZ
2
, that augments the structure of a
/d-tree [10] as follows: A /d-tree refers to a /-dimensional
tree. If a set of points is defined in a 2D space (real or
digital), then a /d-tree is a balanced tree, meant for
answering 2D orthogonal range query. Now, given the set
of points Q, the /d-tree defined on Q permits us to search
for points contained within a specified orthogonal box.
Since we need circular range query in Q, where the number
of vertices of the regular polygon that replaces a (digital)
disc of radius c depends on c and the desired degree of
precision associated with the query, we require angular
tree T
0
Q to suit our purpose. The speciality of T
0
Q is
that it accepts all possible values of /! 2 for a 2/-gonal
range query in Q. For instance, if / 3, then we can search
for points in Q within a (regular) hexagonal region. It may
be mentioned here that 0 indicates the internal angle of the
respective query polygon in the corresponding tree T
0
Q,
that is, 0 / 1,/ 180 degrees. Hence, specifying the
value of / as well describes (dimensionality of) T
0
;
therefore, we have used / synonymously with 0 in the
subsequent discussions.
4.1 Construction of an Angular Tree
To illustrate the construction of an angular tree and
associated operations, we start with / 2 and then go for
the generalization. For / 2, we split the set Q of i points
by a horizontal (median) line at the root dcjt/ 0 of the
tree into two subsets, namely, Q
1
and Q
2
, whose sizes differ
by at most unity. The splitting line being stored at the root
and Q
1
and Q
2
being stored in the respective left and right
subtrees of the root, Q
1
and Q
2
are subsequently partitioned
recursively by appropriate vertical and horizontal (median)
lines alternately to obtain the desired T
0
for / 2. Thus, for
/ 2, we split a region by a horizontal line (that is, a 0

line)
at a node, if its depth is even, and by a vertical line (that is, a
90

line) at a node, if its depth is odd. An instance of T


0
for
/ 2 is shown in Fig. 4, which indicates that, for / 2, T
0
is
structurally same as the corresponding 2D /d-tree.
In general, if the splitting line be inclined at an angle c
with the horizontal line, then, at depth d, we have
c d iod / 180,/. For example, for / 3, we split
Q by a 0

line at depth d 0 (root), by a 60

line at d 1, by
a 120

line at d 2, by a 0

line at d 3, by a 60

line at
d 4, and so forth. The angular tree for / 3 correspond-
ing to a small instance of Q is shown in Fig. 5. The algorithm
BUILD-ANGULAR-TREE for construction of T
0
Q for any
given value of / ! 2 is shown in Fig. 6.
In order to accelerate the repetitive procedure of
median extraction in Step 5 of BUILD-ANGULAR-TREE,
we have presorted the points of Q in / ordered lists,
namel y, L
c
Q for c 0. . 2. . . . . / 1, where
180,/. Each L
c
Q stores the points in nondecreasing
order of their projections (transformed coordinates) along
the line (transformed axis) at an angle of 90

c
BHOWMICK ET AL.: APPROXIMATE MATCHING OF DIGITAL POINT SETS USING A NOVEL ANGULAR TREE 773
measured with respect to r-axis in the anticlockwise
direction. Hence, the time complexity for the preproces-
sing (that is, presorting) phase is T
1
O/ilog i.
Each recursive call for building the left and the right
subtrees (Step 7 and Step 8) has an input of at most di,2e
points and all other operations (including the median
finding on a presorted list) require constant time. Hence,
after preprocessing, the time to construct T
0
is
T
2
i
O1 if i 1.
O1 2T
2
di,2e if i 1.
&
which solves to Oi. Thus, the total time complexity for
building T
0
Q is Ti T
1
i T
2
i O/ilog i. How-
ever, without presorting, eachrecursive call inStep5 requires
Oi time [19], whereby T
2
i Oi 2Tdi,2e if i 1 or
T
2
i Oilog i, which yields Ti Oilog i.
Space complexity. At each step of the algorithm, a region is
recursively split into two subregions whose points differ in
number by at most unity. The height of T
0
Q is, therefore,
bounded by Olog i, where the total number of (internal
and terminal) nodes is Oi. For a fixed value of /, the
building of T
0
Q needs Oilog i time, which is indepen-
dent of / (and of preprocessing, thereof)
2
and, hence, we
have the following fact:
Fact 1. An angular tree T
0
Q for a point set Q of i points needs
Oi space and the tree can be constructed in Oilog i time
with no preprocessing or, alternatively, in O/ilog i time
with preprocessing for presorting the points with respect to
their transformed coordinates.
4.2 Searching in an Angular Tree
For / 2, searching of points would be done in T
0
inside a
rectangular boundary. Similarly, for / 3 or 4, a searching
has to be performed in a hexagonal region or an octagonal
region, respectively. An example of an octagonal query /
4 in T
0
is shown in Fig. 7, in which the query polygon 1 is
sufficiently small so that at most one point of Q lies in 1.
The search starts from the root of T
0
Q, follows the right
path for d 0 and d 1, and bifurcates at d 2 as the
corresponding node |
3
intersects 1 indicating that 1 has
intersections with both the regions divided by |
3
. At each
subsequent node, depending on whether or not the
corresponding line of division intersects 1, the decision is
taken for traversing the left path and/or the right path from
the concerned node. In the leaf level,
1
corresponds to the
leftmost node and
5
corresponds to the rightmost node at
which the respective searches along the leftmost path and
along the rightmost path terminate.
The query algorithm (Fig. 8) takes the root of T
0
and a
query range 1 as input. The query 1 is specified by 1) the
center j 2 ZZ
2
of the corresponding (regular) polygon, 2) the
perpendicular distance d of an edge of the polygon from its
774 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 31, NO. 5, MAY 2009
2. In our implementation, we have incorporated the preprocessing phase.
Without preprocessing, the construction of T
0
Q needs a linear-time
median finding algorithm, which, due to its high hidden cost (not reflected
in its asymptotic linear time complexity) caused by its inherent procedural
complexities, is computationally effective only when i is sufficiently large
(for example, when i ! 2. 048, as found in our experiments).
Fig. 4. A point set Q and its corresponding angular tree T
0
for 0 90

(that is, / 2), which resembles a 2D tree.


Fig. 5. The angular tree T
0
Q for / 3 corresponding to Q containing
12 points on 2D grid. If a point lies exactly on the median line, then
belongs to one of the two subsets of the partition, which is shown by
turning the median line around toward the region in which it is included,
for the sake of clarity. The dashed lines indicate the limiting lines of
icqioiioot associated with the root node of T
0
Q and the points f.
t
:
1 t 2/ 6g denote its vertices obtained from the intersections of
these limiting lines (Section 4.2).
center j, and 3) the number of edges 2/ of the polygon.
From this specification, the ordered set of 2/ vertices,
namely, \
1
: h.
t
: r
t
. y
t
2 IR
2
i
2/
t1
, is obtained for a low-
level description of 1, where .
1
in \
1
corresponds to the
left-bottom vertex of 1. Using a recursive procedure, the
query process reaches each node (that is, region) intersected
by/contained in 1. If the region icqioii corresponding to
a node i lies entirely inside 1 (that is, icqioii 1), then
all of the points (leaf nodes) stored in the subtree T
i
0
rooted at i are reported in Oi
i
time, where i
i
is the
number of points in T
i
0
. If icqioii \ 1 6 ;, then the
search proceeds along the appropriate subtree of i and if
icqioii \ 1 ;, then the search does not proceed down
below i (but possibly proceeds from some other node i
0
of T
0
).
The main test in the query algorithm is for the type of
intersection between 1 and icqioii. We compute
icqioii for each node i while constructing T
0
Q, using
the splitting line at i and the region of its predecessor
node. The region corresponding to the root node of T
0
Q
is given by (the ordered set of) / pairs of minimum and
maximum coordinates along the (transformed) axes. Thus,
if r
c
min
and r
c
max
denote the respective minimum and
maximum r
c
-coordinates 1 c / for the point set Q
(Fig. 5), then the region associated with the root of T
0
Q
is icqioiioot fr
c
min
. r
c
max
g
/
c1
.
From the above set, we can define the (ordered set of)
vertices of icqioiioot as \
ioot
.
t
: r
t
. y
t
f g
2/
t1
, where
the point of intersection between the lines
3
r
t
min
and r
t1
min
is
.
t
1 t / 1; between r
/
min
and r
1
max
is .
/
, between r
t
max
and r
t1
max
is .
t
/ 1 t 2/ 1, and between r
2/
max
and
r
1
min
is .
2/
(see Fig. 5).
The description of icqioi|
i
(and of icqioii
i
) in terms
of its vertices can be obtained from the vertices of
icqioiioot as follows: Since each vertex .
t
in \
ioot
is
the point of intersection between the limiting lines (say, r
t
min
and r
t1
min
, without loss of generality), the r
t
and
r
t1
-coordinates of .
t
become r
t
min
and r
t1
min
, respectively,
which are used to obtain its r. y coordinates for comput-
ing the other / 2 coordinates of .
t
. For instance, in Fig. 5,
the first two r
1
. r
2
coordinates of .
1
are r
1
min
and r
2
min
and its third r
3
coordinate is obtained from these two;
similarly, for .
2
, we have r
2
r
2
min
and r
3
r
2
min
, etc. The
other / 2 coordinates of .
t
are needed to find the
subregions of icqioiioot as discussed next.
When the first median line r
1
med
is used to split
icqioiioot, we search in \
ioot
for two pairs of consecutive
vertices, namely, .
t
. .
t1
and .
t
0 . .
t
0
1
, such that r
1
med
lies
between r
1
-coordinates of .
t
. .
t1
and those of .
t
0 . .
t
0
1
.
(In Fig. 5, the first median line is |
1
and the corresponding
pairs of consecutive vertices are .
2
. .
3
and .
4
. .
5
.)
Subsequently, the fact that the median line r
1
med
intersects
the two edges (of icqioiioot) defined by .
t
. .
t1
and
.
t
0 . .
t
0
1
at two points, .
0
and .
00
, is used to construct the
respective vertex sets for the left and the right subregions of
icqioiioot a s \
|
i
f.
1
. . . . . .
t
. .
0
. .
00
. .
t
0
1
. . . . . .
2/
g a nd
\
i
i
f.
0
. .
t1
. . . . . .
t
0 . .
00
g. Continuing this process, we ob-
tain the vertex set \
i
for each node i of T
0
Q from the
vertex set \
i
of its parent node i by considering the
points of intersection of the median line at i with the two
concerned edges of \
i
.
The low-level description of the query polygon 1, as
described above, enables checking the type of intersection
between icqioii, which is performed as follows:
. If all vertices in \
i
lie inside 1, then icqioii 1,
. If no vertex in \
i
lies inside 1 and no vertex in 1 lies
inside \
i
, then icqioii \ 1 ;.
. Failures of the above two cases imply that icqioii
has partial intersection with 1.
To ascertain whether a vertex n : r
n
. y
n
2 \
i
lies
inside 1 (and whether a vertex of 1 lies inside icqioii),
we check whether n lies to the left of each edge c
t
, directed
from .
t
: r
t
. y
t
2 \
1
to .
t1
: r
t1
. y
t1
2 \
1
. This is
done by simply computing the sign of the determinant,
1c
t
. n :
1 r
t
y
t
1 r
t1
y
t1
1 r
n
y
n

.
since n lies to the left of c
t
if and only if 1c
t
. n 0.
For a circular range query, 1 is specified by the center
and the radius c of the query (digital) disc. Therefore,
whether a vertex (or a grid point) j lies in 1 (in the above
three cases and in Step 2 in Fig. 8) can be decided in
O1 time by checking whether ionid dj. c. Such a
check is faster and easier with respect to the procedure
using 1, which needs O/ time if 1 has O/ edges.
However, we have to look at 1 when 1 is a general convex
polygon and not induced by a digital disc. Henceforth, in
this paper, we consider 1 as a regular polygon with
2/ vertices.
To estimate the time complexity of searching against a
query polygon 1 with 2/ vertices and arbitrary size (that is,
an arbitrarily large value of the perpendicular distance d of
an edge of 1 from its center j) in T
0
Q, let i
0
i be the
number of reported points. Then, the total time for
reporting these i
0
points after (complete) traversal of the
associated subtrees (Step 4 and Step 8) of T
0
Q is
T
1
i Oi
0
. Apart from the traversal of these subtrees,
the searching procedure recursively visits some nodes that
BHOWMICK ET AL.: APPROXIMATE MATCHING OF DIGITAL POINT SETS USING A NOVEL ANGULAR TREE 775
Fig. 6. Algorithm for constructing the angular tree T
0
Q corresponding
to the 2D point set Q.
3. Here, we denote the line r
t
r
t
min
by r
t
min
for simplicity.
are not in these subtrees (Step 6 and Step 10). Since 1 has a
nonempty intersection with icqioii corresponding to
each such node i (by the conditions of if statements in
Step 5 and Step 9), the maximum path length (in T
0
Q) for
the searching recurrence is given by the maximum number
of regions intersected by an edge of 1 or, equivalently, by a
line having any one of the / possible slopes corresponding
to / numbers of transformed axes. Without loss of general-
ity, let us consider a horizontal line | for this purpose. Such
a horizontal line intersects the regions whose nodes
represent horizontal splitting lines in T
0
Q. Clearly, the
first horizontal splitting line is the root node depth 0,
the second one is at depth /, the third one at depth 2/,
and so on. For instance, for / 4, in Fig. 7, the node
representing |
1
is the first horizontal splitting line, the nodes
representing |
6
and |
7
are the next ones, etc.
Now, at depth /! 0, T
0
Q contains 2
/
nodes,
each representing a region containing at most
d. . .
1
2
d
1
2
d
i
2
ee . . . upto /e di,2
/
e points. If the horizontal
line | lies below the first horizontal splitting line,
namely, |
1
, then, in the worst case, | may intersect all
the regions below |
1
. Similar arguments hold if | lies
above |
1
. Hence, half of the nodes at depth /, that is,
2
/1
nodes, correspond to the maximum number of
regions intersected by the horizontal line |. Thus, we
have to count the number of intersected regions in the
subtrees rooted at these 2
/1
nodes recursively (Step 6
and Step 10). Also, the regions from (and including)
level 0 to (and including) level / 1 that are
intersected by | are those corresponding to the root, one
of the two children of the root, two of the four
grandchildren of the root, and so on, which counts to
1
1
2
2
1
2
2
. . . 2
/1
1 2
/1
1 2
/1
.
Hence, the recursive equation for the number of regions
intersected by any line (the time complexity for recursive
traversal of T
0
Q, there of) is given by
T
2
i
Oi if i < /.
2
/1
2
/1
T
2
i,2
/

if i ! /.
&
which solves to T
2
i Oi
log
2
/
2
/1
Oi
/1,/
. For an
arbitrarily large value of /, therefore, T
2
i Oi. Hence,
the total searching time in T
0
Q is Ti T
1
i T
2
i
Oi
/1,/
i
0
or Ti Oi
/1,/
if i
0
Oi
/1,/
;
therefore, for a polygonal query region with an arbitrarily
large size and with an arbitrarily large number of vertices,
we get Ti T
1
i T
2
i Oi i
0
Oi. These
findings are put together in the following fact:
Fact 2. The worst-case polygonal range query with an arbitrary
regular polygon having 2/ vertices in an angular tree T
0
Q,
storing a set Q of i points, needs Oi time.
Searching with a small query polygon 1 that always
contains at most one point of Q (as found in practice [14]),
however, would proceed along a single path starting from
the root and ending at the leaf node that lies inside 1 for
each edge of 1, being suitably small in length, would
intersect just one or two regions at each level of T
0
Q,
thereby curtailing the recursions (Step 6 and Step 10), for
example, Fig. 7. There will be at most 2/ regions having
nonempty intersections with 1 when it is sufficiently small
sized. For such an 1, therefore, the above search time
complexity has a poor bearing apropos the actual runtime.
Here, the bound for T
2
i is 2/ Olog i O/ log i,
which reduces to Olog i for a prescribed value of /; and
T
1
i is O1 i
0
1. Hence, the search time drops down to
Ti Olog i, giving the following fact:
Fact 3. A polygonal range query in an angular tree T
0
Q,
representing a point set Q of i points, needs Olog i time
with the hypothesis that the size of the query polygon is small
enough so as to contain at most one point or a constant
number of points of Q.
776 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 31, NO. 5, MAY 2009
Fig. 7. An instance of range query with the query octagon 1 / 4 in an angular tree T
0
corresponding to a point set Q.
Fig. 8. Algorithm for searching in the angular tree T
0
Q.
It may be noted that, in the APSPM algorithm (Sec-
tion 4.3) and subsequent discussions, the circular range
query is considered to be appropriately small in size so that
the number of points reported against the query is a small
constant, which ensures Olog i time for each query in the
angular tree.
4.3 APSPM Algorithm Using Circular Range Query
For approximate matching of the pattern set 1 containing
i points with the background set Q containing i points, we
construct the angular tree T
0
Q corresponding to Q, which
is used for the circular/polygonal range query for each
point of 1. To negotiate the correspondence among the
points of 1 and Q, we adopt an alignment policy that
speeds up the matching process. We pick the point pair in 1
having the largest (euclidean) distance (in 1) to be anchored
near and aligned along a point pair in Q having its distance
matching within a tolerance of c. Such an act of choosing the
largest distance, failure of which is followed by repetition(s)
with the next largest distance(s), has an experimental
bearing on the frequency of distances in a (discrete/real)
point set (test results in Section 5) and also has a theoretical
basis that is given as follows:
Let o be a finite subset of the euclidean metric space IR
2
.
Let o and / be any two distinct points in o. Let L be the real
line segment joining o and / and having length 1. Let o
0
and
/
0
be two distinct points lying on the line segment L. Hence,
if o
0
and /
0
do not simultaneously coincide with the points o
and /, then the length 1
0
of the line segment L
0
joining o
0
and /
0
follows the relation:
0 < 1
0
< 1. 1
There may exist infinitely many such point pairs o
0
. /
0
on
L, each of which has the distance 1
0
. Thus, given two real-
valued distances, 1 and 1
0
, satisfying (1), we get infinitely
many point pairs having distance 1
0
and contained by a line
segment of length 1 that lies in o. Further, since there may
exist multiple (infinitely many, possibly) instances of line
segments having length 1 in o, we might get multiple
assemblages of infinitely many smaller line segments of
length 1
0
contained by the former line segments of length 1.
Apart from the distance 1 (that is, line segments of
length 1) in o, there may exist only two types of distances in
o, which may be classified into two disjoint sets given by
1 f1 : 1 < 1g and 1 f1 : 1 1g
so that 1 [ f1g [ 1contains all distances in o. No distance 1
in 1 will contain the distance 1 in o because a line segment
of length 1 cannot be made to lie on a line segment of
smaller length 1. However, a distance in 1 may contain the
distance 1
0
in o if the former is greater than the latter. Thus,
the set 1 may contribute 1
0
but never contributes 1.
Regarding the set 1, each distance 1 in 1 always
contains (infinitely many instances of) the distance 1, each
of which in turn contains (infinitely many instances of) the
distance 1
0
. Therefore, the frequency of 1
0
contributed by 1
is always greater than that of 1 contributed by 1. In
particular, the higher the ratio 1 : 1
0
, the greater will be the
frequency of 1
0
in 1 compared to that of 1 in 1.
As a result, the (continuous) probability density of 1
0
always exceeds that of 1 1
0
. The above arguments will
also hold true for the 2D digital space, although the
monotonically increasing nature of frequency with decreas-
ing distances in IR
2
would not satisfy in ZZ
2
due to the
anisotropic nature of ZZ
2
. Hence, we state the following fact,
whose bearing with the reality is evidenced by the plots in
Fig. 14 (Section 5).
Fact 4. Small distances are more frequent and large distances are
less frequent in a point set, whether real or discrete.
The proposed algorithm is given in Fig. 9. In this
algorithm, we consider T1 to be a valid match with Q
(Step 8), provided that the number of points in correspon-
dence between T1 and Q exceeds a certain factor, namely,
, of the maximum number of points (that is, mini. i),
possible to produce an ideal match between them.
Evidently, a match found with a low value of for two
given sets, 1 and Q, signifies a slackened approximation,
whereas that with a high value signifies a tight approxima-
tion. All of the results shown in Section 5 are with 1.
The time complexity of the proposed algorithm is
influenced by the number of failures for the misalignments
arising out of the mismatching transformations in Step 6. For
each such transformation T, all points in 1 are subject to
polygonal range queries in T
0
Q, which incurs Olog i time
per query, producing Oilog i time for i queries
corresponding to 1. Each possible alignment of a point
pair hj
0
. j
00
i of 1 with a matching pair h
0
.
00
i of Q involves
Oc
2
possible positions of j
0
in the c-neighborhood of
0
(that is, inside the digital disc with radius c and center
0
)
and each such position of j
0
in turn allows Oc positions of
j
00
in the neighborhood of
00
(which are the grid points of
the digital circle, having radius ioniddj
0
. j
00
and
BHOWMICK ET AL.: APPROXIMATE MATCHING OF DIGITAL POINT SETS USING A NOVEL ANGULAR TREE 777
Fig. 9. Algorithm on APSPM using angular tree.
center j
0
, lying inside the neighborhood of
00
), thereby
bringing in Oc
3
possible orientations of j
0
j
00
for (approx-
imate) alignment with
0

00
. Thus, the total complexity for all
possible alignments for a given (approximately matching)
pair of point pairs is Oc
3
Oilog i Oic
3
log i.
Since there are Oi
2
point pairs in 1 and each of
these point pairs may have to be approximately aligned
with any of the Oi
2
possible point pairs of Q, the
worst case time complexity for finding out an approx-
imate match (successful or unsuccessful) between the
point sets 1 and Q in the 2D digital space is given by
Ti. i. c. / Oi
2
i
2
Oic
3
log i Oc
3
i
3
i
2
log i,
which reduces to Oi
3
i
2
log i for a prescribed value of c.
Hence, we observe the following fact on the time complex-
ity for approximately matching a 2D point set 1 with
another set Q.
Fact 5. For an c-ojjioriiotc matching of 1 containing
i points with Q containing i points in ZZ
2
using the angular
tree T
0
Q, the worst-case time complexity is given by
Oi
3
i
2
log i for a given value of the approximation
parameter c.
From the above results and discussion, it is clear that the
angular tree and the APSPM algorithm proposed here have
reasonable complexities and are readily realizable for
relevant applications involving point sets in the digital
plane. We have implemented and tested the APSPM
algorithm using the angular tree, which has produced
encouraging results, as shown in Section 5. A comparative
study of some existing point set pattern matching algo-
rithms with the proposed algorithm using angular tree is
given in Table 1, which indicates its readiness and usability
in the digital plane.
5 TEST RESULTS
5.1 Polygonal Approximation of Digital Discs
Exhaustive procedural checking has revealed that each of
the digital discs with radii , from 1 to 10 has a grid point j
that has simultaneously maximum isothetic distance and
maximum radial distance from Cc. ,, which implies that
each of them has a regular polygonal enclosure. To cite a
few more, for , 12-16. 20-25. 32. 33. 40, etc., the corre-
sponding digital discs possess regular polygonal enclosures
(Fig. 10). It is apparent in Fig. 10 that the chance of the
existence of a grid point j decreases as the radius of the disc
continues to increase. In other words, the existence of a
regular polygonal enclosure for a digital disc having radius
, becomes more and more uncertain as , becomes large.
Shown in Fig. 10 are two plotsone theoretical and the
other experimentalon the number of vertices of the
regular polygonal enclosures against the radii of digital
discs. The thin-lined vertical bars denote the theoretical
values of the number of vertices, namely, i, plotted against
the radii , of digital discs, for the regular polygonal
enclosures for the corresponding digital discs. The thick
vertical lines represent the corresponding minimum even
number of vertices, namely, i

, found experimentally, which


the regular polygonal enclosures should possess such that
each grid point of the digital disc Dc. , lies on or inside
the polygon and no grid point lying outside Dc. , lies on
or inside the polygon. It may be observed in this figure that,
for a digital disc having , 2 and whose regular polygonal
enclosure exists, i

is appreciably less than the correspond-


ing value of i, whose explanation is given as follows:
Let ` be the (euclidean) distance of each of the i

< i
vertices of the regular polygonal enclosure from the center
c of the corresponding disc Dc. , (Fig. 11). Then, each of
these i

vertices lies on Cc. `. Let .


t
and .
t1
be two such
adjacent vertices. If Cc. ,
j
represent the real circle
778 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 31, NO. 5, MAY 2009
TABLE 1
Comparison of Existing Methods with the Proposed Method
Fig. 10. Plotted against radius , are i (thin bar) and i

(thick line)the former being the theoretical number of vertices and the latter being an
experimental number of vertices of the regular polygonal enclosures of digital discs. See text for explanation.
centered at c and passing through j, where ,
j
denotes the
distance of j from c, then it may happen that each grid
point i
0
, lying outside Cc. ,
j
and inside Cc. `, always
lies outside the enclosing polygon. For instance, in Fig. 11,
the grid point i
0
lies outside the edge .
t
.
t1
and inside the
circle Cc. `.
For digital discs whose (ideal) regular polygonal en-
closures are not possible, which are found to be the majority
in the output of our program (a part of which shown in
Fig. 10), approximate polygonal enclosures with low error
rates are possible. Further, for large digital discs, we may be
interested in their regular polygonal enclosures with a small
number of vertices. In such a situation, the relative error
associated with the approximation of a digital disc by its
regular polygonal enclosure is important, which may be
obtained as follows:
Let P Cc. ,. 2/ represent the set of grid points lying on
and inside the approximate polygon with 2/ vertices, such
that Dc. , & P Cc. ,. 2/ , then the number of erroneous
grid points is given by P Cc. ,. 2/ n Dc. , j j; therefore,
the relative error of approximation is given by
error
P Cc. ,. 2/ n Dc. , j j
Dc. , j j
100%.
which falls off drastically as the number of vertices of the
approximate polygons increases, as is evident in Fig. 12. In
Fig. 13, a few approximate polygons have been shown for
, 8 to demonstrate the rapid convergence of the polygon
toward the ideal situation as the number of vertices
increases. Here, we have considered an even 2/ number
of vertices of the enclosing polygon simply for doubling the
axes of symmetry and for ease of implementation of the
APSPM algorithm.
5.2 Performance of Circular Range Query
Given a point set in IR
2
containing i points and a
(euclidean) distance d, it has been shown [49] that the
number of distinct point pairs having distance d may be as
high as di
4,3
e. Our experimental results, however, reveal
that the maximum observed frequency of a particular
(range of) distance in ZZ
2
is far short of the theoretical value.
We have generated 1,000 synthetic point sets, each set
Q containing 10 to 500 randomly located points in ZZ
2
and
have studied the change in frequency versus distance in
these sets, considering the following three parameters:
. i10 i 500 number of points in Q.
. d
min
5 d
min
25 minimum distance between
two distinct points in Q.
. 50 50 500 500 mi ni mum- ar ea
orthogonal region containing all points in Q.
For a few sample point sets, the trend of variation of the
(average) frequency and the corresponding standard devia-
tion versus the (average) distance have been shown in
Figs. 14a, 14b, and 14c. From these plots, it is evident that,
for a given point set, the number of occurrences of a
particular distance in the point set decreases as the distance
increases and vice versa. This corroborates the theoretical
interpretation of the frequency pattern of point-pair dis-
tances given in Section 4.3. In the matching algorithm,
therefore, we select the farthest point pair (since its
frequency is likely to be very small) from the pattern set
BHOWMICK ET AL.: APPROXIMATE MATCHING OF DIGITAL POINT SETS USING A NOVEL ANGULAR TREE 779
Fig. 11. Enclosing polygon with i

vertices for the digital disc Dc. ,.


The gray region denotes the region where each grid point i
0
, lying
outside Cc. ,
j
and inside Cc. `, always lies outside the polygon.
Fig. 12. Error (percent) of approximation plotted against the radii , of
digital discs and half the number of vertices of their regular 2/-gonal
enclosures. It is evident from the plot that, for a given radius ,, higher
values of / drastically reduce the error.
Fig. 13. Comparison of approximate regular polygons for a digital circle
with radius , 8. For other values of /, the corresponding errors (that is,
the number of grid points j lying outside the real circle and inside the
approximating polygon) are j/ 4. 5 8, j/ 6 4, j/ ! 7 0.
(a) / 2: j 68. (b) / 3: j 18. (c) / 4: j 8. (d) / 7: j 0.
as the first matching distance for applying the alignment
scheme (Step 5 of the algorithm in Section 4).
5.3 Execution Time
Given a prescribed value of c for c-approximation match, the
runtime of the proposed APSPM algorithm depends upon
two parameters:
. i the number of points in the pattern set 1.
. i the number of points in the background set Q.
Varying these two parameters, we have obtained two sets of
plots (Figs. 15a and 15b)one for i and the other for i
illustrating the variation of CPU time versus the anchoring
distance. We have also considered the dimension / of the
angular tree T
0
Q definedonQandthat its effect onthe CPU
time is muchless evident fromthe plots showninFig. 15c. The
algorithm has been implemented in C on SunOS Release 5.7
Generic of Sun_Ultra 5_10, Sparc, 233 MHz.
From the above plots, it may be concluded that the
runtime of the proposed APSPM algorithm increases with
the decrease in the distance of the point pair (in the pattern
set, 1) selected for anchoring. Hence, we select the pair
having the maximum distance in 1; in case it does not yield
a successful match, we choose the pair(s) with the next
maximum distance, and so on. Such a policy of selecting the
farthest point pair in 1 for anchoring with some suitable
point pair in the background set, Q, reduces the time
requirement to a great extent in real-time matching
applications, which is reflected in the plots in Fig. 15.
6 CONCLUSION
We have shown how a digital disc can be substituted by an
appropriate regular polygon so that a (digitally) circular
range query in ZZ
2
can be efficiently replaced by a polygonal
range query. Such a query for each point in the pattern set 1
can be performed efficiently on the background set Q by
using an appropriate data structure, namely, the angular
tree T
0
Q, defined on Q. The major contributions of this
paper may be summarized as follows.
780 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 31, NO. 5, MAY 2009
Fig. 14. Frequency distribution of distances (shown in uniform intervals
of size 10) for different values of i, d
min
, and . The histogram profiles
show the average frequencies and the points indicate the respective
standard deviations. (a) Frequency versus distance of point pairs for i
varying in three intervals 200 200. d
min
5. (b) Frequency
versus distance of point pairs for three different values of d
min
200 200. i 200. (c) Frequency versus distance of point pairs
for three different sizes of i 200. d
min
10.
Fig. 15. CPU time versus anchoring distance (shown in uniform intervals
of size 10) in case of successful matching the point set 1 containing
i points with the point set Q containing i points for different values of
i, i, / 200 200. c 6. (a) CPU time versus the anchoring
distance for different values of i i 200. / 4. (b) CPU time versus
the anchoring distance for different values of i i 200. / 4.
(c) CPU time versus the anchoring distance for different values of /
i 80-320. i 80-320.
Most of the existing approaches rely on orthogonal range
query. In our method, a (regular) polygonal approximation
of a circular query in the digital plane is computed. Such an
approximation ensures improved matching of a point in the
digital pattern set with the circular neighborhood of a
similar point in the digital background set. Further, for a
small disc, its polygonal approximation is almost error-free,
whereas, for a large disc, the approximation incurs a very
small error. The associated error can also be estimated
easily from the level of approximation.
Regarding polygonal partitioning of points, we have
proposed an efficient search tree in which the 2D points are
stored in accordance to their distribution in the digital
plane. The circular neighborhood of a point is defined by
the grid points of the corresponding digital disc with the
concerned point as center, which are finite (and small for a
small disc) in number. Hence, the approximate matching of
points in the digital plane can be nicely implemented by
using an angular tree that effectively limits the difficult
circular query to an easier polygonal query. Keeping in
mind the trade-off with space and time complexities, the
angular precision (and the error thereof) can be controlled
by varying the specification of the query polygon, depend-
ing on the application.
The proposed approach may be further studied for
finding the general solution of the APSPM problems in
higher dimensions. The possibilities lie in deriving the
regular (convex) polytope that would replace the regular
2D polygonal range query and in constructing the (general-
ized) angular tree based on median hyperplanes instead of
2D median lines. The allied procedures and associated data
structures, of course, would invoke higher complexities,
both in terms of developing theory and subsequent
implementation.
REFERENCES
[1] P.K. Agarwal and J. Erickson, Geometric Range Searching and Its
Relatives, Advances in Discrete and Computational Geometry,
B. Chazelle, J. Goodman, and R. Pollack, eds., pp. 1-56, Am.
Math. Soc., 1998.
[2] H. Alt and L.J. Guibas, Discrete Geometric Shapes: Matching,
Interpolation, and ApproximationA Survey, Report B 96-11,
Freie Universitat, 1996.
[3] H. Alt, K. Mehlhorn, H. Wagener, and E. Welzel, Congruence,
Similarity and Symmetries of Geometric Objects, Discrete and
Computational Geometry, vol. 3, pp. 237-256, 1988.
[4] E. Andres, Discrete Circles, Rings and Spheres, Computers and
Graphics, vol. 18, no. 5, pp. 695-706, 1994.
[5] E. Andres and M. Jacob, The Discrete Analytical Hyperspheres,
IEEE Trans. Visualization and Computer Graphics, vol. 3, no. 1,
pp. 75-86, Mar. 1997.
[6] E.M. Arkin, K. Kedmen, J.S.B. Mitchell, J. Sprinzak, and Werman,
Matching Points into Pair-Wise Disjoint Noise Regions: Combi-
natorials Bounds and Algorithms, ORSA J. Computing, vol. 4,
no. 4, pp. 375-386, 1992.
[7] M.D. Atkinson, An Optional Algorithm for Geometric Congru-
ence, J. Algorithms, vol. 8, pp. 159-172, 1998.
[8] N.I. Badler, Disk Generators for a Raster Display Device,
Computer Graphics and Image Processing, vol. 6, pp. 589-593, 1977.
[9] H.S. Baird, Model-Based Image Matching Using Location, MIT
Press, 1985.
[10] J.L. Bentley, Multidimensional Binary Search Trees Used for
Associative Searching, Comm. ACM, vol. 18, pp. 509-517, 1975.
[11] J.L. Bentley, Multidimensional Binary Search Trees Used in
Database Applications, IEEE Trans. Software Eng., vol. 4, no. 5,
pp. 333-340, 1979.
[12] M.D. Berg, M.V. Kreveld, M. Overmars, and O. Schwarzkopf,
Computational Geometry Algorithms and Applications. Springer,
2000.
[13] P. Bhowmick and B.B. Bhattacharya, Approximate Fingerprint
Matching Using Kd-Tree, Proc. 17th Intl Conf. Pattern Recognition,
vol. 1, pp. 544-547, 2004.
[14] P. Bhowmick and B.B. Bhattacharya, Approximation of Digital
Circles by Regular Polygons, Proc. Intl Conf. Advances in Pattern
Recognition, pp. 257-267, 2005.
[15] P. Bhowmick, A. Bishnu, B.B. Bhattacharya, M.K. Kundu, C.A.
Murthy, and T. Acharya, Determination of Minutiae Scores for
Fingerprint Image Applications, Intl J. Image and Graphics, vol. 5,
pp. 1-35, 2005.
[16] A. Bishnu, S. Das, S.C. Nandy, and B.B. Bhattacharya, An
Improved Algorithm for Point Set Pattern Matching Under Rigid
Motion, Proc. Fifth Italian Conf. Algorithms and Complexity, pp. 36-
45, 2003.
[17] J.F. Blinn, How Many Ways Can You Draw a Circle, IEEE
Computer Graphics and Applications, vol. 7, no. 8, pp. 39-44, Aug.
1987.
[18] J.E. Bresenham, A Linear Algorithm for Incremental Digital
Display of Circular Arcs, Comm. ACM, vol. 20, no. 2, pp. 100-106,
1977.
[19] T.H. Cormen, C.E. Leiserson, and R.L. Rivest, Introduction to
Algorithms. Prentice Hall of India, 2000.
[20] P.J. de Rezende and D.T. Lee, Point Set Pattern Matching in
d-Dimensions, Algorithmica, vol. 13, pp. 387-404, 1995.
[21] M. Doros, Algorithms for Generation of Discrete Circles, Rings,
and Disks, Computer Graphics and Image Processing, vol. 10,
pp. 366-371, 1979.
[22] A. Erafat and A. Itai, Improvements on Bottleneck Matching and
Related Problems Using Geometry, Proc. 12th Ann. ACM Symp.
Computational Geometry, pp. 301-310, 1996.
[23] P.W. Finn, L.E. Kavraki, J. Latombe, R. Motwani, C.R. Shelton, S.
Venkatasubramanian, and A. Yao, RAPID: Randomized Phar-
macophore Identification for Drug Design, Proc. Symp. Computa-
tional Geometry, pp. 324-333, 1997.
[24] J.D. Foley, A. van Dam, S.K. Feiner, and J.F. Hughes, Computer
GraphicsPrinciples and Practice. Addison-Wesley, 1993.
[25] M. Gleicher, Animation from Observation: Motion Capture and
Motion Editing, Computer Graphics, vol. 33, no. 4, pp. 51-55, 1999.
[26] M.T. Goodrich, J.B. Mitchel, and M.W. Orletsky, Practical
Methods for Approximate Geometric Pattern Matching Under
Rigid Motion, Proc. 10th Ann. ACM Symp. Computational
Geometry, pp. 103-113, 1994.
[27] M. Hagedoorn and R.C. Veltkamp, Reliable and Efficient Pattern
Matching Using an Affine Invariant Metric, Intl J. Computer
Vision, vol. 31, nos. 2/3, pp. 203-225, 1999.
[28] R.M. Haralick, A Measure for Circularity of Digital Figures,
IEEE Trans. Systems, Man, and Cybernetics, vol. 4, pp. 394-396, 1974.
[29] P.J. Heffernan and S. Schirra, Approximate Decision Algorithms
for Point Set Congruence, Computational Geometry: Theory and
Applications, vol. 4, no. 3, pp. 137-156, 1994.
[30] F. Hoffmann, K. Kriegel, and C. Wenk, An Applied Point Pattern
Matching Problem: Comparing 2D Patterns of Protein Spots,
Discrete Applied Math., vol. 93, pp. 75-88, 1999.
[31] L. Holm and C. Sander, Mapping the Protein Universe, Science,
vol. 273, no. 5275, pp. 595-602, Aug. 1996.
[32] P.I. Hosur and K.-K. Ma, A Novel Scheme for Progressive
Polygon Approximation of Shape Contours, Proc. IEEE Third
Workshop Multimedia Signal Processing, pp. 309-314, 1999.
[33] S.Y. Hsu, L.R. Chow, and C.H. Liu, A New Approach for the
Generation of Circles, Computer Graphics Forum 12, vol. 2, pp. 105-
109, 1993.
[34] D.P. Huttenlocher, K. Kedem, and J.M. Kleinberg, On Dynamic
Voronoi Diagrams and the Minimum Hausdorff Distance for
Point Sets under Euclidean Motion in the Plane, Proc. Eighth Ann.
ACM Symp. Computational Geometry, pp. 110-120, 1992.
[35] D.P. Huttenlocher and W.T. Rucklidge, A Multi-Resolution
Technique for Comparing Images Using the Hausdorff Distance,
Proc. Intl Conf. Computer Vision and Pattern Recognition, pp. 705-
706, 1993.
[36] P. Indyk, R. Motwani, and S. Venkatasubramanian, Geometric
Matching under Noise: Combinatorial Bounds and Algorithm,
Proc. 10th Ann. SIAM-ACM Symp. Discrete Algorithms, 1999.
BHOWMICK ET AL.: APPROXIMATE MATCHING OF DIGITAL POINT SETS USING A NOVEL ANGULAR TREE 781
[37] A. Jobbagy, E. Furnee, B. Romhanyi, L. Gyo ngy, and G. Soo s,
Resolution and Accuracy of Passive Marker-Based Motion
Analysis, Automatika, vol. 40, pp. 25-29, 1999.
[38] R. Klette and A. Rosenfeld, Digital Geometry: Geometric Methods for
Digital Picture Analysis. Morgan Kaufmann, 2004.
[39] B. Li and H. Holstein, Using k-d Trees for Robust 3D Point
Pattern Matching, Proc. Fourth Intl Conf. 3-D Digital Imaging and
Modeling, 2003.
[40] B. Likar and F. Pernus, Automatic Extraction of Corresponding
Points for the Registration of Medical Images, Medical Physics,
vol. 26, no. 8, pp. 1678-1686, 1999.
[41] J. Maintz and M. Viergever, A Survey of Medical Image
Registration, IEEE Eng. in Medicine and Biology Magazine, vol. 2,
no. 1, pp. 1-36, 1998.
[42] D. Maltoni, D. Maio, A.K. Jain, and S. Prabhakar, Handbook of
Fingerprint Recognition. Springer, 2003.
[43] M.D. Mcllroy, Best Approximate Circles on Integer Grids, ACM
Trans. Graphics, vol. 2, no. 4, pp. 237-263, 1983.
[44] D. Mount, N. Netanyahu, and J. Lemoigne, Improved Algo-
rithms for Robust Point Pattern Matching and Applications to
Image Registration, Proc. 14th Ann. ACM Symp. Computational
Geometry, pp. 155-164, 1998.
[45] J. Panek and J. Vohradsky, Point Pattern Matching in the
Analysis of Two-Dimensional Gel Electropherograms, Electro-
phoresis, vol. 20, pp. 3483-3491, 1999.
[46] S.K. Parui, S. Sarkar, and B.B. Chaudhuri, Computing the Shape
of a Point Set in Digital Images, Pattern Recognition Letters, vol. 14,
no. 2, pp. 89-94, 1993.
[47] M.L.V. Pitteway, Algorithm for Drawing Ellipses or Hyperbolae
with a Digital Plotter, The Computer J., vol. 10, no. 3, pp. 282-289,
1967.
[48] B. Soifman, D. Beymer, P. McLauchlan, and J. Malik, A Real-Time
Computer Vision System for Vehicle Tracking and Traffic Surveillance,
http://www.cs.berkeley.edu/pm/RoadWatch, 2004.
[49] I. Szekely, Crossing Numbers and Hard Erdo s Problems in
Discrete Geometry, Combinatorics, Probability, and Computing,
vol. 6, pp. 36-47, 1997.
[50] S.M. Thomas and Y.T. Chan, A Simple Approach for the
Estimation of Circular Arc Center and Its Radius, Computer
Vision, Graphics, and Image Processing, vol. 45, no. 3, pp. 362-370,
1989.
[51] G. Tian, D. Gledhill, and D. Taylor, Comprehensive Interest
Points Based Imaging Mosaic, Pattern Recognition Letters, vol. 24,
pp. 1171-1179, 2003.
[52] M. Worring and A.W.M. Smeulders, Digitized Circular Arcs:
Characterization and Parameter Estimation, IEEE Trans. Pattern
Analysis and Machine Intelligence, vol. 17, no. 6, pp. 587-598, June
1995.
[53] C. Yao and J.G. Rokne, Hybrid Scan-Conversion of Circles, IEEE
Trans. Visualization and Computer Graphics, vol. 1, no. 4, pp. 311-
318, Dec. 1995.
[54] P.C. Yuen and G.C. Feng, A Novel Method for Parameter
Estimation of Digital Arc, Pattern Recognition Letters, vol. 17, no. 9,
pp. 929-938, 1996.
Partha Bhowmick graduated from the Indian
Institute of Technology, Kharagpur, India, and
received the the masters and PhD degrees from
the Indian Statistical Institute, Kolkata, India. He
is currently on the faculty of Computer Science
and Technology, Indian Institute of Technology,
Kharagpur, India. His research interests include
digital geometry, low-level image processing,
approximate pattern matching, shape analysis,
and biometrics. He has published more than
35 research papers in international journals, edited volumes, and
refereed conference proceedings and holds three US patents.
Ranjan K. Pradhan received the degree in
computer science and engineering from the
College of Engineering and Management, Kola-
ghat, India, in 2002 and the degree in computer
science and technology from Bengal Engineer-
ing and Science University (BESU), Howrah,
India, in 2004. His research interests include
algorithms, image processing, and pattern
matching. He currently is a software professional
at Tata Consultancy Services, India. He was
recognized as the Amex Star Performer in 2006 by American Express.
Bhargab B. Bhattacharya received the BSc
degree in physics from the Presidency College,
Calcutta, the BTech and MTech degrees in
radiophysics and electronics, and the PhD
degree in computer science from the University
of Calcutta, India. Since 1982, he has been on
the faculty of the Indian Statistical Institute,
Calcutta, where he is a full professor. He held
visiting positions in the Department of Computer
Science and Engineering, University of Nebras-
ka, Lincoln, from 1985 to 1987 and from 2001 to 2002 and in the Fault-
Tolerant Computing Group, Institute of Informatics, University of
Potsdam, Germany, from 1998 to 2000. In 2005, he visited the Indian
Institute of Technology Kharagpur as a VSNL chair professor. His
research interests include logic synthesis and testing of VLSI circuits,
physical design, digital geometry, and image-processing architecture.
He has published more than 200 papers in archival journals and
refereed conference proceedings and holds nine US patents. He is on
the editorial board of the Journal of Circuits, Systems, and Computers
and the Journal of Electronic TestingTheory and Applications. He is a
fellow of the Indian National Academy of Engineering, a fellow of the
National Academy of Sciences, India, a fellow of the IEEE, and a
member of the IEEE Computer Society.
> For more information on this or any other computing topic,
please visit our Digital Library at www.computer.org/publications/dlib.
782 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 31, NO. 5, MAY 2009

You might also like