Local Feature Descriptors SIFT Various slides from previous courses - - PowerPoint PPT Presentation

local feature descriptors sift
SMART_READER_LITE
LIVE PREVIEW

Local Feature Descriptors SIFT Various slides from previous courses - - PowerPoint PPT Presentation

CS4501: Introduction to Computer Vision Local Feature Descriptors SIFT Various slides from previous courses by: D.A. Forsyth (Berkeley / UIUC), I. Kokkinos (Ecole Centrale / UCL). S. Lazebnik (UNC / UIUC), S. Seitz (MSR / Facebook), J. Hays


slide-1
SLIDE 1

CS4501: Introduction to Computer Vision

Local Feature Descriptors SIFT

Various slides from previous courses by: D.A. Forsyth (Berkeley / UIUC), I. Kokkinos (Ecole Centrale / UCL). S. Lazebnik (UNC / UIUC), S. Seitz (MSR / Facebook), J. Hays (Brown / Georgia Tech), A. Berg (Stony Brook / UNC), D. Samaras (Stony Brook) . J. M. Frahm (UNC), V. Ordonez (UVA).

slide-2
SLIDE 2
  • Corner Detection - Harris
  • Interest Points
  • Blob Detection

Last Class

slide-3
SLIDE 3
  • Interest Points (DoG extrema operator)
  • SIFT Feature descriptor
  • Feature matching

Today’s Class

slide-4
SLIDE 4

Corner Detection: Basic Idea

  • We should easily recognize the point by looking through a small window
  • Shifting a window in any direction should give a large change in intensity

“edge”: no change along the edge direction “corner”: significant change in all directions “flat” region: no change in all directions

Source: A. Efros

slide-5
SLIDE 5

Harris Corner Detection

  • Compute the following matrix of squared gradients for every pixel.

! = # $%

&

$%$' $'$% $'

& ()*+,

$% $' and are gradients computed using Sobel or some other approximation. ! = 0 ! = 0 . ! = / ! = / .

slide-6
SLIDE 6

Source: R. Collins

!" !# !

!"!# ?

slide-7
SLIDE 7

Harris Corner Detection

! = 0 ! = 0 $ ! = % ! = % $

  • If both a, and b are large then this is a corner, otherwise it is not. Set

a threshold and this should detect corners.

Problem: Doesn’t work for these corners:

slide-8
SLIDE 8

Harris Corner Detection

! = # $%

&

$%$' $'$% $'

&

= ( ) ) *

+,-./

! = 01

23 43

4& 01 Under a rotation M can be diagonalized 43 and 4& are the eigenvalues of M det ! − 4$ = 0 From your linear algebra class finding them requires solving

slide-9
SLIDE 9

However no need to solve det(M-lambda I)=0

1 2 1 2

det trace M M l l l l = = +

slide-10
SLIDE 10

Corner response function

“Corner” R > 0 “Edge” R < 0 “Edge” R < 0 “Flat” region |R| small

