Lecture 2 Local Interest Point Detectors Lin ZHANG, PhD School of - - PowerPoint PPT Presentation

lecture 2 local interest point detectors
SMART_READER_LITE
LIVE PREVIEW

Lecture 2 Local Interest Point Detectors Lin ZHANG, PhD School of - - PowerPoint PPT Presentation

Lecture 2 Local Interest Point Detectors Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2020 Lin ZHANG, SSE, 2020 Content Local Invariant Features Motivation Requirements Invariance Harris


slide-1
SLIDE 1

Lin ZHANG, SSE, 2020

Lecture 2 Local Interest Point Detectors

Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2020

slide-2
SLIDE 2

Lin ZHANG, SSE, 2020

Content

  • Local Invariant Features
  • Motivation
  • Requirements
  • Invariance
  • Harris Corner Detector
  • Scale Invariant Point Detection
  • Automatic scale selection
  • Laplacian‐of‐Gaussian detector
  • Difference‐of‐Gaussian detector
slide-3
SLIDE 3

Lin ZHANG, SSE, 2020

Motivation

slide-4
SLIDE 4

Lin ZHANG, SSE, 2020

Motivation

Application: Image Matching

slide-5
SLIDE 5

Lin ZHANG, SSE, 2020

Motivation

Application: Image Matching

slide-6
SLIDE 6

Lin ZHANG, SSE, 2020

Motivation

Application: Image Matching

NASA Mars Rover Images

slide-7
SLIDE 7

Lin ZHANG, SSE, 2020

Motivation

Application: Image Matching

NASA Mars Rover images with SIFT matches (Look for tiny colored squares)

slide-8
SLIDE 8

Lin ZHANG, SSE, 2020

Motivation

  • Panorama stitching
  • We have two images – how do we combine them?
slide-9
SLIDE 9

Lin ZHANG, SSE, 2020

Motivation

  • Panorama stitching
  • We have two images – how do we combine them?
slide-10
SLIDE 10

Lin ZHANG, SSE, 2020

Motivation

  • Panorama stitching
  • We have two images – how do we combine them?
slide-11
SLIDE 11

Lin ZHANG, SSE, 2020

Motivation

  • Panorama stitching
  • We have two images – how do we combine them?
slide-12
SLIDE 12

Lin ZHANG, SSE, 2020

General Approach for Image Matching

Source: B. Leibe

slide-13
SLIDE 13

Lin ZHANG, SSE, 2020

Characteristics of Good Features

  • Repeatability
  • The same feature can be found in several images despite geometric and

photometric transformations

  • Saliency
  • Each feature has a distinctive description
  • Compactness and efficiency
  • Many fewer features than image pixels
  • Locality
  • A feature occupies a relatively small area of the image; robust to clutter and
  • cclusion
slide-14
SLIDE 14

Lin ZHANG, SSE, 2020

Invariance: Geometric Transformations

slide-15
SLIDE 15

Lin ZHANG, SSE, 2020

Level of Geometric Invariance

slide-16
SLIDE 16

Lin ZHANG, SSE, 2020

Invariance: Photometric Transformations

slide-17
SLIDE 17

Lin ZHANG, SSE, 2020

Applications

Feature points are used for:

  • Motion tracking
  • Image alignment
  • 3D reconstruction
  • Object recognition
  • Indexing and database retrieval
  • Robot navigation
slide-18
SLIDE 18

Lin ZHANG, SSE, 2020

Content

  • Local Invariant Features
  • Motivation
  • Requirements
  • Invariance
  • Harris Corner Detector
  • Scale Invariant Point Detection
  • Automatic scale selection
  • Laplacian‐of‐Gaussian detector
  • Difference‐of‐Gaussian detector
slide-19
SLIDE 19

Lin ZHANG, SSE, 2020

Finding Corners

My office, 5:30PM, Sep. 18, 2011

slide-20
SLIDE 20

Lin ZHANG, SSE, 2020

Finding Corners

  • Key property: in the region around a corner,

