new introduction to computer vision - brown university · 2009. 10. 6. · cs143 intro to computer...

32
©Michael J. Black CS143 Intro to Computer Vision Introduction to Computer Vision Michael J. Black Oct. 2009 Lecture 10: Images as vectors. Appearance-based models.

Upload: others

Post on 16-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Introduction to Computer Vision

Michael J. Black

Oct. 2009

Lecture 10:

Images as vectors.

Appearance-based models.

Page 2: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

News

• Assignment 1 parts 3&4 – extension.

– Due tomorrow, Tuesday, 10/6 at 11am.

CS143 Intro to Computer Vision

Page 3: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Goals

• Images as vectors in a high dimensional space

• Wed/Fri: Covariance, eigenvalues, features, principal component analysis.

– Prep for next homework

Page 4: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Page 5: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Image Filtering

Source: T. Darrell

Smoothing and sharpening Edge detection Feature detection/search

Page 6: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Filters for features

• Previously, thinking of filtering as a

way to remove or reduce noise

• Now, consider how filters will

allow us to abstract higher-level

“features”.

– Map raw pixels to an intermediate

representation that will be used for

subsequent processing

– Goal: reduce amount of data, discard

redundancy, preserve what’s useful

Source: T. Darrell

Page 7: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Filters as “templates”

• Note that filters look like the effects they are intended to

find --- “matched filters”

• Use normalized cross-correlation score to find a given

pattern (template) in the image.

– Szeliski Eq. 8.11

• Normalization needed to control for relative brightnesses.

Source: T. Darrell

Page 8: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Normalized cross correlation

Page 9: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Template matching

Scene

Template (mask)

A toy example

Source: T. Darrell

Page 10: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Template matching

Template

Detected template

Source: T. Darrell

Page 11: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Template matching

Detected template Correlation map

Source: T. Darrell

Page 12: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Where’s Waldo?

Scene

Template

Source: T. Darrell

Page 13: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Where’s Waldo?

Template

Source: T. Darrell

Page 14: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black

Where’s Waldo?

Detected template Correlation map

Source: T. Darrell

Page 15: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Let’s step back a moment…

Convolution Correlation Feature detection

f I H

Page 16: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Image as vectors

Convolution Correlation Feature detection

f I H

Page 17: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Image as vectors

Convolution Correlation Feature detection

f I H

Page 18: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Images as Points (Feature detection)

Points in KxL dimensional space

Matching involves

deciding how far apart

they are in this space.

Page 19: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Template or filter as

a vector

Image patch as a

vector

Angle

between the

vectors

Template Matching

Page 20: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Template or filter as

a vector

Image patch as a

vector

Angle

between the

vectors

Template Matching Correlation

(sum of

product of

“signals”)

Normalized correlation:

Page 21: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

Consider the 2D case. Want to know

x

y

Note that

Also

Page 22: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

x

y

Page 23: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

x

y

Page 24: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

x

y

Page 25: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

Page 26: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

One more connection…

• Problem 4 in Asgn 1 uses corr2 which

computes the correlation coefficient, r,

defined as:

Where are the means of the patches.

Page 27: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

One more connection…

If are zero mean, then

This is just normalized correlation:

Page 28: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Search and Recognition.

1. How can we find the mouth?

2. How can we recognize the “expression”?

Page 29: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Naïve Appearance-Based Approach Database of mouth “templates”

• Search every image region (at every scale).

• Compare each template; chose the “best”

match (Euclidean, correlation, …)

Page 30: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Appearance-Based Methods

Represent objects by their appearance in an ensemble

of images, including different poses, illuminants,

configurations of shape, …

Approaches covered here:

Subspace (eigen) Methods

Local Invariant Image Features

Fleet & Szeliski

Page 31: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Images as Vectors

e.g. standard lexicographic ordering

Page 32: New Introduction to Computer Vision - Brown University · 2009. 10. 6. · CS143 Intro to Computer Vision ©Michael J. Black Appearance-Based Methods Represent objects by their appearance

©Michael J. Black CS143 Intro to Computer Vision

Images as Points

Points in nxm dimensional space

Matching involves

deciding how far apart

they are in this space.