csse463: image recognition day 33 this week this week today: today: graph-theoretic approach to...

14
CSSE463: Image Recognition CSSE463: Image Recognition Day Day 33 33 This week This week Today Today : : Graph-theoretic Graph-theoretic approach to segmentation approach to segmentation Tuesday: Project workday Tuesday: Project workday Thursday: Test 2 Thursday: Test 2 Friday: status reports due Friday: status reports due Next week: Next week: Monday – Friday: presentations Monday – Friday: presentations Questions? Questions?

Upload: bennett-short

Post on 18-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

CSSE463: Image Recognition CSSE463: Image Recognition Day 33Day 33 This week This week

TodayToday: : Graph-theoreticGraph-theoretic approach to segmentation approach to segmentation

Tuesday: Project workdayTuesday: Project workday Thursday: Test 2Thursday: Test 2 Friday: status reports dueFriday: status reports due

Next week:Next week: Monday – Friday: presentationsMonday – Friday: presentations

Questions?Questions?

Page 2: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

SegmentationSegmentation

Goal: we want the pixels in each region to Goal: we want the pixels in each region to be similar to each other, but different than be similar to each other, but different than ones in other regions.ones in other regions.

Measures of Measures of affinityaffinity::Color, distance, edges, texture, etc.Color, distance, edges, texture, etc.

Page 3: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

Graph-theoretic segmentationGraph-theoretic segmentation

J Shi and J Malik, Normalized Cuts and Image J Shi and J Malik, Normalized Cuts and Image Segmentation, IEEE TPAMI, 22(8), Aug 2000.Segmentation, IEEE TPAMI, 22(8), Aug 2000. Posted in Angel > Papers in AngelPosted in Angel > Papers in Angel

Much of the next set of slides is from Forsyth & Much of the next set of slides is from Forsyth & Ponce, section 14.5.Ponce, section 14.5.

But first, what’s a graph? (on board)But first, what’s a graph? (on board) Undirected vs. directedUndirected vs. directed Weight matricesWeight matrices

Q2a-b

Page 4: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

What’s graph-based segmentation? What’s graph-based segmentation?

From images to graphs:From images to graphs: Each pixel is a vertexEach pixel is a vertex Each edge represents an affinity between pixelsEach edge represents an affinity between pixels

Color, texture, distance, edges, etc.Color, texture, distance, edges, etc.

Cut the graph into two subgraphs (regions) with Cut the graph into two subgraphs (regions) with high affinity within each subgraph and low high affinity within each subgraph and low affinity across subgraphsaffinity across subgraphs

RecurseRecurse How? How?

An exact solution is NP-complete.An exact solution is NP-complete.

Q1

Page 5: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

Split such that large weights (affinity) within cluster, low weights between

clusters

Page 6: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

Weight matrixWeight matrix

Brighter = Larger weights

Ordered such that each cluster (blocks) is on the diagonal.Cutting the graph gives two separate blocks

Page 7: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

Measuring AffinityMeasuring Affinity Recall: goal is for similar pixels to have higher affinityRecall: goal is for similar pixels to have higher 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

What if c(x) == c(y)?What if they are very different?

Page 8: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

Scale affects affinityScale affects affinity

Affinity by distance with d = 0.1, d=0.2, d=1

Page 9: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

How to segmentHow to segment

There are some techniques that ignore across-cluster There are some techniques that ignore across-cluster distance (and only use within-cluster affinity).distance (and only use within-cluster affinity). We’ll ignore theseWe’ll ignore these

Want to minimize Want to minimize the cut between the cut between clusters A and B: clusters A and B:

In this graph, cut(left, right) = ___In this graph, cut(left, right) = ___

This creates two segments like discussed above. This creates two segments like discussed above. However, it favors small regionsHowever, it favors small regions

BvAu

vuwBAcut ),(),(

Q2c

Page 10: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

The normalized cuts (The normalized cuts (ncutsncuts) approach minimizes affinities ) approach minimizes affinities between clusters and maximizes affinities within clustersbetween clusters and maximizes affinities within clusters

Weight the cut by the total Weight the cut by the total association with the whole association with the whole graph graph

Example. Example.

),(

),(

),(

),(),(

VBassoc

BAcut

VAassoc

BAcutBANcut

VvAu

vuwVAassoc ),(),(

Q2d-e

This summation double-counts the affinities within a cluster, which is OK.

Ncut(left, right) = 0.2 / [2(0.1 + 0.1 + 2(2+2+5+2))] + 0.2 / [2(0.1 + 0.1+ 2(1+2+3+4+7+1))]

Page 11: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

How do we find min Ncut()?

Let W be the matrix of weightsLet W be the matrix of weights Let d be the total affinity of pixel Let d be the total affinity of pixel

d with the rest of the image (row d with the rest of the image (row sums of W), and D be a matrix sums of W), and D be a matrix with the d(i) on the diagonalwith the d(i) on the diagonal

Let x be a vector whose Let x be a vector whose elements are 1 if item is in A, elements are 1 if item is in A, -1 if it’s in B, -1 if it’s in B,

Let y = f(x,d) defined in the Let y = f(x,d) defined in the paper.paper.

1 is the vector with all ones.1 is the vector with all ones.

Criterion becomesCriterion becomes

subject to the constraintsubject to the constraint

min y

yT D W yyTDy

yTD1 0

See p. 890, Shi and Malik for details

j

jiwiiD ),(),(

Page 12: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

Normalized cuts To do this, we can solve the generalized eigenvalue To do this, we can solve the generalized eigenvalue

problemproblem

which giveswhich gives

The authors showed that the solution, y, corresponding The authors showed that the solution, y, corresponding to the second smallest eigenvalue solves this problem to the second smallest eigenvalue solves this problem (the smallest is a trivial solution).(the smallest is a trivial solution).

When y is discrete, this is np-hard. When y is discrete, this is np-hard. Solution: assume y is continuous, solve, then threshold Solution: assume y is continuous, solve, then threshold

to give the clusters (approximation)to give the clusters (approximation)

Recursively split clusters until we pass a threshold on Recursively split clusters until we pass a threshold on the cut value.the cut value.

max y yT D W y subject to yTDy 1

D W y Dy

Page 13: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

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

Results with color + texture

Page 14: CSSE463: Image Recognition Day 33 This week This week Today: Today: Graph-theoretic approach to segmentation Graph-theoretic approach to segmentation Tuesday:

Figure from “Normalized cuts and image segmentation,” Shi and Malik, copyright IEEE, 2000

Results with motion

This uses distances too

Q3