SlideShare a Scribd company logo
3
Most read
4
Most read
14
Most read
Electrical &Computer
Engineering Department

University of Houston

Snakes in Images
Yan Xu

Bio-Image Analytics Laboratory
How snake works in images

http://www.iacl.ece.jhu.edu/~chenyang/research/levset/movie/index.html
How snake works in images
 Step 1: Model the shape by curve or surface
 Step 2: Define the energy function E along the curve
E = internal energy (curvature) + external energy (images)
 Step 3: Derive the curve to minimize the energy (calculus
of variations)
 Step 4: Propagate the curves (gradient descent) to reach
the minimum using level set (easier to implement in reality).

Keywords:
Curve

Energy

Level set
Snake -> Curves
Consider a closed planar curve C ( p) {x( p), y( p)}, p [0,1]
C(0.1)

S(p) is the arclength

C(0.2)

C(0.7)
C(0)

C(0.4)
C(0.95)

Cp =tangent
C(0.8)

Css

| Cp |

Css

N

N
1

C(0.9)

Cs

Cp

C

The geometric trace of the curve can be alternatively
represented implicitly as C {( x, y ) | ( x, y ) 0}
1
0
0

1
Properties of level sets

T

The level set normal

N

|


N

|

Proof. Along the level sets (equal 0) we have zero change,
that is s 0 , but by the chain rule
So,

s

|

( x, y )

|


,T

x

0

xs

|

y

|


,T

ys

T


N

|

|
Properties of Level Sets
The level set curvature
Css =div

|

|

Proof. zero change along the level sets,
ss

So,

( x, y )

d
( x xs
ds
,

|

|

y

|

ys )
|

[


,T

d
ds
x

xx s

xy

ys ,

ss


,T

d
ds
x

xy s

yy

ys ],

|

0 , also


, N

|

Numerical Geometry of Images:
http://webcourse.cs.technion.ac.il/236861/Winter2012-2013/en/ho_Tutorials.html
Constant Flow

Ct



N

Propagation of Curves

Change in topology

Curvature Flow

Ct

Grayson



N
Vanish at a
Circular
point

First becomes
convex

Gage-Hamilton
Curve propagation in Level Sets
dC
dt



VN

C(t)

d
dt

y

V

x

x, y, t

( x, y; t )
t

0

t


N

x

xt

y

yt

x xt

|

t

C(t) level set


, VN

, Ct

V

|

y

y yt


,N


,N

V

V

0

,

|

x

|

V|

|
Curve propagation in Level Sets
 Handles changes in topology
 Numeric grid points never collide
or drift apart.

Parametric Curve -> Level set in plane -> add time axis for propagation
Curve propagation in Level Sets
Some flows

Ct


VN

Ct


N

Ct

g

t

t

 
g, N N

V
2
xx y

div

t

2

xy x y
2
2
x
y

2
yy x

div g
g

2
xx y

2

xy x y
2
2
x
y

2
yy x

g,
Snake Model
1

arg min
C

Cp
0

2

C pp

tension

2

rigidity

2 g (C ) dp
external energy from the image

Energy

g (C )

|

[G (C ) * I (C )] |2

A snake that minimize E must satisfy the Euler equation

Cpp

Cpppp

g C

0

To find a solution

dC
dt

C pp

C pppp

g C

When C stabilizes and the term Ct vanishes, a solution is achieved.
Snakes: Active Contour Models, 1988
Geodesic Active Contour
arg min
C

L C
0

g C ds

ds is the Euclidean arc-length.

Trying to find minimum weighted distance

I(x)

Euler Lagrange gradient descent

Ct


g (C) n

 
g (C), n n

x
g(x)

d
dt

div g x, y

Geodesic Active Contours, 1997

x
GVF Snakes
Replace the external force with gradient vector flow (GVF) force v.

dC
dt

C pp

C pppp

g C

