Top Banner
Region Segmentation
43

Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Dec 19, 2015

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: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Region Segmentation

Page 2: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Region Segmentation Find sets of pixels, such that

All pixels in region i satisfy some constraint of similarity.

nRRR ,,, 21 IR

ii

ji RRji ,

Page 3: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

K-Means Choose a fixed number of

clusters

Choose cluster centers and point-cluster allocations to minimize error

can’t do this by search, because there are too many possible allocations.

Algorithm fix cluster centers;

allocate points to closest cluster

fix allocation; compute best cluster centers

x could be any set of features for which we can compute a distance (careful about scaling)

x j i

2

jelements of i'th cluster

iclusters

Page 4: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

K-Means

Page 5: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Image Segmentation by K-Means Select a value of K 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.

Page 6: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

K-means clustering using intensity alone and color alone

Image Clusters on intensity Clusters on color

Page 7: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

K-means using color alone, 11 segments

Image Clusters on color

Page 8: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

K-means usingcolor alone,11 segments.

Page 9: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

K-means using colour andposition, 20 segments

Page 10: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

How to find K Use prior knowledge about image. Apply the algorithm for different values of

K and test for goodness of clusters. Analyze Image Histograms.

Page 11: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

How to find K

Page 12: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

How to find K

Page 13: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

How to Find KRealistic Histograms

Page 14: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

How to Find KSmooth Histogram. (Convolve by averagingor Gaussian Filter)

Page 15: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

How to Find KFind Peaks and Valleys and perform peakiness test.

Page 16: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Agglomerative clustering Assume that each cluster is single pixel (i.e.

every pixel is a cluster itself). Merge Clusters i.e. attach closest to cluster it

is closest to (if possible) Repeat step 2 until no more clusters can be

merged.

Page 17: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Divisive clustering Assume that whole image is a single cluster. Split Clusters along best boundary (if exists) Repeat step 2 until no more clusters can be

split.

Page 18: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Inter-Cluster distance single-link clustering: Minimum distance

between an element of the first cluster and one of the second..

complete-link clustering: Maximum distance between an element of the first cluster and one of the second.

group-average clustering: Average of distances between elements in the clusters.

Page 19: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Segmentation by Split and Merge Start with an initial segmentation (for example by K-

Means). Define a criteria P for goodness of region such that

P( R )=True, if R satisfies the criteria P( R )=False, otherwise

For each region R, split R in four regions (quadrants), if P( R ) = False

Merge any two adjacent regions R and Q if

Repeat until no more clusters can be split or merged.

TrueP RQ

Page 20: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Segmentation by Split and Merge

Page 21: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Graph Theoretical Techniques for Image Segmentation

Page 22: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Graph A graph G(V,E) is a triple consisting of a

vertex set V(G) an edge set E(G) and a relation that associates with each edge two vertices called its end points.

Page 23: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Path A path is a sequence of edges e1, e2, e3, …

en. Such that each (for each i>2 & i<n) edge ei is adjacent to e(i+1) and e(i-1). e1 is only adjacent to e2 and en is only adjacent to e(n-1)

Page 24: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Connected & Disconnected Graph

A graph G is connected if there is a path from every vertex to every other vertex in G.

A graph G that is not connected is called disconnected graph.

Page 25: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Graphs Representations

a

e

d

c

b

01101

10000

10000

00001

10010

Adjacency Matrix: W

Page 26: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Weighted Graphs and Their Representations

a

e

d

c

b

0172

106

76043

2401

310

Weight Matrix: W

6

Page 27: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Minimum CutA cut of a graph G is the set of edges S such that removal of S from G disconnects G.

Minimum cut is the cut of minimum weight, where weight of cut <A,B> is given as

ByAxyxwBAw

,,,

Page 28: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Minimum Cut and Clustering

Page 29: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Image Segmentation & Minimum Cut

ImagePixels

Pixel Neighborhood

w

SimilarityMeasure

MinimumCut

Page 30: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Minimum Cut There can be more than one minimum cut in a

given graph

All minimum cuts of a graph can be found in polynomial time1.

1H. Nagamochi, K. Nishimura and T. Ibaraki, “Computing all small cuts in an undirected network. SIAM J. Discrete Math. 10 (1997) 469-481.

Page 31: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Drawbacks of Minimum Cut Weight of cut is directly proportional to the

number of edges in the cut.

Ideal Cut

Cuts with lesser weightthan the ideal cut

Page 32: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Normalized Cuts1

Normalized cut is defined as

Ncut(A,B) is the measure of dissimilarity of sets A and B.

Minimizing Ncut(A,B) maximizes a measure of similarity within the sets A and B

VyBzVyAx

cut yzw

BAw

yxw

BAwBAN

,,,

,

,

,,

1J. Shi and J. Malik, “Normalized Cuts & Image Segmentation,” IEEE Trans. of PAMI, Aug 2000.

Page 33: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Finding Minimum Normalized-Cut Finding the Minimum Normalized-Cut is

NP-Hard. Polynomial Approximations are generally

used for segmentation

Page 34: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Finding Minimum Normalized-Cut

ImagePixels

Pixel Neighborhood

w

SimilarityMeasure

1

n

32

n-1

Page 35: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Finding Minimum Normalized-Cut

wherematrix, symmetric NNW

otherwise0

if,22

iNjeejiWXjiFji XXFF

Proximity Spatial

similarity feature Image

ji

ji

XX

FF

wherematrix, diagonal NND j

jiWiiD ,,

Page 36: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

It can be shown that

such that

If y is allowed to take real values then the minimization can be done by solving the generalized eigenvalue system

Finding Minimum Normalized-Cut

Dyy

yWDyT

T

y

minmin cutN

0 and ,10 ,,1 D1yTbbiy

DyyWD

Page 37: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Algorithm Compute matrices W & D Solve for eigen vectors with the

smallest eigen values Use the eigen vector with second smallest eigen

value to bipartition the graph Recursively partition the segmented parts if

necessary.

DyyWD

Page 38: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Figure from “Image and video segmentation: the normalised cut framework”, by Shi and Malik, 1998

Page 39: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

F igure from “Normalized cuts and image segmentation,” Shi and Malik, 2000

Page 40: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.
Page 41: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.
Page 42: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Drawbacks of Minimum Normalized Cut Huge Storage Requirement and time

complexity Bias towards partitioning into equal

segments Have problems with textured backgrounds

Page 43: Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.

Suggested Reading Chapter 14, David A. Forsyth and Jean Ponce, “Computer

Vision: A Modern Approach”. Jianbo Shi, Jitendra Malik, “Normalized Cuts and Image

Segmentation,” IEEE Transactions on Pattern Analysis and Machine Intelligence, 1997

Chapter 3, Mubarak Shah, “Fundamentals of Computer Vision”