Image Segmentation. Selim Aksoy. Bilkent University

Similar documents
Image Segmentation. Selim Aksoy. Bilkent University

Example 2: Straight Lines. Image Segmentation. Example 3: Lines and Circular Arcs. Example 1: Regions

Example 1: Regions. Image Segmentation. Example 3: Lines and Circular Arcs. Example 2: Straight Lines. Region Segmentation: Segmentation Criteria

Segmentation and Grouping April 19 th, 2018

CS 534: Computer Vision Segmentation and Perceptual Grouping

Grouping and Segmentation

The goals of segmentation

Outline. Segmentation & Grouping. Examples of grouping in vision. Grouping in vision. Grouping in vision 2/9/2011. CS 376 Lecture 7 Segmentation 1

Segmentation and Grouping

Segmentation. Bottom Up Segmentation

Segmentation (continued)

Segmentation and Grouping April 21 st, 2015

Segmentation & Grouping Kristen Grauman UT Austin. Announcements

Image Processing and Image Analysis VU

CMPSCI 670: Computer Vision! Grouping

6.801/866. Segmentation and Line Fitting. T. Darrell

Applications. Foreground / background segmentation Finding skin-colored regions. Finding the moving objects. Intelligent scissors

CS 4495 Computer Vision. Segmentation. Aaron Bobick (slides by Tucker Hermans) School of Interactive Computing. Segmentation

Targil 12 : Image Segmentation. Image segmentation. Why do we need it? Image segmentation

Lecture 7: Segmentation. Thursday, Sept 20

CS 2770: Computer Vision. Edges and Segments. Prof. Adriana Kovashka University of Pittsburgh February 21, 2017

EE 701 ROBOT VISION. Segmentation

From Pixels to Blobs

CS 534: Computer Vision Segmentation and Perceptual Grouping

Color, Texture and Segmentation. CSE 455 Linda Shapiro

CS 2750: Machine Learning. Clustering. Prof. Adriana Kovashka University of Pittsburgh January 17, 2017

Image Analysis - Lecture 5

Image Analysis Image Segmentation (Basic Methods)

Image Segmentation continued Graph Based Methods

Normalized cuts and image segmentation

Lecture 16 Segmentation and Scene understanding

Image segmentation. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

REGION & EDGE BASED SEGMENTATION

CS 534: Computer Vision Segmentation II Graph Cuts and Image Segmentation

In this lecture, we are going to talk about image segmentation, essentially defined as methods for grouping pixels together.

Lecture: k-means & mean-shift clustering

Segmentation Computer Vision Spring 2018, Lecture 27

Segmentation and low-level grouping.

Clustering. Subhransu Maji. CMPSCI 689: Machine Learning. 2 April April 2015

Clustering. So far in the course. Clustering. Clustering. Subhransu Maji. CMPSCI 689: Machine Learning. dist(x, y) = x y 2 2

Content-based Image and Video Retrieval. Image Segmentation

Lecture: k-means & mean-shift clustering

Segmentation and Grouping

CS 664 Slides #11 Image Segmentation. Prof. Dan Huttenlocher Fall 2003

Announcements. Image Segmentation. From images to objects. Extracting objects. Status reports next Thursday ~5min presentations in class

Image Segmentation. Srikumar Ramalingam School of Computing University of Utah. Slides borrowed from Ross Whitaker

Dr. Ulas Bagci

Segmentation & Clustering

Image Segmentation continued Graph Based Methods. Some slides: courtesy of O. Capms, Penn State, J.Ponce and D. Fortsyth, Computer Vision Book

Lecture 11: E-M and MeanShift. CAP 5415 Fall 2007

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

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

Idea. Found boundaries between regions (edges) Didn t return the actual region

Clustering appearance and shape by learning jigsaws Anitha Kannan, John Winn, Carsten Rother

CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu. Lectures 21 & 22 Segmentation and clustering

Today INF How did Andy Warhol get his inspiration? Edge linking (very briefly) Segmentation approaches

CS 664 Segmentation. Daniel Huttenlocher

EECS490: Digital Image Processing. Lecture #22

Region & edge based Segmentation

