Lecture 12 Level Sets & Parametric Transforms. sec & ch. 11 of Machine Vision by Wesley E. Snyder & Hairong Qi

Similar documents
Lecture 10 Segmentation, Part II (ch 8) Active Contours (Snakes) ch. 8 of Machine Vision by Wesley E. Snyder & Hairong Qi

All images are degraded

Lecture 15 Active Shape Models

Lecture 14 Shape. ch. 9, sec. 1-8, of Machine Vision by Wesley E. Snyder & Hairong Qi. Spring (CMU RI) : BioE 2630 (Pitt)

Lecture 13 Theory of Registration. ch. 10 of Insight into Images edited by Terry Yoo, et al. Spring (CMU RI) : BioE 2630 (Pitt)

Lecture 6 Linear Processing. ch. 5 of Machine Vision by Wesley E. Snyder & Hairong Qi. Spring (CMU RI) : BioE 2630 (Pitt)

Registration: Rigid vs. Deformable

What are advanced filters? Lecture 19 Write Your Own ITK Filters, Part2. Different output size. Details, details. Changing the input requested region

Lecture 09 Segmentation (ch 8) ch. 8 of Machine Vision by Wesley E. Snyder & Hairong Qi. Dr. John Galeo3. Into connected regions

The Pipeline. Lecture 17 ITK Pipeline. The pipeline idea. Image sources. Image to image filters. Input and output

HOUGH TRANSFORM CS 6350 C V

Lecture 15: Segmentation (Edge Based, Hough Transform)

2/7/18. For more info/gory detail. Lecture 8 Registration with ITK. Transform types. What is registration? Registration in ITK

Dr. Ulas Bagci

Goals for this lecture. Lecture 4 Getting Started with ITK! Getting help. Assignments. Assignments, cont. Grading of assignments

Types of Edges. Why Edge Detection? Types of Edges. Edge Detection. Gradient. Edge Detection

(Refer Slide Time: 0:32)

Level set methods Formulation of Interface Propagation Boundary Value PDE Initial Value PDE Motion in an externally generated velocity field

Announcements. Edges. Last Lecture. Gradients: Numerical Derivatives f(x) Edge Detection, Lines. Intro Computer Vision. CSE 152 Lecture 10

Level Set Methods and Fast Marching Methods

Massachusetts Institute of Technology. Department of Computer Science and Electrical Engineering /6.866 Machine Vision Quiz I

Variational Methods II

Kernels and Clustering

Straight Lines and Hough

Model Fitting: The Hough transform II

Edge detection. Convert a 2D image into a set of curves. Extracts salient features of the scene More compact than pixels

Other Linear Filters CS 211A

Computer Vision 6 Segmentation by Fitting

Edge linking. Two types of approaches. This process needs to be able to bridge gaps in detected edges due to the reason mentioned above

CS 343: Artificial Intelligence

Level Set Evolution without Reinitilization

Lecture 9: Hough Transform and Thresholding base Segmentation

BACK AND FORTH ERROR COMPENSATION AND CORRECTION METHODS FOR REMOVING ERRORS INDUCED BY UNEVEN GRADIENTS OF THE LEVEL SET FUNCTION

Scientific Visualization Example exam questions with commented answers

A Toolbox of Level Set Methods

Automated Segmentation Using a Fast Implementation of the Chan-Vese Models

Gradient-Free Boundary Tracking* Zhong Hu Faculty Advisor: Todd Wittman August 2007 UCLA Department of Mathematics

A Singular Example for the Averaged Mean Curvature Flow

Fitting: The Hough transform

Fitting: The Hough transform

The Level Set Method. Lecture Notes, MIT J / 2.097J / 6.339J Numerical Methods for Partial Differential Equations

6. Applications - Text recognition in videos - Semantic video analysis

Multimedia Computing: Algorithms, Systems, and Applications: Edge Detection

Recap. Disclaimer. Goals for this lecture. C++ vs. Python. Reference & Review Material

Chapter 11 Arc Extraction and Segmentation

Feature Matching and Robust Fitting

Computer Vision. Image Segmentation. 10. Segmentation. Computer Engineering, Sejong University. Dongil Han

Leow Wee Kheng CS4243 Computer Vision and Pattern Recognition. Motion Tracking. CS4243 Motion Tracking 1

A Brief Look at Optimization

Segmentation. Namrata Vaswani,

