Vous êtes sur la page 1sur 18

Algorithm of dynamic programming for optimization

of the global matching between two contours


defined by ordered points
Francisco P. M. Oliveira, João Manuel R. S. Tavares
tavares@fe.up.pt www.fe.up.pt/~tavares

ICCES’08 – International Conference on Computational


& Experimental Engineering and Science
16 - 22 March 2008, Honolulu, Hawaii, USA
Contents:
♦ Introduction
– Main goal and assumptions;

♦ Dynamic Programming
– Absolute and relative order definition;
– Algorithm proposed;

♦ Methodology used to obtain the affinity cost matrices


– Shapiro’s methodology;

♦ Results and comparisons with the classic assignment algorithms;

♦ Conclusions and future work.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 2
Introduction
♦ Main goal:
– To determine an optimal global matching between two contours defined by
points, without crossed correspondences, based on an affinity cost matrix
previously obtained using a matching methodology.

Crossed
correspondences

Matching of two contours of a heart.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 3
Introduction
♦ Assumptions:
– The contours to be matched are closed and each one is defined by a
sequence of ordered points;
– A affinity cost matrix for the points of the two contours to be matched
was already built;
– The matches to establish are of the type one-to-one.

Example of an affinity cost matrix (that will be further used in our example):

1 0 1 4 5 1
0 3 1 5 2 1
C=
6 1 2 4 0 8
 
3 2 7 5 4 1
Note: Cij represents the affinity cost between the point i from the first contour
and the point j from the second contour.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 4
Introduction
♦ Matching found without respecting the order:

1 0 1 4 5 1 Global matching
0 3 1 5 2 1 1 2 3 4
C=
Contour 1
6 1 2 4 0 8
 
3 2 7 5 4 1 2 1 5 6 Contour 2
Total cost: 1 Crossed correspondences
♦ Matching found respecting the order:

1 0 1 4 5 1 Global matching
0 3 1 5 2 1 1 2 3 4
C= Contour 1
6 1 2 4 0 8
 
3 2 7 5 4 1 2 3 5 6 Contour 2
Total cost: 2

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 5
Dynamic Programming
Absolute order and relative order:
♦ Consider the 5 points numbered from 1 to 5 in the image on bottom.
If these points are organized in the order (1, 2, 3, 4, 5) then they respect both
the absolute and the relative order;

♦ However, if the same 5 points are organized in the order (3, 4, 5, 1, 2) then they
respect only the relative order.

3 2

Note: If we follow the same approach,


4
1 for the relative order it does not matter
which is the first point of the sequence.
5
F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 6
Dynamic Programming
Algorithm to determine the optimum global matching respecting the absolute order:

1. Do n equal to the number of points of the contour with less points and m equal
to the number of points of the other contour;

2. Define n stages and (m – n + 1) states;

3. For i = 1 to n:
- Compute the minimum costs to match the points 1, 2, 3, …, to i of the
contour defined by less points, function of the state variable and cost
matrix;
- Store the values of costs found in a lookup table;

4. Make a search in the lookup table previously built in order to find the global
matching of minimum cost.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 7
Dynamic Programming
An example of application of our algorithm:
 1 0 1 4 5 1
♦ n = 4 (number of points of contour 1)  0 3 1 5 2 1
♦ m = 6 (number of points of contour 2) C= 
♦ It is defined 4 stages and 3 states (m – n + 1)  6 1 2 4 0 8
 
 3 2 7 5 4 1 
State
Minimum costs Cost
1 2 3 matrix

1 1 0 0
2 4 1 1
Stage
3 6 5 1
Minimum
4 11 9 2 cost

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 8
Dynamic Programming
♦ To determine the global matching of minimum cost that respect the relative
order of contours, we determine all relative orders of the contour with more points
and apply the algorithm previously presented choosing for the global matching the
one of minimum cost.
♦ In practice, we change the position of the columns of the affinity cost matrix and
find the optimum global matching that respects the absolute order in those new
matrices and then we choose the global matching with the minimum cost.

1 0 1 4 5 1 0 1 4 5 1 1 1 4 5 1 1 0
0 3 1 5 2 1 3 1 5 2 1 0 1 5 2 1 0 3
C1 =  C2 =  C3 =  …
6 1 2 4 0 8 1 2 4 0 8 6 2 4 0 8 6 1
     
