Segmentation & Clustering

Similar documents
Lecture 16 Segmentation and Scene understanding

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

The goals of segmentation

Segmentation and Grouping

Grouping and Segmentation

Segmentation. Bottom Up Segmentation

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

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

Segmentation (continued)

Segmentation and Grouping April 19 th, 2018

Segmentation and Grouping

Lecture 7: Segmentation. Thursday, Sept 20

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

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 April 21 st, 2015

Segmentation by Clustering Reading: Chapter 14 (skip 14.5)

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

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

Grouping and Segmentation

Lecture: k-means & mean-shift clustering

Lecture: k-means & mean-shift clustering

Digital Image Processing

Segmentation Computer Vision Spring 2018, Lecture 27

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

CMPSCI 670: Computer Vision! Grouping

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

Segmentation & Grouping Kristen Grauman UT Austin. Announcements

Image Segmentation. Computer Vision Jia-Bin Huang, Virginia Tech. Many slides from D. Hoiem

Lecture 13: k-means and mean-shift clustering

CS 534: Computer Vision Segmentation and Perceptual Grouping

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

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

Computer Vision Lecture 6

CS 534: Computer Vision Segmentation and Perceptual Grouping

Image Analysis. Segmentation by Clustering

Dr. Ulas Bagci

Segmentation and low-level grouping.

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

Segmentation by Clustering

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

Image Segmentation continued Graph Based Methods

Computer Vision Lecture 6

Image Segmentation. Selim Aksoy. Bilkent University

Image Segmentation. Selim Aksoy. Bilkent University

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

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

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

Lecture 8: Fitting. Tuesday, Sept 25

2D image segmentation based on spatial coherence

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

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

Image Segmentation. Lecture14: Image Segmentation. Sample Segmentation Results. Use of Image Segmentation

Unit 3 : Image Segmentation

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

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

Image Segmentation. Shengnan Wang

CS 664 Segmentation. Daniel Huttenlocher

Feature Tracking and Optical Flow

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

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

Feature Tracking and Optical Flow

Optical flow and tracking

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

Content-based Image and Video Retrieval. Image Segmentation

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

Computer Vision II Lecture 4

Multi-stable Perception. Necker Cube

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

Image Analysis Lecture Segmentation. Idar Dyrdal

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

Image Processing and Image Analysis VU

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

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

Image Segmentation With Maximum Cuts

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

Human Body Recognition and Tracking: How the Kinect Works. Kinect RGB-D Camera. What the Kinect Does. How Kinect Works: Overview

Nonparametric Clustering of High Dimensional Data

Computer Vision 5 Segmentation by Clustering

Fundamental matrix. Let p be a point in left image, p in right image. Epipolar relation. Epipolar mapping described by a 3x3 matrix F

CSSE463: Image Recognition Day 21

Peripheral drift illusion

CS 4495 Computer Vision Motion and Optic Flow

Multi-view stereo. Many slides adapted from S. Seitz

CPSC 425: Computer Vision

Multi-label image segmentation via max-sum solver

Image Analysis - Lecture 5

Color Image Segmentation

Contour Detection and Hierarchical Image Segmentation Some Experiments

Solution: filter the image, then subsample F 1 F 2. subsample blur subsample. blur

Gender Classification with Support Vector Machines

PPKE-ITK. Lecture

Normalized cuts and image segmentation

EE 701 ROBOT VISION. Segmentation

Colour Segmentation-based Computation of Dense Optical Flow with Application to Video Object Segmentation

Computer Vision II Lecture 4

From Pixels to Blobs

3 October, 2013 MVA ENS Cachan. Lecture 2: Logistic regression & intro to MIL Iasonas Kokkinos

Supervised texture detection in images

STUDYING THE FEASIBILITY AND IMPORTANCE OF GRAPH-BASED IMAGE SEGMENTATION TECHNIQUES

Transcription:

EECS 442 Computer vision Segmentation & Clustering Segmentation in human vision K-mean clustering Mean-shift Graph-cut Reading: Chapters 14 [FP] Some slides of this lectures are courtesy of prof F. Li, prof S. Lazebnik, and various other lecturers

Segmentation Compact representation for image data in terms of a set of components Components share common visual properties Properties can be defined at different level of abstractions

General ideas Tokens whatever we need to group (pixels, points, surface elements, etc., etc.) Bottom up segmentation tokens belong together because they are locally coherent Top down segmentation tokens belong together because they lie on the same visual entity (object, scene ) > These two are not mutually exclusive