Bioimage Informatics

Grouping and Segmentation

Lecture 10: Semantic Segmentation and Clustering

Object Segmentation. Jacob D. Furst DePaul CTI

VC 10/11 T9 Region-Based Segmentation

Image Segmentation Based on Watershed and Edge Detection Techniques

Normalized Graph cuts. by Gopalkrishna Veni School of Computing University of Utah

ECG782: Multidimensional Digital Signal Processing

Operators-Based on Second Derivative double derivative Laplacian operator Laplacian Operator Laplacian Of Gaussian (LOG) Operator LOG

Unsupervised Learning and Clustering

Introduction to Medical Imaging (5XSA0) Module 5

Topic 4 Image Segmentation

CHAPTER 4. ANALYSIS of GRAPH THEORETICAL IMAGE SEGMENTATION METHODS

Processing and Others. Xiaojun Qi -- REU Site Program in CVMA

Image Segmentation. Shengnan Wang

Lecture: Segmentation I FMAN30: Medical Image Analysis. Anders Heyden

Unit 3 : Image Segmentation

Local Feature Detectors

human vision: grouping k-means clustering graph-theoretic clustering Hough transform line fitting RANSAC

CS 556: Computer Vision. Lecture 18

Digital Image Processing Lecture 7. Segmentation and labeling of objects. Methods for segmentation. Labeling, 2 different algorithms

Region-based Segmentation

Outline. Advanced Digital Image Processing and Others. Importance of Segmentation (Cont.) Importance of Segmentation

Unsupervised Learning and Clustering

Image Analysis. Segmentation by Clustering

Image Analysis Lecture Segmentation. Idar Dyrdal

2D image segmentation based on spatial coherence

SYDE Winter 2011 Introduction to Pattern Recognition. Clustering

EE 584 MACHINE VISION

11. Image Data Analytics. Jacobs University Visualization and Computer Graphics Lab

IMAGE SEGMENTATION. Václav Hlaváč

REGION BASED SEGEMENTATION

Segmentation

Fitting: Voting and the Hough Transform April 23 rd, Yong Jae Lee UC Davis

Texture Analysis. Selim Aksoy Department of Computer Engineering Bilkent University

CS4670: Computer Vision

Digital Image Processing

Clustering Color/Intensity. Group together pixels of similar color/intensity.

Part 3: Image Processing

Image Segmentation. Marc Pollefeys. ETH Zurich. Slide credits: V. Ferrari, K. Grauman, B. Leibe, S. Lazebnik, S. Seitz,Y Boykov, W. Freeman, P.

Segmentation

Transcription:

Image Segmentation Selim Aksoy Department of Computer Engineering Bilkent University saksoy@cs.bilkent.edu.tr

