Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH...

65
Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 200

Transcript of Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH...

Page 1: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Analysis and Retrieval

Statistical Shape Descriptors

Notes courtesy of Funk et al., SIGGRAPH 2004

Page 2: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Outline:• Shape Descriptors

• Statistical Shape Descriptors

• Singular Value Decomposition (SVD)

Page 3: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape MatchingGeneral approach:

Define a function that takes in two models and returns a measure of their proximity.

D , D ,M1 M1 M3M2

M1 is closer to M2 than it is to M3

Page 4: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape DescriptorsShape Descriptor:

A structured abstraction of a 3D model that is well suited to the challenges of shape matching

Descriptors

3D Models

D ,

D ,

Page 5: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Matching with DescriptorsPreprocessingCompute database descriptors

Run-Time

3D Query ShapeDescriptor

3D Database

BestMatches

Page 6: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Matching with DescriptorsPreprocessingCompute database descriptors

Run-TimeCompute query descriptor

3D Query ShapeDescriptor

3D Database

BestMatches

Page 7: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Matching with DescriptorsPreprocessingCompute database descriptors

Run-TimeCompute query descriptorCompare query descriptor to database descriptors

3D Query ShapeDescriptor

3D Database

BestMatches

Page 8: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Matching with DescriptorsPreprocessingCompute database descriptors

Run-TimeCompute query descriptorCompare query descriptor to database descriptorsReturn best Match(es)

3D Query ShapeDescriptor

3D Database

BestMatches

Page 9: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Matching ChallengeNeed shape descriptor that is:Concise to store

– Quick to compute

– Efficient to match

– Discriminating

3D Query ShapeDescriptor

3D Database

BestMatches

Page 10: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Matching ChallengeNeed shape descriptor that is:

– Concise to storeQuick to compute

– Efficient to match

– Discriminating

3D Query ShapeDescriptor

3D Database

BestMatches

Page 11: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Matching ChallengeNeed shape descriptor that is:

– Concise to store

– Quick to computeEfficient to match

– Discriminating

3D Query ShapeDescriptor

3D Database

BestMatches

Page 12: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Matching ChallengeNeed shape descriptor that is:

– Concise to store

– Quick to compute

– Efficient to matchDiscriminating

3D Query ShapeDescriptor

3D Database

BestMatches

Page 13: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Matching ChallengeNeed shape descriptor that is:

– Concise to store

– Quick to compute

– Efficient to match

– Discriminating Invariant to transformations

– Invariant to deformations

– Insensitive to noise

– Insensitive to topology

– Robust to degeneracies

Different Transformations(translation, scale, rotation, mirror)

Page 14: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Matching ChallengeNeed shape descriptor that is:

– Concise to store

– Quick to compute

– Efficient to match

– Discriminating

– Invariant to transformations Invariant to deformations

– Insensitive to noise

– Insensitive to topology

– Robust to degeneraciesDifferent Articulated Poses

Page 15: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Matching ChallengeNeed shape descriptor that is:

– Concise to store

– Quick to compute

– Efficient to match

– Discriminating

– Invariant to transformations

– Invariant to deformations Insensitive to noise

– Insensitive to topology

– Robust to degeneracies

Scanned Surface

Image courtesy ofRamamoorthi et al.

Page 16: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Matching ChallengeNeed shape descriptor that is:

– Concise to store

– Quick to compute

– Efficient to match

– Discriminating

– Invariant to transformations

– Invariant to deformations

– Insensitive to noise Insensitive to topology

– Robust to degeneraciesDifferent Tessellations

Different Genus

Images courtesy of Viewpoint & Stanford

Page 17: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Shape Matching ChallengeNeed shape descriptor that is:

– Concise to store

– Quick to compute

– Efficient to match

– Discriminating

– Invariant to transformations

– Invariant to deformations

– Insensitive to noise

– Insensitive to topologyRobust to degeneracies

No Bottom!

&*Q?@#A%!

Images courtesy of Utah & De Espona

Page 18: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Outline:• Shape Descriptors

• Statistical Shape Descriptors

• Singular Value Decomposition (SVD)

Page 19: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Statistical Shape Descriptors

Challenge:Want a simple shape descriptor that is easy to compare and gives a continuous measure of the similarity between two models.

Solution:Represent each model by a vector and define the distance between models as the distance between corresponding vectors.

Page 20: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Statistical Shape Descriptors

Properties:– Structured representation– Easy to compare– Generalizes the

matching problem

Models represented as points in a fixed dimensional vector space

Page 21: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Statistical Shape Descriptors

General Approaches:– Retrieval– Clustering– Compression– Hierarchical

representation

Models represented as points in a fixed dimensional vector space

Page 22: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Outline:• Shape Descriptors

• Statistical Shape Descriptors