What is Segmentation? Clustering image elements that belong together Partitioning Divide into regions/sequences with coherent internal properties Grouping Identify sets of coherent tokens in image Slide credit: Christopher Rasmussen

Basic ideas of grouping in human vision Gestalt properties Figure-ground discrimination Emergence

Gestalt psychology or gestaltism German: Gestalt - "form" or "whole Berlin School, early 20th century Kurt Koffka, Max Wertheimer, and Wolfgang Köhler Advocate brain is: holistic parallel analog self-organizing tendencies whole is different from the sum of its parts.

A series of factors affect whether elements should be grouped together Gestalt properties

Gestalt properties

Grouping by occlusions Gestalt properties

Grouping by occlusions Gestalt properties

Grouping by invisible completions Gestalt properties

Figure-ground discrimination Grouping can be seen in terms of allocating some elements to a figure, some to ground Can be based on local bottom-up cues or high level recognition

Figure-ground discrimination

Emergence

Segmentation as clustering Cluster together tokens that share similar visual characteristics K-mean Mean-shift Graph-cut

Feature Space Every token is identified by a set of salient visual characteristics. For example: Position Color Texture Motion vector Size, orientation (if token is larger than a pixel) Slide credit: Christopher Rasmussen

Feature Space Source: K. Grauman

Feature space: each token is represented by a point b g r

Token similarity is thus measured by distance between points ( feature vectors ) in feature space b g p q r

Cluster together tokens with high similarity b g r

Agglomerative clustering Add token to cluster if token is similar enough to element of clusters Repeat Divisive clustering Split cluster into subclusters if tokens are dissimilar enough within cluster Boundary separates subclusters based on similarity Repeat

Hierachical structure of clusters (Dendrograms) rand('seed',12); X = rand(100,2); Y = pdist(x, euclidean'); Z = linkage(y, single'); [H, T] = dendrogram(z);

K-Means Clustering Initialization: Given K (number of clusters) and N points in feature space. Pick K points randomly; these are initial cluster centers (means) 1,, K. Repeat the following: 1. Assign each of the N points, x j, to clusters by nearest i 2. Re-compute mean i of each cluster from its member points 3. If no mean has changed more than some, stop Slide credit: Christopher Rasmussen

Example: 3-means Clustering 1. Assign each of the N points, x j, to clusters by nearest i 2. Re-compute mean i of each cluster from its member points 3. If no mean has changed more than some, stop Source: wikipedia

Effectively carries out gradient descent to minimize the error: e( μ i ) (x 1, x 2,, x n ) = observations S = {S 1, S 2,, S k } = partition the n observations into k clusters (k n) μ i = mean of points in S i (cluster center) e μ i 0 t1 μ i

K-means clustering using intensity alone and color alone Image Clusters on intensity Clusters on color

K-Means pros and cons Pros Simple and fast Converges to a local minimum of the error function - Kmeans in matlab Cons Need to pick K Sensitive to initialization Only finds spherical clusters Sensitive to outliers

Segmentation as clustering Cluster together tokens that share similar visual characteristics K-mean Mean-shift Graph-cut

Mean shift segmentation D. Comaniciu and P. Meer, Mean Shift: A Robust Approach toward Feature Space Analysis, PAMI 2002. An advanced and versatile technique for clusteringbased segmentation

Mean shift algorithm Fukunaga, Keinosuke; Larry D. Hostetler (January 1975). "The Estimation of the Gradient of a Density Function, with Applications in Pattern Recognition". IEEE Transactions on Information Theory (IEEE) 21 (1): 32 40 The mean shift algorithm seeks a mode or local maximum of density of a given distribution Choose a search window (width and location) Compute the mean of the data in the search window Center the search window at the new mean location Repeat until convergence

Region of interest Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Region of interest Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Mean shift Region of interest Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Mean shift Region of interest Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Region of interest Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Region of interest Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

Region of interest Center of mass Slide by Y. Ukrainitz & B. Sarel

Computing The Mean Shift Simple Mean Shift procedure: Compute mean shift vector Translate the Kernel window by m(x) 2 1 2 1 ( ) n i i i n i i g h g h x - x x m x x x - x g( ) ( ) k x x

Slide by Y. Ukrainitz & B. Sarel Multimodal distributions

Real Modality Analysis Tessellate the space with windows Merge windows that end up near the same peak or model

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

