Segmentation (continued)

Similar documents
Segmentation. Bottom Up Segmentation

Segmentation and Grouping April 19 th, 2018

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

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

Grouping and Segmentation

Segmentation and Grouping

Segmentation and Grouping April 21 st, 2015

The goals of segmentation

Segmentation & Grouping Kristen Grauman UT Austin. Announcements

CMPSCI 670: Computer Vision! Grouping

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

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

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

Segmentation & Clustering

Lecture 7: Segmentation. Thursday, Sept 20

Image Segmentation. Selim Aksoy. Bilkent University

Image Segmentation. Selim Aksoy. Bilkent University

CS 534: Computer Vision Segmentation and Perceptual Grouping

Lecture 16 Segmentation and Scene understanding

Lecture: k-means & mean-shift clustering

Lecture: k-means & mean-shift clustering

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

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

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

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

Segmentation Computer Vision Spring 2018, Lecture 27

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Segmentation and low-level grouping.

Image Segmentation continued Graph Based Methods

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

Lecture 10: Semantic Segmentation and Clustering

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

Segmentation by Clustering

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

Lecture 13: k-means and mean-shift clustering

Edge Detection Lecture 03 Computer Vision

Computer Vision Lecture 6

Digital Image Processing

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

Image Analysis. Segmentation by Clustering

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

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

Segmentation and Grouping

EE 701 ROBOT VISION. Segmentation

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

Lecture 8: Fitting. Tuesday, Sept 25

Image Analysis - Lecture 5

Content-based Image and Video Retrieval. Image Segmentation

Grouping and Segmentation

Segmentation by Clustering. Segmentation by Clustering Reading: Chapter 14 (skip 14.5) General ideas

CS 534: Computer Vision Segmentation and Perceptual Grouping

Segmentation by Clustering Reading: Chapter 14 (skip 14.5)

Announcements. Segmentation & Grouping. Review questions. Outline. Grouping in vision. Examples of grouping in vision 9/21/2015

Computer Vision Lecture 6

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

Image Segmentation. Shengnan Wang

Image Segmentation. Luc Van Gool, ETH Zurich. Vittorio Ferrari, Un. of Edinburgh. With important contributions by

Clustering Part 3. Hierarchical Clustering

Computer Vision 5 Segmentation by Clustering

Visual Representations for Machine Learning

Local Features: Detection, Description & Matching

Clustering. Discover groups such that samples within a group are more similar to each other than samples across groups.

University of Florida CISE department Gator Engineering. Clustering Part 2

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

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

University of Florida CISE department Gator Engineering. Clustering Part 4

Normalized cuts and image segmentation

Clustering Part 4 DBSCAN

Image Processing and Image Analysis VU

Segmentation and Grouping

2%34 #5 +,,% ! # %& ()% #% +,,%. & /%0%)( 1 ! # %& % %()# +(& ,.+/ +&0%//#/ &

From Pixels to Blobs

Hierarchical Clustering

Data Mining Cluster Analysis: Basic Concepts and Algorithms. Slides From Lecture Notes for Chapter 8. Introduction to Data Mining

Image Segmentation. April 24, Stanford University. Philipp Krähenbühl (Stanford University) Segmentation April 24, / 63

BBS654 Data Mining. Pinar Duygulu. Slides are adapted from Nazli Ikizler

Clustering CS 550: Machine Learning

Clustering Lecture 3: Hierarchical Methods

Lecture 13 Segmentation and Scene Understanding Chris Choy, Ph.D. candidate Stanford Vision and Learning Lab (SVL)

SYDE Winter 2011 Introduction to Pattern Recognition. Clustering

CAP 5415 Computer Vision Fall 2012

CSSE463: Image Recognition Day 21

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

Fitting. Lecture 8. Cristian Sminchisescu. Slide credits: K. Grauman, S. Seitz, S. Lazebnik, D. Forsyth, J. Ponce

Hierarchical Clustering Lecture 9

