Features & Correspondences Kevin Kser Spring 2013 - - PowerPoint PPT Presentation

features
SMART_READER_LITE
LIVE PREVIEW

Features & Correspondences Kevin Kser Spring 2013 - - PowerPoint PPT Presentation

3D Photography: Features & Correspondences Kevin Kser Spring 2013 http://www.cvg.ethz.ch/teaching/2013spring/3dphoto/ Schedule (tentative) Feb 18 Introduction Feb 25 Geometry, Camera Model, Calibration Mar 4 Features,


slide-1
SLIDE 1

3D Photography: Features & Correspondences

Kevin Köser

Spring 2013

http://www.cvg.ethz.ch/teaching/2013spring/3dphoto/

slide-2
SLIDE 2

Feb 18 Introduction Feb 25 Geometry, Camera Model, Calibration Mar 4 Features, Tracking/Matching Mar 11 Project Proposals by Students Mar 18 Epipolar Geometry Mar 25 Stereo Vision Apr 1 Easter Apr 8 Structure from Motion / SLAM Apr 15 Project Updates (Sechseläuten in afternoon) Apr 22 Active Ranging, Structured Light Apr 29 Volumetric Modeling May 6 Mesh-based Modeling May 13 Shape-from-X May 20 Pentecost / White Monday May 27 Student Project Demo Day

Schedule (tentative)

slide-3
SLIDE 3

2D-2D 2D-3D 2D-3D

mi mi+1 M

Correspondences are at the heart of 3D reconstruction from images Today: Features & Correspondences

slide-4
SLIDE 4

Feature matching vs. tracking

Extract features independently and then match by comparing descriptors Extract features in first images and then try to find same feature back in next view

What is a good feature? Image-to-image correspondences are key to passive triangulation-based 3D reconstruction

slide-5
SLIDE 5

Compare intensities pixel-by-pixel

Comparing image regions

I(x,y) I´(x,y) Sum of Square Differences

Dissimilarity measures

slide-6
SLIDE 6

Feature points

  • Required properties:
  • Well-localized
  • Stable across views, „repeatable“

(i.e. same 3D point should be extracted as feature for neighboring viewpoints)

slide-7
SLIDE 7

Feature point extraction

homogeneous edge corner Find points (local image patches) that differ as much as possible from all neighboring points

slide-8
SLIDE 8

Feature point extraction

  • Approximate SSD for small displacement Δ
  • Image difference, square difference for pixel
  • SSD for window
slide-9
SLIDE 9

Feature point extraction

homogeneous edge corner

Find points for which the following is maximum i.e. maximize smallest eigenvalue of M

slide-10
SLIDE 10

Harris corner detector

  • Only use local maxima, subpixel accuracy through

second order surface fitting

  • Select strongest features over whole image and over

each tile (e.g. 1000/image, 2/tile)

  • Use small local window:
  • Maximize „cornerness“:
slide-11
SLIDE 11

Simple matching

  • for each corner in image 1 find the corner in

image 2 that is most similar and vice-versa

  • Only compare geometrically compatible points
  • Keep mutual best matches

What transformations does this work for?

slide-12
SLIDE 12

Compare intensities pixel-by-pixel

Comparing image regions

I(x,y) I´(x,y) Sum of Square Differences

Dissimilarity measures

slide-13
SLIDE 13

Compare intensities pixel-by-pixel

Comparing image regions

I(x,y) I´(x,y) Zero-mean Normalized Cross Correlation

Similarity measures

slide-14
SLIDE 14

Feature matching: example

0.96

  • 0.40
  • 0.16
  • 0.39

0.19

  • 0.05

0.75

  • 0.47

0.51 0.72

  • 0.18
  • 0.39

0.73 0.15

  • 0.75
  • 0.27

0.49 0.16 0.79 0.21 0.08 0.50

  • 0.45

0.28 0.99

1 5 2 4 3 1 5 2 4 3

What transformations does this work for? What level of transformation do we need?

slide-15
SLIDE 15

Wide baseline matching

  • Requirement to cope with larger

variations between images

  • Translation, rotation, scaling
  • Foreshortening
  • Non-diffuse reflections
  • Illumination

geometric transformations photometric changes