Examples of grouping in vision [http://poseidon.csd.auth.gr/lab_research/latest/imgs/s peakdepvidindex_img2.jpg] Group video frames into shots [Figure by J. Shi] Determine image regions [Figure by Wang & Suter] Figure-ground separation [Figure by Grauman & Darrell] Object-level grouping CS 484, Spring 2011 2011, Selim Aksoy 2

Image segmentation CS 484, Spring 2011 2011, Selim Aksoy 3

Image segmentation CS 484, Spring 2011 2011, Selim Aksoy 4

From images to objects What defines an object? Subjective problem, but has been well-studied. Gestalt laws seek to formalize this. What is interesting and what is not depends on the application. Broad theory is absent at present. CS 484, Spring 2011 2011, Selim Aksoy 5

Gestalt laws A series of factors affect whether elements should be grouped together. Proximity: tokens that are nearby tend to be grouped. Similarity: similar tokens tend to be grouped together. Common fate: tokens that have coherent motion tend to be grouped together. Common region: tokens that lie inside the same closed region tend to be grouped together. Parallelism: parallel curves or tokens tend to be grouped together. Closure: tokens or curves that tend to lead to closed curves tend to be grouped together. Symmetry: curves that lead to symmetric groups are grouped together. Continuity: tokens that lead to continuous curves tend to be grouped. Familiar configuration: tokens that, when grouped, lead to a familiar object, tend to be grouped together. CS 484, Spring 2011 2011, Selim Aksoy 6

Gestalt laws CS 484, Spring 2011 2011, Selim Aksoy 7

Gestalt laws Similarity Symmetry Adapted from Kristen Grauman CS 484, Spring 2011 2011, Selim Aksoy 8

Gestalt laws Proximity Common fate Adapted from Kristen Grauman CS 484, Spring 2011 2011, Selim Aksoy 9

Gestalt laws Continuity, explanation by occlusion CS 484, Spring 2011 2011, Selim Aksoy 10

Image segmentation Image segmentation is the operation of partitioning an image into a collection of connected sets of pixels. Segmentation criteria: a segmentation is a partition of an image I into a set of regions S satisfying: 1. S i = S Partition covers the whole image. 2. S i S j =, i j No regions intersect. 3. S i, P(S i ) = true Homogeneity predicate is satisfied by each region. 4. P(S i S j ) = false, Union of adjacent regions i j, S i adjacent S j does not satisfy it. CS 484, Spring 2011 2011, Selim Aksoy 11

Image segmentation So, all we have to do is to define and implement the similarity predicate. But, what do we want to be similar in each region? Is there any property that will cause the regions to be meaningful objects? Example approaches: Histogram-based Clustering-based Region growing Split-and-merge Morphological Graph-based CS 484, Spring 2011 2011, Selim Aksoy 12

Histogram-based segmentation How many orange pixels are in this image? This type of question can be answered by looking at the histogram. CS 484, Spring 2011 2011, Selim Aksoy 13

Histogram-based segmentation How many modes are there? Solve this by reducing the number of colors to K and mapping each pixel to the closest color. Here s what it looks like if we use two colors. CS 484, Spring 2011 2011, Selim Aksoy 14

Clustering-based segmentation How to choose the representative colors? This is a clustering problem! K-means algorithm can be used for clustering. CS 484, Spring 2011 2011, Selim Aksoy 15

Clustering-based segmentation K-means clustering of color. CS 484, Spring 2011 2011, Selim Aksoy 16

Clustering-based segmentation K-means clustering of color. CS 484, Spring 2011 2011, Selim Aksoy 17

Clustering-based segmentation Clustering can also be used with other features (e.g., texture) in addition to color. Original Images Color Regions Texture Regions CS 484, Spring 2011 2011, Selim Aksoy 18

Clustering-based segmentation Pros: Simple, fast to compute Converges to local minimum of withincluster squared error Cons: Setting K? Sensitive to initial centers Sensitive to outliers Detects spherical clusters Adapted from Kristen Grauman CS 484, Spring 2011 2011, Selim Aksoy 19

Clustering-based segmentation K-means variants: Different ways to initialize the means. Different stopping criteria. Dynamic methods for determining the right number of clusters (K) for a given image. Problem: histogram-based and clustering-based segmentation using color/texture/etc can produce messy/noisy regions. (Why?) How can these be fixed? CS 484, Spring 2011 2011, Selim Aksoy 20

Mean shift algorithm The mean shift algorithm seeks modes or local maxima of density in the feature space. Image Feature space (L*u*v* color values) Adapted from Kristen Grauman CS 484, Spring 2011 2011, Selim Aksoy 21

Mean shift algorithm Search window Center of mass Mean Shift vector CS 484, Spring 2011 2011, Selim Aksoy 22

Mean shift algorithm Search window Center of mass Mean Shift vector CS 484, Spring 2011 2011, Selim Aksoy 23

Mean shift algorithm Search window Center of mass Mean Shift vector CS 484, Spring 2011 2011, Selim Aksoy 24

Mean shift algorithm Search window Center of mass Mean Shift vector CS 484, Spring 2011 2011, Selim Aksoy 25

Mean shift algorithm Search window Center of mass Mean Shift vector CS 484, Spring 2011 2011, Selim Aksoy 26

Mean shift algorithm Search window Center of mass Mean Shift vector CS 484, Spring 2011 2011, Selim Aksoy 27

Mean shift algorithm Search window Center of mass CS 484, Spring 2011 2011, Selim Aksoy 28

Mean shift clustering/segmentation Find features (color, gradients, texture, etc) Initialize windows at individual feature points Perform mean shift for each window until convergence Merge windows that end up near the same peak or mode CS 484, Spring 2011 2011, Selim Aksoy 29

Mean shift segmentation http://www.caip.rutgers.edu/~comanici/mspami/mspamiresults.html CS 484, Spring 2011 2011, Selim Aksoy 30

Mean shift segmentation CS 484, Spring 2011 2011, Selim Aksoy 31

Mean shift segmentation Pros: Does not assume shape on clusters One parameter choice (window size) Generic technique Find multiple modes Cons: Selection of window size Does not scale well with dimension of feature space Adapted from Kristen Grauman CS 484, Spring 2011 2011, Selim Aksoy 32

Region growing Region growing techniques start with one pixel of a potential region and try to grow it by adding adjacent pixels till the pixels being compared are too dissimilar. The first pixel selected can be just the first unlabeled pixel in the image or a set of seed pixels can be chosen (manually or automatically) from the image. We need to define a measure of similarity between a pixel and a set of pixels as well as a rule that makes a decision for growing based on this measure. CS 484, Spring 2011 2011, Selim Aksoy 33

Region growing Usually a statistical test is used to decide which pixels can be added to a region. Region is a population with similar statistics. Use statistical test to see if neighbor on border fits into the region population. Let R be the N pixel region so far and p be a neighboring pixel with gray tone y. Define the mean X and scatter S 2 (sample variance) by 1 N X = I(r,c) ( ) 2 S = I(r,c)- X 2 (r,c) R (r,c) R CS 484, Spring 2011 2011, Selim Aksoy 34 1 N

Region growing The T statistic is defined by T= (N 1)N (p X) 2 /S 2 (N + 1) 1/2 It has a T N-1 distribution if all the pixels in R and the test pixel p are independent and identically distributed Gaussians (i.i.d. assumption). CS 484, Spring 2011 2011, Selim Aksoy 35

Region growing For the T distribution, statistical tables give us the probability Pr(T t) for a given degrees of freedom and a confidence level. From this, pick a suitable threshold t. If the computed T t for desired confidence level, add p to region R and update the mean and scatter using p. If T is too high, the value p is not likely to have arisen from the population of pixels in R. Start a new region. Many other statistical and distance-based methods have also been proposed for region growing. CS 484, Spring 2011 2011, Selim Aksoy 36

Region growing image segmentation CS 484, Spring 2011 2011, Selim Aksoy 37

Split-and-merge 1. Start with the whole image. 2. If the variance is too high, break into quadrants. 3. Merge any adjacent regions that are similar enough. 4. Repeat steps 2 and 3, iteratively until no more splitting or merging occur. Idea: good Results: blocky CS 484, Spring 2011 2011, Selim Aksoy 38

Split-and-merge CS 484, Spring 2011 2011, Selim Aksoy 39

Split-and-merge CS 484, Spring 2011 2011, Selim Aksoy 40

Watershed segmentation The image can be interpreted as a topographic surface, with both valleys and mountains. Three types of points can be considered: Points belonging to a regional minimum. Points at which a drop of water, if placed at the location of any of those points, would fall to a single minimum. catchment basins Points at which water would be equally likely to fall to more than one such minimum. watershed lines CS 484, Spring 2011 2011, Selim Aksoy 41

Watershed segmentation Assume that there is a hole in each minima and the surface is immersed into a lake. The water will enter through the holes at the minima and flood the surface. To avoid the water coming from two different minima to meet, a dam is build whenever there would be a merge of the water. Finally, the only thing visible of the surface would be the dams. These dam walls are called the watershed lines. CS 484, Spring 2011 2011, Selim Aksoy 42

Watershed segmentation CS 484, Spring 2011 2011, Selim Aksoy 43

Watershed segmentation CS 484, Spring 2011 2011, Selim Aksoy 44

Watershed segmentation A multi-scale segmentation can be obtained by iteratively smoothing the topographic surface. CS 484, Spring 2011 2011, Selim Aksoy 45

Watershed segmentation The key behind using the watershed transform for segmentation is this: change your image into another image whose catchment basins are the objects you want to identify. Examples: Distance transform can be used with binary images where the catchment basins correspond to the foreground components of interest. Gradient can be used with grayscale images where the catchment basins should theoretically correspond to the homogeneous grey level regions of the image. CS 484, Spring 2011 2011, Selim Aksoy 46

Watershed segmentation Binary image. Distance transform of the complement of the binary image. Watershed transform after complementing the distance transform, and forcing pixels that do not belong to the objects to be at Inf. CS 484, Spring 2011 2011, Selim Aksoy 47

Watershed segmentation A cell image. Gradient of the cell image. CS 484, Spring 2011 2011, Selim Aksoy 48

Watershed segmentation Multi-scale watershed segmentation of the cell image. CS 484, Spring 2011 2011, Selim Aksoy 49

Graph-based segmentation An image is represented by a graph whose nodes are pixels or small groups of pixels. The goal is to partition the nodes into disjoint sets so that the similarity within each set is high and across different sets is low. CS 484, Spring 2011 2011, Selim Aksoy 50

Graph-based segmentation Let G = (V,E) be a graph. Each edge (u,v) has a weight w(u,v) that represents the similarity between u and v. Graph G can be broken into 2 disjoint graphs with node sets A and B by removing edges that connect these sets. Let cut(a,b) = Σ u A, v B w(u,v). One way to segment G is to find the minimum cut. CS 484, Spring 2011 2011, Selim Aksoy 51

Graph-based segmentation Problem with minimum cut: weight of cut proportional to number of edges in the cut; tends to produce small, isolated components. CS 484, Spring 2011 2011, Selim Aksoy 52

Graph-based segmentation Shi and Malik proposed the normalized cut. cut(a,b) cut(a,b) Ncut(A,B) = --------------- + --------------- assoc(a,v) assoc(b,v) Normalized cut assoc(a,v) = Σ w(u,t) How much is A connected u A, t V to the graph as a whole CS 484, Spring 2011 2011, Selim Aksoy 53

Graph-based segmentation A 2 2 2 1 4 3 2 2 2 1 B 2 2 2 2 2 3 3 3 Ncut(A,B) = ------- + ------ 21 16 CS 484, Spring 2011 2011, Selim Aksoy 54

Graph-based segmentation Shi and Malik turned graph cuts into an eigenvector/eigenvalue problem. Set up a weighted graph G=(V,E). V is the set of (N) pixels. E is a set of weighted edges (weight w ij gives the similarity between nodes i and j). Length N vector d: d i is the sum of the weights from node i to all other nodes. N x N matrix D: D is a diagonal matrix with d on its diagonal. N x N symmetric matrix W: W ij = w ij. CS 484, Spring 2011 2011, Selim Aksoy 55

Graph-based segmentation Let x be a characteristic vector of a set A of nodes. x i = 1 if node i is in a set A x i = -1 otherwise Let y be a continuous approximation to x Solve the system of equations (D W) y = λ D y for the eigenvectors y and eigenvalues λ. Use the eigenvector y with second smallest eigenvalue to bipartition the graph (y x A). If further subdivision is merited, repeat recursively. CS 484, Spring 2011 2011, Selim Aksoy 56

Graph-based segmentation Edge weights w(i,j) can be defined by - F(i)-F(j) 2 / σ I 2 w(i,j) = e * - X(i)-X(j) 2 / σ 2 X e if X(i)-X(j) 2 < r 0 otherwise where X(i) is the spatial location of node I F(i) is the feature vector for node I which can be intensity, color, texture, motion The formula is set up so that w(i,j) is 0 for nodes that are too far apart. CS 484, Spring 2011 2011, Selim Aksoy 57

Graph-based segmentation CS 484, Spring 2011 2011, Selim Aksoy 58

Graph-based segmentation Pros: Generic framework, flexible to choice of function that computes weights ( affinities ) between nodes Does not require model of the data distribution Cons: Time complexity can be high Dense, highly connected graphs many affinity computations Solving eigenvalue problem Adapted from Kristen Grauman CS 484, Spring 2011 2011, Selim Aksoy 59