Matching


Overview

We will describe here the comparison between two shapes, which is the next logical step to our goal, the image database. We will derive a measure (not in the mathematical sense) for polygonal arcs, representing parts of our curve. With this measure, the comparison of the whole shapes is built up by finding the optimal combination of arcs, using dynamical programming.

If you are not interested in details, you can skip the formal description and continue with results.


Formal Description

As seen in previous chapters, the shape is represented as a digital polygonal curve, which is then decomposed into a set of maximal convex (or concave) arcs.

Definitions:
We denote:

Comparison of two curves C1, C2

To compare curves, we compare the arcs the curves are composed of.

We derived a measure for arc comparison, for details click here.

It is not possible, to make a simple one to one comparison of maximal convex/concave arcs ma, due to the following reasons:

Hence we join together maximal arcs, forming groups:

Definition:
A group g is a polygonal subarc of the curve C, consisting of the segments of consecutive maximal arcs:

g:=(sstart,...,send), start>=0, end<=ns,
where

We will call the decomposition of a curve C into groups a grouping G:

Definition:
A grouping G is an ordered set of consecutive groups, covering the whole curve C:
G:=(g0,...,gng) where

Definition:
We denote the set of all possible groupings G of a curve C as SG(C).

Given two curves C1,C2 their comparison can be defined as a mapping on a special subset of groupings SG1,SG2, called the correspondence:

Definition:
We call a relation CO on SG1 x SG2 a correspondence if:

  1. (G1,G2) is in CO <==> #G1 = #G2, where #Gi denotes the number of groups in Gi (#Gi = ng(G1,2))
  2. (G1,G2) is in CO ==> min(#gj(G1) , #gj(G2) = 1 for all j=0..ng(G1,2)
The first condition means that both curves are decomposed into the same amount of groups,
the second condition means, that at least one group in the decomposition of both curves having the same index contains exactly one maximal arc, the other group contains at least one maximal arc.
The reason herefore is, that in the following comparison, we only want to allow mappings between one to many arcs or many to one arcs, but never between many to many arcs.
This rule has an intuitive motivation:

At least, the comparison between the curves:

Definition:
Given two curves C1,C2, we define a mapping GM on the correspondence CO, called the groupmatching:

GM:

For a description of the arc-comparison click here.

With these definitions, we can easily formulate the task for comparison:

Find the element BE in the correspondence CO such that the groupmatching is minimal, i.e. GM(BE)<=GM(e) for all elements e in CO.

Note that the grouping takes respect of the order of groups, and hence of the order of the digital segments. This means, that in every element (G1,G2) in CO the first groups g0(G1) and g0(G2) always contain the first digital segment of their corresponding curves.
This leads to the problem, that for an intuitive groupmatching the correct starting point must be found. We will come later to the solution of this problem.


Finding the best comparison

As seen in the previous chapter, finding the best comparison is the solution of finding an element in the correspondence that minimizes the groupmatching. This problem can be solved by finding the cheapest path in a graph in a sense described in this chapter.

We will explain the strategy by a special example, see curve right. The two fishlike shapes are decomposed into three maximal arcs each. We want to find the minimal correspondence (intuitively we expect that the best correspondence is a one to one mapping of each maximal arc).

The figure on the left shows the correspondence CO between the left fish (a), which is composed of the arcs a0 to a3, and the right one (arcs a0 to a3).

CO consists of all possible combinations of groupings that hold the conditions stated in its definition above.

We assign a value to each of the nine elements of CO by the groupmatching.

Finding the best comparison be explained by the following graph:


An example:
Let's take the upper right element in the correspondence. The grouping of each curve consists of three groups:
  1. group 0: a0 for curve a, b0 for curve b
  2. group 1: a1 for curve a, b1,b2 for curve b
  3. group 2: a2,a3 for curve a, b3 for curve b
hence our way on the graph will lead
  1. through vertex D(0,0) to node (0,0),
  2. through vertex D(1,1 2) to node (01,012),
  3. through vertex D(2 3, 3) to node (0123,0123),
the groupmatching is given by adding D(0,0), D(1,1 2), D(2 3, 3).

Hence to get the best comparison is the task to find the cheapest way in the graph.

This is typically solved by dynamical programming.


Goon! Continue with Results