slide-16
SLIDE 16

Invariant detectors

Scale invariant Affine invariant

(approximately invariant w.r.t. perspective/viewpoint)

Rotation invariant

slide-17
SLIDE 17

2D Transformations of a Local Patch

Block Matching

e.g. MSER In practise hardly observable in small patches !

slide-18
SLIDE 18

Example: Find Correspondences between these images using the MSER Detector [Matas„02]

slide-19
SLIDE 19

MSER Features

Local regions, not points !

slide-20
SLIDE 20

Extremal Regions:

  • Much Brighter than

Surrounding

  • Use intensity threshold
slide-21
SLIDE 21

Extremal Regions:

  • OR: Much Darker than

Surrounding

  • Use intensity threshold
slide-22
SLIDE 22

Regions: Connected Pixels at some threshold

  • Region Size = # Pixels
  • Maximally stable: Size Constant near some

threshold

slide-23
SLIDE 23

A Sample Feature

slide-24
SLIDE 24

„T“ is maximally stable with respect to surrounding

slide-25
SLIDE 25
  • Compute „center of gravity“
  • Compute Scatter (PCA / Ellipsoid)
slide-26
SLIDE 26

Different Images: Different positions/sizes/shapes

Ellipse abstracts from pixels ! Geometric representation: position/size/shape

slide-27
SLIDE 27

Still: How to compare ?

Idea: Normalize to „Default“ Position/Size/Shape ! e.g. Circle of Radius 16 Pixels !

slide-28
SLIDE 28

Idea: Normalize to „Default“ Position/Size/Shape ! Ok, but 2D orientation ?

slide-29
SLIDE 29
  • Idea (Lowe„99): Run over all Pixels:

Chart Local Gradient Orientation in Histogram

  • Find Dominant Orientation in Histogram
  • Rotate Local Patch into Dominant Orientation
slide-30
SLIDE 30

Each normalized patch obtained from single image !

slide-31
SLIDE 31

Wrap-up MSER

  • detect sets of pixels brighter/darker than surr.
  • fit elliptical shape to pixel set
  • warp image so that ellipse becomes circle
  • rotate to dominant gradient direction [other

constructions posible as well] Affine normalization of feature leads to similar patches in different views ! Two MSERegions: Are they in correspondence ?

slide-32
SLIDE 32

Traditional Matching Approach: Compare Regions (Sum of Squared Differences)

  • Small Misalignment
  • Brightness Change

 More Tolerant Comparison ?

slide-33
SLIDE 33

SIFT Descriptor [Lowe„99]:

  • Brightness offset: use only gradients

!

For each Sector:

  • Store Orientations of Gradients !

Gradient Magnitude

Partition into Sectors

Gradient Orientation/Magnitude

slide-34
SLIDE 34

Quantize Gradient Orientation, e.g. 45° Steps

Orientation Histogram per Sector Gradient Orientation/Magnitude

Orientation Histogram (Magnitude as Weight) m Sectors with n Orientations: (m·n) values Construct Vector 35 12 10 25 … 29

slide-35
SLIDE 35

35 12 10 25 … 29

0.12 0.04 0.03 0.08

0.10

Normalize (Suppresses Changing Contrast Effects) … … Summed Gradient Magnitudes for Different Sectors and Orientations „SIFT Descriptor“: 128 Bytes Memory Comparison 11x11 Patch: Raw Grey Values = 121 Bytes

slide-36
SLIDE 36

Wrap Up: Normalized Patch Comparison vs. Descriptor Usage of Gradients: Intensity Offset Compensation Subdivision into Sectors / Per-Sector Histogram: Small Alignment Error Compensation Normalization of Histogram Vector: Image Contrast Compensation But most important: Avoid sudden „descriptor jumps“

slide-37
SLIDE 37

Classical Histogram (Quantization 45°): 22° quantized/rounded to 0° 23° quantized/rounded to 45° Small Differences can lead to different bins ! Feature Position, Size, Shape, Orientation uncertain, Image Content noisy ! Descriptor MUST tolerate this (no sudden changes !) Solution: „Soft-Binning“ !

slide-38
SLIDE 38

