geometric transformations - university of washington · 2019-10-17 · geometric transformations...

23
Geometric Transformations ECE P 596 Linda Shapiro

Upload: others

Post on 12-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Geometric Transformations

ECE P 596Linda Shapiro

Page 2: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

10/17/2019 2

Review: Canonical Frames

Page 3: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

10/17/2019 3

Matt Brown’s Multi-Scale Oriented Patches

Extract oriented patches at multiple scales

[ Brown, Szeliski, Winder CVPR 2005 ]

Page 4: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Ideas from Matt’s Multi-Scale Oriented Patches

• 1. Detect an interesting patch with an interest operator. Patches are translation invariant.

• 2. Determine its dominant orientation.

• 3. Rotate the patch so that the dominant orientation points upward. This makes the patches rotation invariant.

• 4. Do this at multiple scales, converting them all to one scale through sampling.

• 5. Convert to illumination “invariant” form

10/17/2019 4

Page 5: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

10/17/2019 5

Implementation Concern:How do you rotate a patch?

• Start with an “empty” patch whose dominant direction is “up”.

• For each pixel in your patch, compute the position in the detected image patch. It will be in floating point and will fall between the image pixels.

• Interpolate the values of the 4 closest pixels in the image, to get a value for the pixel in your patch.

Page 6: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

10/17/2019 6

Rotating a Patch

empty canonical patch

patch detected in the imagex’ = x cosθ – y sinθ

y’ = x sinθ + y cosθT

T

counterclockwise rotation

(x,y)

(x’,y’)

Page 7: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

10/17/2019 7

Using Bilinear Interpolation

• Use all 4 adjacent samples

x

y

I00 I10

I01 I11

We will soon see this again.

Page 8: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

What are geometric transformations?

Why do we need them?

Page 9: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Translation

Preserves: Orientation

Page 10: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Translation and rotation

Page 11: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Scale

Page 12: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Similarity transformations

Similarity transform (4 DoF) = translation + rotation + scale

Preserves: Angles

Page 13: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Aspect ratio

Page 14: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Shear

Page 15: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Affine transformations

Affine transform (6 DoF) = translation + rotation + scale + aspect ratio + shear

Preserves: Parallelism

Page 16: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

What is missing?

Are there any other planar transformations?

Canaletto

Page 17: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

General affine

We already used these

How do we compute projective transformations?

Page 18: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Homogeneous coordinates

One extra step:

Page 19: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Projective transformationsa.k.a. Homographies

“keystone” distortions

Preserves: Straight Lines

Page 20: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Finding the transformation

Translation = 2 degrees of freedomSimilarity = 4 degrees of freedomAffine = 6 degrees of freedomHomography = 8 degrees of freedom

How many corresponding points do we need to solve?

Page 21: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

Finding the transformation

- How can we find the transformation between these images?

- How many corresponding points do we need to solve?

Page 22: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

What can I use homographies for?

22

Page 23: Geometric Transformations - University of Washington · 2019-10-17 · Geometric Transformations ECE P 596 Linda Shapiro. 10/17/2019 2 Review: Canonical Frames. 10/17/2019 3 Matt

For one thing: Panoramas

23