image segmentation - huji csecsip/csip2007-segmentation.pdf · hierarchical segmentation image...

30
Problem Statement Unsupervised Segmentation Spectral Segmentation Image Segmentation

Upload: others

Post on 22-Sep-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Problem StatementUnsupervised Segmentation

Spectral Segmentation

Image Segmentation

Page 2: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Image Segmentation

Partitioning of an image into coherent regionsGrouping image pixels into coherent regions

backgroundbackground

hairhair

shirtshirt

pantspants

skinskin

Page 3: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

“Correct” Segmentation

What is the “correct” partitioning/grouping?No single correct answerInterpretation depends on prior world knowledgeWorld knowledge is difficult to represent

?

Input Image

Alternative Segmentations

Page 4: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

“Correct” Segmentation

Page 5: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

“Correct” Segmentation

What is the “correct” partitioning/grouping?No single correct answerInterpretation depends on prior world knowledgeWorld knowledge is difficult to represent

Typical assumptions (low level vision):Brightness/color coherenceTexture coherenceMotion coherence

Page 6: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Hierarchical Segmentation

Image partitioning is inherently hierarchicalSegmentation should construct a tree structure, rather than a “flat” structureLow-level coherence is appropriate for lower hierarchy levelsMid- and high-level knowledge may be used higher in the hierarchy:

symmetriesobject models, etc.

Page 7: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Bottom-up vs. Top-down

Bottom-up: group similar pixels togetherTop-down: split regions

Page 8: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Normalized Cuts

Use graph partitioning to perform image segmentation.

Clearly defined criterion to optimizeEfficient algorithms for approximating the optimumFormulation lends itself naturally to hierarchical partitioning

Page 9: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Normalized Cuts

Represent an image as a weighted undirected graph, G = (V, E).Each image pixel is a vertex, v ∈ V.Nearby pixels are connected by edges.The weight of each edge w(i,j) is a function of the similarity between its endpoint pixels, i and j, for example:

Page 10: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Normalized Cuts

Goal: find an optimal partitioning of V into A and B, such that A ∪ B = V, A ∩ B = ∅

What is an optimal partitioning?Idea 1: find the partitioning that minimizes the (cost of the) cut:

Page 11: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Problem

Minimal cut partitioning favors cutting off small isolated groups of vertices:

Page 12: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Idea

Instead of looking at the total sum of edges across the cut, consider the fraction of all edge connections:

where

Page 13: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Idea

Another heuristic: maximize the fraction of the connections inside each group:

Surprise!

Kill two birds with one stone!

Page 14: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

And Now, The Bad News…

Minimizing the normalized cut is NP-complete (even when the graph is a regular grid).

However, we can solve the problem approximately!

Page 15: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Matrix Notation

Affinity matrix W:

A diagonal matrix D:

Indicator vector for A ∈ V:

Page 16: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Back to Normalized Cuts

Page 17: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Back to Normalized Cuts

After some rather ugly algebra, we get:

with the condition

Page 18: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Real-Valued Normalized Cuts

Allow y to take on real values (rather than requiring y ∈ {1,-b}, and solve the generalized eigenvalue problem:

The second condition on y (yTD1 =0) will be satisfied automatically!

Page 19: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Proof

Page 20: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Rayleigh Quotient

Let A be a real symmetric matrix. Under the constraint that x is orthogonal to the j-1 smallest eigenvectors x1,…,xj-1, the Rayleigh quotient

is minimized by the next smallest eigenvector xj, and its minimum value is the j-th eigenvalue λj.

Page 21: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Finally…

We have that:

And, consequently:

The second smallest generalized eigenvector is the solution for our real-valued normalized cut problem!

Page 22: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

N-cuts Segmentation

Given an image, set up the weighted graph G = (V,E).Solve (D – W)x = λDx for the smallest eigenvectors.Use the second smallest eigenvector to bi-partition the graph.Recurse on each of the resulting parts, if necessary.

Page 23: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Partitioning

The second smallest eigenvector has continuous values.Choose a splitting threshold to find a discrete vector

use the medianfind a splitting point that minimizes Ncut(A,B)

Page 24: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

Example

Page 25: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

The first partition

Page 26: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

The second partition

Page 27: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

The third partition

Page 28: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

The fourth partition

Page 29: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

The fifth partition

Page 30: Image Segmentation - HUJI CSEcsip/CSIP2007-segmentation.pdf · Hierarchical Segmentation Image partitioning is inherently hierarchical Segmentation should construct a tree structure,

The sixth partition