Unsupervised Learning. Presenter: Anil Sharma, PhD Scholar, IIIT-Delhi

k-means demo Administrative Machine learning: Unsupervised learning" Assignment 5 out

CS7267 MACHINE LEARNING

Dr. Ulas Bagci

Clustering Lecture 8. David Sontag New York University. Slides adapted from Luke Zettlemoyer, Vibhav Gogate, Carlos Guestrin, Andrew Moore, Dan Klein

2D image segmentation based on spatial coherence

Lecture Notes for Chapter 7. Introduction to Data Mining, 2 nd Edition. by Tan, Steinbach, Karpatne, Kumar

Image Segmentation for Image Object Extraction

Cluster analysis. Agnieszka Nowak - Brzezinska

Hierarchical Clustering

CSE 5243 INTRO. TO DATA MINING

Automatic Segmentation of Semantic Classes in Raster Map Images

Unit 3 : Image Segmentation

Data Mining Concepts & Techniques

CS 558: Computer Vision 4 th Set of Notes

Transcription:

Segmentation (continued) Lecture 05 Computer Vision

Material Citations Dr George Stockman Professor Emeritus, Michigan State University Dr Mubarak Shah Professor, University of Central Florida The Robotics Institute Carnegie Mellon University Dr David A. Forsyth Professor, University of Illinois at Urbana- Champaign Dr Kristen Grauman Associate Professor, University of Texas at Austin

Suggested Readings Chapter 10 Linda G. Shapiro and George Stockman, Computer Vision, Upper Saddle River, NJ, Prentice Hall, 2001. Chapter 15 David A. Forsyth and Jean Ponce, Computer Vision A Modern Approach, 2 nd edition, Prentice Hall, Inc., 2003. Chapter 3 Mubarak Shah, Fundamentals of Computer Vision.

Clustering Main idea: Cluster together (pixels, tokens, etc.) that belong together Tokens: Whatever we need to group (pixels, points, surface elements, etc.)

Segmentation by Clustering R 1 R2 R 4 R 3 R 6 R 5

Segmentation by Clustering Main idea: Cluster together (pixels, tokens, etc.) that belong together Simple Methods Divisive clustering Split cluster along best boundary Repeat Agglomerative clustering Attach token to cluster it is closest to Repeat Inter-Cluster distance criteria Single-link clustering Distance between closest elements of clusters Complete-link clustering Maximum distance between elements of clusters Group-average clustering Average distance between elements of clusters

Segmentation by Clustering Dendrograms A representation of structure of hierarchy of clusters Dataset Dendogram

Segmentation by Clustering K Means Objective function Assuming we know there are k clusters and k is known Each cluster has center Center of i th cluster is c i The j th element to be clustered is described by feature vector x j (could be any set of features) The objective function can be given as: Φ (clusters, data) = Properties i clusters j elements of i'th cluster function that it is desired to maximize or minimize. x j i 2 Will always converge to some solution Can be a local minimum ; doesn't always find the global minimum The k-means problem is finding the least-squares assignment to centroids.

Segmentation by Clustering K Means Desirables Choose a fixed number of clusters Choose cluster centers Point-cluster allocations to minimize error Algorithm Fix cluster centers; allocate points to closest Fix allocation; compute best cluster centers

Segmentation by Clustering K Means Andrew Moore

Segmentation by Clustering K Means Andrew Moore

Segmentation by Clustering K Means Andrew Moore

Segmentation by Clustering K Means Andrew Moore

Segmentation by Clustering K Means Andrew Moore

Segmentation by Clustering K Means Select a feature vector for every pixel (color, texture, position, or combination of these etc.) Define a similarity measure between feature vectors (Usually Euclidean Distance) Apply K-Means Algorithm Apply Connected Components Algorithm Merge any components of size less than some threshold to an adjacent component that is most similar to it

Segmentation by Clustering K Means Image Clusters on intensity Clusters on color K-means clustering using intensity alone and color alone No requirement that clusters be spatially localized and they re not

