Top Banner
CSE486, Penn State Robert Collins Lecture 31: Object Recognition: SIFT Keys
40

Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

Jul 21, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Lecture 31:

Object Recognition: SIFT Keys

Page 2: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Motivation

• Want to recognize a known objects from unknown viewpoints.

database of models

find them in an image

Page 3: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Local Feature based Approaches

• Represent appearance of object by little intensity/feature patches.

• Try to match patches from object to image

• Geometrically consistent matches tell you the location and pose of the object

Page 4: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Simple Example

• Represent object by set of 11x11 intensity templates extracted around Harris corners.

harris corners our object “model”

Page 5: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Simple Example

• Match patches to new image using NCC.

Page 6: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Simple Example

• Find matches consistent with affine transformation using RANSAC

Page 7: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Simple Example

• Inlier matches let you solve for location and pose of object in the image.

Page 8: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Problem with Simple Example

Using NCC to match intensity patches puts restrictions on the amount of overall rotation and scaling allowed between the model and the image appearance.

model template

matches well no match no match

nccncc

ncc

Page 9: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

More General : SIFT Keys

David G. Lowe, "Distinctive image features from scale-invariant keypoints," International Journal of Computer Vision, 60, 2 (2004), pp. 91-110.

Page 10: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

SIFT Keys: General Idea

• Reliably extract same image points regardless of new magnification and rotation of the image.

• Normalize image patches, extract feature vector• Match feature vectors using correlation

Page 11: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

SIFT Keys: General Idea

Want to detect/match same features regardless of

Translation : easy, almost every feature extraction and correlation matching algorithm in vision is translation invariant

Rotation : harder. Guess a canonical orientation for each patch from local gradients

Scaling : hardest of all. Create a multi-scale representation of the image and appeal to scale space theory to determine correct scale at each point.

Page 12: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Basic idea: different scales are appropriate for describing different objects in the image, and we may not know the correct scale/sizeahead of time.

Recall: Scale Space

Page 13: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Scale Selection

“Laplacian” operator.

Page 14: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Local Scale Space Maxima

Lindeberg proposes that the natural scale for describing a featureis the scale at which a normalized derivative for detecting thatfeature achieves a local maximum both spatially and in scale.

Sca

le

Example forblob detection

DnormL is theDoG operator, inthis case.

Page 15: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Recall: LoG Blob FindingLoG filter extrema locates “blobs”

maxima = dark blobs on light background minima = light blobs on dark background

Scale of blob (size ; radius in pixels) is determinedby the sigma parameter of the LoG filter.

LoG sigma = 2 LoG sigma = 10

Page 16: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Extrema in Space and Scale

Scale(sigma)

Space

DOG level L-1

DOG level L

DOG level L+1

Hint: when finding maxima or minima at level L,use DownSample or UpSample as necessary to makeDOG images at level L-1 and L+1 the same size as L.

Page 17: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

SIFT Keys: General Idea

Want to detect/match same features regardless of

Translation : easy, almost every feature extraction and correlation matching algorithm in vision is translation invariant

Rotation : harder. Guess a canonical orientation for each patch from local gradients

Scaling : hardest of all. Create a multi-scale representation of the image and appeal to scale space theory to determine correct scale at each point.

Page 18: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Sift Key Steps

Page 19: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Example

•Keypoint location = extrema location•Keypoint scale is scale of the DOG image

Page 20: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Example (continued)

gaussian image(at closest scale,from pyramid)

gradientmagnitude

gradientorientation

Page 21: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Example (continued)

gradientmagnitude

.* =

weighted by 2Dgaussian kernel

weighted gradientmagnitude

Page 22: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Example (continued)

gradientorientation

weighted gradientmagnitude weighted orientation histogram.

Each bucket contains sum of weighted gradient magnitudes corresponding to angles that fall within that bucket.

36 buckets10 degree range of angles in each bucket, i.e.

0 <=ang<10 : bucket 110<=ang<20 : bucket 220<=ang<30 : bucket 3 …

Page 23: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Example (continued)

gradientorientation

weighted gradientmagnitude

weighted orientation histogram.

80% of peak value

peak

20-30 degrees

Orientation of keypointis approximately 25 degrees

Page 24: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Example (continued)

There may be multiple orientations.

80% of peak value

peakSecond peak

In this case, generate duplicate keypoints, one with orientation at 25 degrees, one at 155 degrees.

Design decision: you may want to limit number of possible multiple peaks to two.

Page 25: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Example of KeyPoint Detection

Each keypoint has a center point (location),an orientation (rotation) and a radius (scale).

At this point, we could try to correlate patches(after first normalizing to a canonical orientationand scale).

Page 26: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

SIFT Vector

to make things more insensitive to changes in lighting or small changes in geometry, Lowe constructs feature vector from image gradients.

Page 27: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

SIFT Vector

Page 28: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Sift Key Matching

Page 29: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Model Verification

Page 30: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Application: Object Recognition

Compute SIFT keysof models and storein a database

Page 31: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Application: Object Recognition

database of models

find them in an image

Page 32: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Application: Object Recognition

For sets of 3 SIFT key matches, compute affinetransformation and perform model verification.

Page 33: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Application: Object Recognition

Note: since these are local, parts-based descriptors,they perform well even when some parts are missing(i.e. under occlusion).

Page 34: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Application: Landmark Recognition

Page 35: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Application: Generating PanoramasB

row

n an

d L

owe,

IC

CV

03

Page 36: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

Application: Generating Panoramas

Brown and Lowe, ICCV03

Page 37: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

State of the Art

Fully affine invariant local feature descriptors.

Page 38: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

State of the Art

Affine invariant descriptors can handle larger changesin viewpoint.

Page 39: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

State of the Art

Page 40: Lecture 31: Object Recognition: SIFT Keysrtc12/CSE486/lecture31.pdf · Application: Object Recognition For sets of 3 SIFT key matches, compute affine transformation and perform model

CSE486, Penn StateRobert Collins

For More Information

David G. Lowe, "Distinctive image features from scale-invariant keypoints," International Journal of Computer Vision, 60, 2 (2004), pp. 91-110.

SIFT keys

Affine local-feature methods