Pattern Matching Using the Hausdorff Distance - PDF by uda13689

VIEWS: 37 PAGES: 8

									         Pattern Matching Using the Hausdorff Distance

                              Fang Yi, Xiong ShengWu

               Computer Science and Technology Department

                        Wuhan University of Technology

                            Wuhan, Hubei, P.R. China

Abstract Point matching can be a computationally intensive task, especially when
large point sets are involved and when the transformation space has many degree of
freedom. Here, we employ two efficient algorithms to solve the problem, in an
attempt to reduce its computational complexity, while providing acceptable result.
The first method is an approximation algorithm based on branch-and-bound approach,
it is possible to achieve a tradeoff between the quality of result and the running time.
The second method operates within the framework of the first method but accelerate it
by using point alignments. We demonstrate the algorithms’ performances on
synthetically generate data. Moreover, we apply them on finding facial feature points
in images and show some preliminary results.
Keywords Feature extraction, Pattern matching, Hausdorff distance, Image
registration, Feature space




                                                      In an attempt to arrive a sound
                                                registration scheme, we explore two
1. Introduction
                                                efficient algorithms that are both
                                                accurate and fast. We show the overview
In pursuing an image registration task,         of these two algorithms according to the
we are given two images of roughly the          following four factors, proposed by
same scene, and are asked to determine          Brown[1] for classifying any image
the transformation that most nearly maps        registration method.
one image into the other. Based on point
pattern matching, the problem can be
                                                1.1 Feature space
defined abstractly as follows. Given two
point sets A and B lying in two different
spaces, a space T of transformations                 Feature space is the domain in
mapping one space into the other, a             which information for matching is
measure of distance between any two             extracted. Specifically, we consider
point sets, to find the transformation t        feature points that were extracted in the
T that minimizes the distance between           image domain. They may be control
t(A) and B.                                     points, corners, line segments, etc. All of


                                            1
them are assumed to be available as a             1.3 Search strategy
result of applying standard feature
extraction algorithms. It is important to
                                                        We use two search strategies for
notice that feature extraction process
                                                  finding the optimal transformation. The
would yield unexpected result. The first
                                                  first is based on a branch-and-bound
is perturbation errors, which result from
                                                  search of transformation space, and the
a combination of the image digitization
                                                  second combines this with a method
process, expansion or shrinkage of
                                                  based on alignment judiciously chosen
objects due to variations in lighting
                                                  candidate feature points. The first
conditions, and the failure of the feature
                                                  method has the advantage that it can
extraction algorithm. The second source
                                                  provide arbitrarily good guarantees on
of error is the presence of outliers,
                                                  the accuracy of the final match, and that
which can result from many sources, the
                                                  it naturally uses a priori information to
fact that the two images cover different
                                                  bound the search. The main problem
regions, the presence of occluding
                                                  with this method is that the nature of the
objects in images, and the sensitivity of
                                                  search leads to rather high running times.
the feature extraction algorithm to
                                                  The second method is very easy to
variations in lighting, point of view, or
                                                  implement, but it cannot generate results
other aspects of imaging process.
                                                  with better than a fixed constant error,
                                                  and does not lend itself easily to
1.2 Search space                                  exploiting a priori information in the
                                                  search.
     Search space is the class of
transformations that establish the                1.4 Similarity metric
correspondence between the sensed
image and the reference data.
                                                       The figure of merit assigned to a
Specifically,         we          consider
                                                  match that is determined by a specific
two-dimensional affine transformations,
                                                  transformation is based on the
allowing for translation, rotation, scaling
                                                  (directional)      partial       Hausdorff
along each axis, and shearing. Using
                                                  distance[2]. This is a robust measure, it
homothetic coordinates expressing, any
                                                  consider the set of distances resulting
linear transformation in the plane can be
                                                  from taking each point in one set, and
expressed as affine transformation.
                                                  finding the nearest point to it in the other
Usually, we consider such common
                                                  set. Rather than taking the sum or the
subspaces of transformations as
                                                  maximum of these distances, which may
translation    only,     rigid     motions
                                                  be affected by outliers, we consider the
(translation, rotation and possibly
                                                  median or, in general, the k-th smallest
reflection), homothetic transformations
                                                  distance. More formally, given two point
(translation, rotation and uniform
                                                  sets A and B, and a parameter k, 1 k
scaling). Our algorithm methodology
                                                  |A|, we define the directed partial