Example - Segmenting Kristen Grauman, University of Texas at Austin How to determine the three main intensities? Kristen Grauman, University of Texas at Austin

Segmentation by Clustering K Means Depending on what we choose as the feature space, we can group pixels in different ways. Grouping pixels based on intensity similarity Feature space: intensity value (1-d)

Segmentation by Clustering K Means K=2 K=3 quantization of the feature space; segmentation label map

Segmentation by Clustering K Means Depending on what we choose as the feature space, we can group pixels in different ways. Grouping pixels based on color similarity B G R=255 G=200 B=250 R=245 G=220 B=248 Feature space: color value (3-d) Kristen Grauman R R=15 G=189 B=2 R=3 G=12 B=2

Segmentation by Clustering K Means Depending on what we choose as the feature space, we can group pixels in different ways. Grouping pixels based on intensity similarity Clusters based on intensity similarity don t have to be spatially coherent. Kristen Grauman

Segmentation by Clustering K Means Depending on what we choose as the feature space, we can group pixels in different ways. Grouping pixels based on intensity + position similarity Intensity Kristen Grauman Y X Both regions are black, but if we also include position (x,y), then we could group the two into distinct segments; way to encode both similarity & proximity.

Segmentation by Clustering K Means Color, brightness, position alone are not enough to distinguish all regions Kristen Grauman

Segmentation by Clustering K Means Depending on what we choose as the feature space, we can group pixels in different ways. Grouping pixels based on texture similarity F 1 F 2 Filter bank of 24 filters F 24 Feature space: filter bank responses (e.g., 24-d) Kristen Grauman

Dimension 2 (mean d/dy value) Segmentation by Clustering K Means Texture representation example Windows with primarily horizontal edges Both Dimension 1 (mean d/dx value) Kristen Grauman Windows with small gradient in both directions Windows with primarily vertical edges

Count Count Count Segmentation by Clustering K Means Segmentation with texture features Find textons by clustering vectors of filter bank outputs Describe texture in a window based on texton histogram Image Texton map Texton index Malik, Belongie, Leung and Shi. IJCV 2001. Adapted from Lana Lazebnik Texton index Texton index

Segmentation by Clustering K Means Kristen Grauman

Segmentation by Clustering K Means Pros Simple, fast to compute Converges to local minimum of within-cluster squared error Cons/issues Setting k? Sensitive to initial centers Sensitive to outliers Detects spherical clusters Assuming means can be computed Sample Code http://www.mathworks.com/matlabcentral/fileexchange/8379-kmeans-image-segmentation

Segmentation by Clustering Mean Shift The mean shift algorithm seeks modes or local maxima of density in the feature space image Feature space (L*u*v* color values)

Segmentation by Clustering Mean Shift Mean Shift Algorithm Choose a search window size. Choose the initial location of the search window. Compute the mean location (centroid of the data) in the search window. Center the search window at the mean location computed in Step 3. Repeat Steps 3 and 4 until convergence.

Segmentation by Clustering Mean Shift Search window Center of mass Slide by Y. Ukrainitz & B. Sarel Mean Shift vector

Segmentation by Clustering Mean Shift Search window Center of mass Slide by Y. Ukrainitz & B. Sarel Mean Shift vector

Segmentation by Clustering Mean Shift Search window Center of mass Slide by Y. Ukrainitz & B. Sarel Mean Shift vector

Segmentation by Clustering Mean Shift Search window Center of mass Slide by Y. Ukrainitz & B. Sarel Mean Shift vector

Segmentation by Clustering Mean Shift Search window Center of mass Slide by Y. Ukrainitz & B. Sarel Mean Shift vector

Segmentation by Clustering Mean Shift Search window Center of mass Slide by Y. Ukrainitz & B. Sarel Mean Shift vector

Segmentation by Clustering Mean Shift Search window Center of mass Slide by Y. Ukrainitz & B. Sarel

Segmentation by Clustering Mean Shift Cluster: all data points in the attraction basin of a mode Attraction basin: the region for which all trajectories lead to the same mode Slide by Y. Ukrainitz & B. Sarel

