73
FFTs in Graphics and Vision Spherical Harmonics and Legendre Polynomials 1

FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

FFTs in Graphics and Vision

Spherical Harmonics

and

Legendre Polynomials

1

Page 2: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Outline

Math StuffGram-Schmidt Orthogonalization

Height Functions

Completing Homogenous Polynomials

Review

Defining the Harmonics

2

Page 3: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Given an inner product space V, and given a

basis {v1,…,vn} we can define an orthonormal

basis {w1,…,wn} for V:

3

ijji ww ,

Page 4: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Given an inner product space V, and given a

basis {v1,…,vn} we can define an orthonormal

basis {w1,…,wn} for V:

Algorithm:

Start by making v1 a unit vector:

4

ijji ww ,

1

11

v

vw

Page 5: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Given an inner product space V, and given a

basis {v1,…,vn} we can define an orthonormal

basis {w1,…,wn} for V:

Algorithm:

To get the 2nd basis element, subtract off from v2

the w1 component and then normalize:

5

ijji ww ,

1122

1122

2,

,

wwvv

wwvvw

Page 6: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Given an inner product space V, and given a

basis {v1,…,vn} we can define an orthonormal

basis {w1,…,wn} for V:

Algorithm:

To get the i-th basis element, subtract off all the

earlier components from vi and then normalize:

6

ijji ww ,

1111

1111

,,

,,

wwvwwvv

wwvwwvvw

iiiii

iiiii

i

Page 7: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Consider the space of polynomial functions of

degree N on the interval [-1,1], with the standard

inner-product:

We would like to obtain an orthogonal basis:

7

1

