Snakes - Active Contour Lecturer: Hagit Hel-Or

Slides:



Advertisements
Similar presentations
An Active contour Model without Edges
Advertisements

Image Segmentation with Level Sets Group reading
TP11 - Fitting: Deformable contours Computer Vision, FCUP, Miguel Coimbra Slides by Prof. Kristen Grauman.
Fitting: Deformable contours
MRI Brain Extraction using a Graph Cut based Active Contour Model Noha Youssry El-Zehiry Noha Youssry El-Zehiry and Adel S. Elmaghraby Computer Engineering.
Active Contours, Level Sets, and Image Segmentation
Fitting: The Hough transform. Voting schemes Let each feature vote for all the models that are compatible with it Hopefully the noise features will not.
Snakes, Strings, Balloons and Other Active Contour Models.
CS 4487/9587 Algorithms for Image Analysis
Segmentation In The Field Medicine Advanced Image Processing course By: Ibrahim Jubran Presented To: Prof. Hagit Hel-Or.
P. Brigger, J. Hoeg, and M. Unser Presented by Yu-Tseh Chi.
Segmentation (2): edge detection
Image Segmentation and Active Contour
Active Contours / Planes Sebastian Thrun, Gary Bradski, Daniel Russakoff Stanford CS223B Computer Vision Some slides.
International Journal of Computer Vision, (1988) o 1987 KIuwer Academic Publishers, Boston, Manufactured in The Netherlands Snakes: Active Contour.
Active Contour Models (Snakes) 건국대학교 전산수학과 김 창 호.
Active Contour Model (Snake) rew. Outline Introduce Active Contour Model.
Tuesday, Oct 7 Kristen Grauman UT-Austin
Active Contours (SNAKES) Back to boundary detection –This time using perceptual grouping. This is non-parametric –We’re not looking for a contour of a.
Snakes with Some Math.
Segmentation Using Active Contour Model and Tomlab By: Dalei Wang 29/04/2003.
Snake: Active Contour Models. Department of Computer Science University of Missouri at Columbia History A seminal work in Computer vision, and imaging.
On Constrained Optimization Approach To Object Segmentation Chia Han, Xun Wang, Feng Gao, Zhigang Peng, Xiaokun Li, Lei He, William Wee Artificial Intelligence.
Snakes : Active Contour models
Instructor: Mircea Nicolescu Lecture 13 CS 485 / 685 Computer Vision.
Active Contour Models (Snakes)
Deformable Contours Dr. E. Ribeiro.
Local or Global Minima: Flexible Dual-Front Active Contours Hua Li Anthony Yezzi.
Computer Vision Optical Flow
Lecture 6 Image Segmentation
EE 7730 Image Segmentation.
EE663 Image Processing Edge Detection 5 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Segmentation Divide the image into segments. Each segment:
Today: Image Segmentation Image Segmentation Techniques Snakes Scissors Graph Cuts Mean Shift Wednesday (2/28) Texture analysis and synthesis Multiple.
Snakes Goes from edges to boundaries. Edge is strong change in intensity. Boundary is boundary of an object. –Smooth (more or less) –Closed. –…
Snake: Active Contour Models
CSSE463: Image Recognition Day 30 Due Friday – Project plan Due Friday – Project plan Evidence that you’ve tried something and what specifically you hope.
SNAKES Adapted from : Octavia Camps, Penn. State UCF.
Active Contour Models (Snakes) Yujun Guo.
1 Numerical geometry of non-rigid shapes Non-Euclidean Embedding Non-Euclidean Embedding Lecture 6 © Alexander & Michael Bronstein tosca.cs.technion.ac.il/book.
Instructor: Dr. Peyman Milanfar
T-Snake Reference: Tim McInerney, Demetri Terzopoulos, T-snakes: Topology adaptive snakes, Medical Image Analysis, No ,pp73-91.
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
Fitting: Deformable contours Tuesday, September 24 th 2013 Devi Parikh Virginia Tech 1 Slide credit: Kristen Grauman Disclaimer: Many slides have been.
06 - Boundary Models Overview Edge Tracking Active Contours Conclusion.
Snakes : Active Contour Models MICHAEL KASS International journal of computer vision.
Deformable Models Segmentation methods until now (no knowledge of shape: Thresholding Edge based Region based Deformable models Knowledge of the shape.
CSSE463: Image Recognition Day 30 This week This week Today: motion vectors and tracking Today: motion vectors and tracking Friday: Project workday. First.
1 TEMPLATE MATCHING  The Goal: Given a set of reference patterns known as TEMPLATES, find to which one an unknown pattern matches best. That is, each.
Numerical Methods Applications of Loops: The power of MATLAB Mathematics + Coding 1.
7.1. Mean Shift Segmentation Idea of mean shift:
Course 13 Curves and Surfaces. Course 13 Curves and Surface Surface Representation Representation Interpolation Approximation Surface Segmentation.
Chapter 10 Image Segmentation.
Fitting: The Hough transform
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Lecture 19: Solving the Correspondence Problem with Graph Cuts CAP 5415 Fall 2006.
Presenter : Kuang-Jui Hsu Date : 2011/3/24(Thur.).
CS 641 Term project Level-set based segmentation algorithms Presented by- Karthik Alavala (under the guidance of Dr. Jundong Liu)
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Quadric Error Metrics 1/20 Geometric Morphometrics Feb 27, 2013 Geometric Morphologyd.
Autonomous Robots Robot Path Planning (3) © Manfred Huber 2008.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
TP11 - Fitting: Deformable contours
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Outline Perceptual organization, grouping, and segmentation
Snakes, Shapes, and Gradient Vector Flow
Active Contours (“Snakes”)
Image Segmentation Image analysis: First step:
Active Contour Models.
Presentation transcript:

Snakes - Active Contour Lecturer: Hagit Hel-Or By: Saar Arbel Lecturer: Hagit Hel-Or

What is our objective? But Wait... To find a contour that best approximates the perimeter of an object Subdividing or partitioning an image into its constituent regions or objects But Wait... Its just like segmentation and many other methods...

Problem with other methods Not effective in presence of noise and sampling artifacts (e.g. medical images). This is done with segmentation on a noisy image

This is done with snakes on a noisy image

What is a snake? A framework for drawing an object outline from a possibly noisy 2D image. An energy-minimizing curve guided by external constraint forces and influenced by image forces that pull it towards features (lines, edges). Represents an object boundary or some other salient image feature as a parametric curve

So... Why snakes? Snakes are autonomous and self-adapting in their search for a minimal energy state They can be easily manipulated using external image forces They can be used to track dynamic objects in temporal as well as the spatial dimensions

Applications Object tracking Shape recognition Segmentation Segmentation example Shape recognition Segmentation Edge detection

Aspects we need to consider Representation of the contours Defining the energy functions - Internal - External Minimizing the energy function

How is a snake represented? A Snake is represented as a set of points (x,y) that defines a function V(s).

Every snake include: External Energy Function Internal Energy Function A set of k points (in the discreet world) or a continuous  function that will represent the points

The Energy functions The Snake's energy functions measure the appropriateness of the contour Good solutions correspond to the minimum of the energy functions Getting the snake closer to the target In charge of the snake curvature and smoothness Our goal is to minimize this function with respect to the contour parameters

A brief example:

The Energy functions Our goal is to find a function V that will minimize E and give us a perfect match

Intuitive tip You can think about the energy function like a heuristic function, they are similar because they both lead to a solution in a way that lets the programmer decide what is important and what’s not.

Internal Energy Econt Ecurv Forces the contour to be continuous Forces the contour to be smooth Decide if the snake wants to shrink/expand Econt Ecurv

Econt Forces the contour to be continuous Minimizing the first derivative has two effects: The snake wants to shrink The squaring of  the differences causes the differences to be as similar as possible (the points are at equal distances from each other)

On the continuous world: On the discrete world: The contour is approximated by N points P1, P2, . .., Pn and the first derivative is approximated by a finite difference:

Example The points are equi-distances The points are not equi-distances

Ecurv Forces the contour to be smooth. By taking the second derivative which represent the difference of the differences  between 2 consecutive differences. This 2 consecutive differences represent the curvature and we want to penalize if the curvature is too high.

On the continuous world: On the discrete world: The curvature can be approximated by the following finite difference:

Example: compare curvature That’s better!

α,β meaning Reminder: We can play with α,β and to control the relation between the first derivative and the second derivative and get different results

Small α Big α Small alpha make the energy function insensitive to the amount of stretch Increase the internal energy of the snake as it stretches more and more

Small β Big β Small beta causes snake to allow large curvature so that snake will curve into bends in the contour When beta is large then high price for curvature so snake prefers to be smooth and not curving

Internal energy - Summary On the continuous world: On the discrete world:

Discrete representation Represent the snake with a set of n points (X0 , Y0) (X3 , Y3) (X14 , Y14)

Open and close snake closed snake open snake Dealing with open snake is easier and our algorithm will run faster (soon…)

External Energy – The Energy map An energy map is a function f (x, y) that we extract from the image – I(x, y) The energy map’s task is to emphasize the areas of the contour and to weaken the other areas of the image by creating a new image. By doing this we can attract our snake near the “emphasized” pixels which represent the contour of the image.

How do we build an Energy map? By given an image – I(x, y) , we can build an energy map – f(x, y), that will attract our snake to edges on our image. For each pixel we will do: (color image) (black-white image) By doing this we can easily locate the edges on the images because the gradient there is big.

Energy map Image

External Energy Attracts the contour towards the closest image edge with dependence on the energy map. determines whether the snake feels attracted to object boundaries

Intuitive example Initial state Final state

Eexternal In order to make snakes useful for early vision we need energy functions that attract them to salient features in images. I will present you 2 different energy functions which attract a snake to lines & edges.

Eline Depending on the sign of Wline the snake will be attracted either to bright lines or dark lines.

Eedge Reminder: Gradient is a generalization of the usual concept of derivative to the functions of several variables

Clarification Note: As long as the points on the snake are closer to the edge (where the gradient is bigger) and then the Eedge is smaller, so that’s a good thing because that's how the external energy works! this gets the snake closer and closer to the target contour.

Examle Image External force Zoomed in

External energy - Summary On the continuous world: On the discrete world:

Example – External energy

How to find the optimal function V? Several algorithms have been proposed to fit deformable contours. We’ll look at two: -  Greedy search -  Dynamic programming (for 2d snakes)

Greedy algorithm A greedy algorithm makes locally optimal choices, hoping that the final solution will be globally optimal. For each point of the snake, we search a window around it (window size: m) and move to where the energy function is minimal. We will stop after enough points have not changed in the last iteration 

Points are calculates by an iterative process: Energy function for each point in the local neighborhood is calculated The point is moved to the next point with lowest energy function This process is repeated for every point Iteration is done until termination condition met Defined number of iterations Complexity:

But... Convergence not guaranteed!! Need decent initialization Works very well as far as the initial snake is not too far from the desired solution

Viterbi algorithm Dynamic programming algorithm We need to make the snake discrete in order to use the algorithm The discretization of the external energy depends on the particular energy term but the internal energy is always the same and can be discretized as follows:

Our problem is to finding the set of vertex positions V that minimizes:

(The internal energy is a local property of neighboring vertices) We will now make the assumption that the snake is open and that β=0 In most cases, snake energy can be rewritten as a sum of pair-wise interaction potential: (The internal energy is a local property of neighboring vertices)

This means that each vertex position Vi influences the total energy only through the terms and Each vertex has m possible moves

We now define n variables (i=2,3,…,n) Each contains the lowest total energy for the first k-1 vertices of the snake for a given value of . Thus the minimum energy E of the whole snake is equal to

The globally best position for the snake is therefore computed by first computing all the , so we determine at each node the optimal position of its predecessor for each possible location of the node. When we have computed we can find the optimal position for by minimizing the expression Once we know the position of the last node we look up the optimal position for the second last node and so on until we have determined the optimal position for all the nodes.

states 1 2 … m sites Complexity:

Now, β≠0 If β≠0 then the decomposition of the energy function into local terms becomes: This means that each vertex position Vi influences the total energy only through the terms and

And now we will define again n variables (i=2,3,…,n) Note that we have to compute a table of values at each node instead of only m values per node for the simpler snakes with β=0. Complexity:

Now, the snake is closed Solution: 1. Can use Viterbi to optimize snake energy in case v1 = c is fixed. (in this case the energy above effectively has no loop) 2. Use Viterbi to optimize snake for all possible values of c and choose the best of the obtained m solutions. Complexity:

Snakes - Pros Vs. Cons Pros: Snakes optimize globally. Snakes are 1-dimensional which means that we can reduce 2-dimensional optimization problems to 1-dimensional optimization problems. Active contour models provide a unified solution to several image processing problems such as the detection of light and dark lines and edges. Useful to track and fit non-rigid shapes. Flexibility in how energy function is defined.

Cons: Must have decent initialization near true boundary, may get stuck in local minimum. Parameters of energy function must be set well based on prior information.

Extensions We will review two main applications of snakes: -  Snake splitting -  Snake expending

Snake Splitting Problem: Snakes including multiple objects can not always extract each of them individually (when initialize the contour wrong) Solution: Using the split-and-merge contour model based on detecting self- and mutual-crossings of the contour. The method: There is a single contour which surrounding all objects and then iteratively splits into multiple contours by cutting at self-crossing points for extracting multiple objects individually

Snake Expanding There is some cases when our snakes would need to expand in order to get close to the contour.

Problems: If there is no image force (F=0), the curve shrinks on itself and vanishes to a point. Often, due to noise, some isolated points are gradient maxima and can stop the curve when it passes by. We can get stuck inside a shape (if our image force=0) So we need the define new force for this cases:

Solution: we add another force which makes the contour have a more dynamic behavior. You can think about our curve as a “Balloon” Force which inflate our snake The new Force

Cool demonstrations

Summary Snakes include: - Two energy functions (Internal and External) - N points who represents a function V Main problem: Finding an optimal function V that minimize the Energy function Solved by: - Greedy algorithm - Viterbi algorithm

References M. Kass, A. Witkin, and D. Terzopoulos, "Snakes: Active contour models.“, International Journal of Computer Vision. v. 1, n. 4, pp. 321-331, 1987. 1. http://www.computing.edu.au/~jim/thesis/ivins02.pdf 3. Wikipedia – Active contour models (Snakes) 2. http://www.cse.unr.edu/~bebis/CS791E/Notes/Def ormableContours.pdf 4. http://www.cs.utexas.edu/~grauman/courses/378/ handouts/snakes.pdf 5. http://cs.gmu.edu/~kosecka/cs682/lect-snakes.pdf 6.

Thank you