Histogram (Quantization 45°): 20° 0° 45° 90° … Classical (closest bin)

1.0

22°

2.0

If orientation is 3° different, all measurements go to second bin ! => Sudden Change in Histogram from (2 0 0 0) to (0 2 0 0)

slide-39
SLIDE 39

Histogram (Quantization 45°): 20° 0° 45° 90° … Soft-Binning

0.56

22°

1.07

If orientation is 3° different, descriptor changes only gradually !

0.44 0.93 0.56 0.44

Soft Weights: „Bin Correctness“

slide-40
SLIDE 40

Wrap-up Detector:

  • Find interesting regions (position/size/shape)
  • Assign dominant gradient orientation
  • Normalize regions

Descriptor:

  • Compute „signature“ upon normalized region
  • Behave smoothly in presence of distortions:

brightness changes / normalization inaccuracies

slide-41
SLIDE 41

How to find correspondences ? For each Region: 128-dim. Descriptor

slide-42
SLIDE 42

Matching Scenario I Two images in a dense foto sequence:

  • think about maximum movement d (e.g. 50 pixel)
  • Search in a window +/- d of old position
  • Compare descriptors, choose most similar
slide-43
SLIDE 43

Matching Scenario II Two arbitrary images / Wide baseline

  • Compare every descriptor with every other (e.g. GPU)
  • OR: Find small set of matches, predict others
  • OR: Find nearest neighbor in descriptor space
slide-44
SLIDE 44

Searching Descriptor Space Key Ideas:

  • Each descriptor consists of 128 numbers

Imagine vector from IR128

  • Correspondending descriptors: not far apart !
  • Arrange all descriptors of image 1 in kd-tree

(imagine „octree“ but with more dims)

  • For each descriptor of image 2:

Find (approximate) nearest neighbor in tree

slide-45
SLIDE 45

Searching Descriptor Space „Learn“ important dimensions of 128D space for a given scene, e.g. PCA or LDA Project descriptors to important dimensions, use kd-tree

slide-46
SLIDE 46

Matching Techniques Spatial Search Window:

  • Requires/exploits good prediction
  • Can avoid far away similar-looking features
  • Good for sequences

Descriptor Space:

  • Initial tree setup
  • Fast lookup for huge amounts of features
  • More sophisticated outlier detection required
  • Good for asymmetric (offline/online) problems,

registration, initialization, object recognition, wide baseline matching

slide-47
SLIDE 47

Correspondence Verification Features have only very local view => Mismatches How to detect ?

  • Discard Matches with low similarity
  • Delete „non-distinctive“ features (those with close

match in same image or with similar 2nd best match)

  • Check for bi-directional consistency
  • Geometric verification, e.g. RANSAC
slide-48
SLIDE 48

“conjugate rotation property” equivalent to l   ) determines “projective” scale factor when going to

Object Detection / Pose Estimation using single MSER Affine feature: position(2x), shape(3x), orientation(1x) 6 degree of freedom, more than 2D simple point !

slide-49
SLIDE 49

2D Transformations of a Local Patch

Block Matching

e.g. MSER e.g. SIFT

slide-50
SLIDE 50

Lowe‟s SIFT features

Detector + Descriptor Recover features with position, orientation and scale

(Lowe, ICCV99)

slide-51
SLIDE 51

Position

  • Look for strong responses of DOG filter

(Difference-Of-Gaussian)

  • Only consider local maxima
slide-52
SLIDE 52

Scale

  • Look for strong responses of DOG filter

(Difference-Of-Gaussian) over scale space

  • Only consider local maxima in both

position and scale

  • Fit quadratic around maxima for subpixel
slide-53
SLIDE 53

Minimum contrast and “cornerness”

slide-54
SLIDE 54

Orientation

  • Create histogram of local

gradient directions computed at selected scale

  • Assign canonical
  • rientation at peak of

smoothed histogram

  • Each key specifies stable

2D coordinates (x, y, scale, orientation)

slide-55
SLIDE 55

SIFT descriptor

  • Thresholded image gradients are sampled over

16x16 array of locations in scale space

  • Create array of orientation histograms
  • 8 orientations x 4x4 histogram array = 128

dimensions

