42
CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Embed Size (px)

DESCRIPTION

8-hour exposure © Atta Kim

Citation preview

Page 1: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

CS 691B Computational Photography

Instructor: Gianfranco DorettoData Driven Methods: Faces

Page 2: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

The Power of Averaging

Page 3: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

8-hour exposure

© Atta Kim

Page 4: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Fun with long exposures

Photos by Fredo Durand

Page 5: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

More fun with exposures

http://vimeo.com/14958082

Page 6: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Figure-centric averages

Antonio Torralba & Aude Oliva (2002)Averages: Hundreds of images containing a person are averaged to reveal regularities

in the intensity patterns across all the images.

Page 7: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

More by Jason Salavon

More at: http://www.salavon.com/

Page 8: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

“100 Special Moments” by Jason Salavon

Why blurry?

Page 9: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Computing Means

• Two Requirements:• Alignment of objects• Objects must span a subspace

• Useful concepts:• Subpopulation means• Deviations from the mean

Page 10: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Images as Vectors=

m

n

n*m

Page 11: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Vector Mean: Importance of Alignment

=

m

n

n*m

=

n*m

½ + ½ = mean image

Page 12: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

How to align faces?

http://www2.imm.dtu.dk/~aam/datasets/datasets.html

Page 13: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Shape Vector

=

43Provides alignment!

Page 14: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Average Face

1. Warp to mean shape2. Average pixels

http://graphics.cs.cmu.edu/courses/15-463/2004_fall/www/handins/brh/final/

Page 15: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Objects must span a subspace

(1,0)

(0,1)

(.5,.5)

Page 17: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Deviations from the mean

-

=

Image X Mean X

DX = X - X

Page 18: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Deviations from the mean

+=

+ 1.7=

XDX = X - X

Page 19: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Manipulating faces• How can we make a face look more

male/female, young/old, happy/sad, etc.?1. Obtain the two prototypes spanning the

desired axis (gender, age, expression, etc.) and find the difference vector between them

2. Add scaled versions of this vector to a given image

Prototype 1

Prototype 2

Current face

D. Rowland and D. Perrett, “Manipulating Facial Appearance through Shape and Color,” IEEE CG&A,

September 1995

Page 20: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Changing gender•Deform shape and/or color of an input face in the direction of “more female”

•Original shape

•Color both

D. Rowland and D. Perrett, “Manipulating Facial Appearance through Shape and Color,” IEEE CG&A,

September 1995

Page 21: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Enhancing gender

more same original androgynous opposite more opposite

D. Rowland and D. Perrett, “Manipulating Facial Appearance through Shape and Color,” IEEE CG&A,

September 1995

Page 22: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Changing age•Face becomes “rounder” and “more textured” and “grayer”

• original shape

• color both

D. Rowland and D. Perrett, “Manipulating Facial Appearance through Shape and Color,” IEEE CG&A,

September 1995

Page 23: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Which face is more attractive?

http://www.beautycheck.de

Page 24: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Which face is more attractive?leftright

Page 25: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Which face is more attractive?

attractive0.5(attractive + average)

Page 26: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Which face is more attractive?

http://www.beautycheck.de

Page 27: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Which face is more attractive?leftright

Page 28: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Which face is more attractive?

0.5(adult+child) adult

Page 29: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Which face is more attractive?

originalbeautified

Page 30: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Effect of skin texture

average shape + unattractive texture

average shape + average texture

Page 31: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Back to the Subspace

Page 32: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Linear Subspace: convex combinations

m

iii XaX

1

Any new image X can beobtained as weighted sum of stored “basis” images.

Our old friend, change of basis!What are the new coordinates of X?

Page 33: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

The Morphable Face Model

•The actual structure of a face is captured in the shape vector S = (x1, y1, x2, …, yn)T, containing the (x, y) coordinates of the n vertices of a face, and the appearance (texture) vector T = (R1, G1, B1, R2, …, Gn, Bn)T, containing the color values of the mean-warped face image.

Shape S

Appearance T

Page 34: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

The Morphable face model• Again, assuming that we have m such vector pairs in full

correspondence, we can form new shapes Smodel and new appearances Tmodel as:

• If number of basis faces m is large enough to span the face subspace then: Any new face can be represented as a pair of vectors (a1, a2, ... , am)T and (b1, b2, ... , bm)T !

m

iiimodel a

1

SS

m

iiimodel b

1

TT

Page 35: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Issues:1. How many basis images is enough?2. Which ones should they be?3. What if some variations are more important than

others?– E.g. corners of mouth carry much more information

than haircut

• Need a way to obtain basis images automatically, in order of importance!

• But what’s important?

Page 36: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Principal Component Analysis• Given a point set , in an M-dim

space, PCA finds a basis such that– coefficients of the point set in that basis are uncorrelated– first r < M basis vectors provide an approximate basis that

minimizes the mean-squared-error (MSE) in the approximation (over all bases with dimension r)

x1

x0

x1

x0

1st principal component

2nd principal component

Page 37: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

PCA via Singular Value Decomposition

[u,s,v] = svd(A);

http://graphics.cs.cmu.edu/courses/15-463/2004_fall/www/handins/brh/final/

Page 38: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Principal Component Analysis

Choosing subspace dimension r:• look at decay of the eigenvalues

as a function of r• Larger r means lower expected

error in the subspace data approximation

r M1

eigenvalues

Page 39: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

EigenFacesFirst popular use of PCA on images was for modeling and recognition of faces [Kirby and Sirovich, 1990, Turk and Pentland, 1991]

Collect a face ensemble Normalize for contrast, scale, &

orientation. Remove backgrounds Apply PCA & choose the first N

eigen-images that account for most of the variance of the data.

mean face

lighting variation

Page 40: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Using 3D Geometry: Blinz & Vetter, 1999

http://www.youtube.com/watch?v=nice6NYb_WA

Page 41: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Using 3D Geometry: Blinz & Vetter, 1999

http://www.youtube.com/watch?v=nice6NYb_WA

Page 42: CS 691B Computational Photography Instructor: Gianfranco Doretto Data Driven Methods: Faces

Slide Credits• This set of sides also contains

contributionskindly made available by the following authors– Alexei Efros