can be applied to any reasonable space
                                                  Hausdorff distance from A to B to be
of     transformations      of    bounded
dimensionality.                                             hk ( A, B ) = K a∈A min d (a , b )
                                                                            th
                                                                                b∈B




                                              2
     where Kth returns the k-th smallest         q' = (1 - εq)q, the weak quantile.
element of the set, and where d(a,b) is          Note that since q' q, we have
the Euclidean distance from a to b. The          simq’(τ) simq(τ), for any τ T.
parameter k is typically based on a priori       τ is approximately optimal relative
bounds on the number of points of A that         to εr, εa and εq, if either simq’(t)
are expected to have close matches in B          (1+εr)simopt or simq’(t) simopt + εa
under the optimum transformation.                holds.
These are the inliers[3].                        Tree, node and cell. We construct a
                                                 search tree, where each node of the
                                                 tree is identified with the set of
                                                 transformations contained in some
2.     The       Branch-and-Bound
                                                 axis-aligned hyperrectangle in the
                                                 six-dimensional          transformation
Algorithm
                                                 space. These hyperrectangles are
                                                 called cells.
     Both of our registration algorithms         τlo and τhi, a pair of transformations
are based on a branch-and-bound                  for each cell, whose coordinates are
framework, we will describe the                  the upper and lower bounds on the
branch-and-bound algorithm in this               transformations of the cell.
section. For conveniences, we introduce          T0, an initial cell. It is assumed to
some definitions and notations.                  contain the optimum transformation.
                                                 This is supplied by the user, based
2.1 Definitions and Notations                    on a priori knowledge of the nature
                                                 of the transformation.
     A and B, the given two point sets,          Active cell, if the cell is a candidate
     they are fixed for the remainder of         to       provide      the       optimum
     the discussion.                             transformation.
     T, a space of transformations.              Killed cell, if it cannot provide the
     τ, τ T, a concrete transformation.          optimum solution.
     q, a distance quantile, 0<q 1,              Cell processing. Select one of the
     define Hq(A,B) to be Hk(A,B),               active cells to process. After
     where k=ceil(q*|A|).                        processing, a cell is either killed or
     simq(τ), the similarity measure of τ,       is split into two disjoint subcells.
     i.e., simq(τ) = Hq(τ(A),B).                 simhi(T), an upper bound of the
     τopt, the optimum transformation.           smallest       similarity,    associated
     simopt, the optimum similarity, i.e.        transformation of which contained
     simopt = H(τopt(A), B) = min                in cell T.
     H(τ(A),B).                                  simlo(T), an lower bound of the
     M and t, parameters for affine              smallest       similarity,    associated
     transformation. For any a = (a1, a2)        transformation of which contained
        A, τ(a) = Ma + t.                        in cell T.
     εr, the relative error bound.               simbest,     the     best      similarity
     εa, the absolute error bound.               encountered so far in the search.
     εq, the quantile error bound.               τbest, the transformation associated

                                             3
    with simbest.                                 Hausdorff quantile q, the approximation
    A simhi(T) computing. We may                  parameters εr, εa and εq, and the initial
    sample any transformation from                cell T0.
    within the cell. In particular, this is       (1) Build a nearest neighbor data
    done by simply taking the midpoint                structure for the points of B.
    τ of the cell, and then computing                 Initialize the priority queue to
    simq(τ).                                          contain T0. Set simbest= . Define
    Uncertain region. Given any cell                  the weak quantile q' to be (1 - εq)q.
    T ⊂ T, and given any point a A,                   Repeat steps (2)-(5) until the priority
    consider the image of a under every               queue is empty or until simbest εa.
           T. It is easy to compute a             (2) Remove the largest cell T from the
    bounding rectangle for this set. We               queue. Compute its lower and upper
    call this bounding rectangle the                  bounds. This involve the following
    uncertainty region of a relative to T.            steps:
    A simlo(T) computing. To derive our               (a) Compute the uncertainty regions
    lower bound for T, for each point a                    for every point a A with respect
       A, we compute the distance from                     to T.
    the      corresponding     uncertainty            (b) For each uncertainty region,
    region to its nearest neighbor in B.                   compute its nearest neighbor in
    Observe that this distance is a lower                  B.
    bound on the distance from       (a) to           (c) Using       any     fast   selection
    its nearest neighbor in B, for any                     algorithm, compute the q-th
       T. We then take the q-th smallest                   quantile among these distances.
    such distance. Call this simlo(T).                     Call this simlo(T). If simlo(T) >
    The size of uncertain region, define                   simbest/(1+εr) or if simlo(T) >
    as its longest side.                                   simbest - εa, kill this cell and
    The size of a cell, define as largest                  return to step (2).
    size      among      the    associated            (d) Otherwise,           sample        a
    uncertainty regions for each point in                  transformation       from this cell.
    A.                                                     Compute the image of each point
    Cell queue. The active cells are                       of A under , and compute the
    stored in a priority queue, ordered                    nearest neighbors of these points
    by cell size.                                          with respect to B. Find the q'th
    Cell splitting. Split cell T into two                  smallest such distance. Call this
    smaller subcells T1 and T2, by                         simhi(T).
    splitting it along the dimension that         (3) If simhi(T) < simbest, update simbest
    contributes most to its uncertainty               and let τbest be the associated
    region size.                                      transformation.
                                                  (4) Split cell T into two smaller subcells