OBJECT detection in general has many applications

Fitting: The Hough transform

8 Special Models for Animation. Chapter 8. Special Models for Animation. Department of Computer Science and Engineering 8-1

Computer Vision. Recap: Smoothing with a Gaussian. Recap: Effect of σ on derivatives. Computer Science Tripos Part II. Dr Christopher Town

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

Classification: Feature Vectors

Background for Surface Integration

Ian Mitchell. Department of Computer Science The University of British Columbia

CSC Computer Graphics

A simple problem that has a solution that is far deeper than expected!

Isophote-Based Interpolation

Perception IV: Place Recognition, Line Extraction

Level-set MCMC Curve Sampling and Geometric Conditional Simulation

Feature Extractors. CS 188: Artificial Intelligence Fall Nearest-Neighbor Classification. The Perceptron Update Rule.

CS S Lecture February 13, 2017

GENERALIZING THE HOUGH TRANSFORM TO DETECT ARBITRARY SHAPES. D. H. Ballard Pattern Recognition Vol. 13 No

CS443: Digital Imaging and Multimedia Perceptual Grouping Detecting Lines and Simple Curves

CS 130. Scan Conversion. Raster Graphics

COMPUTER AND ROBOT VISION

For Information on SNAKEs. Active Contours (SNAKES) Improve Boundary Detection. Back to boundary detection. This is non-parametric

Image Registration Lecture 4: First Examples

Medical Image Segmentation using Level Sets

EE795: Computer Vision and Intelligent Systems

Lecture 8: Fitting. Tuesday, Sept 25

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Case-Based Reasoning. CS 188: Artificial Intelligence Fall Nearest-Neighbor Classification. Parametric / Non-parametric.

CS 188: Artificial Intelligence Fall 2008

COMPUTER VISION > OPTICAL FLOW UTRECHT UNIVERSITY RONALD POPPE

Issues with Curve Detection Grouping (e.g., the Canny hysteresis thresholding procedure) Model tting They can be performed sequentially or simultaneou

Finding 2D Shapes and the Hough Transform

Edge and local feature detection - 2. Importance of edge detection in computer vision

Stream Function-Vorticity CFD Solver MAE 6263

CS 188: Artificial Intelligence Spring Today

Mixture Models and EM

Biomedical Image Analysis. Point, Edge and Line Detection

Fast Segmentation of Kidneys in CT Images

Lecture 4: Image Processing

Comparison of segmentation using fast marching and geodesic active contours methods for bone

In what follows, we will focus on Voronoi diagrams in Euclidean space. Later, we will generalize to other distance spaces.

Visual Tracking (1) Tracking of Feature Points and Planar Rigid Objects

Multiple Contour Finding and Perceptual Grouping as a set of Energy Minimizing Paths

Segmentation I: Edges and Lines

EE795: Computer Vision and Intelligent Systems

Numerical Methods for PDEs : Video 9: 2D Finite Difference February 14, Equations / 29

Segmentation. Separate image into coherent regions

CS205b/CME306. Lecture 9

Investigating The Stability of The Balance-force Continuum Surface Force Model of Surface Tension In Interfacial Flow

Tangent & normal vectors The arc-length parameterization of a 2D curve The curvature of a 2D curve

How does bilateral filter relates with other methods?

CSE 573: Artificial Intelligence Autumn 2010

Transcription:

Lecture 12 Level Sets & Parametric Transforms sec. 8.5.2 & ch. 11 of Machine Vision by Wesley E. Snyder & Hairong Qi Spring 2017 16-725 (CMU RI) : BioE 2630 (Pitt) Dr. John Galeotti The content of these slides by John Galeotti, 2012-2017 Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN276201000580P, and is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/ or send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA. Permissions beyond the scope of this license may be available either from CMU or by emailing itk@galeotti.net. The most recent version of these slides may be accessed online via http://itk.galeotti.net/ A Quick Review The movement of boundary points on an active contour can be governed by a partial differential equation (PDE) PDE s operate on discrete time steps One time step per iteration Snake points move normal to the curve The normal direction is recalculated for each iteration. Snake points move a distance determined by their speed. 2 1