V(x,y) = [u(x,y),v(x,y)]
Why?
f generally have large magnitudes only in the vicinity of the edges, the
capture range would be small.
It’s nearly zero in homogeneous regions.
V(x,y) = [u(x,y), v(x,y)] is defined as the vector field that minimizes
the energy functional:

http://www.iacl.ece.jhu.edu/static/gvf/
GVF Snake Results
Original Snake Model

2d GVF vector field

GVF Snake Model
itk Implementation for
GVF Geodesic Active Contour
Original Image

Gradient Magnitude

Gradient

Initial Contour

Sigmoid
Rescaling

Geodesic
Active
Contour

Gradient
Vector Flow
Thresholding

Insight Segmentation and Registration Toolkit (ITK)
itk Implementation for
GVF Geodesic Active Contour
gvfFilter->Update();
GeoAC->SetInput(initialContour->GetOutput());
GeoAC->SetAutoGenerateSpeedAdvection(false);
GeoAC->SetFeatureImage(sigmoid->GetOutput());
GeoAC->GenerateSpeedImage();
GeoAC->SetAdvectionImage(gvfFilter->GetOutput());
Recommended:
Numerical Geometry of Images:
http://webcourse.cs.technion.ac.il/236861/Winter2012-2013/en/ho_Tutorials.html
Calculus of Variations
Generalization of Calculus that seeks to find the
path, curve, surface, etc., for which a given Functional has
a minimum or maximum.
Goal: find extrema values of integrals of the form

F (u, u x )dx
It has an extremum only if the Euler-Lagrange
Differential Equation is satisfied,

u

d
F ( u, u x )
dx u x

0
Calculus of Variations
Example: Find the shape of the curve {x,y(x)} with
shortest length:
x1
y ( x1 )
2
1 y x dx ,
y ( x0 )
x0
given y(x0),y(x1)

x0
Solution: a differential equation that y(x) must
satisfy,
y xx
0
yx a
y ( x ) ax b
3/ 2
2
1 yx

x1

More Related Content

PPTX
Particle swarm optimization
PDF
Lec11: Active Contour and Level Set for Medical Image Segmentation
PPTX
Discrete Fourier Transform
PPT
pushdown automata
PPTX
Introduction to Random Walk
PPT
Fourier analysis of signals and systems
PPTX
Classical Sets & fuzzy sets
PDF
Solved problems
Particle swarm optimization
Lec11: Active Contour and Level Set for Medical Image Segmentation
Discrete Fourier Transform
pushdown automata
Introduction to Random Walk
Fourier analysis of signals and systems
Classical Sets & fuzzy sets
Solved problems

What's hot (20)

PPTX
Noise
PPT
Fuzzy c-means clustering for image segmentation
PDF
Dcs unit 2
PPTX
High pass-low-pass-filter
PDF
digital signal-processing-lab-manual
PPT
aem : Fourier series of Even and Odd Function
PDF
Chapter2 - Linear Time-Invariant System
PPT
fuzzy_measures.ppt
PPT
PPTX
Design of Filters PPT
PDF
Fast Fourier Transform
PPTX
The False-Position Method
PDF
Hw1 solution
PPTX
Quantum error correction
PPTX
Fourier series
PDF
Markov Chain Monte Carlo Methods
PPTX
single stage amplifier Unit 5 AMVLSI
PDF
Laplace Transforms
PPTX
discrete time signals and systems
Noise
Fuzzy c-means clustering for image segmentation
Dcs unit 2
High pass-low-pass-filter
digital signal-processing-lab-manual
aem : Fourier series of Even and Odd Function
Chapter2 - Linear Time-Invariant System
fuzzy_measures.ppt
Design of Filters PPT
Fast Fourier Transform
The False-Position Method
Hw1 solution
Quantum error correction
Fourier series
Markov Chain Monte Carlo Methods
single stage amplifier Unit 5 AMVLSI
Laplace Transforms
discrete time signals and systems
Ad

