1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A....

18
1 Variational Approaches and Image Segmentation Lecture #6 Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department, Ain Shams University, Cairo, Egypt 2 Electerical and Computer Engineering Department, University of Louisville, Louisville, KY, USA ECE 643 – Fall 2010

Transcript of 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A....

Page 1: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

1

Variational Approaches and Image Segmentation

Lecture #6Lecture #6Hossam 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

Page 2: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

The curvature and The Implicit Function FormThe curvature and The Implicit Function Form

)0(0)( 1 CorC

The level set function has the following relation with the embedded curve C:

0)( sTC

Us the following derivative equation w.r.t. the arc-length s:

To prove that: (Assignment)

Page 3: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

Calculating Additional Quantities

||),2/())/cos(1()(

||,1)(

||)),/sin(1

1(5.0)(

H

HExample of a Level Set Function

iso-contours

H and Delta FunctionsApplying H FunctionApplying δ Function

,)( dxdyHA

,||)( dxdyL

• Enclosed Area

• Length of Interface

• Mainly used to track the Interface/contour:-

Page 4: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

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.

• 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.

Boundary Band Points.

Red line is the zero level set corresponding to

front.

Page 5: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

Level Set PDELevel Set PDE

0),).(,(

dt

dy

dt

dx

yxt0.

||||

Vt

0),,( tyx

Curve Contracts with time

0

dyy

dxx

dtt

Level Set Function changes with time

0||

Ft

Fundamental Level Set Equation

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.

Page 6: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

Speed FunctionSpeed Function

1F

Among several forms, the following speed function can be used:

Contour characteristics:

Forces the contour to evolve smoothly. The bending is quantized by ε.

Image data (force):

+1 for expansion

-1 for contraction

It will be a function of the image (I).

Page 7: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

7

Need for Re-initializationNeed for Re-initializationNeed for Re-initializationNeed for Re-initialization• Solving the PDE of level set evolution does not keep the definition.• Keeping the definition is very necessary to hold the front between

the positive and negative regions.

|)|1)(sgn( 0 t

• Solving this equation frequently often in parallel with the main equation keeps the function close to the signed distance definition.

1|| x

x0x

Page 8: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

Numerical Solution

Page 9: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

Upwind Scheme and Discontinuous Solutions

Upwind Scheme and Discontinuous Solutions

Consider the following PDE:

It is one dimensional in x and can have the following numerical solution for different values of the speed a (can be of course a function of x):

Page 10: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

Upwind Scheme and Discontinuous Solutions (Cont…)

Upwind Scheme and Discontinuous Solutions (Cont…)

So, we can define (as a notation):

To put the solution in the following general form:

Page 11: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

First Order Upwind Scheme and Discontinuous Solutions

First Order Upwind Scheme and Discontinuous Solutions

Consider the Solution of the re-initialization PDE:-

a+=max(a,0) and a-=min(a,0)

Page 12: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

First Order Upwind Scheme and Discontinuous Solutions whereFirst Order Upwind Scheme and Discontinuous Solutions where

)2

1)((2)( HS

And a smoothed version of the sign function is defined as follows:

Page 13: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

Numerical Algorithm for the Level Set Evolution Equation – Higher Order Scheme

Numerical Algorithm for the Level Set Evolution Equation – Higher Order Scheme

We consider the numerical solution of the equation:

0|| Ft

Note that it is very similar to the 1D equation we showed above. Without proof, this equation will have the following numerical solution:

Page 14: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

Numerical Algorithm for the Level Set Evolution Equation (Cont…) where

Numerical Algorithm for the Level Set Evolution Equation (Cont…) where

Page 15: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

Numerical Algorithm for the Level Set Evolution Equation (Cont…) and

Numerical Algorithm for the Level Set Evolution Equation (Cont…) and

The switching function m is given by:

The speed function is given by:

Page 16: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

16

Examples..1Examples..1Examples..1Examples..1• Curvature flow with a curvature speed:

F

Parts of the curve with different curvature signs, move in opposite directions.

Page 17: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

17

Examples..2Examples..2Examples..2Examples..2• Curvature flow with a positive curvature speed:

)0,max(F

Parts of the curve with -ve curvature do not move

Page 18: 1 Lecture #6 Variational Approaches and Image Segmentation Lecture #6 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department,

18

Examples..3Examples..3Examples..3Examples..3• Curvature flow with a negative speed vector:

Parts of the curve with +ve curvature do not move

)0,min(F