3 2 7 5 4 1 2 7 5 4 1 3 7 5 4 1 3 2

Total cost: 2 Total cost: 2 Total cost: 7

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 9
Methodology used to obtain the affinity cost matrices
Diagram of the methodology based on modal analysis of the objects’ shapes
proposed by Shapiro:

Compute
Shape eigenvalues
Contour 1 matrix and
eigenvectors
Correlation
matrix (affinity
cost matrix)

Compute
Shape
eigenvalues
Contour 2 matrix
and
eigenvectors

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 10
Results
Matching obtained using the classic assignment algorithm (CAA) (Hungarian
method, LAPm and Simplex for flow problems) and the dynamic programming
algorithm (DPA):

Matching with CAA: Matching with DPA:

Matching of two contours of a heart and aorta artery.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 11
Results
Matching obtained using the classic assignment algorithm (CAA) (Hungarian
method, LAPm and Simplex for flow problems) and the dynamic programming
algorithm (DPA):

Matching with CAA: Matching with DPA:

Matching of two contours of a thoracic cage.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 12
Results
Matching obtained using the classic assignment algorithm (CAA) (Hungarian
method, LAPm and Simplex for flow problems) and the dynamic programming
algorithm (DPA):

Matching with CAA: Matching with DPA:

Matching of two contours from images of dynamic pedobarography.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 13
Results
Computation times of the optimization algorithms considered in this work
(using a PC Intel Pentium III at 1.0 GHz and 256 MB RAM):

Contours’ number of points


Computation times [s]
and “name”
Contour 1 Contour 2 Hungarian LAPm Simplex Dynamic
28, “heart1” 28, “heart1a” 4,23 0,01 0,02 0,00
36, “heartA1” 36, “heartA2” >60 3,33 0,04 0,00
46, “rib1” 46, “rib2” >60 2,78 0,06 0,00
51, “foot1” 58, “foot6” >60 0,75 0,09 0,01
86, “airplane2” 57, “airplane12” >60 1,77 0,19 0,01
81, “heart5” 84, “heart6” >60 2,34 0,21 0,00
233, “foot13” 67, “foot2” >60 23,55 1,37 0,24
233, “foot13” 253, “foot14” >60 >60 2,01 0,15
389, “heartB3” 139, “heartB2” >60 >60 4,39 2,16
389, “heartB3” 417, “heartB4” >60 >60 6,96 0,62

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 14
Conclusions
♦ Our dynamic programming algorithm always reached a matching solution
without crossed correspondences;

♦ The matching quality obtained using our dynamic programming algorithm was
always equal or better than the matching quality obtained using the classic
assignment algorithms considered;

♦ The computation time of our dynamic programming algorithm was always


considerable lower than the computation time of the classic assignment algorithms
used;

♦ The affinity (matching) methodology proposed by Shapiro becomes easier to


use and more robust when applied to ordered contours in combination with our
dynamic programming algorithm.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 15
Future work
♦ To apply and test our dynamic programming algorithm on cost matrices built
using others affinity methodologies in order to optimize the global matching of
contours’ points;

♦ To improve the computational efficiency of our algorithm by developing a


parallel implementation;

♦ To apply and test our matching algorithm on common benchmarking matching


images.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 16
Acknowledgment
 This work was partially done in the scope of project “Segmentation,
Tracking and Motion Analysis of Deformable (2D/3D) Objects using
Physical Principles”, financially supported by FCT - Fundação para a
Ciência e a Tecnologia from Portugal, with reference POSC/EEA-
SRI/55386/2004.

F. Oliveira & J. Tavares Alg. of dynamic prog. for optimization of the global matching between two contours defined by ordered points 17
Algorithm of dynamic programming for optimization
of the global matching between two contours
defined by ordered points
Francisco P. M. Oliveira, João Manuel R. S. Tavares
tavares@fe.up.pt www.fe.up.pt/~tavares

ICCES’08 – International Conference on Computational


& Experimental Engineering and Science
16 - 22 March 2008, Honolulu, Hawaii, USA

Vous aimerez peut-être aussi