Lecture 10 Segmentation (ch 8) ch. 8 of Machine Vision by Wesley E

Slides:



Advertisements
Similar presentations
Applications of one-class classification
Advertisements

Clustering & image segmentation Goal::Identify groups of pixels that go together Segmentation.
Image Segmentation Image segmentation (segmentace obrazu) –division or separation of the image into segments (connected regions) of similar properties.
Lecture 07 Segmentation Lecture 07 Segmentation Mata kuliah: T Computer Vision Tahun: 2010.
Computer Vision Lecture 16: Region Representation
Lecture 6 Image Segmentation
Optimal solution of binary problems Much material taken from :  Olga Veksler, University of Western Ontario
EE 7730 Image Segmentation.
Thresholding Otsu’s Thresholding Method Threshold Detection Methods Optimal Thresholding Multi-Spectral Thresholding 6.2. Edge-based.
Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.
Segmentation Divide the image into segments. Each segment:
Objective of Computer Vision
Highlights Lecture on the image part (10) Automatic Perception 16
Objective of Computer Vision
Introduction --Classification Shape ContourRegion Structural Syntactic Graph Tree Model-driven Data-driven Perimeter Compactness Eccentricity.
COMP 175: Computer Graphics March 24, 2015
Machine Vision for Robots
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
Course Syllabus 1.Color 2.Camera models, camera calibration 3.Advanced image pre-processing Line detection Corner detection Maximally stable extremal regions.
1Ellen L. Walker Segmentation Separating “content” from background Separating image into parts corresponding to “real” objects Complete segmentation Each.
CS 6825: Binary Image Processing – binary blob metrics
Texture. Texture is an innate property of all surfaces (clouds, trees, bricks, hair etc…). It refers to visual patterns of homogeneity and does not result.
September 23, 2014Computer Vision Lecture 5: Binary Image Processing 1 Binary Images Binary images are grayscale images with only two possible levels of.
Digital Image Processing CCS331 Relationships of Pixel 1.
Chapter 10 Image Segmentation.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
CS654: Digital Image Analysis
Lecture 9 Segmentation (ch 8) ch. 8 of Machine Vision by Wesley E
Course14 Dynamic Vision. Biological vision can cope with changing world Moving and changing objects Change illumination Change View-point.
Digital Image Processing
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
Machine Vision ENT 273 Regions and Segmentation in Images Hema C.R. Lecture 4.
Image Segmentation Nitin Rane. Image Segmentation Introduction Thresholding Region Splitting Region Labeling Statistical Region Description Application.
Thresholding Foundation:. Thresholding In A: light objects in dark background To extract the objects: –Select a T that separates the objects from the.
Robotics Chapter 6 – Machine Vision Dr. Amit Goradia.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Course 3 Binary Image Binary Images have only two gray levels: “1” and “0”, i.e., black / white. —— save memory —— fast processing —— many features of.
Course : T Computer Vision
Machine Vision ENT 273 Lecture 4 Hema C.R.
Image Representation and Description – Representation Schemes
(CMU ECE) : (CMU BME) : BioE 2630 (Pitt)
Line Fitting James Hayes.
IMAGE SEGMENTATION USING THRESHOLDING
COMP 9517 Computer Vision Segmentation 7/2/2018 COMP 9517 S2, 2017.
Computer Vision Lecture 13: Image Segmentation III
DIGITAL SIGNAL PROCESSING
Lecture 13 Shape ch. 9, sec. 1-8, of Machine Vision by Wesley E
Mean Shift Segmentation
Computer Vision Lecture 12: Image Segmentation II
Lecture 12 Level Sets & Parametric Transforms sec & ch
Lecture 6 Linear Processing ch. 5 of Machine Vision by Wesley E
Computer Vision Lecture 5: Binary Image Processing
DICOM 11/21/2018.
ECE 692 – Advanced Topics in Computer Vision
Computer Vision Lecture 16: Texture II
Lecture 5 Image Characterization ch. 4 of Machine Vision by Wesley E
Lecture 15 Active Shape Models
Lecture 16: Morphology (ch 7) & Image Matching (ch 13) ch. 7 and ch
Lecture 10 Segmentation, Part II (ch 8) Active Contours (Snakes) ch
CSE 185 Introduction to Computer Vision
Lecture 3 Math & Probability Background ch
Computer and Robot Vision I
Computer and Robot Vision I
(CMU ECE) : (CMU BME) : BioE 2630 (Pitt)
Lecture 14 Shape ch. 9, sec. 1-8, of Machine Vision by Wesley E
Lecture 3 Math & Probability Background ch
Lecture 10 Segmentation, Part II (ch 8) Active Contours (Snakes) ch
(CMU ECE) : (CMU BME) : BioE 2630 (Pitt)
Lecture 10 Segmentation (ch 8) ch. 8 of Machine Vision by Wesley E
Presentation transcript:

Lecture 10 Segmentation (ch 8) ch. 8 of Machine Vision by Wesley E Lecture 10 Segmentation (ch 8) ch. 8 of Machine Vision by Wesley E. Snyder & Hairong Qi Note: To print these slides in grayscale (e.g., on a laser printer), first change the Theme Background to “Style 1” (i.e., dark text on white background), and then tell PowerPoint’s print dialog that the “Output” is “Grayscale.” Everything should be clearly legible then. This is how I also generate the .pdf handouts.

Segmentation A partitioning… Where each region is: There is room for interpretation here… A partitioning… Into connected regions… Where each region is: Homogeneous Identified by a unique label And here

The “big picture:” Examples from The ITK Software Guide BE SLOW & DISCUSS (next 3 slides) Figures 9.12 (top) & 9.1 (bottom) from the ITK Software Guide v 2.4, by Luis Ibáñez, et al.

Connected Regions This image has 2 foreground regions Lots of room for interpretation Possible meanings: In an image Don’t forget about the connectivity paradox In “real life” How do you measure that from an image? Background vs. foreground 1 2 3 4 This image has 2 foreground regions But is has 4 connected components

Homogeneous Regions Lots of room for interpretation Possible meanings: All pixels are the “same” brightness Close to some representative (mean) brightness Color Motion Texture Generically & formally: The values of each pixel are consistent with having been generated by a particular model (such as a probability distribution)

Segmentation Methods There are many methods Here are a few examples: Threshold-based Guaranteed to form closed regions (why?) Region-based Start with elemental homogonous regions Merge & split them Hybrid methods E.g., watershed

Human Segmentation Class discussion: How do humans segment what they see? What about a static image? How do radiologists segment a medical image? Is human segmentation task-dependent? So, how would you compare the accuracy of one segmentation to another?

Segmentation by Thresholding Results in a binary labeling When would we want this? When not? Notion of object(s)/foreground vs. background We want to segment a single object… Or the single set of all objects of a given type Any time we need to distinguish between multiple objects

Segmentation by Thresholding Real-world annoyances: Most images are not taken under perfectly uniform illumination (or radiation, contrast agent, etc.) Optical imaging devices are typically not equally sensitive across their field of view (vignetting, etc.) These are less problematic for most radiological images than for camera images, ultrasound, OCT, etc. Problem: The same object often has different intensities at different locations in an image Solution: Use local thresholds

Local Thresholding Typically, block thresholding: Tessellate the image into rectangular blocks Use different threshold parameter(s) for each block Slower (but better?): Use a moving window

Computing Thresholds In a few lucky cases: If multiple, similar objects will be imaged under virtually identical conditions, then… Carefully choose a good threshold (often by hand) for the first object, and then… Use that threshold for all future objects Remember, we may be doing this for each block in the image

Computing Thresholds Most of the time: If we expect to see different objects under different conditions, then… We need to automate the selection of thresholds Many ways to do this Remember, we may be doing this for each block in the image

Computing Thresholds If we expect lots of contrast, then use: Tmin = iavg +  OR Tmax = iavg -  More typically: Histogram analysis 96 64 32 20 40 60 80 100 80 pixels with an intensity of 20 96 pixels with an intensity of 100 Histogram / #pixels -> pdf Many bright pixels & many dark pixels

Histogram analysis Idea: Choose a threshold between the peaks Histograms often require pre-processing How to find the peaks? Try fitting Gaussians to the histogram Use their intersection(s) as the threshold(s) See the text for details How many Gaussians to try to fit? This lobe requires Tmin and Tmax 96 64 32 20 40 60 80 100 Requires prior knowledge!

ITK Histogram-Based Thresholding: GMM & Otsu GMM = Gaussian Mixture Model Otsu is a classic method to fit two Gaussians (2-class GMM) Looks at a single histogram of pixel intensities across the entire image Computes a single global threshold that (more or less) maximizes the variance between the two populations of pixels on either side of that threshold. Expectation Maximization (EM) to fit Gaussians – more powerful & flexible EM can infer the parameters of multiple Gaussian distributions Usually more computationally expensive You must separately compute the thresholds after the GMM has been inferred. See ITK Software Guide 10.4.4, and also this very old mailing list post: http://www.itk.org/pipermail/insight-users/2004-December/011458.html EM of GMM is probably preferable over Otsu when we need both an upper and a lower threshold. General EM of GMM can easily model multiple classes of pixels, including multiple different classes of "background" pixels. You can also read more about histogram-based thresholding in this Insight Journal article: http://hdl.handle.net/10380/3279

Connected Component Analysis Recall that thresholding produces a binary segmentation. What if thresholding detects multiple objects, and we need to analyze each of them separately? Multiple bones in a CT scan Multiple fiducial markers Etc. We want a way to give a different label to each detected object