slide-56
SLIDE 56
slide-57
SLIDE 57
  • Affine feature evaluation + binaries:

http://www.robots.ox.ac.uk/~vgg/research/affine/

  • SIFT + MSER + some tools:

http://vlfeat.org

  • SURF:

http://www.vision.ee.ethz.ch/~surf/

  • GPU-SIFT:

http://www.cs.unc.edu/~ccwu/siftgpu/

  • DAISY (dense descriptors)

http://cvlab.epfl.ch/~tola/daisy.html

  • FAST[er] (simple but …)

http://svr-www.eng.cam.ac.uk/~er258/work/fast.html

Some Feature Resources

Check also opencv + try to google

slide-58
SLIDE 58
  • BRIEF[Calonder10]: binary descriptor

(tests=position a darker than b), compare descriptors by XOR (Hamming) + POPCNT

  • RIFF[Takacs10]: CENSURE + gradients

tangential/radial

  • ORB[Rublee11] FAST+orientation
  • BRISK[Leutenegger11] FAST+scale+BRIEF
  • FREAK[Alahi12] FAST + “daisy”-BRIEF
  • Lucid[Ziegler12]: “sort intensities”
  • D-BRIEF[Trzcinski12]:Box-Filter+learned

projection+BRIEF

  • LDA HASH[Strecha12]: binary tests
  • n descriptor

Recent Variants and Accelerations

(much faster, but this usually comes at a price)

slide-59
SLIDE 59

Features: local normalization + robust descriptors Allow

  • changing perspective/illumination/scale
  • scenarios with many occlusions
  • different reasoning (descriptor vectors)

Require

  • (Nearly) planarity across feature in 3d
  • „detectable“ regions, enough structure

But

  • fewer features / slower
  • invariance vs. descriptiveness:

Descriptors can be similar when regions are not ! => What level of invariance / speed / properties do YOU really need ?

slide-60
SLIDE 60

Feature tracking

  • Identify features and track them
  • ver video
  • Small difference between frames
  • potential large difference overall
  • Standard approach:

KLT (Kanade-Lukas-Tomasi)

slide-61
SLIDE 61

Tracking corners through video

slide-62
SLIDE 62

Good features to track

  • Use same window in feature selection as for

tracking itself

  • Compute motion assuming it is small

Affine is also possible, but a bit harder (6x6 instead of 2x2)

differentiate:

slide-63
SLIDE 63

Example

Simple displacement is sufficient between consecutive frames, but not to compare to reference template

slide-64
SLIDE 64

Example

slide-65
SLIDE 65

Good features to keep tracking

Perform affine alignment between first and last frame Stop tracking features with too large errors

slide-66
SLIDE 66
  • Brightness constancy assumption

Intensity Linearization

(small motion)

  • 1D example

possibility for iterative refinement

slide-67
SLIDE 67
  • Brightness constancy assumption

Intensity Linearization

(small motion)

  • 2D example

(2 unknowns) (1 constraint) ? isophote I(t)=I isophote I(t+1)=I the “aperture” problem

slide-68
SLIDE 68

Intensity Linearization

  • How to deal with aperture problem?

Assume neighbors have same displacement

(3 constraints if color gradients are different)

slide-69
SLIDE 69

Lucas-Kanade

Assume neighbors have same displacement least-squares:

slide-70
SLIDE 70

Revisiting the small motion assumption

  • Is this motion small enough?
  • Probably not—it‟s much larger than one pixel (1st
  • rder Taylor not sufficient)
  • How might we solve this problem?

* From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

slide-71
SLIDE 71

Reduce the resolution!

* From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

slide-72
SLIDE 72

image It-1 image I Gaussian pyramid of image It-1 Gaussian pyramid of image I image I image It-1 u=10 pixels u=5 pixels u=2.5 pixels u=1.25 pixels

Coarse-to-fine optical flow estimation

slides from Bradsky and Thrun

slide-73
SLIDE 73

image I image J Gaussian pyramid of image It-1 Gaussian pyramid of image I image I image It-1

Coarse-to-fine optical flow estimation

run iterative L-K run iterative L-K warp & upsample

. . .

slides from Bradsky and Thrun

slide-74
SLIDE 74

Next week: Project Proposals