Viewers also liked (20)

PPTX
Active contour segmentation
PPT
Dip Image Segmentation
PPT
Image segmentation ppt
PPTX
IMAGE SEGMENTATION.
PDF
Mesh Processing Course : Active Contours
PDF
CVIM mean shift-3
PDF
Chapter1 4.6
PPTX
Image Segmentation
PDF
Meanshift Tracking Presentation
PDF
Segmentation of Color Image using Adaptive Thresholding and Masking with Wate...
PPTX
various methods for image segmentation
PPTX
Image Processing Using MATLAB
PDF
A version of watershed algorithm for color image segmentation
PDF
36324442 biosignal-and-bio-medical-image-processing-matlab-based-applications...
PPTX
Image segmentation
PDF
Microscopic Digital Image Segmentation And feature Extraction of Acute Leukemia
PPSX
Water conservation
PDF
Unidad 5.
RTF
โทรศัพท์และสัญญาณ
PPTX
Evaluation question 6..
Active contour segmentation
Dip Image Segmentation
Image segmentation ppt
IMAGE SEGMENTATION.
Mesh Processing Course : Active Contours
CVIM mean shift-3
Chapter1 4.6
Image Segmentation
Meanshift Tracking Presentation
Segmentation of Color Image using Adaptive Thresholding and Masking with Wate...
various methods for image segmentation
Image Processing Using MATLAB
A version of watershed algorithm for color image segmentation
36324442 biosignal-and-bio-medical-image-processing-matlab-based-applications...
Image segmentation
Microscopic Digital Image Segmentation And feature Extraction of Acute Leukemia
Water conservation
Unidad 5.
โทรศัพท์และสัญญาณ
Evaluation question 6..
Ad

Similar to Snakes in Images (Active contour tutorial) (20)

PDF
On approximating the Riemannian 1-center
PDF
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...
PDF
Adaptive Restore algorithm & importance Monte Carlo
PDF
sublabel accurate convex relaxation of vectorial multilabel energies
PDF
TAO Fayan_X-Ray and MIP volume rendering
PDF
Iterative methods with special structures
PDF
Fast Object Recognition from 3D Depth Data with Extreme Learning Machine
PDF
Divergence clustering
DOCX
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
PDF
QMC: Transition Workshop - Applying Quasi-Monte Carlo Methods to a Stochastic...
PDF
Fir 05 dynamics
PDF
cswiercz-general-presentation
PPT
Fracture Mechanics and general idea to applied mechanics
PDF
How to design a linear control system
PDF
Computing the masses of hyperons and charmed baryons from Lattice QCD
PPT
amyn.pptfrgvvbjkrte5uihnhnhnhnhnhnhnhnhnwropiiijnmweo
PDF
ABC-Gibbs
PDF
Trilinear embedding for divergence-form operators
PDF
Ch06 ssm
PPT
showing the details of the animation-fundamentals.ppt
On approximating the Riemannian 1-center
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...
Adaptive Restore algorithm & importance Monte Carlo
sublabel accurate convex relaxation of vectorial multilabel energies
TAO Fayan_X-Ray and MIP volume rendering
Iterative methods with special structures
Fast Object Recognition from 3D Depth Data with Extreme Learning Machine
Divergence clustering
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
QMC: Transition Workshop - Applying Quasi-Monte Carlo Methods to a Stochastic...
Fir 05 dynamics
cswiercz-general-presentation
Fracture Mechanics and general idea to applied mechanics
How to design a linear control system
Computing the masses of hyperons and charmed baryons from Lattice QCD
amyn.pptfrgvvbjkrte5uihnhnhnhnhnhnhnhnhnwropiiijnmweo
ABC-Gibbs
Trilinear embedding for divergence-form operators
Ch06 ssm
showing the details of the animation-fundamentals.ppt

More from Yan Xu (20)