Connected Component Analysis What separates one thresholded object from another one? Space! More precisely, background pixels Two objects are separate if they are not connected by foreground pixels Connected component analysis lets us: Assign a different label to each (disconnected) object… from the (binary) set of segmented objects

Connected Component Analysis 1 2 Graph-theory basis Example containing 2 (foreground) connected components Thresholding gives us the top figure Connected Component Analysis on the foreground of the top figure gives us the bottom figure Thresholding Thresholding + Connected Component Analysis of Foreground 1 2 3

Connected Component Analysis Example of a label image: A label image L is isomorphic to its original image f (pixel-by-pixel correspondence) Each component is given its own numerical label N 1 2 3 Label image

Recursive Region Growing One method of doing connected component analysis Basically a series of recursive flood-fills Assume: A threshold segmentation already marked object pixels as black in f Find an unlabeled black pixel; that is, L(x, y) = 0 . Choose a new label number for this region, call it N . If all pixels have been labeled, stop. L(x, y)  N Push unlabeled neighboring object pixels onto the stack If f(x-1, y) is black and L(x-1, y) = 0 , push (x-1, y) onto the stack. If f(x+1, y) is black and L(x+1, y) = 0 , push (x+1, y) onto the stack. If f(x, y-1) is black and L(x, y-1) = 0 , push (x, y-1) onto the stack. If f(x, y+1) is black and L(x, y+1) = 0 , push (x, y+1) onto the stack. Choose an new (x, y) by popping the stack. If the stack is empty, go to 1, else go to 2. Flood-fill {

Trees Instead of Label Images for Scale Space Normal practice: Label image identifies which pixels belong to which regions. Tree-based approach: A graph is established Each node  segmented object Levels of the graph correspond to levels of scale A “parent node” is at a higher (more blurred) level of scale than the children of that node. All the children of a given parent are assumed to lie in the same region. A child node is related to a parent if: It is geometrically close to the parent, and It is similar in intensity

Texture Segmentation Two fundamentally different types of textures: Deterministic Pattern replications E.g. brick wall or a grid of ceiling tiles Use template matching, or Use FT to find spatial frequencies Random E.g. the pattern on a single cinder block or a single ceiling tile Model with Markov random fields Remember: Ultimately, you need a single number with which to compare a pixel to a neighbor

Segmentation of Curves Assume: The object is already segmented We have a curve tracing around an object New problem: Segment the curve Identify “salient” points along the boundary Salient points in curve ≈ edges in image Enables characterizing the curve between the salient points. Can fit a “reasonable” low order curve between 2 salient points Salient points

The Nature of Curves A curve is a 1D function, which is simply bent in (“lives in”) ND space. That is, a curve can be parameterized using a single parameter (hence, 1D). The parameter is usually arc length, s Even though not invariant to affine transforms. Will be VERY RELAVNT later.

The Nature of Curves The speed of a curve at a point s is: Denote the outward normal direction at point s as n(s) Suppose the curve is closed: The concepts of INSIDE and OUTSIDE make sense Given a point x = [xi,yi] not on the curve, Let x represent the closest point on the curve to x The arc length at x is defined to be sx. x is INSIDE the curve if: [x - x]  n(sx)  0 And OUTSIDE otherwise.

Segmentation of Surfaces A surface is a 2D function, which is simply bent in (“lives in”) three-space. 2 philosophies: Seek surfaces which do not bend too quickly Segment regions along lines of high surface curvature (fitting a surface with a set of planes) Points where planes meet produce either “roof” edges or “step” edges, depending on viewpoint Assume some equation E.g. a quadric (a general second order surface) All points which satisfy the equation and which are adjacent belong to the same surface. The “difference” in edges is only from viewpoint. But curvature is invariant to viewpoint! (Unfortunately, curvature is sensitive to noise.)

Describing Surfaces An explicit representation might be: An implicit form is: The latter is a quadric: A general form Describes all second order surfaces (cones, spheres, planes, ellipsoids, etc.) Can’t linearly solve an explicit quadric for the vector of coefficients (to fit to data) You would have a √ on the right hand side! Note: Earlier, when we derived a kernel by fitting a plane to image data, we did solve an explicit function to data, but a plane doesn’t involve a z^2 term.

Fitting an Implicit Quadric Define Then: We have a parameter vector q = [a,b,c,d,e,f,g,h,i,j]T If the point [xi,yi,zi]T is on the surface described by q, Then f(xi,yi,zi) should = 0. Define a level set of a function as the collection of points [xi,yi,zi]T such that f(xi,yi,zi)=L for some scalar constant L. Solve for q by minimizing the distances between every point, [xi,yi,zi]T, and the surface described by q, which is f(xi,yi,zi)=0. Level Sets will also be VERY RELAVNT later.

Final Notes Next class: Active contours! Shadow Program!