lecture 7.1 feature descriptors - universitetet i oslo · • speeded up robust features (surf) –...

30
Lecture 4.1 Feature descriptors Trym Vegard Haavardsholm

Upload: others

Post on 24-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Lecture 4.1 Feature descriptors

Trym Vegard Haavardsholm

Page 2: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Feature descriptors

• Histogram of Gradients (HoG) descriptors

• Binary descriptors

2

Page 3: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Histogram of Gradients (HOG) descriptors

• Scale Invariant Feature Transform (SIFT) – David G. Lowe.

"Distinctive image features from scale-invariant keypoints.” IJCV 60 (2), pp. 91-110, 2004

• Speeded Up Robust Features (SURF)

– Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.” Computer Vision–ECCV 2006. Springer Berlin Heidelberg, 2006. 404-417

3

Page 4: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT detector

4

Page 5: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT detections

5

Page 6: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Patch at detected position, scale, orientation

6

Page 7: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Extract patch around detected keypoint

• Normalize the patch to canonical scale and orientation

7

Page 8: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Extract patch around detected keypoint

• Normalize the patch to canonical scale and orientation

• Resize patch to 16x16 pixels

8

Page 9: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Compute the gradients

9

Page 10: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Compute the gradients – Unaffected by additive intensity change

10

Page 11: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Compute the gradients – Unaffected by additive intensity change

• Apply a Gaussian weighting function

11

Page 12: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Compute the gradients – Unaffected by additive intensity change

• Apply a Gaussian weighting function

– Weighs down gradients far from the centre – Avoids sudden changes in the descriptor

with small changes in the window position

12

Page 13: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Compute the gradients – Unaffected by additive intensity change

• Apply a Gaussian weighting function

– Weighs down gradients far from the centre – Avoids sudden changes in the descriptor

with small changes in the window position

• Divide the patch into 16 4x4 pixels squares

13

Page 14: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Compute gradient direction histograms over 8 directions in each square

14

Page 15: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Compute gradient direction histograms over 8 directions in each square – Trilinear interpolation – Robust to small shifts, while preserving

some spatial information

15

Page 16: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

16

• Compute gradient direction histograms over 8 directions in each square – Trilinear interpolation – Robust to small shifts, while preserving

some spatial information

Page 17: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Concatenate the histograms to obtain a 128 dimensional feature vector

17

Page 18: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT descriptor

• Concatenate the histograms to obtain a 128 dimensional feature vector

• Normalize to unit length – Invariant to multiplicative contrast change

• Threshold gradient magnitudes to avoid

excessive influence of high gradients – Clamp gradients > 0.2 – Renormalize

18

Page 19: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Example: Feature comparison

19

Page 20: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Example: Feature comparison

20

Page 21: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Example: Feature comparison

21

Page 22: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT summary

• Extract a 16x16 patch around detected keypoint • Compute the gradients and apply a Gaussian weighting function • Divide the window into a 4x4 grid of cells • Compute gradient direction histograms over 8 directions in each cell • Concatenate the histograms to obtain a 128 dimensional feature vector • Normalize to unit length

22

Page 23: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

SIFT summary

23 http://www.vlfeat.org/

Page 24: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Binary descriptors

• Extremely efficient construction and comparison

• Based on pairwise intensity comparisons – Sampling pattern around keypoint – Set of sampling pairs – Feature descriptor vector is a binary string:

• Matching using Hamming distance:

24

0

1 2

2 ( )

1 if ( ) ( )( )

0 otherwise

aa

a N

r ra a

a

F T P

I P I PT P

≤ ≤

=

>=

1 2

0( , )a a

a NL XOR F F

≤ ≤

= ∑

BRISK sampling pattern

BRISK sampling pairs

Page 25: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Binary descriptors

Method Sampling pattern Orientation calculation

Sampling pairs

BRIEF None None Random

ORB None Moments Learned pairs

BRISK Concentric circles, More points on outer rings

Comparing gradients of long pairs

Short pairs

FREAK Overlapping concentric circles, more points on inner rings

Comparing gradients of preselected 45 pairs

Learned pairs

25

BRIEF sampling pairs

Credit: Gil Levi

Page 26: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Binary descriptors

26

ORB sampling pairs

Credit: Trzcinski, et al, “Learning Image Descriptors with Boosting”, 2015

Method Sampling pattern Orientation calculation

Sampling pairs

BRIEF None None Random

ORB None Moments Learned pairs

BRISK Concentric circles, More points on outer rings

Comparing gradients of long pairs

Short pairs

FREAK Overlapping concentric circles, more points on inner rings

Comparing gradients of preselected 45 pairs

Learned pairs

Page 27: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Binary descriptors

27

BRISK sampling pattern

BRISK sampling pairs

Method Sampling pattern Orientation calculation

Sampling pairs

BRIEF None None Random

ORB None Moments Learned pairs

BRISK Concentric circles, More points on outer rings

Comparing gradients of long pairs

Short pairs

FREAK Overlapping concentric circles, more points on inner rings

Comparing gradients of preselected 45 pairs

Learned pairs

Credit: Gil Levi

Page 28: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Binary descriptors

28

Method Sampling pattern Orientation calculation

Sampling pairs

BRIEF None None Random

ORB None Moments Learned pairs

BRISK Concentric circles, More points on outer rings

Comparing gradients of long pairs

Short pairs

FREAK Overlapping concentric circles, more points on inner rings

Comparing gradients of preselected 45 pairs

Learned pairs

FREAK sampling pattern

FREAK sampling pairs

Page 29: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Binary descriptors

• Often achieves very good performance compared to SIFT/SURF • Much faster than SIFT/SURF

29

A. Alahi, R. Ortiz, and P. Vandergheynst. FREAK: Fast Retina Keypoint. In IEEE Conference on Computer Vision and Pattern Recognition,

Page 30: Lecture 7.1 Feature Descriptors - Universitetet i oslo · • Speeded Up Robust Features (SURF) – Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. “Surf: Speeded up robust features.”

Binary descriptors

• Gil Levi’s CV blog: – https://gilscvblog.wordpress.com/

30