image gradient has two or more dominant directions

  • Corners are repeatable and distinctive
  • C. Harris and M. Stephens. “A Combined Corner and Edge Detector.“

Proceedings of the 4th Alvey Vision Conference: pages 147—151, 1988.

slide-21
SLIDE 21

Lin ZHANG, SSE, 2020

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

slide-22
SLIDE 22

Lin ZHANG, SSE, 2020

‐ Demo of a point + with well distinguished neighborhood. Moving the window in any direction will result in a large intensity change.

+

> 0

Harris Detector: Basic Idea

Difference = 3

slide-23
SLIDE 23

Lin ZHANG, SSE, 2020

  • +

> 0

Harris Detector: Basic Idea

Demo of a point + with well distinguished neighborhood. Moving the window in any direction will result in a large intensity change. Difference = 2

slide-24
SLIDE 24

Lin ZHANG, SSE, 2020

  • +

> 0

Harris Detector: Basic Idea

Demo of a point + with well distinguished neighborhood. Moving the window in any direction will result in a large intensity change. Difference = 5

slide-25
SLIDE 25

Lin ZHANG, SSE, 2020

  • +

> 0

Harris Detector: Basic Idea

Demo of a point + with well distinguished neighborhood. Moving the window in any direction will result in a large intensity change. Difference = 2

slide-26
SLIDE 26

Lin ZHANG, SSE, 2020

  • +

> 0

Harris Detector: Basic Idea

Demo of a point + with well distinguished neighborhood. Moving the window in any direction will result in a large intensity change. Difference = 3

slide-27
SLIDE 27

Lin ZHANG, SSE, 2020

  • +

> 0

Harris Detector: Basic Idea

Demo of a point + with well distinguished neighborhood. Moving the window in any direction will result in a large intensity change. Difference = 2

slide-28
SLIDE 28

Lin ZHANG, SSE, 2020

  • +

> 0

Harris Detector: Basic Idea

Demo of a point + with well distinguished neighborhood. Moving the window in any direction will result in a large intensity change. Difference = 3

slide-29
SLIDE 29

Lin ZHANG, SSE, 2020

  • +

> 0

Harris Detector: Basic Idea

Demo of a point + with well distinguished neighborhood. Moving the window in any direction will result in a large intensity change. Difference = 2

slide-30
SLIDE 30

Lin ZHANG, SSE, 2020

Harris Corner Detection: Mathematics

Change in appearance of a local patch (defined by a window w) centered at p for the shift :

Intensity Shifted intensity Window function

  • r

Window function w= Gaussian 1 in window, 0 outside

2 ( , )

( , ) ( ( , ) ( , ))

i i

w i i i i x y w

S x y f x y f x x y y

     

 

( , ) x y  

slide-31
SLIDE 31

Lin ZHANG, SSE, 2020

 

2 ( , ) 2 ( , ) 2 ( , )

( , ) ( ( , ) ( , )) ( , ) ( , ) ( , ) ( , ) , ( , ) ( , ) , ( , ) , (

i i i i i i

w i i i i x y w i i i i i i i i x y w i i i i x y w i i

S x y f x y f x x y y x f x y f x y f x y f x y y x y x f x y f x y y x y f x y x x y f x

  

                                                          

  

       

 

( , )

( , ) ( , ) , )

i i

i i i i i i x y w

x f x y f x y y y x y y x x y M y

                                                 

      (Due to )

2 T

 u u u

Harris Corner Detection: Mathematics

(1) (2)

slide-32
SLIDE 32

Lin ZHANG, SSE, 2020

2 ( , ) ( , ) 2 ( , ) ( , )

( , ) ( , ) ( , ) ( , ) ( , ) ( , )

i i i i i i i i

i i i i i i x y w x y w i i i i i i x y w x y w

M f x y f x y f x y x x y f x y f x y f x y x y y

   

                                                      

   

  • It is real symmetric

Harris Corner Detection

slide-33
SLIDE 33

Lin ZHANG, SSE, 2020