2.2 Overview of the Algorithm                         T1 and T2, by splitting it along the
                                                      dimension that contributes most to
                                                      its uncertainty region size. Compute
     Here is an overview of the
                                                      size bounds for T1 and T2.
approximation algorithm. The input
                                                  (5) Enqueue T1 and T2 in the queue of
consists of the point sets A and B, the

                                              4
   active cells.                                  its similarity is simbest.
    The final transformation is τbest and

                                                  corresponding triples from B in order to
3. Bound Alignment                                determine a candidate transformation is
                                                  called alignment.
     The branch-and-bound algorithm                    Noise bound η. In noisy
has many nice features, but its main                   environments, suppose that for each
drawback is its relatively high running                inlier a A there is a point of B that
time. This occurs especially when high                 lies within some small distance η
accuracy is required and the optimum                   from its optimum image point,
similarity is very good. For this reason,              τopt(a). We assume that an upper
we introduce an additional process                     bound on η, called the noise bound,
called bound alignment to help                         is provided to the search algorithm.
accelerate the search.                                 Alignable uncertain region. An
     Suppose that the search of                        uncertainty region is said to be
branch-and-bound has progressed to a                   alignable if there is at most one
stage where most of the uncertainty                    point of B in the region, or if the
regions associated with the points of A                region is empty and there is at least
contain at most one point of B. Consider               one point of B within distance η of
the points of A that have exactly one                  the region.
point of B in their uncertainty regions. If            Alignable cell. If the current cell
a    cell     contains    the    optimum               has a significant fraction of
transformation, we sample one such                     alignable uncertainty regions, we
point at random and compute the unique                 say that this cell is eligible for
transformation that maps this point to                 alignment.
the corresponding point of B for several               qs, the quantile of uncertainty
times, and there is a good probability                 regions becoming alignable.
that desired optimum transformation is                 Ns, the number of taking samples.
found. On the other hand, if a cell does
not contain the optimum, after taking a           3.2 Detailed Algorithm
number of samples and witnessing
repeatedly poor similarities, we may
                                                       Here are steps used for the bounded
regard this as evidence that the cell in
                                                  alignment algorithm. (These steps are
question does not contain the optimum
                                                  added after step (2d) in the previous
and therefore we kill it.
                                                  description.) The algorithm is given an
     Before giving detailed alignment
                                                  expected inlier perturbation η, sampling
algorithm,      we     introduce     some
                                                  quantile qs, and a minimum sample size
definitions and notations.
                                                  Ns.
                                                  (e)    For each a A, count the number
3.1 Definitions and Notations                            of points of B that lie within a's
                                                         uncertainty region. If this at most
Alignment. The process whereby triples                   one, and the nearest neighbor is
from A are matched against prospective                   within distance η of the

                                              5
         uncertainty region, flag this               find FFP in sensed face image. To
         region as alignable.                        comparing with standard face, the