Typical Speed Function Speed is usually a combination (product or sum) of internal and external terms: s(x,y) = s I (x,y) s E (x,y) Internal (shape) speed: e.g., s I (x,y) = 1 - úú ek(x,y) úú where k(x,y) measures the snake s curvature at (x,y) External (image) speed: Can be pre-computed e.g., s E (x,y) = (1+D(x,y) ) -1 from the input image where D(x,y) measures the image s edginess at (x,y) Note that s(x,y) above is always positive. Such a formulation would allow a contour to grow but not to shrink. 3 Active Contours using PDEs: Typical Problems Curvature measurements are very sensitive to noise They use 2nd derivatives They don t allow an object to split This can be a problem when tracking an object through multiple slices or multiple time frames. A common problem with branching vasculature or dividing cells How do you keep a curve from crossing itself? One solution: only allow the curve to grow 4 2

Level Sets A philosophical/mathematical framework: Represent a curve (or surface, etc.) as an isophote in a special image, denoted y, variously called the: Merit function Embedding Level-set function Manipulate the curve indirectly by manipulating the level-set function. 5 Active Contours using PDEs on Level Sets The PDE active-contour framework can be augmented to use a level-set representation. This use of an implicit, higher-dimensional representation addresses the active-contour problems mentioned 2 slides back. 6 3

Level Sets: An Example from the ITK Software Guide Figures 9.13 from the ITK Software Guide v 2.4, by Luis Ibáñez, et al. 7 Level Sets and the Distance Transform (DT) DT is applied to a binary or segmented image Typically applied to the contour s initialization Outside the initial contour, we typically negate the DT Records at each pixel the distance from that pixel to the nearest boundary. The 0-level set of the initialization s DT is the original boundary 1 1 1 1 1 1 1 1 1 1 2 1 1 2 2 1 2 2 1 1 2 2 3 2 1 1 2 3 2 2 1 1 2 2 1 2 1 1 2 1 1 1 1 1 1 8 4

Level-Set Segmentation: Typical Procedure Create an initial contour Many level-set segmentation algorithms require the initialization to be inside the desired contour Initialize y: y(x,y) = -DT(x,y) if (x,y) is outside the contour DT(x,y) if (x,y) is inside the contour Use a PDE to incrementally update the segmentation (by updating y) Stop at the right time This can be tricky; more later. 9 Measuring curvature and surface normals One of the advantages of level sets is that they can afford good measurements of curvature Because the curve is represented implicitly as the 0-level set, it can be fit to y with sub-pixel resolution Surface normals are collinear with the gradient of y. (why?) See Snyder 8.5 for details on computing curvature (k). 10 5

Allowing objects to split or merge Suppose we want to segment vasculature from CT with contrast Many segmentation algorithms only run in 2D So we need to slice the data But we don t want to initialize each slice by hand 11 Allowing objects to split or merge Solution: Initialize 1 slice by hand Segment that slice Use the result as the initialization for neighboring slices But vasculature branches One vessel on this slice might branch into 2 vessels on the next slice Segmentation methods that represent a boundary as a single, closed curve will break here. 12 6

Allowing objects to split or merge Level Sets represent a curve implicitly Nothing inherently prevents the 0-level set of y from representing multiple, distinct objects. Most level-set segmentation algorithms naturally handle splitting or merging PDEs are applied and calculated locally 13 Active Surfaces Level Sets can represent surfaces too! y now fills a volume The surface is still implicitly defined as the zero level set. The PDE updates every point in the volume (To speed up computation, on each iteration we can update only pixels that are close to the 0 level set) Being able to split and merge 3D surfaces over time can be very helpful! 14 7

ITK s Traditional PDE Formulation d dt ψ = αa x ( ) ψ βp x ( ) ψ +γz x ( )κ ψ A is an advection term Draws the 0-level set toward image edginess P is a propagation (expansion or speed) term The 0-level set moves slowly in areas of edginess in the original image Z is a spatial modifier term for the mean curvature k a, b, and g are weighting constants Many algorithms don t use all 3 terms 15 A Very Simple Example (ITK Software Guide 4.3.1) Initialize inside the object Propagation: Slow down near edges Is always positive (growth only) Stop at the right time Perform enough iterations (time steps) for the curve to grow close to the boundaries Do not allow enough time for the curve to grow past the boundaries This method is very fast! 16 8

