Mesh Processing Course : Active Contours
-
Upload
gabriel-peyre -
Category
Documents
-
view
651 -
download
0
description
Transcript of Mesh Processing Course : Active Contours
Active Contours
Gabriel PeyréCEREMADE, Université Paris-Dauphine
www.numerical-tours.com
Overview
•Parametric Edge-based Active Contours
• Implicit Edge-based Active Contours
• Region-based Active Contours
2
Parametric Active Contours
3
– Closed curve: �(0) = �(1).– Open curve: �(0) = x0 and �(1) = x1.
Boundary conditions:
Local minimum: �� � argmin�
E(�) = L(�) + ⇥R(�)
RegularizationDatafidelity
x0
x1
Parametric Active Contours
3
– Closed curve: �(0) = �(1).– Open curve: �(0) = x0 and �(1) = x1.
Boundary conditions:
R(�) =� 1
0||��(t)|| + µ||���(t)||dt
Snakes energy: (depends on parameterization)
L(�) =� 1
0W (�(t))||��(t)||dt,
Local minimum: �� � argmin�
E(�) = L(�) + ⇥R(�)
RegularizationDatafidelity
x0
x1
Image f Weight W (x) Curve ��
Geodesic Active Contours
4
Geodesic active contours: (intrinsic) Replace W by W + �,
E(�) = L(�) =� 1
0W (�(t))||��(t)||dt
� (local) minimum of the weighted length L.
� local geodesic (not minimal path).
Weight W (x) Curve ��
Curve Evolution
5
�s
�s+ds
Family of curves {�s(t)}s>0 minimizing E(�s).
Do not confound:t: abscise along the curve.s: artificial “time” of evolution.
Curve Evolution
5
�s
�s+ds
Family of curves {�s(t)}s>0 minimizing E(�s).
Do not confound:t: abscise along the curve.s: artificial “time” of evolution.
Local minimum of: min�
E(�)
Minimization flow: d
ds�s = ��E(�s)
Curve Evolution
5
�s
�s+ds
Family of curves {�s(t)}s>0 minimizing E(�s).
Do not confound:t: abscise along the curve.s: artificial “time” of evolution.
Local minimum of: min�
E(�)
Minimization flow: d
ds�s = ��E(�s)
Warning: the set of curves is not a vector space.
Inner product at �: �µ, ⇥⇥� =� 1
0�µ(t), ⇥(t)⇥||��(t)||dt
� Riemannian manifold of infinite dimension.
Curve Evolution
5
�s
�s+ds
Family of curves {�s(t)}s>0 minimizing E(�s).
Do not confound:t: abscise along the curve.s: artificial “time” of evolution.
Local minimum of: min�
E(�)
Minimization flow: d
ds�s = ��E(�s)
Warning: the set of curves is not a vector space.
Inner product at �: �µ, ⇥⇥� =� 1
0�µ(t), ⇥(t)⇥||��(t)||dt
� Riemannian manifold of infinite dimension.
Numerical implementation: �(k+1) = �(k) � ⇥kE(�(k))
Intrinsic Curve Evolutions
6
Intrinsic energy E: evolution along the normal
speed
d
ds⇥s(t) = �(⇥s(t), ns(t),⇤s(t)) ns(t)
normal
ns(t) =��s(t)�
||��s(t)||
⇥s(t) = �n�s(t), ��
s(t)⇥1
||��s(t)||2
Normal:
Curvature:
�s
ns
E(�) only depends on {�(t) \ t � [0, 1]}.
Mean Curvature Motion
7�(x, n, ⇥) = ⇥Speed:
No data-fidelity: E(�) =� 1
0||��(t)||dt
�� Curve-shortening flow.
d
ds�s(t) = ⇥s(t)ns(t)
�0
�s
E(� + ⇥) = E(�) +� 1
0� ��(t)||��(t)|| , ⇥�(t)⇥dt + O(||⇥||)
⌅E(�) : t ⇤⇥ � 1||�(t)||
ddt
���(t)
||��(t)||
�
d
ds�s = ��E(�s)
Mean-curvature motion:
Discretization
8
Discretization: � = {�(i)}N�1i=0 � R2, with �(N) = �(0).
�k
⇥µ, ⇥⇤� =�
i⇥µ(i), ⇥(i)⇤||�(i) � �(i + 1)||
Discretization
8
Discretization: � = {�(i)}N�1i=0 � R2, with �(N) = �(0).
Discrete energy:
�k
E(�) =�
i ||�(i)� �(i + 1)||
⇥µ, ⇥⇤� =�
i⇥µ(i), ⇥(i)⇤||�(i) � �(i + 1)||
Discretization
8
Discretization: � = {�(i)}N�1i=0 � R2, with �(N) = �(0).
Gradient descent flow:
Discrete energy:
�k+1 = �k � ⇥k�E(�k)
��E(�k)
�k
E(�) =�
i ||�(i)� �(i + 1)||
⇥µ, ⇥⇤� =�
i⇥µ(i), ⇥(i)⇤||�(i) � �(i + 1)||
Discretization
8
Discretization: � = {�(i)}N�1i=0 � R2, with �(N) = �(0).
Gradient descent flow:
Discrete energy:
�k+1 = �k � ⇥k�E(�k)
��E(�k)
�k
⇥E(�) =1
||⇥�||⇥� �N � ⇥(�)Discrete gradient:
E(�) =�
i ||�(i)� �(i + 1)||
⇥µ, ⇥⇤� =�
i⇥µ(i), ⇥(i)⇤||�(i) � �(i + 1)||
(⇥�)(i) = �(i + 1)� �(i)
(⇥��)(i) = �(i� 1)� �(i)
(N�)(i) =�(i)||�(i)||
Geodesic Active Contours Motion
E(�) = L(�) =� 1
0W (�(t))||��(t)||dt
�(x, n, ⇥) = W (x)⇥� ��W (x), n�
d
ds⇥s(t) = �(⇥s(t), ns(t),⇤s(t)) ns(t)
Weighted length:
Evolution:
�0
�s
Weight W (x)
where W is small.
�� finite di�erences discretization.
�� attraction toward areas
Open vs. Closed Curves
�s
�0
Weight W (x) Image f(x)
x0
x1
�0
�s
Global Minimum with Fast Marching
Image f Metric W (x)
Distance Ux0(x) Geodesic curve �(t)
Geodesic distance map:
Global minimum: Ux0(x1) = L(��)
Ux0(x1) = min�(0)=x0,�(1)=x1
L(�)
Global Minimum with Fast Marching
Image f Metric W (x)
Distance Ux0(x) Geodesic curve �(t)
Geodesic distance map:
Global minimum: Ux0(x1) = L(��)
Ux0(x1) = min�(0)=x0,�(1)=x1
L(�)
– Compute Ux0 with Fast Marching.
– Solve EDO:d��
dt(t) = ��Ux0(�(t))
��(0) = x1
Fast O(N log(N)) algorithm:
Overview
• Parametric Edge-based Active Contours
•Implicit Edge-based Active Contours
• Region-based Active Contor
12
Level Sets
{�s(t) \ t � [0, 1]} =�x � R2 \ ⇥s(x) = 0
�.
Level-set curve representation:
�s(x) = ||x� x0||� s
�s(x) = ||x� x0||� � s
�s(x) � 0
�s(x) � 0
Example: circle of radius r
Example: square of radius r
Level Sets
{�s(t) \ t � [0, 1]} =�x � R2 \ ⇥s(x) = 0
�.
Level-set curve representation:
�s(x) = ||x� x0||� s
�s(x) = ||x� x0||� � s
�s(x) � 0
�s(x) � 0
Union of domains: �s = min(�1s,�
2s)
Intersection of domains: �s = max(�1s,�
2s)
Example: circle of radius r
Example: square of radius r
�s = min(�1s,�
2s)
�s(x) � 0
Level Sets
{�s(t) \ t � [0, 1]} =�x � R2 \ ⇥s(x) = 0
�.
Level-set curve representation:
�s(x) = ||x� x0||� s
�s(x) = ||x� x0||� � s
�s(x) � 0
�s(x) � 0
Union of domains: �s = min(�1s,�
2s)
Intersection of domains: �s = max(�1s,�
2s)
Popular choice: (signed) distance to a curve
⇥s(x) = ± mint
||�s(t)� x||
Example: circle of radius r
Example: square of radius r
�� infinite number of mappings �s � �s.�s = min(�1
s,�2s)
�s(x) � 0
Level Sets Evolution
14
Dictionary parameteric � implicit:
ns(t) =��s(x)
||��s(x)||Normal:
Position: x = �s(t)
�s(x) = div��⇥s
||�⇥s||
�(x)Curvature:
Level Sets Evolution
14
Dictionary parameteric � implicit:
ns(t) =��s(x)
||��s(x)||Normal:
Position: x = �s(t)
�s(x) = div��⇥s
||�⇥s||
�(x)Curvature:
d
ds⇥s(x) = ||�⇥s(x)||�
�⇥s(x),
�⇥s(x)||�⇥s(x)|| ,div
��⇥s
||�⇥s||
�(x)
�.
d
ds⇥s(t) = �(⇥s(t), ns(t),⇤s(t)) ns(t)
Evolution PDE:
�� All level sets evolves together.
Proof
15
� t, ⇥s(�s(t)) = 0Definition of level-sets:
d
ds⇥s(t) = �(⇥s(t), ns(t),⇤s(t)) ns(t)Evolution PDE: (�)
Proof
15
� t, ⇥s(�s(t)) = 0
��⇥s(x),⇤�s
⇤s(t)� +
⇤⇥s
⇤s(x) = 0 for x = �s(t)
Deriving with respect to t:
Definition of level-sets:
d
ds⇥s(t) = �(⇥s(t), ns(t),⇤s(t)) ns(t)Evolution PDE: (�)
(��)
Proof
15
� t, ⇥s(�s(t)) = 0
��⇥s(x),⇤�s
⇤s(t)� +
⇤⇥s
⇤s(x) = 0 for x = �s(t)
Deriving with respect to t:
Definition of level-sets:
d
ds⇥s(t) = �(⇥s(t), ns(t),⇤s(t)) ns(t)Evolution PDE: (�)
(��)
(�) + (��) :⌅⇤s
⌅s(x) = ��(x, ns(t),⇥s(t))��⇤s(x), ns(t)�
Proof
15
� t, ⇥s(�s(t)) = 0
��⇥s(x),⇤�s
⇤s(t)� +
⇤⇥s
⇤s(x) = 0 for x = �s(t)
Deriving with respect to t:
Definition of level-sets:
d
ds⇥s(t) = �(⇥s(t), ns(t),⇤s(t)) ns(t)Evolution PDE: (�)
(��)
(�) + (��) :⌅⇤s
⌅s(x) = ��(x, ns(t),⇥s(t))��⇤s(x), ns(t)�
d
ds⇥s(x) = ||�⇥s(x)||�
�⇥s(x),
�⇥s(x)||�⇥s(x)|| ,div
��⇥s
||�⇥s||
�(x)
�.
For all x on the curve,=��s(x)
||��s(x)||
Implicit Geodesic Active Contours
16
d
ds�s = ||��s||div
�W��s
||��s||
�.
Evolution PDE:
Comparison with explicit active contours:
� : 2D instead of 1D equation.
+ : allows topology change.
Implicit Geodesic Active Contours
16
Re-initialization: ⇥s(x) = ± mint
||�s(t)� x||
Eikonal equation: ||��s|| = 1 with ⇥s(�s(t)) = 0
d
ds�s = ||��s||div
�W��s
||��s||
�.
Evolution PDE:
Comparison with explicit active contours:
� : 2D instead of 1D equation.
+ : allows topology change.
Multiple Fluids Dynamics
17
See Ron Fedkiw homepage.Multiple gaz:
Fluid/air interface:
http://physbam.stanford.edu/�fedkiw/
Overview
• Parametric Edge-based Active Contours
• Implicit Edge-based Active Contours
•Region-based Active Contours
18
Energy Depending on Region
19
RegularizationDatafidelity
Optimal segmentation [0, 1]2 = � � �c:
min�
L1(�) + L2(�c) + �R(�) R(�) = |��|
Chan-Vese binary model:
�� More general models
L1(�) =�
�|I(x)� c1|2dx
Energy Depending on Region
19
RegularizationDatafidelity
Optimal segmentation [0, 1]2 = � � �c:
min�
L1(�) + L2(�c) + �R(�) R(�) = |��|
Chan-Vese binary model:
�� More general models
Level set implementation: � = {x \ �(x) > 0}
Smoothed Heaviside:H(x)
xH�(x) =
2�
atan�x
⇥
�
R(�) � R(�) =�
||⇥(H�)(x)||dx
L1(�) =�
�|I(x)� c1|2dx
L1(�) ⇥ L(�) =�
H�(�(x))||I(x)� c1||2dx
Descent Schemes
20
For a given c = (c1, c2) � R2:
min⇥
Ec(�) =�
H�(�(x))||I(x)� c1||2+
H�(�⇥(x))||I(x)� c2||2 + �||⇥(H�⇥)(x)||dx
Descent Schemes
20
Descent with respect to �:
For a given c = (c1, c2) � R2:
⇥(k+1) = ⇥(k) � �k�Ec(⇥(k))
G(x) = ||I(x)� c1||2 � ||I(x)� c2||2�Ec(�) = H �
�(�(x))G(x)
��div�⇥⇥
||⇥⇥||
�(x)
min⇥
Ec(�) =�
H�(�(x))||I(x)� c1||2+
H�(�⇥(x))||I(x)� c2||2 + �||⇥(H�⇥)(x)||dx
Descent Schemes
20
Descent with respect to �:
For a given c = (c1, c2) � R2:
⇥(k+1) = ⇥(k) � �k�Ec(⇥(k))
G(x) = ||I(x)� c1||2 � ||I(x)� c2||2
Limit �� 0:
�Ec(�) = H ��(�(x))G(x)
��div�⇥⇥
||⇥⇥||
�(x)
⇥Ec(⇥)� �{�=0}(x)||⇥⇥(x)||G(x)
Numerically, use �Ec(�) = ||��(x)||G(x)
min⇥
Ec(�) =�
H�(�(x))||I(x)� c1||2+
H�(�⇥(x))||I(x)� c2||2 + �||⇥(H�⇥)(x)||dx
Update of c
21
Joint minimization: min�,c1,c2
Ec(�)
Update of c
21
Joint minimization: min�,c1,c2
Ec(�)
Update of �: ⇥(k+1) = ⇥(k) � �k�Ec(k)(⇥(k))
Update of c
21
Update of (c1, c2):
c(�) =�
I(x)H(�(x))dx�H(�(x))dx
Joint minimization:
c(k+1)1 = c(�(k))
c(k+1)2 = c(��(k))
min�,c1,c2
Ec(�)
Update of �: ⇥(k+1) = ⇥(k) � �k�Ec(k)(⇥(k))
(c(k+1)1 , c(k+1)
2 ) = argminc1,c2
Ec(�(k))
Example of Evolution
22
�(0)
Use de-localized initialization.
Conclusion
23
Curve evolution�� Energy minimization
Parametric vs. level set representation.
Dictionary to translate
– curve properties.– energy gradients.
Edge based vs. region based energies.