• Singular Value Decomposition (SVD)

Page 23: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Complexity of Retrieval

Given a query:• Compute the distance to each database model• Sort the database models by proximity• Return the closest matches

~

Best Match(es)

3D Query

Database Models Sorted Models

D(Q,Mi

)Q

M1

M2

Mk

M1

M2

Mk

~

~

~

ji

MQDMQD ji

)~

,()~

,(

M1~

M2

Page 24: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Complexity of Retrieval

If there are k models in the database and each model is represented by an n-dimensional vector:

• Computing the distance to each database model:– O(k n) time

• Sort the database models by proximity:– O(k logk) time

If n is large, retrieval will be prohibitively slow.

Page 25: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Algebra

Definition: Given a vector space V and a subspace WV, the projection onto W, written W, is the map that sends vV to the nearest vector in W.

If {w1,…,wm} is an orthonormal basis for W, then:

i

m

iiW wwvv

1

,)(

Page 26: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Tensor Algebra

Definition: The inner product of two n-dimensional vectors v={v1,…,vn} and w={w1,…,wn}, written v,w, is the scalar value defined by:

wv

w

w

vvwvwv t

n

nn

i

ii

1

1

1

,

Page 27: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Tensor Algebra

Definition: The outer product of two n-dimensional vectors v={v1,…,vn} and w={w1,…,wn}, written vw, is the matrix defined by:

tn

n

vwww

v

v

wv

1

1

Page 28: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Tensor Algebra

Definition: The transpose of an mxn matrix M, written Mt, is the nxm matrix with:

Property: For any two vectors v and w, the transpose has the property:

ijjit MM ,,

wvMMwv t ,,

Page 29: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

SVD Compression

Key Idea:Given a collection of vectors in n-dimensional space, find a good m-dimensional subspace (m<<n) in which to represent the vectors.

Page 30: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

SVD Compression

Specifically:If P={p1,…,pk} is the initial n-dimensional point set, and {w1,…,wm} is an orthonormal basis for the m-dimensional subspace, we will compress the point set by sending:

mwpwpp ,,,, 1

Page 31: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

SVD Compression

Challenge:To find the m-dimensional subspace that will best capture the initial point information.

Page 32: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Variance of the Point Set

Given a collection of points P={p1,…,pk}, in an n-dimensional vector space, determine how the vectors are distributedacross different directions. pi

p1

p2

pk

Page 33: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Variance of the Point Set

Define the VarP as the function:

giving the variance of thepoint set P in direction v(assume |v|=1).

pi

p1

p2

pk

k

iiv

k

iiP pvpvVar

1

2

1

2,)(

Page 34: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Variance of the Point Set

More generally, for a subspace WV, define the variance of P in the subspace W as:

If {w1,…,wm} is an orthonormal basis for W, then:

n

iiWP pWVar

1

2)(

m

jjP

n

i

m

jjiP wVarwpWVar

11 1

2)(,)(

Page 35: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Variance of the Point Set

Example:

The variance in the direction v1

is large, while the variance inthe direction v2 is small.

If we want to compressdown to one dimension, weshould project the points onto v1

pi

p2

p1

vv11

vv22

pk

Page 36: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Covariance Matrix

Definition: The covariance matrix MP, of a point set P={p1,…,pk} is the symmetric matrix which is the sum of the outer products of the pi:

k

i

tiiP ppM

1

Page 37: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Covariance Matrix

Theorem: The variance of the point set P in a direction v is equal to:

vMvvpvVar pt

k

iiP

1

2,)(

Page 38: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Covariance Matrix

Theorem: The variance of the point set P in a direction v is equal to:

Proof:

vMvvpvVar pt

k

iiP

1

2,)(

k

iPi

k

i

k

i

tii

ttii

t

p

n

i

tii

tp

t

vVarpv

vppvvppv

vppvvMv

1

2

1 1

1

,

Page 39: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Theorem: Every symmetric matrix M can be written out as the product:

where O is a rotation/reflection matrix (OOt=Id) and D is a diagonal matrix with the property:

tODOM

n

n

D

21

1

with

0

0

Page 40: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Implication:Given a point set P, we can compute the covariance matrix of the point set, MP, and express the matrix in terms of its SVD factorization:

where {v1,…,vn} is an orthonormal basis and i is the variance of the point set in direction vi.

ntn

t

n

nP

v

v

vvM

21

11

1 with

0

0

Page 41: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Compression:

The vector subspace spanned by {v1,…,vm} is the vector sub-space that maximizes the variance in the initial point set P.

If m is too small, then too much information is discarded and there will be a loss in retrieval accuracy.

Page 42: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Hierarchical Matching:First coarsely compare the query to database vectors.• If {query is coarsely similar to target}

– Refine the comparison

• Else– Do not refine

O(k n) matching becomes O(k m) with m<<n and no loss of retrieval accuracy.

Page 43: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Hierarchical Matching:

SVD expresses the initial vectors in terms of the eigenbasis:

Because there is more variance in v1 than in v2, more variance in v2 than in v3, etc. this gives a hierarchical representation of the data so that coarse comparisons can be performed by comparing only the first m coefficients.

nn vvpvvpp ,, 11

Page 44: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

Preprocessing:• Compute SVD factorization• Transform database descriptors

Run-Time:

3. Transform Query

SVD

SVD

Query

Page 45: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

4. Low resolution sort

0.040 0.052 0.103 0.6610.430

Distance to Query

Query Database

Page 46: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

5. Update closest matches

6. ResortQuery

0.229 0.052 0.103 0.6610.430

Database

Distance to Query

Page 47: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

5. Update closest matches

6. ResortQuery

0.2290.141 0.103 0.6610.430

Database

Distance to Query

Page 48: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

5. Update closest matches

6. ResortQuery

0.2290.1410.189 0.6610.430

Database

Distance to Query

Page 49: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

5. Update closest matches

6. ResortQuery

0.2290.230 0.189 0.6610.430

Database

Distance to Query

Page 50: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

5. Update closest matches

6. ResortQuery

0.229 0.2300.200 0.6610.430

Database

Distance to Query

Page 51: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

5. Update closest matches

6. ResortQuery

0.229 0.230=0.289 0.6610.430

Database

Distance to Query

Page 52: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

5. Update closest matches

6. ResortQuery

0.334 0.230 =0.289 0.6610.430

Database

Distance to Query

Page 53: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

5. Update closest matches

6. ResortQuery

0.334=0.301 =0.289 0.6610.430

Database

Distance to Query

Page 54: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Efficient to match?

5. Update closest matches

6. ResortQuery

0.334=0.301=0.289 0.6610.430

Database

Distance to Query

Page 55: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Theorem: Every symmetric matrix M can be written out as the product:

where O is a rotation/reflection matrix (OOt=Id) and D is a diagonal matrix with the property:

tODOM

n

n

D

21

1

with

0

0

Page 56: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Proof:

1. Every symmetric matrix has at least one real eigenvector v.

2. If v is an eigenvector and w is perpendicular to v then Mw is also perpendicular to v. v

wvSince M maps the subspace of vectors perpendicular to v back into itself, we can look at the restriction of M to the subspace and iterate to get the next eigenvector.

Page 57: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Proof (Step 1):

Let F(v) be the function on the unit sphere (||v||=1) defined by:

vv

FF((vv))

MvvvF t)(

Page 58: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Proof (Step 1):

Let F(v) be the function on the unit sphere (||v||=1) defined by:

Then F must have a maximumat some point v0. vv00

FF((vv00))MvvvF t)(

Page 59: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Proof (Step 1):

Let F(v) be the function on the unit sphere (||v||=1) defined by:

Then F must have a maximumat some point v0.

Then F(v0)=v0.

MvvvF t)(

vv00

FF((vv00))

Page 60: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

If F has a maximum at some point v0 then F(v0)=v0.If w0 is on the sphere, next to v0, then w0-v0 is nearly perpendicular to v0. And for any small vector w1 perpendicular to v0, v0+ w1 is nearly on the sphere

vv00

ww00

vv00ww

00 -v-v00

ww00

Page 61: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

If F has a maximum at some point v0 then F(v0)=v0.For small values of w0 close to v0, we have:

For v0 to be a maximum, we must have:

for all w0 near v0.

Thus, F(v0) must be perpendicular to all vectors that are perpendicular to v0, and hence must itself be a multiple of v0.

00000 ),()()( vwvFvFwF

0),( 000 vwvF

Page 62: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Proof (Step 1):

Let F(v) be the function on the unit sphere (||v||=1) defined by:

Then F must have a maximumat some point v0.

Then F(v0)=v0.

MvvvF t)(

vv00

FF((vv00))

Page 63: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Proof (Step 1):

Let F(v) be the function on the unit sphere (||v||=1) defined by:

Then F must have a maximumat some point v0.

Then F(v0)=v0.

But F(v)=2Mv

MvvvF t)(

vv00

FF((vv00))

v0 is an eigenvector of M.

Page 64: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Proof:

1. Every symmetric matrix has at least one eigenvector v.

2. If v is an eigenvector and w is perpendicular to v then Mw is also perpendicular to v.

Page 65: Shape Analysis and Retrieval Statistical Shape Descriptors Notes courtesy of Funk et al., SIGGRAPH 2004.

Singular Value Decomposition

Proof (Step 2):

If w is perpendicular to v, then v,w=0.

Since M is symmetric:

so that Mw is also perpendicular to v.

0,,, wvwMvMwv