A More Complex Example (ITK Software Guide 4.3.3) Geodesic Active Contours Segmentation Uses an advection term, A Draws the curve toward edginess in the input image Things no longer blow up if we run too long Now, we can simply stop when things converge (sufficiently small change from one time step to the next). Still, it s a good idea to program a maximum number of allowed time steps, in case things don t converge. 17 Some General Thoughts about Level Sets Remember, Level Sets are nothing more than a way of representing a curve (or surface, hypersurface, etc.) Level-Sets do have some advantages (e.g, splitting/merging) But, Level-Sets otherwise work no better than any other method. Look at the many examples in the ITK software guide; their results often leave a little or a lot to be desired 18 9

Level Set References Snyder, 8.5.2 Insight into Images, ch. 8 ITK Software Guide, book 2, 4.3 The book: Level Set Methods and Fast Marching Methods: Evolving Interfaces in Computational Geometry, Fluid Mechanics, Computer Vision and Materials Science, by J.A. Sethian, Cambridge University Press, 1999. Also see: http://math.berkeley.edu/~sethian/2006/level_set.html All of the above reference several scientific papers. 19 Snyder ch. 11: Parametric Transforms Goal: Detect geometric features in an image Method: Exchange the role of variables and parameters References: Snyder 11 & ITK Software Guide book 2, 4.4 20 10

Geometric Features? For now, think of geometric features as shapes that can be graphed from an equation. Line: y = mx + b Circle: R 2 = (x-x center ) 2 + (y-y center ) 2 (variables are shown in bold purple, parameters are in black) 21 Why Detect Geometric Features? Guide segmentation methods Automated initialization! Prepare data for registration methods Recognize anatomical structures From the ITK Software Guide v 2.4, by Luis Ibáñez, et al., p. 596 22 11

How do we do this again? Actually, each edge pixel votes If we are looking for lines, each edge pixel votes for every possible line through itself: Edge Pixel Example: 3 collinear edge pixels: This line gets 3 votes Possible lines through edge pixel 23 How to Find All Possible Shapes for each Edge Pixel Exchange the role of variables and parameters: Example for a line: y = mx + b (variables are shown in bold purple) Each edge pixel in the image: Has its own (x, y) coordinates Establishes its own equation of (m,b) This is the set of all possible shapes through that edge point 24 12

How to Implement Voting With an accumulator Think of it as an image in parameter space Its axes are the new variables (which were formally parameters) But, writing to a pixel increments (rather than overwriting) that pixel s value. Graph each edge pixel s equation on the accumulator (in parameter space) Maxima in the accumulator are located at the parameters that fit the shape to the image. 25 Example 1: Finding Lines If we use y = mx + b Then each edge pixel results in a line in parameter space: b = -mx + y Edge Detection Results (contains 2 dominant line segments) Accumulator Intermediate Result (after processing 2 edge pixels) b m 26 13

Example 1: Finding Lines A closer look at the accumulator after processing 2 and then 3 edge pixels The votes from each edge pixel are graphed as a line in parameter space Each accumulator cell is incremented each time an edge pixel votes for it I.e., each time a line in parameter space passes through it 1 1 1 1 1 2 1 1 1 12 23 1 1 1 1 1 1 1 1 1 1 1 Each of these edge pixels could have come from this line 27 Example 2: Finding Lines A Better Way What s wrong with the previous example? Consider vertical lines: m = My computer doesn t like infinite-width accumulator images. Does yours? For parametric transforms, we need a different line equation, one with a bounded parameter space. 28 14

Example 2: Finding Lines A Better Way A better line equation for parameter voting: r = x cos q + y sin q r the input image diagonal size But, to make math easy, r can be - too. q is bounded within [0,2p] y ρ θ Gradient direction θ x See Machine Vision Fig. 11.5 for example of final accumulator for 2 noisy lines 29 Computational Complexity This can be really slow Each edge pixel yields a lot of computation The parameter space can be huge Speed things up: Only consider parameter combinations that make sense Each edge pixel has an apx. direction attached to its gradient, after all. 30 15

Example 3: Finding Circles Equation: R 2 = (x-x center ) 2 + (y-y center ) 2 Must vote for 3 parameters if R is not known! This vote is for a certain (x center, y center ) with a corresponding particular R Another vote for a different (x center, y center ) with its own, different R 31 Example 4: General Shapes What if our shape is weird, but we can draw it? Being able to draw it implies we know how big it will be See Snyder 11.4 for details Main idea: For each boundary point, record its coordinates in a local reference frame (e.g., at the shape s center-of-gravity). Itemize the list of boundary points (on our drawing) by the direction of their gradient 32 16