Course : T0283 - Computer Vision Year : 2013 Segmentation Session 7
Learning Outcomes After carefully listening this lecture, students will be able to do the following: Explain various segmentation techniques and demonstrate their implementation (histogram based segmentation, k-means) using MATLAB and OpenCV (LO2, LO3) T0283 - Computer Vision
Lecture Outline Motivation: Recognition Using Region Properties Region Segmentation Similarity Constraints Simple Segmentation Image Histogram Segmentation Using Histogram (Simple Case) Segmentation Using Histogram (Real image histograms) Recursive Connected Component Algorithm Sequential Connected Component Algorithm Phagocyte Algorithm Likelihood Ratio Test Difference Between Segmentation and Edge Detection T0283 - Computer Vision
Segmentation is the process of distinguishing objects in the dataset from their surroundings so as to facilitate the creation of geometric models. For example, in medical imaging it is often important to measure the shape, surface area, or volume of tissues in the body. Once the dataset is segmented, those quantities are easily measured. T0283 - Computer Vision
Motivation: Recognition Using Region Properties Training For all training samples of each model object Segment the image Compute region properties (features) Recognition Given an image of unknown object, Compute its feature vector Compare with the training set T0283 - Computer Vision
Region Segmentation T0283 - Computer Vision
Segmentation Find set of regions R1, R2, ….,Rn such that: All pixels in region i satisfy some similarity constraint: T0283 - Computer Vision
Similarity Constraints All pixels in any sub-image musts have the same gray levels. All pixels in any sub-image must not differ more than some threshold All pixels in any sub-image may not differ more than some threshold from the mean of the gray of the region The standard deviation of gray levels in any sub-image must be small. T0283 - Computer Vision
Simple Segmentation T0283 - Computer Vision
Image Histogram Histogram graphs the number of pixels with a particular gray level as a function of the image of gray levels. number of pixels gray level T0283 - Computer Vision
Segmentation Using Histogram Simple Case T0283 - Computer Vision
Segmentation Using Histogram Simple Case T0283 - Computer Vision
Realistic Histograms Smooth out noise Convolve hist. by averaging or 1D Gaussian filter peak peak valley peak valley valley T0283 - Computer Vision
Segmentation Using Histogram Real image histograms Compute the histogram of a given image. Smooth the histogram by averaging peaks and valleys in the histogram. Detect good peaks by applying thresholds at the valleys. Segment the image into several binary images using thresholds at the valleys. Apply connected component algorithm to each binary image find connected regions. T0283 - Computer Vision
Segmentation Using Histograms Select the valleys as thresholds Apply threshold to histogram Label the pixels within the range of a threshold with same label, i.e., a, b, c … or 1, 2, 3 … T0283 - Computer Vision
Connected Components Disjoint segments with same labels need to be split may be added to segment c T0283 - Computer Vision
Recursive Connected Component Algorithm Scan the binary image left to right, top to bottom. If there is an unlabeled pixel with a value of “1”, assign a new label to it. Recursively check the neighbors of the pixel in step 2 and assign the same label if they are unlabeled with value “1”. Stop when all the pixels of value “1” have been labeled. T0283 - Computer Vision
Sequential Connected Component Algorithm Scan the binary image left to right, top to bottom. If an unlabeled pixel with a value of “1”, assign a new label to it according to the following rules : Determine equivalence classes of labels In the second pass, assign the same label to all elements in an equivalence class. T0283 - Computer Vision
Sequential Connected Component Algorithm Equivalence class T0283 - Computer Vision
Example: Detecting Finger Tips (marked white) T0283 - Computer Vision
Recaps: Steps in Seed Segmentation Compute the histogram. Smooth the histogram Detect good peaks Segment image into binary images using thresholds at the valleys. Apply connected component algorithm. T0283 - Computer Vision
Improving Seed Segmentation Merge small neighboring regions Region growing step Split large regions Region splitting Remove weak boundaries between adjacent regions T0283 - Computer Vision
Region Growing Seed segmentation (histogram based seg.) Region splitting and merging Phagocyte algorithm Likelihood ratio test T0283 - Computer Vision
Region Split and Merge Splitting: split non uniform region into 4 adjacent regions Merging: merge similar regions Stop when no splitting merging are possible Uniformity/similarity function: P T0283 - Computer Vision
Example R R R R R R R R R R R T0283 - Computer Vision R R R R R R R R
Phagocyte Algorithm Boundary melting Remove weak boundaries Similar to region merging Boundary weakness is based on color similarity R1 R2 T0283 - Computer Vision
Phagocyte Algorithm R1 R2 T0283 - Computer Vision
Phagocyte Merging Heuristics Merge two regions if where P1 and P2 are the perimeters of regions R1 and R2. Merge regions if Phagocyte Weakness T0283 - Computer Vision
Likelihood Ratio Test Two region hypothesis There is only one region There are indeed two regions Intensity at every pixel is independent Joint probability Gaussian distribution T0283 - Computer Vision
Likelihood Ratio Test observing intensity under Gaussian model Likelihood of region A x1, x2, …,xm1A Likelihood of region B xm1+1, xm1+2, …,xm1+m2B T0283 - Computer Vision
Likelihood Ratio Test There is 1 region hypothesis There are 2 regions hypothesis T0283 - Computer Vision
Likelihood Ratio Test Merge regions if LH<T. T0283 - Computer Vision
Region Growing Methods Different algorithms have different number of thresholds How much merging is required Stopping criterion Though simple, seed segmentation succeed by region growing is usually successful T0283 - Computer Vision
Difference Between Segmentation and Edge Detection Closed boundary Edges are usually open Segmentation provides closed boundaries Local or global Edges are computed in the locality Segmentation is global Increasing feature vector dimensionality Does not drastically improve edge detection Improves segmentation (motion, texture information etc.) Boundary position Localized in edge detection Usually not localized (recent advancements use locality as well) Especially contour based segmentation T0283 - Computer Vision
References Textbook Forsyth, D., Ponce, J. (2012). Computer Vision: A Modern Approach. 2nd ed. Prentice Hall. ISBN: 978-0-27-376414-4 Web Relationship to edge detection, segmentation, and classification http://www.cs.utah.edu/~gk/MS/html/node4.html T0283 - Computer Vision
THANK YOU T0283 - Computer Vision