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.

Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black

News

• Assignment 1 parts 3&4 – extension.

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

CS143 Intro to Computer Vision

Page 3: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Page 5: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black

Image Filtering

Source: T. Darrell

Smoothing and sharpening Edge detection Feature detection/search

Page 6: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black

Normalized cross correlation

Page 9: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black

Template matching

Scene

Template (mask)

A toy example

Source: T. Darrell

Page 10: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black

Template matching

Template

Detected template

Source: T. Darrell

Page 11: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black

Template matching

Detected template Correlation map

Source: T. Darrell

Page 12: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black

Where’s Waldo?

Scene

Template

Source: T. Darrell

Page 13: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black

Where’s Waldo?

Template

Source: T. Darrell

Page 14: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black

Where’s Waldo?

Detected template Correlation map

Source: T. Darrell

Page 15: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Let’s step back a moment…

Convolution Correlation Feature detection

f I H

Page 16: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Image as vectors

Convolution Correlation Feature detection

f I H

Page 17: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Image as vectors

Convolution Correlation Feature detection

f I H

Page 18: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

Consider the 2D case. Want to know

x

y

Note that

Also

Page 22: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

x

y

Page 23: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

x

y

Page 24: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

x

y

Page 25: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Dot Product

Page 26: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

One more connection…

If are zero mean, then

This is just normalized correlation:

Page 28: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©Michael J. Black CS143 Intro to Computer Vision

Images as Vectors

e.g. standard lexicographic ordering

Page 32: Introduction to Computer Vision - Brown Universitycs.brown.edu/courses/cs143/2009/lecture10.pdf · CS143 Intro to Computer Vision ©Michael J. Black One more connection… • Problem

©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.