actually is the ellipse equation.

 

( , ) , x S x y x y M y              ( , ) 1 S x y   

2 ( , ) ( , ) 2 ( , ) ( , )

( ) ( ) ( ) ( )

i i i i i i i i

x x y x y w x y w x y y x y w x y w

I I I M I I I

   

            

   

The shape of the ellipse is determined by M.

Harris Corner Detection

slide-34
SLIDE 34

Lin ZHANG, SSE, 2020

The “cornerness” of the window w is reflected in M Suppose there are two local windows w1 and w2; consider the cases when the moving of the two windows leads to the intensity change equals to 1. The moving vector of each window satisfies the ellipse equation. Thus,

 

, x y  

Which window has higher cornerness?

Harris Corner Detection

 

2

, 1 x x y M y           

For w2,

x  y 

 

1

, 1 x x y M y           

For w1,

x  y 

slide-35
SLIDE 35

Lin ZHANG, SSE, 2020

R R M       

 2 1 1

 

The axis lengths of the ellipse are determined by the eigenvalues and the orientation is determined by R

direction of the slowest change direction of the fastest change

(max)-1/2 (min)-1/2 Diagonalization of M: Why?

Harris Corner Detection

slide-36
SLIDE 36

Lin ZHANG, SSE, 2020

Interpreting the eigenvalues

1 2 “Corner” 1 and 2 are large, 1 ~ 2; S increases in all

directions

1 and 2 are small; S is almost constant

in all directions

“Edge” 1 >> 2 “Edge” 2 >> 1 “Flat” region

Classification of image points using eigenvalues of M:

slide-37
SLIDE 37

Lin ZHANG, SSE, 2020

Corner response function

Measure of corner response:

(k – empirical constant, k = 0.04‐0.06)

 

2

trace det M M k R  

2 1 2 1

trace det        M M

slide-38
SLIDE 38

Lin ZHANG, SSE, 2020

Harris corner detector‐‐illustration

Ellipse with equation :

, 1 x x y M y           

slide-39
SLIDE 39

Lin ZHANG, SSE, 2020

 

, 1 x x y M y           

Harris corner detector‐‐illustration

Ellipse with equation :

slide-40
SLIDE 40

Lin ZHANG, SSE, 2020

Harris corner detector‐Algorithm

slide-41
SLIDE 41

Lin ZHANG, SSE, 2020

Harris Detector: Steps

slide-42
SLIDE 42

Lin ZHANG, SSE, 2020

Compute corner response R

Harris Detector: Steps

slide-43
SLIDE 43

Lin ZHANG, SSE, 2020

Harris Detector: Steps

Find points with large corner response: R>threshold

slide-44
SLIDE 44

Lin ZHANG, SSE, 2020

Take only the points of local maxima of R

Harris Detector: Steps

slide-45
SLIDE 45

Lin ZHANG, SSE, 2020

Models of Image Change

Photometric

  • Affine intensity change (I  a I + b)

Geometric

  • Rotation
  • Scale
  • Affine
slide-46
SLIDE 46

Lin ZHANG, SSE, 2020

Harris Detector: Some Properties

Rotation invariance

Ellipse rotates but its shape (i.e. eigenvalues) remains the same Corner response R is invariant to image rotation

slide-47
SLIDE 47

Lin ZHANG, SSE, 2020

Harris Detector: Some Properties

Not invariant to image scale!

All points will be classified as edges

Corner ! The underlying reason is that Harris corner detection scheme does not provide an automatic and appropriate window size selection method!

slide-48
SLIDE 48

Lin ZHANG, SSE, 2020

Local Descriptors for Harris Corners

p

vectorize the patch

1 2

n

v v v             

descriptor

  • Descriptor for a Harris corner point
  • Take a region with a fixed size around it
  • Stack the region into a vector
  • This vector serves as the descriptor
  • When matching two descriptors in two different

images, usually the correlation coefficient is used

slide-49
SLIDE 49

Lin ZHANG, SSE, 2020

