Top Banner
CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance
46
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: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

CS4670: Computer VisionKavita Bala

Lecture 8: Scale invariance

Page 2: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Announcements

• HW 1 out yesterday – Due in 2 weeks on Tue 2/24– Work alone

• PA 1 demos tomorrow

Page 3: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Quick eigenvalue/eigenvector review

• The solution:

Once you know , you find the eigenvectors by solving

Symmetric, square matrix: eigenvectors are mutually orthogonal

Page 4: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

The surface E(u,v) is locally approximated by a quadratic form. Let’s try to understand its shape.

Interpreting the second moment matrix

v

uMvuvuE ][),(

Page 5: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Invariance and covariance • We want corner locations to be invariant to photometric transformations

and covariant to geometric transformations– Invariance: image is transformed and corner locations do not change– Covariance: if we have two transformed versions of the same image,

features should be detected in corresponding locations

Page 6: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Image transformations• Geometric

Rotation

Scale

• Photometric Intensity change

Page 7: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Scaling

All points will be classified as edges

Corner

Corner location is not covariant to scaling!

Page 8: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Scale invariant detectionSuppose you’re looking for corners

Q: How to find circle of right size?

Page 9: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.
Page 10: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Scale invariant detectionSuppose you’re looking for corners

Q: How to find circle of right size? Key idea: find scale that gives local maximum of f

– in both position and scale– One definition of f: the Harris operator

Page 11: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Solution

• Design a function on the region (circle) which is “scale invariant” – i.e., the same for corresponding regions, even if at

different scales– E.g., average intensity. Same even for different

sizes

• For a point in one image, consider it as a function of region size (circle radius)

Page 12: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.
Page 13: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.
Page 14: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Automatic Scale Selection

K. Grauman, B. Leibe

)),(( )),((11

xIfxIfmm iiii

How to find corresponding patch sizes?

Page 15: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Automatic Scale Selection• Function responses for increasing scale (scale signature)

K. Grauman, B. Leibe)),((

1xIf

mii )),((1

xIfmii

Page 16: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Automatic Scale Selection

K. Grauman, B. Leibe)),((

1xIf

mii )),((1

xIfmii

Page 17: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Automatic Scale Selection

K. Grauman, B. Leibe)),((

1xIf

mii )),((1

xIfmii

Page 18: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Automatic Scale Selection

K. Grauman, B. Leibe)),((

1xIf

mii )),((1

xIfmii

Page 19: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Automatic Scale Selection

K. Grauman, B. Leibe)),((

1xIf

mii )),((1

xIfmii

Page 20: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Automatic Scale Selection

K. Grauman, B. Leibe)),((

1xIf

mii )),((1

xIfmii

Page 21: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Implementation

• Instead of computing f for larger and larger windows, we can implement using a fixed window size with a Gaussian pyramid

(sometimes need to create in-between levels, e.g. a ¾-size image)

Page 22: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Questions?

Page 23: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Another type of feature

• The Laplacian of Gaussian (LoG)

2

2

2

22

y

g

x

gg

(very similar to a Difference of Gaussians (DoG) – i.e. a Gaussian minus a slightly smaller Gaussian)

Page 24: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.
Page 25: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Laplacian of Gaussian

• “Blob” detector

• Find maxima and minima of LoG operator in space and scale

* =

maximum

minima

Page 26: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Scale selection

• At what scale does the Laplacian achieve a maximum response for a binary circle of radius r?

r

image Laplacian

Page 27: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Characteristic scale

• We define the characteristic scale as the scale that produces peak of Laplacian response

characteristic scale

T. Lindeberg (1998). "Feature detection with automatic scale selection." International Journal of Computer Vision 30 (2): pp 77--116.

Page 28: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Difference-of-Gaussian (DoG)

K. Grauman, B. Leibe

- =

Page 29: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

DoG – Efficient Computation• Computation in Gaussian scale pyramid

K. Grauman, B. Leibe

s

Original image

4

1

2

Sampling withstep s4 =2

s

s

s

Page 30: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Find local maxima in position-scale space of Difference-of-Gaussian

K. Grauman, B. Leibe

)()( yyxx LL

s

s2

s3

s4

s5

List of (x, y, s)

Page 31: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Results: Difference-of-Gaussian

K. Grauman, B. Leibe

Page 32: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Scale-space blob detector: Example

Page 33: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Scale-space blob detector: Example

Page 34: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Scale-space blob detector: Example

Page 35: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.
Page 36: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Comparison of Keypoint Detectors

Tuytelaars Mikolajczyk 2008

Page 37: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.
Page 38: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Questions?

Page 39: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Feature descriptorsWe know how to detect good pointsNext question: How to match them?

Answer: Come up with a descriptor for each point, find similar descriptors between the two images

?

Page 40: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Feature descriptorsWe know how to detect good pointsNext question: How to match them?

Lots of possibilities (this is a popular research area)– Simple option: match square windows around the point– State of the art approach: SIFT

• David Lowe, UBC http://www.cs.ubc.ca/~lowe/keypoints/

?

Page 41: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Invariance vs. discriminability

• Invariance:– Descriptor shouldn’t change even if image is

transformed

• Discriminability:– Descriptor should be highly unique for each point

Page 42: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Invariance

• Most feature descriptors are designed to be invariant to – Translation, 2D rotation, scale

• They can usually also handle– Limited 3D rotations (SIFT works up to about 60 degrees)– Limited affine transformations (some are fully affine invariant)– Limited illumination/contrast changes

Page 43: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

How to achieve invariance

Need both of the following:1. Make sure your detector is invariant2. Design an invariant feature descriptor

– Simplest descriptor: a single 0• What’s this invariant to?

– Next simplest descriptor: a square window of pixels • What’s this invariant to?

– Let’s look at some better approaches…

Page 44: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

• Find dominant orientation of the image patch– This is given by xmax, the eigenvector of M corresponding to max (the

larger eigenvalue)– Rotate the patch according to this angle

Rotation invariance for feature descriptors

Figure by Matthew Brown

Page 45: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Take 40x40 square window around detected feature– Scale to 1/5 size (using

prefiltering)– Rotate to horizontal– Sample 8x8 square window

centered at feature– Intensity normalize the

window by subtracting the mean, dividing by the standard deviation in the window CSE 576: Computer Vision

Multiscale Oriented PatcheS descriptor

8 pixels40 pixels

Adapted from slide by Matthew Brown

Page 46: CS4670: Computer Vision Kavita Bala Lecture 8: Scale invariance.

Detections at multiple scales