28
CS376 Computer Vision Lecture 9: Active Contours Qixing Huang Feb. 20 th 2019

CS376 Computer Vision Lecture 9: Active Contours

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS376 Computer Vision Lecture 9: Active Contours

CS376 Computer VisionLecture 9: Active Contours

Qixing Huang

Feb. 20th 2019

Page 2: CS376 Computer Vision Lecture 9: Active Contours

Previous Lecture

• RANSAC

• Robust fitting

Page 3: CS376 Computer Vision Lecture 9: Active Contours

This Lecture

• Active contour and its variants

– Widely used in computer vision and beyond

Page 4: CS376 Computer Vision Lecture 9: Active Contours

Shortest paths segmentation

• “Intelligent scissors”or “Live wire”

– Shortest paths on image graph connect seeds, which the user places on the boundary

Page 5: CS376 Computer Vision Lecture 9: Active Contours

Minimizing user interaction

• Suppose we only know roughly where the object is. Can we do without placing sample points

Page 6: CS376 Computer Vision Lecture 9: Active Contours

Active Contours (snakes)

• Start with a curve near the object

– Evolve the curve to fit the boundary

– Application is in segmentation and tracking

Page 7: CS376 Computer Vision Lecture 9: Active Contours

Snakes: Active Contour Models

• Introduced by Kass, Witkin, and Terzopoulos in 1988

• Framework: energy minimization

– Bending and stretching curve = more energy

– Good features = less energy

– Curve evolves to minimize energy

• Also “Deformable Contours”

Page 8: CS376 Computer Vision Lecture 9: Active Contours

Snake energy function

• Energy function on a snake has two terms (one prior + one data)

Etotal= Ein + Eex

Internal energy encourages smoothness or any particular shape

Internal energy incorporates prior knowledge about object boundary allowing to extract boundary even if some image data is missing

External energy encourages curve onto image structures (e.g. image edges)

Page 9: CS376 Computer Vision Lecture 9: Active Contours

Discrete snake formulation

• Use a spline with control points vi = (xi, yi)

(x0,y0)

(x3,y3)

(x10,y10)

Page 10: CS376 Computer Vision Lecture 9: Active Contours

Discrete external energy

• Want to attract the snake to edges

Slide Credit: Ramin Zabih

Page 11: CS376 Computer Vision Lecture 9: Active Contours

Other external energy-corner attraction

• Can use corner detector (e.g., when talking about the optical flow)

• Alternatively, let q = tan-1 Iy / Ix

and let n⊥be a unit vector perpendicular to the gradient. Then

Page 12: CS376 Computer Vision Lecture 9: Active Contours

Other external energy-constraint forces

• Spring

• Repulsion

Page 13: CS376 Computer Vision Lecture 9: Active Contours

Discrete internal energy

Elasticity term Stiffness term

Slide Credit: Ramin Zabih

Page 14: CS376 Computer Vision Lecture 9: Active Contours

Relative weighting of terms

• Notice that the strength of the internal elastic component can be controlled by the parameter alpha

• Increasing this increases curve stiffness

Slide Credit: Ramin Zabih

Page 15: CS376 Computer Vision Lecture 9: Active Contours

Some variants

Slide Credit: Ramin Zabih

Page 16: CS376 Computer Vision Lecture 9: Active Contours

Synthetic example

Slide Credit: Ramin Zabih

Page 17: CS376 Computer Vision Lecture 9: Active Contours

Snake energy

Slide Credit: Ramin Zabih

Page 18: CS376 Computer Vision Lecture 9: Active Contours

Evolving strategy - dynamic programming

Slide Credit: Ramin Zabih

Page 19: CS376 Computer Vision Lecture 9: Active Contours

Other evolving strategies (Not required)

• Think about the continuous formulation

• A curve can be represented parametrically

Page 20: CS376 Computer Vision Lecture 9: Active Contours

Evolving curve

• Exact solution: calculus of variations

• Write equations directly in terms of forces,not energy

• Most follow-up works use this formulation

• Implicit equation solver

– More complicated implementations

Page 21: CS376 Computer Vision Lecture 9: Active Contours

Limitations of snakes

• Get stuck in local minimum

• Often miss indentations in objects

• Hard to prevent self-intersections

• Cannot follow topological changes!

Page 22: CS376 Computer Vision Lecture 9: Active Contours

Variants on snakes

• Balloons [Cohen 91]

– Add inflation force

– Helps avoid getting stuck on small features

)(skFinfl n=

Slide Credit: Szymon Rusinkiewicz

Page 23: CS376 Computer Vision Lecture 9: Active Contours

Balloons

[Cohen 91]Snakes

Balloons

Slide Credit: Szymon Rusinkiewicz

Page 24: CS376 Computer Vision Lecture 9: Active Contours

Balloons

[Cohen 91]

Slide Credit: Szymon Rusinkiewicz

Page 25: CS376 Computer Vision Lecture 9: Active Contours

Diffusion-Based Methods

• Another way to attract curve to localized features: vector flow or diffusion methods

• Example:

– Find edges using Canny

– For each point, compute distance tonearest edge

– Push curve along gradient of distance field

Slide Credit: Szymon Rusinkiewicz

Page 26: CS376 Computer Vision Lecture 9: Active Contours

Gradient Vector Fields

Simple Snake With Gradient Vector Field

Xu and Prince 98

Slide Credit: Szymon Rusinkiewicz

Page 27: CS376 Computer Vision Lecture 9: Active Contours

Gradient Vector Fields

Xu and Prince 98

Slide Credit: Szymon Rusinkiewicz

Page 28: CS376 Computer Vision Lecture 9: Active Contours

User-Visible Options

• Initialization: user-specified, automatic

• Curve properties: continuity, smoothness

• Image features: intensity, edges, corners, …

• Other forces: hard constraints, springs, attractors, repulsors, …

• Scale: local, multiresolution, global