Slide 1

Slide 1 text

Active Contours Gabriel Peyré CEREMADE, Université Paris-Dauphine www.numerical-tours.com

Slide 2

Slide 2 text

Overview •Parametric Edge-based Active Contours • Implicit Edge-based Active Contours • Region-based Active Contours 2

Slide 3

Slide 3 text

Parametric Active Contours 3 – Closed curve: (0) = (1). – Open curve: (0) = x0 and (1) = x1 . Boundary conditions: Local minimum: argmin E( ) = L( ) + ⇥R( ) Regularization Data fidelity x0 x1

Slide 4

Slide 4 text

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 0 W( (t))|| (t)||dt, Local minimum: argmin E( ) = L( ) + ⇥R( ) Regularization Data fidelity x0 x1 Image f Weight W(x) Curve

Slide 5

Slide 5 text

Geodesic Active Contours 4 Geodesic active contours: (intrinsic) Replace W by W + , E( ) = L( ) = 1 0 W( (t))|| (t)||dt (local) minimum of the weighted length L. local geodesic (not minimal path). Weight W(x) Curve

Slide 6

Slide 6 text

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.

Slide 7

Slide 7 text

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 )

Slide 8

Slide 8 text

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.

Slide 9

Slide 9 text

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))

Slide 10

Slide 10 text

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) = ns (t), s (t)⇥ 1 || s (t)||2 Normal: Curvature: s ns E( ) only depends on { (t) \ t [0, 1]}.

Slide 11

Slide 11 text

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)|| d dt (t) || (t)|| d ds s = E( s ) Mean-curvature motion:

Slide 12

Slide 12 text

Discretization 8 Discretization: = { (i)}N 1 i=0 R2, with (N) = (0). k ⇥µ, ⇥⇤ = i ⇥µ(i), ⇥(i)⇤|| (i) (i + 1)||

Slide 13

Slide 13 text

Discretization 8 Discretization: = { (i)}N 1 i=0 R2, with (N) = (0). Discrete energy: k E( ) = i || (i) (i + 1)|| ⇥µ, ⇥⇤ = i ⇥µ(i), ⇥(i)⇤|| (i) (i + 1)||

Slide 14

Slide 14 text

Discretization 8 Discretization: = { (i)}N 1 i=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)||

Slide 15

Slide 15 text

Discretization 8 Discretization: = { (i)}N 1 i=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)||

Slide 16

Slide 16 text

Geodesic Active Contours Motion E( ) = L( ) = 1 0 W( (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

Slide 17

Slide 17 text

Open vs. Closed Curves s 0 Weight W(x) Image f(x) x0 x1 0 s

Slide 18

Slide 18 text

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( )

Slide 19

Slide 19 text

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:

Slide 20

Slide 20 text

Overview • Parametric Edge-based Active Contours •Implicit Edge-based Active Contours • Region-based Active Contor 12

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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( 1 s , 2 s ) Intersection of domains: s = max( 1 s , 2 s ) Example: circle of radius r Example: square of radius r s = min( 1 s , 2 s ) s (x) 0

Slide 23

Slide 23 text

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( 1 s , 2 s ) Intersection of domains: s = max( 1 s , 2 s ) Popular choice: (signed) distance to a curve ⇥s (x) = ± min t || s (t) x|| Example: circle of radius r Example: square of radius r infinite number of mappings s s . s = min( 1 s , 2 s ) s (x) 0

Slide 24

Slide 24 text

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:

Slide 25

Slide 25 text

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.

Slide 26

Slide 26 text

Proof 15 t, ⇥s ( s (t)) = 0 Definition of level-sets: d ds ⇥s (t) = (⇥s (t), ns (t), ⇤s (t)) ns (t) Evolution PDE: ( )

Slide 27

Slide 27 text

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: ( ) ( )

Slide 28

Slide 28 text

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)

Slide 29

Slide 29 text

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)||

Slide 30

Slide 30 text

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.

Slide 31

Slide 31 text

Implicit Geodesic Active Contours 16 Re-initialization: ⇥s (x) = ± min t || 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.

Slide 32

Slide 32 text

Multiple Fluids Dynamics 17 See Ron Fedkiw homepage. Multiple gaz: Fluid/air interface: http://physbam.stanford.edu/ fedkiw/

Slide 33

Slide 33 text

Overview • Parametric Edge-based Active Contours • Implicit Edge-based Active Contours •Region-based Active Contours 18

Slide 34

Slide 34 text

Energy Depending on Region 19 Regularization Data fidelity Optimal segmentation [0, 1]2 = c: min L1 ( ) + L2 ( c) + R( ) R( ) = | | Chan-Vese binary model: More general models L1 ( ) = |I(x) c1 |2dx

Slide 35

Slide 35 text

Energy Depending on Region 19 Regularization Data fidelity 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) x H (x) = 2 atan x ⇥ R( ) R( ) = ||⇥(H )(x)||dx L1 ( ) = |I(x) c1 |2dx L1 ( ) ⇥ L( ) = H ( (x))||I(x) c1 ||2dx

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

Update of c 21 Joint minimization: min ,c1,c2 Ec ( )

Slide 40

Slide 40 text

Update of c 21 Joint minimization: min ,c1,c2 Ec ( ) Update of : ⇥(k+1) = ⇥(k) k Ec(k) (⇥(k))

Slide 41

Slide 41 text

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 ) = argmin c1,c2 Ec ( (k))

Slide 42

Slide 42 text

Example of Evolution 22 (0) Use de-localized initialization.

Slide 43

Slide 43 text

Conclusion 23 Curve evolution Energy minimization Parametric vs. level set representation. Dictionary to translate – curve properties. – energy gradients. Edge based vs. region based energies.