snakes: active contour modelsgerig/cs6640-f2014/materials/cs6640-f2014-snakes.pdf · univ of utah,...

23
Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig School of Computing University of Utah (some material from Zoltan Kato http://www.cab.u- szeged.hu/~kato/variational/) J. Prince, JHU: http://www.iacl.ece.jhu.edu/static/gvf/gvfsnake5.html

Upload: others

Post on 14-Mar-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Univ of Utah, Guido Gerig, CS/BIOEN6640

1

Snakes: Active Contour Models

CS/BIOEN 6640Guido GerigSchool of ComputingUniversity of Utah(some material from Zoltan Kato http://www.cab.u-szeged.hu/~kato/variational/)

J. Prince, JHU: http://www.iacl.ece.jhu.edu/static/gvf/gvfsnake5.html

Page 2: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Principle: Active Contour Models

Univ of Utah, Guido Gerig, CS/BIOEN6640

2http://www.ee.iitb.ac.in/uma/~krishnan/research.html

Page 3: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Univ of Utah, Guido Gerig, CS/BIOEN6640

3

Materials

• Kass, Witkin, Terzopopoulos, Int. Journal of Computer Vision, 321-331, 1988

• Trucco and Verri, Introductory Techniques for 3-D Computer Vision, Chapter 5

• Bryan Morse, Lecture 21 Image Understanding

Page 4: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Websites

• Andy Witkin’s homepage: http://www.cs.cmu.edu/~aw/

• Terzopoulos: http://www.cs.ucla.edu/~dt/vision.html→ Snakes: Active Contour Models

• Original snake demo: Kass, Witkin, Terzopoulos 1988: http://www.cs.ucla.edu/~dt/videos/deformable-models/snakes.avi

• Other Demos:– Xu/Prince: http://www.iacl.ece.jhu.edu/static/gvf/– http://users.ecs.soton.ac.uk/msn/book/new_demo/– http://www.markschulze.net/snakes/index.html

Univ of Utah, Guido Gerig, CS/BIOEN6640

4

Page 5: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Video Analysis

Univ of Utah, Guido Gerig, CS/BIOEN6640

5

http://www.ee.iitb.ac.in/uma/~krishnan/OneStopNoEnter2cor-SS.avi http://www.ee.iitb.ac.in/uma/~krishnan/ShopAssistant1cor.avi

movie

Page 6: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Snake: Active Contour Model

Univ of Utah, Guido Gerig, CS/BIOEN6640

6

From: PhD thesis Dr Jim Ivins http://www.computing.edu.au/~jim/thesis.html

Page 7: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Snake’s Energy Function• Position of the snake v(s) = (x(s),y(s))• Esnake = ∫ [ Eint v(s) + Eimagev(s) + Econv(s)] ds

– Internal: Internal energy due to bending. Serves to impose piecewise smoothness constraint

– Image: Image forces pushing the snake toward image features (edges, etc…)

– Constraints: External constraints are responsible for putting the snake near the desired local minimum

Univ of Utah, Guido Gerig, CS/BIOEN6640

7

Page 8: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Internal Energy

• Eint = [ α(s) |vs(s)|2 + β(s) |vss(s)|2 ]

– First order term: membrane, α(s): ”elasticity”

– Second order term: thin plate, β(s): “rigidity, stiffness”

– If α(s)=β(s)=0, we allow breaks in the contour

Univ of Utah, Guido Gerig, CS/BIOEN6640

8

Page 9: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Image Forces

• Edge Functional : negative gradient magnitude: Eedge= - |∇ I(x,y)|2

• Better: negative gradient magnitude of Gaussian-smoothed image:

Eedge= - |∇ G(� )� I(x,y)|2

→ Attracts the snake to locations of large gradients = strong edges

Univ of Utah, Guido Gerig, CS/BIOEN6640

9

Page 10: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Image Term: Potential Energy

Univ of Utah, Guido Gerig, CS/BIOEN6640

10

From: PhD thesis Dr Jim Ivins http://www.computing.edu.au/~jim/thesis.html

Page 11: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

External Constraint Forces: Spring

Univ of Utah, Guido Gerig, CS/BIOEN6640

11

Page 12: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

External Constraint Forces• Springs: add k(xsnake-ximage)2 to Econ : energy becomes

zero when xsnake moves to ximage, otherwise gets large

Univ of Utah, Guido Gerig, CS/BIOEN6640

12

xsnake

ximage

Page 13: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

External Constraint Forces• Volcano: 1/r2 repulsion force, combine with image

potential: Econ = k /(xsnake-xvolcano)2 : large at volcano center, fades off with distance

Univ of Utah, Guido Gerig, CS/BIOEN6640

13

Page 14: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Original Demo Kass et al., 1988

Univ of Utah, Guido Gerig, CS/BIOEN6640

14

http://www.cs.ucla.edu/~dt/videos/deformable-models/snakes.avi

Click image to run

Local link

Page 15: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

External Constraint Forces

Univ of Utah, Guido Gerig, CS/BIOEN6640

15

From: PhD thesis Dr Jim Ivins http://www.computing.edu.au/~jim/thesis.html

Page 16: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Web-Demo• Computer Vision Demonstration Website, Electronics and

Computer Science, University of Southampton• http://users.ecs.soton.ac.uk/msn/book/new_demo/Snakes/

Univ of Utah, Guido Gerig, CS/BIOEN6640

16

Page 17: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

External Forces(Suri/Farag)

Univ of Utah, Guido Gerig, CS/BIOEN6640

17

Page 18: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

External Forces(Suri/Farag)

Univ of Utah, Guido Gerig, CS/BIOEN6640

18

Spring: Adds-k(x1-x2)2

to Econ

Use: Pull a snake to the specified true boundary

Page 19: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

External Forces(Suri/Farag)

Univ of Utah, Guido Gerig, CS/BIOEN6640

19

Page 20: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Numerical Solutions

Univ of Utah, Guido Gerig, CS/BIOEN6640

20

0

2

2

2

22

2

=−+

∂+

∂− vv EE

dsd

dsyd

E

dsxd

Edsd

s

Page 21: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Numerical Solutions

Univ of Utah, Guido Gerig, CS/BIOEN6640

21

• The spline v(s) which minimizes E*snakemust satisfy

• Solutions: Greedy local updates, Euler Lagrange etc. (see handouts)

0

2

2

2

22

2

=−+

∂+

∂− vv EE

dsd

dsyd

E

dsxd

Edsd

s

Page 22: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Using Snakes for Dynamic Scenes

• Once a snake finds a feature, it „locks on”

• If feature begins to move, the snake will track the same local minimum

• Fast motion could cause the snake to flip into a different minimum

Univ of Utah, Guido Gerig, CS/BIOEN6640

22

Page 23: Snakes: Active Contour Modelsgerig/CS6640-F2014/Materials/CS6640-F2014-Snakes.pdf · Univ of Utah, Guido Gerig, CS/BIOEN6640 1 Snakes: Active Contour Models CS/BIOEN 6640 Guido Gerig

Example Movie Sequences

Univ of Utah, Guido Gerig, CS/BIOEN6640

23

movie