Top Banner
Segmentation
60

Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Jan 15, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Segmentation

Page 2: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Terminology

• Segmentation, grouping, perceptual organization: gathering features that belong together

• Fitting: associating a model with observed features

• Top-down segmentation: pixels belong together because they come from the same object

• Bottom-up segmentation: pixels belong together because they look similar

Page 3: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

The goals of segmentation

• Separate image into coherent “objects”

Berkeley segmentation database:http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/

image human segmentation

Page 4: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

The goals of segmentation

• Separate image into coherent “objects”• Top-down or bottom-up process?• Supervised or unsupervised?

• Group together similar-looking pixels for efficiency of further processing

X. Ren and J. Malik. Learning a classification model for segmentation. ICCV 2003.

“superpixels”

Page 5: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

The goals of segmentation

• Separate image into coherent “objects”• Top-down or bottom-up process?• Supervised or unsupervised?

• Group together similar-looking pixels for efficiency of further processing• Related to image compression• Measure of success is often application-dependent

Page 6: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Segmentation: Outline

• Inspiration from psychology• Segmentation as clustering

• K-means• Mean shift

• Segmentation as partitioning• Graph-based segmentation, normalized cuts

• Integrating top-down and bottom-up segmentation for recognition

Page 7: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

The Gestalt school

• Grouping is key to visual perception

The Muller-Lyer illusion

Page 8: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

The Gestalt school

• Grouping is key to visual perception• Elements in a collection can have properties

that result from relationships • “The whole is greater than the sum of its parts”

Page 9: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

The Gestalt school

• Grouping is key to visual perception• Elements in a collection can have properties

that result from relationships • “The whole is greater than the sum of its parts”

subjective contours occlusion

familiar configuration

http://en.wikipedia.org/wiki/Gestalt_psychology

Page 10: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Figure-ground discrimination

Page 11: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

The ultimate Gestalt?

Page 12: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Gestalt factors

• These factors make intuitive sense, but are very difficult to translate into algorithms

Page 13: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Gestalt factors

• They may be hard to put into algorithms, but understanding them can come in useful for interface design

Page 14: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Gestalt factors

• They may be hard to put into algorithms, but understanding them can come in useful for interface design

Page 15: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Segmentation as clustering

Source: K. Grauman

Page 16: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Segmentation as clustering

Source: K. Grauman

Page 17: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Different clustering strategies

• Agglomerative clustering• Start with each point in a separate cluster• At each iteration, merge two of the “closest” clusters

• Divisive clustering• Start with all points grouped into a single cluster• At each iteration, split the “largest” cluster

• K-means clustering• Iterate: assign points to clusters, compute means

• K-medoids• Same as k-means, only cluster center cannot be computed

by averaging• The “medoid” of each cluster is the most centrally located

point in that cluster (i.e., point with lowest average distance to the other points)

Page 18: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Image Intensity-based clusters Color-based clusters

K-Means clustering

• K-means clustering based on intensity or color is essentially vector quantization of the image attributes• Clusters don’t have to be spatially coherent

Page 19: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

K-Means clustering

• K-means clustering based on intensity or color is essentially vector quantization of the image attributes• Clusters don’t have to be spatially coherent

• Clustering based on (r,g,b,x,y) values enforces more spatial coherence

Page 20: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

K-Means pros and cons

• Pros• Simple and fast• Converges to a local minimum of the error function

• Cons• Need to pick K• Sensitive to initialization• Sensitive to outliers• Only finds “spherical”

clusters

Page 21: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

http://www.caip.rutgers.edu/~comanici/MSPAMI/msPamiResults.html

Mean shift segmentation

• An advanced and versatile technique for clustering-based segmentation

D. Comaniciu and P. Meer, Mean Shift: A Robust Approach toward Feature Space Analysis, PAMI 2002.

Page 22: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

• 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

Mean shift algorithm

Page 23: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Region ofinterest

Center ofmass

Mean Shiftvector

Mean shift

Slide by Y. Ukrainitz & B. Sarel

Page 24: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Region ofinterest

Center ofmass

Mean Shiftvector

Mean shift

Slide by Y. Ukrainitz & B. Sarel