1

)()()(),( dxxgxfxgxf

)(,),(0 xpxp N

Page 8: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Consider the space of polynomial functions of

degree N on the interval [-1,1], with the standard

inner-product:

We would like to obtain an orthogonal basis:

An easy basis to start with is the monomials:

8

1

1

)()()(),( dxxgxfxgxf

Nxxx ,,,,1 2

)(,),(0 xpxp N

Page 9: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Starting with the constant term, we get:

9

2

1

1

1

1)(

1

1

0

dx

xp

Page 10: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Starting with the constant term, we get:

10

2

1

1

1

1)(

1

1

0

dx

xp

Page 11: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Starting with the constant term, we get:

11

2

1

1

1

1)(

1

1

0

dx

xp

Page 12: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Moving on to the linear term, we get:

12

x

dxx

x

xpxpxx

dxxx

xpxpxx

xpxpxxxp

2

3

)()(,

2

1

2

1

)()(,

)()(,)(

1

1

2

00

1

1

00

00

1

Page 13: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Moving on to the linear term, we get:

13

x

dxx

x

xpxpxx

dxxx

xpxpxx

xpxpxxxp

2

3

)()(,

2

1

2

1

)()(,

)()(,)(

1

1

2

00

1

1

00

00

1

Page 14: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Moving on to the linear term, we get:

14

x

dxx

x

xpxpxx

dxxx

xpxpxx

xpxpxxxp

2

3

)()(,

2

1

2

1

)()(,

)()(,)(

1

1

2

00

1

1

00

00

1

Page 15: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

And the quadratic term:

15

)()(,)()(,

)()(,)()(,)(

00

2

11

22

00

2

11

22

2

xpxpxxpxpxx

xpxpxxpxpxxxp

Page 16: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

And the quadratic term:

16

These polynomials are called the

Legendre Polynomials.

)()(,)()(,

)()(,)()(,)(

00

2

11

22

00

2

11

22

2

xpxpxxpxpxx

xpxpxxpxpxxxp

Page 17: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Legendre Polynomials

Claim:

The degrees of the monomials comprising the

Legendre polynomials have the same parity as k:

...)( 2

2

k

k

k

kk xaxaxp

17

Page 18: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Legendre Polynomials

Claim:

The degrees of the monomials comprising the

Legendre polynomials have the same parity as k:

Proof by Induction:

...)( 2

2

k

k

k

kk xaxaxp

18

Page 19: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Legendre Polynomials

Claim:

The degrees of the monomials comprising the

Legendre polynomials have the same parity as k:

Proof by Induction (k=0):

2

1)(0 xp

...)( 2

2

k

k

k

kk xaxaxp

19

Page 20: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Legendre Polynomials

Claim:

The degrees of the monomials comprising the

Legendre polynomials have the same parity as k:

Proof by Induction (assume true for k=n):

...)( 2

2

k

k

k

kk xaxaxp

)()(,)()(,

)()(,)()(,)(

00

111

00

111

1

xpxpxxpxpxx

xpxpxxpxpxxxp

n

nn

nn

n

nn

nn

n

20

Page 21: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Legendre Polynomials

Claim:

The degrees of the monomials comprising the

Legendre polynomials have the same parity as k:

Proof by Induction (assume true for k=n):

Recall that:

1

1

11 )()(, dxxpxxpx m

n

m

n

)()(,)()(,

)()(,)()(,)(

00

111

00

111

1

xpxpxxpxpxx

xpxpxxpxpxxxp

n

nn

nn

n

nn

nn

n

...)( 2

2

k

k

k

kk xaxaxp

21

Page 22: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Legendre Polynomials

Claim:

The degrees of the monomials comprising the

Legendre polynomials have the same parity as k:

Proof by Induction:

Since mn we can assume that the monomials

comprising pm(x) are all even if m is even and all

odd if m is odd.

1

1

11 )()(, dxxpxxpx m

n

m

n

...)( 2

2

k

k

k

kk xaxaxp

22

Page 23: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Legendre Polynomials

Claim:

The degrees of the monomials comprising the

Legendre polynomials have the same parity as k:

Proof by Induction:

So if n and m are both either odd or both even,

the polynomial xn+1pm(x) is comprised of strictly

odd-powered monomials:

0)()(,

1

1

11

dxxpxxpx m

n

m

n

...)( 2

2

k

k

k

kk xaxaxp

23

Page 24: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Legendre Polynomials

Claim:

The degrees of the monomials comprising the

Legendre polynomials have the same parity as k:

Proof by Induction:

)()(,)()(,

)()(,)()(,)(

00

111

00

111

1

xpxpxxpxpxx

xpxpxxpxpxxxp

n

nn

nn

n

nn

nn

n

)()(,)()(,

)()(,)()(,)(

33

1

11

11

33

1

11

11

1

xpxpxxpxpxx

xpxpxxpxpxxxp

nn

n

nn

nn

nn

n

nn

nn

n

...)( 2

2

k

k

k

kk xaxaxp

24

Page 25: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Legendre Polynomials

Claim:

The degrees of the monomials comprising the

Legendre polynomials have the same parity as k:

Proof by Induction:

So pn+1(x) is obtained by starting with the

monomial xn+1 and subtracting off monomials with

the same parity.

)()(,)()(,

)()(,)()(,)(

33

1

11

11

33

1

11

11

1

xpxpxxpxpxx

xpxpxxpxpxxxp

nn

n

nn

nn

nn

n

nn

nn

n

...)( 2

2

k

k

k

kk xaxaxp

25

Page 26: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Consider the space of polynomials of degree N

on the interval [-1,1], with an inner-product giving

more weight to points near the origin:

26

1

1

2 )()(1)(),( dxxgxfxxgxfm

m

Page 27: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

Consider the space of polynomials of degree N

on the interval [-1,1], with an inner-product giving

more weight to points near the origin:

We would like to obtain an orthogonal basis:

27

1

1

2 )()(1)(),( dxxgxfxxgxfm

m

)(,),(0 xpxp m

N

m

Page 28: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

We proceed exactly as before but now using the

new inner-product.

28

1

1

2 )()(1)(),( dxxgxfxxgxfm

m

Page 29: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

We proceed exactly as before but now using the

new inner-product.

Since the weighting function is even, if f is an

even function and g is an odd function (or vice-

versa), the inner product must be zero:

29

0)(),( m

xgxf

1

1

2 )()(1)(),( dxxgxfxxgxfm

m

Page 30: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Gram–Schmidt Orthogonalization

Example:

We proceed exactly as before but now using the

new inner-product.

Since the weighting function is even, if f is an

even function and g is an odd function (or vice-

versa), the inner product must be zero:

Thus, as before, the degree of the monomials

comprising plm(x) must all have the same parity. 30

0)(),( m

xgxf

1

1

2 )()(1)(),( dxxgxfxxgxfm

m

Page 31: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Height Functions

Given a function f(x) on the interval [-1,1], we can

turn the function into a function on the sphere:

2

)(),,(

yfzyxF

31

Page 32: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Height Functions

Given a function f(x) on the interval [-1,1], we can

turn the function into a function on the sphere:

Given two such functions f(x) and g(y), the

mapping from 1D functions to spherical functions

preserves inner products:

2

)(),,(

yfzyxF

1

11

)()()()( dyygyfdppGpFp

32

Page 33: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Height Functions

To see this, we can parameterize points on the

sphere by spherical angle:

Then the integral on the left-hand side becomes:

sinsin,cos,sincos),(

0

0

2

0

0

2

01

)sin(coscos

)sin(coscos2

1

)sin(),(),()()(

dgf

ddgf

ddGFdppGpFp

33

Page 34: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Height Functions

To see this, we can parameterize points on the

sphere by spherical angle:

Then the integral on the left-hand side becomes:

sinsin,cos,sincos),(

0

0

2

0

0

2

01

)sin(coscos

)sin(coscos2

1

)sin(),(),()()(

dgf

ddgf

ddGFdppGpFp

34

Page 35: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Height Functions

To see this, we can parameterize points on the

sphere by spherical angle:

Then the integral on the left-hand side becomes:

sinsin,cos,sincos),(

0

0

2

0

0

2

01

)sin(coscos

)sin(coscos2

1

)sin(),(),()()(

dgf

ddgf

ddGFdppGpFp

35

Page 36: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Height Functions

On the other hand, setting y=cos, the left-hand

side can be expressed as:

0

0

01

1

)sin()(cos)(cos

)sin()(cos)(cos

)(cos)(cos)()(

dgf

dgf

dd

dygfdyygyf

36

Page 37: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Height Functions

On the other hand, setting y=cos, the left-hand

side can be expressed as:

0

0

01

1

)sin()(cos)(cos

)sin()(cos)(cos

)(cos)(cos)()(

dgf

dgf

dd

dygfdyygyf

37

Page 38: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Height Functions

On the other hand, setting y=cos, the left-hand

side can be expressed as:

0

0

01

1

)sin()(cos)(cos

)sin()(cos)(cos

)(cos)(cos)()(

dgf

dgf

dd

dygfdyygyf

38

Page 39: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Height Functions

On the other hand, setting y=cos, the left-hand

side can be expressed as:

dppGpF

dgf

dgf

dd

dygfdyygyf

p

)()(

)sin()(cos)(cos

)sin()(cos)(cos

)(cos)(cos)()(

1

0

0

01

1

39

Page 40: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Completing Homogenous Polynomials

Given a polynomial p(x,y,z) of degree d,

consisting of monomials of powers d,d-2,d,…:

2/

0 2

),,(d

k kdnml

nml

lmn zyxazyxp

40

Page 41: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Completing Homogenous Polynomials

Given a polynomial p(x,y,z) of degree d,

consisting of monomials of powers d,d-2,d,…:

This is not a homogenous polynomial.

2/

0 2

),,(d

k kdnml

nml

lmn zyxazyxp

41

Page 42: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Completing Homogenous Polynomials

Given a polynomial p(x,y,z) of degree d,

consisting of monomials of powers d,d-2,d,…:

This is not a homogenous polynomial.

However, if we restrict it to the sphere, we can

think of it as homogenous:

2/

0 2

),,(d

k kdnml

nml

lmn zyxazyxp

2/

0 2

222),,(d

k kdnml

nml

lmn

kzyxazyxzyxp

42

Page 43: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Completing Homogenous Polynomials

Example:

Is not a homogenous polynomial.

zyyxzyxp 2),,(

43

Page 44: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Completing Homogenous Polynomials

Example:

Is not a homogenous polynomial.

But on the unit-sphere, the polynomial:

has identical values and is homogenous of

degree 3.

zyyxzyxp 2),,(

2222),,( zyxzyyxzyxq

44

Page 45: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Outline

Math Stuff

ReviewSpherical Harmonics

Defining the Harmonics

45

Page 46: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Spherical Harmonics

For each non-negative integer l, there are 2l+1

spherical harmonics of degree l satisfying:

1. Each spherical harmonic of degree l can be

expressed as the restriction of a homogenous

polynomial of degree l to the unit-sphere.

2. The different spherical harmonics are

orthogonal to each other.

46

Page 47: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Spherical Harmonics

We had seen that by considering just the

rotations about the y-axis, we could factor the

spherical harmonics as:

where |m|l.

)(sincos

)(,

m

l

m

m

l

imm

l

Pi

PeY

47

Page 48: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Outline

Math Stuff

Review

Defining the Harmonics

48

Page 49: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

To define the spherical harmonics, we would like

to express the function:

as the restriction of a homogenous polynomial of

degree l to the unit sphere.

49

)(sincos, m

l

mm

l PiY

Page 50: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Using the parameterization of the unit-sphere

we get:

sinsin,cos,sincos),(

m

m

lm

m

m

lm

m

l

m

m

l

y

yPizx

Pizx

Pz

ix

Y

2

1

1

)(cos

sin

)(

)(sinsin

,

50

Page 51: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Using the parameterization of the unit-sphere

we get:

sinsin,cos,sincos),(

m

m

lm

m

m

lm

m

l

m

m

l

y

yPizx

Pizx

Pz

ix

Y

2

1

1

)(cos

sin

)(

)(sinsin

,

51

Page 52: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Using the parameterization of the unit-sphere

we get:

sinsin,cos,sincos),(

m

m

lm

m

m

lm

m

l

m

m

l

y

yPizx

Pizx

Pz

ix

Y

2

1

1

)(cos

sin

)(

)(sinsin

,

52

Page 53: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

This is a homogenous polynomial of degree m.

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

53

Page 54: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

This is a homogenous polynomial of degree m.

So we want:

1. This to complete to a homogenous

polynomial of degree l-m.

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

54

Page 55: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

This is a homogenous polynomial of degree m.

So we want:

1. This to complete to a homogenous

polynomial of degree l-m.

2. The different Ylm to be orthogonal.

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

55

Page 56: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Homogeneity:

To satisfy the homogeneity constraint, we need:

...

1

)(cos 2

22

1

ml

ml

ml

mlm

m

l yaya

y

yP

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

56

Page 57: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Homogeneity:

To satisfy the homogeneity constraint, we need:

Or equivalently:

for a polynomial:

...

1

)(cos 2

22

1

ml

ml

ml

mlm

m

l yaya

y

yP

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

mm

l

m

l yyqyP 21 1)(cos

...)( 2

2

ml

ml

ml

ml

m

l yayayq 57

Page 58: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Orthogonality:

To satisfy the orthogonality constraint, we need:

'or ' 0),(),,( '

' mmllYY m

l

m

l

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

58

Page 59: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Orthogonality (mm’):

Since we have separation of variables:

we know that:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

)(, m

l

imm

l PeY

2

0

)'(