Local Descriptors for Harris Corners

Correlation coefficient can be used to measure the similarity of two descriptors

1 1 2 2 1 2

[ ( )][ ( )] ( ) ( ) E E E D D     v v v v v v

  • Descriptor for a Harris corner point
  • Take a region with a fixed size around it
  • Stack the region into a vector
  • This vector serves as the descriptor
  • When matching two descriptors in two different

images, usually the correlation coefficient is used

slide-50
SLIDE 50

Lin ZHANG, SSE, 2020

Local Descriptors for Harris Corners

  • Deficiencies of such simple descriptors
  • Not rotation invariant
  • Not scale invariant
  • Descriptor for a Harris corner point
  • Take a region with a fixed size around it
  • Stack the region into a vector
  • This vector serves as the descriptor
  • When matching two descriptors in two different

images, usually the correlation coefficient is used

slide-51
SLIDE 51

Lin ZHANG, SSE, 2020

Local Descriptors for Harris Corners

  • We want:
  • Rotation and scale invariant feature points
  • Rotation and scale invariant feature descriptors
  • Descriptor for a Harris corner point
  • Take a region with a fixed size around it
  • Stack the region into a vector
  • This vector serves as the descriptor
  • When matching two descriptors in two different

images, usually the correlation coefficient is used

slide-52
SLIDE 52

Lin ZHANG, SSE, 2020

Content

  • Local Invariant Features
  • Motivation
  • Requirements
  • Invariance
  • Harris Corner Detector
  • Scale Invariant Point Detection
  • Automatic scale selection
  • Laplacian‐of‐Gaussian detector
  • Difference‐of‐Gaussian detector
slide-53
SLIDE 53

Lin ZHANG, SSE, 2020

From Points to Regions

  • The Harris corner detector defines interest points
  • Precise localization
  • High repeatability
  • In order to match those points, we need to compute a

descriptor over a region

  • How can we define such a region in a scale invariant

manner?

  • That is how can we detect sale invariant regions?
slide-54
SLIDE 54

Lin ZHANG, SSE, 2020

Scale Invariant Region Selection

slide-55
SLIDE 55

Lin ZHANG, SSE, 2020

Scale Invariant Region Selection

slide-56
SLIDE 56

Lin ZHANG, SSE, 2020

Scale Invariant Region Selection

slide-57
SLIDE 57

Lin ZHANG, SSE, 2020

Scale Invariant Region Selection

slide-58
SLIDE 58

Lin ZHANG, SSE, 2020

What do we want to do next?

  • Naïve approach for scale invariant local description is

not efficient (Detect Harris corners first, and then exhaustively searching for regions with appropriate sizes)

  • Now we want to:
  • Find scale invariant points in the image (location)
  • At the same time, we want to know their characteristic

scales (used to determine the neighborhood for local description)

slide-59
SLIDE 59

Lin ZHANG, SSE, 2020

Achieving scale covariance

  • Goal: independently detect corresponding regions in

scaled versions of the same image

  • Need scale selection mechanism for finding

characteristic region size that is covariant with the image transformation

slide-60
SLIDE 60

Lin ZHANG, SSE, 2020

Automatic Scale Selection

slide-61
SLIDE 61

Lin ZHANG, SSE, 2020

Automatic Scale Selection

  • Common approach
  • Take a local extremum of this function
  • Observation: region size for which the extremum is achieved

should be covariant to image scale; this scale covariant region size is found in each image independently

slide-62
SLIDE 62

Lin ZHANG, SSE, 2020

Automatic Scale Selection

slide-63
SLIDE 63

Lin ZHANG, SSE, 2020

Automatic Scale Selection

slide-64
SLIDE 64

Lin ZHANG, SSE, 2020

Automatic Scale Selection

slide-65
SLIDE 65

Lin ZHANG, SSE, 2020

Automatic Scale Selection

slide-66
SLIDE 66

Lin ZHANG, SSE, 2020

Automatic Scale Selection

slide-67
SLIDE 67

