Académique Documents
Professionnel Documents
Culture Documents
♦ Dynamic Programming
– Absolute and relative order definition;
– Algorithm proposed;
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
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
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;
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
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):
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):
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):
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):
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;
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;
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