0

'

'

0

2

0

'

'

''

'

sin)()(

sin)()(),(),,(

dedPP

ddPePeYY

mmim

l

m

l

m

l

imm

l

imm

l

m

l

59

Page 60: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Orthogonality (mm’):

Since we have separation of variables:

we know that:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

)(, m

l

imm

l PeY

2

0

)'(

0

'

'

0

2

0

'

'

''

'

sin)()(

sin)()(),(),,(

dedPP

ddPePeYY

mmim

l

m

l

m

l

imm

l

imm

l

m

l

60

Page 61: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Orthogonality (mm’):

But this is zero whenever mm’:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

2

0

)'(

0

'

'

'

' sin)()(),(),,( dedPPYY mmim

l

m

l

m

l

m

l

0)'(

12

0

)'(

2

0

)'(

mmimmi emmi

de

61

Page 62: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Orthogonality (m=m’ and ll’):

We have to choose the function:

so that:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

mm

l

m

l yyqyP 21 1)(cos

0sin)()(),(),,(0

'

'

'

2

0

'

ddPePeYY m

l

imm

l

imm

l

m

l

62

Page 63: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Orthogonality (m=m’ and ll’):

We have to choose the function:

so that:

Since m=m’, this reduces to:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

0sin)()(0

'

dPP m

l

m

l

0sin)()(),(),,(0

'

'

'

2

0

'

ddPePeYY m

l

imm

l

imm

l

m

l

mm

l

m

l yyqyP 21 1)(cos

63

Page 64: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Orthogonality (m=m’ and ll’):

We have to choose the function:

Using the change of variable formulation we get:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

1

1

2

'

1

1

1

'

1

0

'

1)()(

)(cos)(cossin)()(

dyyypyp

dyyPyPdPP

mm

l

m

l

m

l

m

l

m

l

m

l

mm

l

m

l yyqyP 21 1)(cos

64

Page 65: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Orthogonality (m=m’ and ll’):

We have to choose the function:

Using the change of variable formulation we get:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

1

1

2

'

1

1

1

'

1

0

'

1)()(

)(cos)(cossin)()(

dyyyqyq

dyyPyPdPP

mm

l

m

l

m

l

m

l

m

l

m

l

mm

l

m

l yyqyP 21 1)(cos

65

Page 66: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Thus, we require:

1. The polynomials qlm(y) to complete to

homogenous polynomials of degree l-m:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

mm

l

m

l yypyP 21 1)(cos

...)( 2

2

ml

ml

ml

ml

m

l yayayq

66

Page 67: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

Thus, we require:

1. The polynomials qlm(y) to complete to

homogenous polynomials of degree l-m:

2. And they satisfy the orthogonality condition:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

01)()(

1

1

2

'

dyyyqyqmm

l

m

l

mm

l

m

l yypyP 21 1)(cos

...)( 2

2

ml

ml

ml

ml

m

l yayayq

67

Page 68: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

This is precisely what we get when we compute

the G.S. orthogonalization of {1,y,y2,…} relative to

the inner-product:

and set:

m

m

lmm

l

y

yPizxY

2

1

1

)(cos,

)()( ypyq m

ml

m

l

mm

l

m

l yypyP 21 1)(cos

1

1

21)()()(),( dyyygyfygyfm

m

68

Page 69: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

In sum, we get an expression for the spherical

harmonics as:

)(, m

l

imm

l PeY

mm

ml

im

mm

ml

imm

l

pe

peY

sin)(cos

cos1)(cos, 2

mm

l

m

l yypyP 21 1)(cos

69

Page 70: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

Defining the Harmonics (m0)

In sum, we get an expression for the spherical

harmonics as:

where is a polynomial of degree l-m.

)(, m

l

imm

l PeY

mm

ml

im

mm

ml

imm

l

pe

peY

sin)(cos

cos1)(cos, 2

mm

l

m

l yypyP 21 1)(cos

)(ypm

ml

70

Page 71: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

The Spherical Harmonics

Examples (l=0):

4

1,0

0 Y

71

mm

ml

imm

l peY sin)(cos,

Page 72: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

The Spherical Harmonics

Examples (l=1):

i

i

eY

Y

eY

)sin(8

3,

)cos(4

3,

)sin(8

3,

1

1

0

1

1

1

72

mm

ml

imm

l peY sin)(cos,

Page 73: FFTs in Graphics and Visionmisha/Fall08/14.pdf · basis {v 1,…,v n} we can define an orthonormal basis {w 1,…,w n} for V: Algorithm: To get the i-th basis element, subtract off

The Spherical Harmonics

Examples (l=2):

i

i

i

i

eY

eY

Y

eY

eY

222

2

1

2

20

2

1

2

222

2

)(sin32

15,

)cos()sin(8

15,

1)(cos316

5,

)cos()sin(8

15,

)(sin32

15,

73

mm

ml

imm

l peY sin)(cos,