2 2 1 2 1 2

) ( ) ( trace ) det( l l a l l a +

  • =
  • =

M M R

α: constant (0.04 to 0.06)

slide-11
SLIDE 11

Harris Detector Summary [Harris88]

  • Second moment matrix

ú ú û ù ê ê ë é * = ) ( ) ( ) ( ) ( ) ( ) , (

2 2 D y D y x D y x D x I D I

I I I I I I g s s s s s s s µ

11

  • 1. Image

derivatives

  • 2. Square of

derivatives

  • 3. Gaussian

filter g(sI)

Ix Iy Ix

2

Iy

2

IxIy g(Ix2) g(Iy2) g(IxIy)

2 2 2 2 2 2

)] ( ) ( [ )] ( [ ) ( ) (

y x y x y x

I g I g I I g I g I g +

  • a

=

  • =

] )) , ( [trace( )] , ( det[

2 D I D I

har s s µ a s s µ

  • 4. Cornerness function – both eigenvalues are strong

har

  • 5. Non-maxima suppression

1 2 1 2

det trace M M l l l l = = +

(optionally, blur first)

slide-12
SLIDE 12

Alternative Corner response function

“flat” region l1 and l2 are small; “edge”: l1 >> l2 l2 >> l1 “corner”: l1 and l2 are large, l1 ~ l2;

1 2 1 2

det trace M M l l l l = = +

Szeliski Harmonic mean

slide-13
SLIDE 13

Harris Detector: Steps

slide-14
SLIDE 14

Harris Detector: Steps

Compute corner response R

slide-15
SLIDE 15

Harris Detector: Steps

Find points with large corner response: R>threshold

slide-16
SLIDE 16

Harris Detector: Steps

Take only the points of local maxima of R

slide-17
SLIDE 17

Harris Detector: Steps

slide-18
SLIDE 18

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

Slide by James Hays

slide-19
SLIDE 19

Keypoint detection with scale selection

  • We want to extract keypoints with characteristic

scale that is covariant with the image transformation

Slide by Svetlana Lazebnik

slide-20
SLIDE 20

Basic idea

  • Convolve the image with a “blob filter” at multiple

scales and look for extrema of filter response in the resulting scale space

  • T. Lindeberg. Feature detection with automatic scale selection.

IJCV 30(2), pp 77-116, 1998.

Slide by Svetlana Lazebnik

slide-21
SLIDE 21

Blob detection

  • Find maxima and minima of blob filter response in

space and scale

*

=

maxima minima

Source: N. Snavely

slide-22
SLIDE 22

Blob filter

  • Laplacian of Gaussian: Circularly symmetric operator for blob

detection in 2D

2 2 2 2 2

y g x g g ¶ ¶ + ¶ ¶ = Ñ

slide-23
SLIDE 23

Scale-space blob detector

  • 1. Convolve image with scale-normalized Laplacian at several scales
slide-24
SLIDE 24

Scale-space blob detector: Example

Slide by Svetlana Lazebnik

slide-25
SLIDE 25

Scale-space blob detector: Example

Slide by Svetlana Lazebnik

slide-26
SLIDE 26

Scale-space blob detector

  • 1. Convolve image with scale-normalized Laplacian at several scales
  • 2. Find maxima of squared Laplacian response in scale-space

Slide by Svetlana Lazebnik

slide-27
SLIDE 27

Scale-space blob detector: Example

Slide by Svetlana Lazebnik

slide-28
SLIDE 28

Eliminating edge responses

  • Laplacian has strong response along edge

Slide by Svetlana Lazebnik

slide-29
SLIDE 29
  • Approximating the Laplacian with a difference of Gaussians:

( )

2

( , , ) ( , , )

xx yy

L G x y G x y s s s = +

( , , ) ( , , ) DoG G x y k G x y s s =

  • (Laplacian)

(Difference of Gaussians)

Efficient implementation

Slide by Svetlana Lazebnik

slide-30
SLIDE 30

Efficient implementation

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

slide-31
SLIDE 31

Eliminating rotation ambiguity

  • To assign a unique orientation to circular image

windows:

  • Create histogram of local gradient directions in the

patch

  • Assign canonical orientation at peak of smoothed

histogram

2 p Slide by Svetlana Lazebnik

slide-32
SLIDE 32

SIFT keypoint detection

  • D. Lowe, Distinctive image features from scale-invariant keypoints, IJCV 60 (2),
  • pp. 91-110, 2004.
slide-33
SLIDE 33

From keypoint detection to keypoint representation (feature descriptors)

Figure by Svetlana Lazebnik

slide-34
SLIDE 34

SIFT descriptors

  • Inspiration: complex neurons in the primary visual cortex
  • D. Lowe. Distinctive image features from scale-invariant keypoints. IJCV 60 (2),
  • pp. 91-110, 2004.
slide-35
SLIDE 35

From keypoint detection to keypoint representation (feature descriptors)

Figure by Svetlana Lazebnik

Compare SIFT feature vectors instead

slide-36
SLIDE 36

SIFT Feature Matching

Rice Hall at UVA

slide-37
SLIDE 37

JiaWang Bian, Wen-Yan Lin, Yasuyuki Matsushita, Sai-Kit Yeung, Tan Dat Nguyen, Ming-Ming Cheng GMS: Grid-based Motion Statistics for Fast, Ultra-robust Feature Correspondence IEEE CVPR, 2017 The method has been integrated into OpenCV library (see xfeatures2d in opencv_contrib).

slide-38
SLIDE 38

A hard keypoint matching problem

NASA Mars Rover images

slide-39
SLIDE 39

NASA Mars Rover images with SIFT feature matches Figure by Noah Snavely

Answer below (look for tiny colored squares…)

slide-40
SLIDE 40

Feature Descriptors Zoo

  • SIFT (under a patent) Proposed around 1999
  • SURF (under a patent too – I think)
  • BRIEF
  • ORB (seems free as it is OpenCV’s preferred)
  • BRISK
  • FREAK
  • FAST
  • KAZE
  • LIFT (Most recently proposed at ECCV 2016)
slide-41
SLIDE 41
slide-42
SLIDE 42

Questions?

42