Page 25: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Region ofinterest

Center ofmass

Mean Shiftvector

Mean shift

Slide by Y. Ukrainitz & B. Sarel

Page 26: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Region ofinterest

Center ofmass

Mean Shiftvector

Mean shift

Slide by Y. Ukrainitz & B. Sarel

Page 27: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Region ofinterest

Center ofmass

Mean Shiftvector

Mean shift

Slide by Y. Ukrainitz & B. Sarel

Page 28: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Region ofinterest

Center ofmass

Mean Shiftvector

Mean shift

Slide by Y. Ukrainitz & B. Sarel

Page 29: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Region ofinterest

Center ofmass

Mean shift

Slide by Y. Ukrainitz & B. Sarel

Page 30: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

• Cluster: all data points in the attraction basin of a mode

• Attraction basin: the region for which all trajectories lead to the same mode

Mean shift clustering

Slide by Y. Ukrainitz & B. Sarel

Page 31: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

• 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 clustering/segmentation

Page 32: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

http://www.caip.rutgers.edu/~comanici/MSPAMI/msPamiResults.html

Mean shift segmentation results

Page 33: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

More results

Page 34: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

More results

Page 35: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

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

Page 36: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

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

Page 37: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Images as graphs

• Node for every pixel• Edge between every pair of pixels (or every pair

of “sufficiently close” pixels)• Each edge is weighted by the affinity or

similarity of the two nodes

wij

i

j

Source: S. Seitz

Page 38: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Segmentation by graph partitioning

• Break Graph into Segments• Delete links that cross between segments• Easiest to break links that have low affinity

– similar pixels should be in the same segments

– dissimilar pixels should be in different segments

A B C

Source: S. Seitz

wij

i

j

Page 39: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Measuring Affinity

Intensity

Color

Distance

aff x, y exp 12 i

2

I x I y 2

aff x, y exp 12 d

2

x y

2

aff x, y exp 12 t

2

c x c y 2

Page 40: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Scale affects affinity

• Small σ: group only nearby points• Large σ: group far-away points

Page 41: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Graph cut

• Set of edges whose removal makes a graph disconnected

• Cost of a cut: sum of weights of cut edges• A graph cut gives us a segmentation

• What is a “good” graph cut and how do we find one?

A B

Source: S. Seitz

Page 42: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Graph cut

Page 43: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Graph cut

Page 44: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Affinity matrix Block detection

* Slides from Dan Klein, Sep Kamvar, Chris Manning, Natural Language Group Stanford University

Multi-way graph cut

Page 45: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

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

* Slide from Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Page 46: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

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 weightthan the ideal cut

* Slide from Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Page 47: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Normalized cut

• A minimum cut penalizes large segments• This can be fixed by normalizing the cut by

component size• The normalized cut cost is:

• The exact solution is NP-hard but an approximation can be computed by solving a generalized eigenvalue problem

assoc(A, V) = sum of weights of all edges in V that touch A

),(

),(

),(

),(

VBassoc

BAcut

VAassoc

BAcut

J. Shi and J. Malik. Normalized cuts and image segmentation. PAMI 2000

Page 48: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Example results

Page 49: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Example results

Page 50: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Using texture features for segmentation

• Texture descriptor is vector of filter bank outputs

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

Page 51: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Using texture features for segmentation

• Texture descriptor is vector of filter bank outputs

• Textons are found by clustering

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

Page 52: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Using texture features for segmentation

• Texture descriptor is vector of filter bank outputs

• Textons are found by clustering

• Affinities are given by similarities of texton histograms over windows given by the “local scale” of the texture

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

Page 53: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

The importance of scale

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

Page 54: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Example results

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

Page 55: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

• 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: Pro and con

Page 56: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

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.

Page 57: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Image parsing

• Define generative models for text and faces• Deformable spline-based templates for characters

• PCA model for faces

Page 58: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

• Top-down: propose a model for a given region• Bottom-up: verify the consistency of the model

with image features

Image parsing

Data-driven Markov Chain Monte Carlo

Page 59: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Example results

Page 60: Segmentation. Terminology Segmentation, grouping, perceptual organization: gathering features that belong together Fitting: associating a model with observed.

Example results