(f)      If the fraction of alignable                sensed image may have many
         uncertainty regions is less than qs,        transformations,      such     translation,
         return to step (2). Otherwise, let          rotation, scaling, etc. Extracting feature
         A' denote the subset of A such              point set in the reference image and
         that for each a A', there exists            sensed image, we can use our search
         at least one point b B that                 algorithm       to     derive     optimum
         either lies inside or within                transformation by minimizing Hausdorff
         distance η of a's uncertainty               distance, and find FFP in sensed image
         region. Repeat the following Ns             finally.
         times:                                            Fig. 1 gives a standard FFP map as
         (i) Sample (without replacement)            reference image, fig.2 shows a face
              triples of points of A', until a       image and its corresponding feature
              triple that is geometrically           points that served as candidate FFP, fig.
              well-distributed is found.             4 displays a final found facial feature
         (ii) Compute the transformation             points using optimum transformation
              that aligns each point in the          computed by the bound alignment
              triple with a random point of          algorithm.
              B      in     its    associated
              uncertainty region. Compute
              the     similarity    of    this
              transformation.
         (iii)If the similarity of this
              transformation is better than
              the current best similarity
              simbest, make it the new best.
              If the similarity obtained for
              all of the Ns transformations
              exceeds the current best by
              an additive amount of η, kill                            Fig. 1
              this cell.
      If the similarity obtained for all of
the Ns transformations exceeds the
current best by an additive amount of η,
kill this cell.


4. Experiments

     We apply the algorithms on finding
Facial Feature Points (FFP) in images.
We are given a reference face image,
FFP of which is known, and expected to


                                                 6
                                             Fig. 2


5. Conclusion                                    References


      We have explored two algorithms            [1] L.P.Chew, D.Dor, A.Efrat, K.Kedem.
for registering images in a robust                   Geometric Pattern Matching in
manner through the use of feature point              d-Dimensional Space. Proc. Ninth
pattern matching. Both algorithms allow              Ann. ACM-SIAM Symp. Discrete
the user to choose tradeoff between                  Algorithms, pp. 658-667, Jan. 2003.
running time and accurate by specifying          [2] M.T.Goodrich,        J.S.B.Mitchell,
initial parameters. The first algorithm is           M.W.Orletsky.          Approximate
based on branch-and-bound search. It is              Geometric Pattern Matching under
simple and safe, but is relatively slow,             Rigid     Motions.    Proc.    First
especially when high accuracy is desired.            Workshop High Performance Data
The second algorithm, called bounded                 Mining, Mar. 1998.
alignment, is based on combining                 [3] M.Gavrilov, P.Indyk, R.Motwani.
branch-and-bound with computing point                Geometric Pattern Matching: A
alignments to accelerate the search. It              Performance Study. Proc. Seventh
seems to be much faster than the                     Ann. European Symp. Algorithms, J.
branch-and-bound algorithm in many                   Nesetril, ed., pp. 362-371, July
cases, but it may fail with some small               1999.
probability.                                     [4] D.P.Huttenlocher, G.A.Klanderman,
                                                     W.J.Rucklidge. Comparing Images

                                             7
    Using the Hausdorff Distance. IEEE              IEEE Trans. Pattern Analysis and
    Trans. Information Theory, vol. 28,             Machine Intelligence, vol. 22, no. 1,
    129-137, 1982.                                  pp. 4-37, Jan. 2000.
[5] D.M.Mount,           N.S.Netanyahu,        [8] Sunil Arya, David M. Mount.
    J.L.Moigne. Efficient Algorithms                Algorithms      for    Fast   Vector
    for Robust Feature Matching. Data               Quantization.        Proc.      Data
    Mining and Knowledge Discovery,                 Compression Conference, J. A.
    vol. 1, pp. 183-201, 1997.                      Storer and M. Cohn, eds., Snowbird,
[6] D.P.Huttenlocher,          K.Kedem,             Utah, 1993, IEEE Computer Society
    J.M.Kleinberg.      On      Dynamic             Press, 381-390.
    Voronoi      Diagrams     and    the       [9] Sunil Arya, David M. Mount.
    Minimum Hausdorff Distance for                  Approximate Range Searching, Proc.
    Point Sets Under Euclidean Motion               of the 11th Annual ACM Symp. on
    in the Plane. Proc. 10th Ann.                   Computational Geometry, 1995,
    ACMSIAM          Symp.      Discrete            172-181.
    Algorithms, pp. S931-S932, Jan.            [10] S.M. Smith and J.M. Brady.
    1999.                                           SUSAN - a new approach to low
[7] L.P.Chew,             M.T.Goodrich,             level image processing. Int. Journal
    D.P.Huttenlocher. Geometric Pattern             of Computer Vision, 23(1):45-78,
    Matching under Euclidean Motion.                May 2002.




                                           8

								
To top