Lin ZHANG, SSE, 2020

Automatic Scale Selection

slide-68
SLIDE 68

Lin ZHANG, SSE, 2020

Automatic Scale Selection

slide-69
SLIDE 69

Lin ZHANG, SSE, 2020

Automatic Scale Selection

  • A good function for scale selection
  • It should have one stable sharp peak response to

region size

slide-70
SLIDE 70

Lin ZHANG, SSE, 2020

What is a useful signature function for scale?

slide-71
SLIDE 71

Lin ZHANG, SSE, 2020

Characteristic Scale

slide-72
SLIDE 72

Lin ZHANG, SSE, 2020

Another Fact

Spatial selection: the magnitude of the Laplacian response will achieve an extremum at the center of the blob, provided the scale of the Laplacian is “matched” to the scale

  • f the blob
slide-73
SLIDE 73

Lin ZHANG, SSE, 2020

Scale‐Invariant Point Detection

Local extremum in scale space

  • f Laplacian of Gaussian
slide-74
SLIDE 74

Lin ZHANG, SSE, 2020

Scale‐Invariant Point Detection

Local extremum in scale space

  • f Laplacian of Gaussian
slide-75
SLIDE 75

Lin ZHANG, SSE, 2020

Scale‐Invariant Point Detection

Local extremum in scale space

  • f Laplacian of Gaussian
slide-76
SLIDE 76

Lin ZHANG, SSE, 2020

Scale‐Invariant Point Detection

Local extremum in scale space

  • f Laplacian of Gaussian

(Positions of extrema in the scale‐spatial space)

slide-77
SLIDE 77

Lin ZHANG, SSE, 2020

We have got want we want!

Note: local extrema is obtained by comparing the examined location with all the other 26 points around it in the scale‐ space If the local extrema of LoG is achieved at p, two things of p can be determined: its spatial location and characteristic scale!

slide-78
SLIDE 78

Lin ZHANG, SSE, 2020

Scale normalization

  • The response of a derivative of Gaussian filter to a

perfect step edge decreases as σ increases

  • To keep response the same (scale‐invariant),

must multiply Gaussian derivative by σ

  • Laplacian is the second Gaussian derivative, so it

must be multiplied by σ2

slide-79
SLIDE 79

Lin ZHANG, SSE, 2020

Blob detection in 2D

Laplacian of Gaussian: Circularly symmetric operator for blob detection in 2D

2 2 2 2 2

y g x g g       

, g is the Gaussian function

slide-80
SLIDE 80

Lin ZHANG, SSE, 2020

Blob detection in 2D

Laplacian of Gaussian: Circularly symmetric operator for blob detection in 2D

              

2 2 2 2 2 2 norm

y g x g g 

Scale‐normalized:

slide-81
SLIDE 81

Lin ZHANG, SSE, 2020

Scale‐Invariant Point Detection: Example

slide-82
SLIDE 82

Lin ZHANG, SSE, 2020

Scale‐Invariant Point Detection: Example

slide-83
SLIDE 83

Lin ZHANG, SSE, 2020

Scale‐Invariant Point Detection: Example

slide-84
SLIDE 84

Lin ZHANG, SSE, 2020

Approximating the Laplacian with a difference of Gaussians:

 

2

( , , ) ( , , )

xx yy

L G x y G x y      ( , , ) ( , , ) DoG G x y k G x y    

(Laplacian) (Difference of Gaussians)

Efficient implementation

where Gaussian is

Assignment!

slide-85
SLIDE 85

Lin ZHANG, SSE, 2020

DoG

slide-86
SLIDE 86

Lin ZHANG, SSE, 2020

Scale‐Invariant Point Detection

slide-87
SLIDE 87

Lin ZHANG, SSE, 2020

Examples

slide-88
SLIDE 88

Lin ZHANG, SSE, 2020

Examples

Interest points found by DoG extrema What does the arrows mean? Next lecture!!

slide-89
SLIDE 89

Lin ZHANG, SSE, 2020