Segmentation by Clustering Mean Shift Mean Shift Segmentation Algorithm Convert the image into tokens (via color, gradients, texture measures etc). Choose initial search window locations uniformly in the data. Compute the mean shift window location for each initial position. Merge windows that end up on the same peak or mode. The data these merged windows traversed are clustered together.

Segmentation by Clustering Mean Shift 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 Szeliski Book

Segmentation by Clustering Mean Shift http://www.caip.rutgers.edu/~comanici/mspami/mspamiresults.html

Segmentation by Clustering Mean Shift

Segmentation by Clustering Mean Shift 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 Kristen Grauman

Segmentation by Graph theoretic clustering Graph Theory A graph is a non-empty finite set of vertices V along with a set E of 2- element subsets of V. The elements of V are called Vertices. The elements of E are called edges.

Segmentation by Graph theoretic clustering Represent tokens using A weighted undirected graph G = (V,E) Nodes are points in the feature space Fully connected graph The weight associated are generally called affinity measures and Edge weight w(i,j) is a function of the similarity between nodes i and j. The graphs can be represented by weight or affinity matrices Task: Cut up this graph to get sub-graphs with strong interior links, i.e. Partition the set V into disjoint sets V 1,..,V n, s.t. similarity among nodes in V i is high and similarity across V i and V j is low.

Segmentation by Graph theoretic clustering Segmentation by Graph Cuts p w pq q w A B C Break Graph into Segments Want to delete links that cross between segments Easiest to break links that have low similarity (low weight) Similar pixels should be in the same segments Dissimilar pixels should be in different segments Source: Steve Seitz

Graph Representations a a b c d e b c d e V = {a,b,c,d,e} E = {(a,b), (a,e), (c,e), (d,e)} Adjacency Matrix Cardinality: No of vertices G = 5 Degree of vertex: Nodes connecting to a vertex deg(a) = 2

Weighted Graphs and Their Representations a a b c d e b c d e

Measuring Affinity Distance aff x, y exp 1 2 2 d x y 2 Intensity Texture aff x, y exp 1 2 2 i aff x, y exp 1 2 2 t I x I y 2 c x c y 2

Minimum Cut A cut of a graph G is the set of edges S such that removal of S from G disconnects G Given a graph G=(V,E), the sets A and B are a disjoint partition of V Cut A B (, ) wpq, p A, q B Cut(A,B) is a measure of similarity between the two groups. Cut(A,B) is the sum of weights of all edges in V that have one end in A and the other in B Minimum cut is the cut of minimum weight, where weight of Cut <A,B> is given as A B There can be more than one minimum cut in a given graph

Minimum Cut

Minimum Cut Problem with minimum cut: Weight of cut proportional to number of edges in the cut; tends to produce small, isolated components. Cuts with lesser weight than the ideal cut Ideal Cut

Normalized Cut We d like to maximize the within cluster similarity compared to the across cluster difference In other words the approach is to cut the graph into two connected components such that the cost of the cut is a small fraction of the total affinity within each group

Normalized Cut Normalized cut is defined as: Cut( A, B) Cut( A, B) Assoc( A, V ) Assoc( B, V ) i.e. construct A, B such that their within cluster similarity is high compared to their association with the rest of the graph Cut(A,B) = Sum of weights of all edges in V that touch both A and B Assoc(A,V) = Sum of weights of all edges that touch A Ncut value small when we get two clusters with many edges with high weights, and few edges of low weight between them Approximate solution for minimizing the Ncut value is Generalized eigenvalue problem det( A I) 0

Finding Minimum Normalized Cut

Finding Minimum Normalized Cut

Normalized Cut - Example results Berkley Segmentation Engine http://www.cs.berkeley.edu/~fowlkes/bse/

Normalized Cut 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 Bias towards partitioning into equal segments Sample student project: http://note.sonots.com/scisoftware/ncutimagesegmentation.html#sd872c22