Slide by Y. Ukrainitz & B. Sarel Attraction basin

Segmentation by Mean Shift Find features (color, gradients, texture, etc) Initialize windows at individual pixel locations Perform mean shift for each window until convergence Merge windows that end up near the same peak or mode

Mean shift segmentation results http://www.caip.rutgers.edu/~comanici/mspami/mspamiresults.html

Mean shift pros and cons Pros Does not assume spherical clusters Just a single parameter (window size) Finds variable number of modes Robust to outliers Cons Output depends on window size Computationally expensive Does not scale well with dimension of feature space

Segmentation as clustering Cluster together tokens that share similar visual characteristics K-mean Mean-shift Graph-cut

Graph-based segmentation Represent features and their relationships using a graph Cut the graph to get subgraphs with strong interior links and weaker exterior links

Images as graphs Node for every pixel Edge between every pair of pixels Each edge is weighted by the affinity or similarity of the two nodes Source: S. Seitz

Measuring Affinity Distance Intensity Color affx, y exp 1 2 2 d affx, y exp 1 2 2 i affx, y exp 1 2 2 t x y 2 Ix Iy 2 cx cy 2

Segmentation by graph partitioning Break Graph into sub-graphs Break links (cutting) that have low affinity similar pixels should be in the same sub-graphs dissimilar pixels should be in different sub-graphs Sub-graphs represents different image segments

Segmentation by graph partitioning Break Graph into sub-graphs Break links (cutting) that have low affinity similar pixels should be in the same sub-graphs dissimilar pixels should be in different sub-graphs Sub-graphs represents different image segments

Segmentation by graph partitioning j i w ij Break Graph into sub-graphs Break links (cutting) that have low affinity similar pixels should be in the same sub-graphs dissimilar pixels should be in different sub-graphs Sub-graphs represents different image segments Graph-cut: technique to cut a graph optimally

Segmentation by graph partitioning j 2 3 A B C i w ij CUT: Set of edges whose removal makes a graph disconnected Cost of a cut: sum of weights of cut edges Example: Cost of the blue cut? Source: S. Seitz

Minimum cut We can do segmentation by finding the minimum cut in a graph Efficient algorithms exist for doing this Drawback: minimum cut tends to cut off very small, isolated components Ideal Cut Cuts with lesser weight than the ideal cut * Slide from Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Normalized cut J. Shi and J. Malik. Normalized cuts and image segmentation. PAMI 2000 IDEA: normalizing the cut by component size The normalized cut cost is: cut ( A, B) assoc( A, V ) cut ( A, B) assoc( B, V ) assoc(a, V) = sum of weights of all edges in V that touch A The exact solution is NP-hard but an approximation can be computed by solving a generalized eigenvalue problem

Normalized cuts: Pro and con Pros Generic framework, can be used with many different features and affinity formulations Cons High storage requirement and time complexity Bias towards partitioning into equal segments * Slide from Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Normalized cuts: Results Figure from Image and video segmentation: the normalised cut framework, by Shi and Malik, copyright IEEE, 1998

Normalized cuts: Results F igure from Normalized cuts and image segmentation, Shi and Malik, copyright IEEE, 2000

Contour and Texture Analysis for Image Segmentation J. Malik, S. Belongie, T. Leung and J. Shi. "Contour and Texture Analysis for Image Segmentation". IJCV 43(1),7-27,2001.

Contour and Texture Analysis for Image Segmentation Using Contours to Detect and Localize Junctions in Natural Images" Now on CUDA M. Maire, P. Arbelaez, C. Fowlkes, and J. Malik. CVPR 2008

Efficient Graph-Based Image Segmentation Efficient Graph-Based Image Segmentation Pedro F. Felzenszwalb and Daniel P. Huttenlocher International Journal of Computer Vision, Volume 59, Number 2, September 2004 C++ implementation http://people.cs.uchicago.edu/~pff/segment superpixel

Segmentation in computer vision Object Recognition as Machine Translation, Duygulu, Barnard, de Freitas, Forsyth, ECCV02

Integrating top-down and bottom-up segmentation Z.W. Tu, X.R. Chen, A.L. Yuille, and S.C. Zhu. Image parsing: unifying segmentation, detection and recognition. IJCV 63(2), 113-140, 2005.

Joint Optimisation for Object Class Segmentation and Dense Stereo Reconstruction Ladický et al 2010

EECS 442 Computer vision Object Recognition