SLIDE 11 9/24/2009 11
Energy minimization
- Several algorithms have been proposed to fit
deformable contours.
– Greedy search – Dynamic programming (for 2d snakes)
1
v
2
v
3
v
4
v
6
v
5
v
Energy minimization: dynamic programming
5
With this form of the energy function, we can minimize using dynamic programming, with the Viterbi algorithm. Iterate until optimal position for each point is the center
- f the box, i.e., the snake is optimal in the local search
space constrained by boxes.
[Amini, Weymouth, Jain, 1990] Fig from Y. Boykov
Energy minimization: dynamic programming
∑
− = +
=
1 1 1 1
) , ( ) , , (
n i i i i n total
E E ν ν ν ν K
- Possible because snake energy can be rewritten as a
sum of pair-wise interaction potentials:
- Or sum of triple-interaction potentials.
∑
− = + −
=
1 1 1 1 1
) , , ( ) , , (
n i i i i i n total
E E ν ν ν ν ν K
Snake energy: pair-wise interactions
2 1 1 2 1 1
| ) , ( | | ) , ( | ) , , , , , (
i i y n i i i x n n total
y x G y x G y y x x E
∑
− =
+ − = K K
2 1 1 1 2 1
) ( ) (
i i n i i i
y y x x − + − ⋅ +
+ − = +
∑
α
1 1
Re-writing the above with :
( )
i i i
y x v , =
∑
− =
− =
1 1 2 1
|| ) ( || ) , , (
n i i n total
G E ν ν ν K
∑
− = + −
⋅ +
1 1 2 1
|| ||
n i i i
ν ν α ) , ( ... ) , ( ) , ( ) , , (
1 1 3 2 2 2 1 1 1 n n n n total
v v E v v E v v E E
− −
+ + + = ν ν K
2 1 2 1
|| || || ) ( || ) , (
i i i i i i
G E ν ν α ν ν ν − + − =
+ +
where In which terms of this sum will a vertex vi show up?
) , ( 4
4 n
v v E ) , (
4 3 3
v v E
) , ( ... ) , ( ) , (
1 1 3 2 2 2 1 1 n n n total
v v E v v E v v E E
− −
+ + + =
) , (
3 2 2
v v E ) , (
2 1 1
v v E
Main idea: determine optimal position (state) of predecessor, for each possible position of self. Then backtrack from best state for last vertex.
t t vertices
1
v
2
v
3
v
4
v
n
v
Viterbi algorithm
) 3 (
3
E ) (
3 m
E ) (
4 m
E ) 3 (
4
E ) 2 (
4
E ) 1 (
4
E ) (m En ) 3 (
n
E ) 2 (
n
E ) 1 (
n
E ) 2 (
3
E ) 1 (
3
E ) (
2 m
E ) 3 (
2
E ) 1 (
2
E ) 2 (
2
E ) 1 (
1
= E ) 2 (
1
= E ) 3 (
1
= E ) (
1
= m E
states 1 2 … m v
) (
2
nm O
Complexity:
- vs. brute force search ____?
Example adapted from Y . Boykov
1
v
2
v
3
v
4
v
6
v
5
v
Energy minimization: dynamic programming
5
With this form of the energy function, we can minimize using dynamic programming, with the Viterbi algorithm. Iterate until optimal position for each point is the center
- f the box, i.e., the snake is optimal in the local search
space constrained by boxes.
[Amini, Weymouth, Jain, 1990] Fig from Y. Boykov