Variational Approaches and Image Segmentation Lecture #7 Hossam Abdelmunim1 & Aly A. Farag2 1Computer & Systems Engineering Department, Ain Shams University, Cairo, Egypt 2Electerical and Computer Engineering Department, University of Louisville, Louisville, KY, USA ECE 643 – Fall 2010 1 The curvature and The Implicit Function Form The level set function has the following relation with the embedded curve C: (C) 0 or C 1 (0) Us the following derivative equation w.r.t. the arc-length s: ( )T Cs 0 To prove that: (Assignment) Calculating Additional Quantities • A H ()dxdy, Enclosed Area • L () | | dxdy, Length of Interface • Mainly used to track the Interface/contour:- () (1 cos( / )) /(2 ),| | H () 0.5(1 H () 1, | | 1 sin( / )),| | Applying δ Function H and Delta Functions Example of a Level Set Function iso-contours Applying H Function Narrow Banding • Points of the interface/front/contour are only the points of interest. • The points (highlighted) are called the narrow band. • The change of the level set function at these points only are considered. Boundary Band Points. • Other points (outside the narrow band) are called far away points and take large positive or large negative values. • This will expedite the processing later on. Red line is the zero level set corresponding to front. Level Set PDE Curve Contracts with time ( x, y, t ) 0 Level Set Function changes with time dt dx dy 0 t x y dx dy ( , ).( , ) 0 | | .V 0 t x y dt dt t | | Fundamental Level Set Equation | | F 0 t The velocity vector V has a component F in the normal direction. The other tangential component has no effect because the gradient works in the normal direction. Speed Function Among several forms, the following speed function is used: F 1 k Image data (force): Contour characteristics: +1 for expansion Smoothes the evolution and the bending is quantized by ε -1 for contraction It will be a function of the image (I). Variational Edge-based Segmentation Edge map 1 g (I ) 1 | (G * I ) | Where g is an indicator function of the image gradient: Variational Edge-based Segmentation (Cont…) Energy = Arc-Length + Enclosed Area: E() g ( I ) () | | d g ( I ) H ()d By calculus of variation: t ()[div( g ) g ] | | The amount of bending is controlled by λ>0. The sign of עdepends on the position of the contour w.r.t. the object. Variational Segmentation without Edges Chan-Vese Model c1 H () Id H ()d c2 H () Id H ()d Object Mean Background Mean Ecv [( I c1 ) 2 H () ( I c2 ) 2 H () | H () |]d Maximizes the distance between c1 and c2 Only one level set function is used Variational Segmentation without Edges Chan-Vese Model (Cont…) The PDE will be: t ()[div( ) ( I c1 ) 2 ( I c2 ) 2 ] | | For computational issues: t ()[div( where: ) ] | | 1 if ( I c1 ) 2 ( I c 2 ) 2 0 1 if ( I c1 ) 2 ( I c 2 ) 2 0 Chan & Vese--Examples Multi-phase Evolution Chan & Vese C3 In this example 2 functions are used. Then 22=4 regions are considered. The energy will be: Ф2>0 Ф1<0 Ф1>0 Ф2>0 Ф2<0 Ecv ( I c3 ) 2 H (1 ) H ( 2 ) ( I c 4 ) 2 H ( 1 ) H ( 2 ) (| H (1 ) | | H ( 2 ) |)]d C4 Ф1<0 [(I c1 ) 2 H (1 ) H ( 2 ) ( I c 2 ) 2 H ( 1 ) H ( 2 ) Ф1>0 Ф2<0 C2 C1 Multi-phase Evolution Chan & Vese (Cont…) Using calculus of variations will result in: 1 (1 )[(I c1 ) 2 H ( 2 ) ( I c2 ) 2 H ( 2 ) ( I c3 ) 2 H ( 2 ) t ( I c4 ) 2 H ( 2 ) 1 ] 2 ( 2 )[(I c1 ) 2 H (1 ) ( I c2 ) 2 H (1 ) ( I c3 ) 2 H (1 ) t ( I c4 ) 2 H (1 ) 2 ] Multi-phase Evolution Chan & Vese (Example) The given image contains 4 regions. Three different color boxes are represented in the foreground. The background is considered the fourth region. Multi-phase Evolution 8 Regions-3 Level sets 2 5 6 1 4 3 7 8 Chan & Vese (Cont…) The curvature is included with a coefficient μ which helps in segmenting images with noise but when the noise level is high, the weight needs to be increased. This affects the boundaries of the object and also increases the convergence time. Number of regions are always 2n depending on the number of level set functions n. No vacuum pixels appear because if any point does not belong to a certain region, it will go to another one. Unless the region can be described by only its mean, the segmentation will fail. Thank You & Questions