PPTX
Kaggle winning solutions: Retail Sales Forecasting
PDF
Basics of Dynamic programming
PPTX
Walking through Tensorflow 2.0
PPTX
Practical contextual bandits for business
PDF
Introduction to Multi-armed Bandits
PDF
A Data-Driven Question Generation Model for Educational Content - by Jack Wang
PDF
Deep Learning Approach in Characterizing Salt Body on Seismic Images - by Zhe...
PDF
Deep Hierarchical Profiling & Pattern Discovery: Application to Whole Brain R...
PDF
Detecting anomalies on rotating equipment using Deep Stacked Autoencoders - b...
PDF
Introduction to Autoencoders
PPTX
State of enterprise data science
PDF
Long Short Term Memory
PDF
Deep Feed Forward Neural Networks and Regularization
PPTX
Linear algebra and probability (Deep Learning chapter 2&3)
PPTX
HML: Historical View and Trends of Deep Learning
PDF
Secrets behind AlphaGo
PPTX
Optimization in Deep Learning
PDF
Introduction to Recurrent Neural Network
PDF
Convolutional neural network
PDF
Introduction to Neural Network
Kaggle winning solutions: Retail Sales Forecasting
Basics of Dynamic programming
Walking through Tensorflow 2.0
Practical contextual bandits for business
Introduction to Multi-armed Bandits
A Data-Driven Question Generation Model for Educational Content - by Jack Wang
Deep Learning Approach in Characterizing Salt Body on Seismic Images - by Zhe...
Deep Hierarchical Profiling & Pattern Discovery: Application to Whole Brain R...
Detecting anomalies on rotating equipment using Deep Stacked Autoencoders - b...
Introduction to Autoencoders
State of enterprise data science
Long Short Term Memory
Deep Feed Forward Neural Networks and Regularization
Linear algebra and probability (Deep Learning chapter 2&3)
HML: Historical View and Trends of Deep Learning
Secrets behind AlphaGo
Optimization in Deep Learning
Introduction to Recurrent Neural Network
Convolutional neural network
Introduction to Neural Network

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Electronic commerce courselecture one. Pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Review of recent advances in non-invasive hemoglobin estimation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Per capita expenditure prediction using model stacking based on satellite ima...
Machine learning based COVID-19 study performance prediction
Electronic commerce courselecture one. Pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Snakes in Images (Active contour tutorial)

  • 1. Electrical &Computer Engineering Department University of Houston Snakes in Images Yan Xu Bio-Image Analytics Laboratory
  • 2. How snake works in images http://www.iacl.ece.jhu.edu/~chenyang/research/levset/movie/index.html
  • 3. How snake works in images  Step 1: Model the shape by curve or surface  Step 2: Define the energy function E along the curve E = internal energy (curvature) + external energy (images)  Step 3: Derive the curve to minimize the energy (calculus of variations)  Step 4: Propagate the curves (gradient descent) to reach the minimum using level set (easier to implement in reality). Keywords: Curve Energy Level set
  • 4. Snake -> Curves Consider a closed planar curve C ( p) {x( p), y( p)}, p [0,1] C(0.1) S(p) is the arclength C(0.2) C(0.7) C(0) C(0.4) C(0.95) Cp =tangent C(0.8) Css | Cp | Css N N 1 C(0.9) Cs Cp C The geometric trace of the curve can be alternatively represented implicitly as C {( x, y ) | ( x, y ) 0} 1 0 0 1
  • 5. Properties of level sets  T The level set normal  N |  N | Proof. Along the level sets (equal 0) we have zero change, that is s 0 , but by the chain rule So, s | ( x, y ) |  ,T x 0 xs | y |  ,T ys  T  N | |
  • 6. Properties of Level Sets The level set curvature Css =div | | Proof. zero change along the level sets, ss So, ( x, y ) d ( x xs ds , | | y | ys ) | [  ,T d ds x xx s xy ys , ss  ,T d ds x xy s yy ys ], | 0 , also  , N | Numerical Geometry of Images: http://webcourse.cs.technion.ac.il/236861/Winter2012-2013/en/ho_Tutorials.html
  • 7. Constant Flow Ct   N Propagation of Curves Change in topology Curvature Flow Ct Grayson   N Vanish at a Circular point First becomes convex Gage-Hamilton
  • 8. Curve propagation in Level Sets dC dt   VN C(t) d dt y V x x, y, t ( x, y; t ) t 0 t  N x xt y yt x xt | t C(t) level set  , VN , Ct V | y y yt  ,N  ,N V V 0 , | x | V| |
  • 9. Curve propagation in Level Sets  Handles changes in topology  Numeric grid points never collide or drift apart. Parametric Curve -> Level set in plane -> add time axis for propagation
  • 10. Curve propagation in Level Sets Some flows Ct  VN Ct  N Ct g t t   g, N N V 2 xx y div t 2 xy x y 2 2 x y 2 yy x div g g 2 xx y 2 xy x y 2 2 x y 2 yy x g,
  • 11. Snake Model 1 arg min C Cp 0 2 C pp tension 2 rigidity 2 g (C ) dp external energy from the image Energy g (C ) | [G (C ) * I (C )] |2 A snake that minimize E must satisfy the Euler equation Cpp Cpppp g C 0 To find a solution dC dt C pp C pppp g C When C stabilizes and the term Ct vanishes, a solution is achieved. Snakes: Active Contour Models, 1988
  • 12. Geodesic Active Contour arg min C L C 0 g C ds ds is the Euclidean arc-length. Trying to find minimum weighted distance I(x) Euler Lagrange gradient descent Ct  g (C) n   g (C), n n x g(x) d dt div g x, y Geodesic Active Contours, 1997 x
  • 13. GVF Snakes Replace the external force with gradient vector flow (GVF) force v. dC dt C pp C pppp g C V(x,y) = [u(x,y),v(x,y)] Why? f generally have large magnitudes only in the vicinity of the edges, the capture range would be small. It’s nearly zero in homogeneous regions. V(x,y) = [u(x,y), v(x,y)] is defined as the vector field that minimizes the energy functional: http://www.iacl.ece.jhu.edu/static/gvf/
  • 14. GVF Snake Results Original Snake Model 2d GVF vector field GVF Snake Model
  • 15. itk Implementation for GVF Geodesic Active Contour Original Image Gradient Magnitude Gradient Initial Contour Sigmoid Rescaling Geodesic Active Contour Gradient Vector Flow Thresholding Insight Segmentation and Registration Toolkit (ITK)
  • 16. itk Implementation for GVF Geodesic Active Contour gvfFilter->Update(); GeoAC->SetInput(initialContour->GetOutput()); GeoAC->SetAutoGenerateSpeedAdvection(false); GeoAC->SetFeatureImage(sigmoid->GetOutput()); GeoAC->GenerateSpeedImage(); GeoAC->SetAdvectionImage(gvfFilter->GetOutput());
  • 17. Recommended: Numerical Geometry of Images: http://webcourse.cs.technion.ac.il/236861/Winter2012-2013/en/ho_Tutorials.html
  • 18. Calculus of Variations Generalization of Calculus that seeks to find the path, curve, surface, etc., for which a given Functional has a minimum or maximum. Goal: find extrema values of integrals of the form F (u, u x )dx It has an extremum only if the Euler-Lagrange Differential Equation is satisfied, u d F ( u, u x ) dx u x 0
  • 19. Calculus of Variations Example: Find the shape of the curve {x,y(x)} with shortest length: x1 y ( x1 ) 2 1 y x dx , y ( x0 ) x0 given y(x0),y(x1) x0 Solution: a differential equation that y(x) must satisfy, y xx 0 yx a y ( x ) ax b 3/ 2 2 1 yx x1