1 / 72

Snakes - Active Contour

Snakes - Active Contour. By: Saar Arbel. Lecturer : Hagit Hel-Or. What is our objective?. 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.

courtney
Télécharger la présentation

Snakes - Active Contour

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. What is our objective? 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...

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

  4. This is done with snakes on a noisy image

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

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

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

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

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

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

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

  12. A brief example:

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

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

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

  16. Econt Minimizing the first derivative has two effects: Forces the contour to be continuous 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)

  17. 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:

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

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

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

  21. Example: compare curvature That’s better!

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

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

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

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

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

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

  28. External Energy – The Energy map 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. An energy map is a function f (x, y) that we extract from the image – I(x, y)

  29. 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: By doing this we can easily locate the edges on the images because the gradient there is big. (color image) (black-white image)

  30. Energy map Image

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

  32. Intuitive example Initial state Final state

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

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

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

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

  37. Examle Image Zoomed in External force

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

  39. Example – External energy

  40. 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)

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

  42. Complexity: 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

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

  44. 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:

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

More Related