Top Banner
CS 6350 COMPUTER VISION Local Feature Detectors Local Feature Detectors and and Descriptors Descriptors
38

Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Mar 10, 2018

Download

Documents

lytu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

CS 6350 – COMPUTER VISION

Local Feature DetectorsLocal Feature Detectorsandand

DescriptorsDescriptors

Page 2: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

OverviewOverview

• Local invariant features• Local invariant features• Keypoint localization

‐ Hessian detector‐ Harris corner detector

• Scale Invariant region detection‐ Laplacian of Gaussian (LOG) detectoraplacian of Gaussian ( OG) detector‐ Difference of Gaussian (DOG) detector

• Local feature descriptorLocal feature descriptor‐ Scale Invariant Feature Transform (SIFT)Gradient Localization Oriented Histogram (GLOH)‐ Gradient Localization Oriented Histogram (GLOH)

• Examples of other local feature descriptors

Page 3: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

MotivationMotivation• Global feature from the whole image is often not desirable

• Instead match local regions which are prominent to the object or scene in the image.object or scene in the image.• Application Area

Obj t d t ti‐ Object detection‐ Image matching‐ Image stitching

Page 4: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Requirements of a local featureRequirements of a local feature

• Repetitive : Detect the same points independently in each image.Repetitive : Detect the same points independently in each image.

• Invariant to translation, rotation, scale.

• Invariant to affine transformation.

• Invariant to presence of noise, blur etc.

• Locality :Robust to occlusion clutter and illumination change• Locality :Robust to occlusion, clutter and illumination change.

• Distinctiveness : The region should contain “interesting” structure.

• Quantity : There should be enough points to represent the image• Quantity : There should be enough points to represent the image.

• Time efficient.

Page 5: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

General approachGeneral approachpppp++

1. Find the interest points. ++

+ ( )2. Consider the region around each keypoint.

++ ( )

local descriptor around each keypoint.3. Compute a local 

d i t f thdescriptor from the region and normalize the feature.

4. Match local descriptors4. Match local descriptors

Slide credit: Bastian Leibe

Page 6: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Some popular detectorsSome popular detectors• Hessian/ Harris corner detection• Laplacian of Gaussian (LOG) detector • Difference of Gaussian (DOG) detector• Hessian/ Harris Laplacian detector• Hessian/ Harris Affine detectorHessian/ Harris Affine detector• Maximally Stable Extremal Regions (MSER)

M th• Many others ….Looks for change in image gradient in two direction ‐ CORNERS

Change in both the directions

Change in one direction only

No change in any directionSlide credit: 

Fei Fei Li

Page 7: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Hessian Corner DetectorHessian Corner Detector[Beaudet, 1978]

Searches for image locations which have strong change inSearches for image locations which have strong change in gradient along both the orthogonal direction.

)(I)(I),x(I),x(I

),x(H xyxx

),x(I),x(I

),(yyxy

2III)Hd t( 2xyyyxx III)Hdet(

• Perform a non‐maximum suppression using a 3*3 windowPerform a non maximum suppression using a 3 3 window.• Consider points having higher value than its 8 neighbors.

)Hdet( where pointsSelect

Page 8: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Hessian Detector Hessian Detector –– Result Result

Effect: Responses mainly on corners and strongly textured areas.Effect: Responses mainly on corners and strongly textured areas.

Page 9: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Harris CornerHarris Corner[Forstner and Gulch, 1987]

• Search for local neighborhoods where the image content hasSearch for local neighborhoods where the image content has two main directions (eigenvectors).• Consider 2nd moment autocorrelation matrix• Consider 2 moment autocorrelation matrix

2~),x(II),x(I)~,x(G)~,,x(C 2

yx2x

2 ),x(I),x(II

),x(G),,x(C 2yyx

G i ll th i l i i l l l

Gaussian sums over all the pixels in circular local neighborhood using weights accordingly.

2yyx

yx2x

IIIIII

C R0

0R

2

11

yy

S t iIf λ1 or λ2 is about 0, the 

0 2

Symmetric Matrix

1 2point is not a corner.    

Page 10: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Harris cornerHarris cornerEigen decomposition: visualizationEigen decomposition: visualization

Slide credit: K. Grauman, B. Leibe

Page 11: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Harris Corner: Different approachHarris Corner: Different approach

Instead of explicitly computing the eigen values, the stead o e p c t y co put g t e e ge a ues, t efollowing equivalence are used

)Cd t( 21)Cdet(

21)C(trace 21)(

)1r()r()()C(trace 2222

221

2 )1(If 1 r

r)1r(

r)r()(

)Cdet()C(trace

22

22

21

21

),1( If,

2

1

r

ConsiderthresholdCtraceC )(.)det( 2

Consider these pointspoints

α in the range 0.04 – 0.25, experimentally verified

Page 12: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

21)Cdet( 21)C(trace

)/1(2)1()()()det(

)( 2

22

222

21

221

2rr

rr

rr

CCtrace

),1(

2

1 r

)( 2212

Let, r = 2; )5.4(*2 dctrc 2

);2220(54/1;0);*5.41()(.)det( 2

c

HIfdcCtraceCH

?)why0.2,h(risky wit0.1say );222.0(5.4/1 ;0 cHIf

?)why 0.2,h (risky wit 0.1say

For Edge, r >>1, say 5 For Corners, r = 2g , , y

);10*271(dcH )10*541(dH;*3.0

);1.02.71(dc

dcHc

550*);1.0*5.41(

dcdcHc

55.0dc

Page 13: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Harris Corner : ExampleHarris Corner : Example

1. Image derivatives

Ix Iy

derivatives

2. Square of Ix2Iy2 IxIy q

derivatives

3. Gaussian filter G(I)

(I 2) (I 2) g(I I )g(Ix2) g(Iy2) g(IxIy)

4. Cornerness function – both 

leigenvalues are strong

Slide credit: K. Grauman, B. Leibe

Page 14: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

CORNERNESS – HARRIS CORNERCORNERNESS HARRIS CORNER

α = .04 α = .08 α = .1

α = .17 α = .2 α = .25α = .14

Page 15: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Harris Corner : ResultHarris Corner : Result

Effect: A very precise corner detector.Effect: A very precise corner detector.

Page 16: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Scale Invariant region detectionScale Invariant region detection

Hessian and Harris corner detectors are not scale invariant.

Solution:Use the 

concept of pScale Space

Page 17: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

LaplacianLaplacian of Gaussian (LOG) of Gaussian (LOG) ppdetector detector [[LindebergLindeberg, 1998], 1998]

• Using the concept of Scale Space.• Instead of taking zero crossing (for edge detection), consider the point which is maximum among its 26 neighbors  (9+9+8).

)),(),((),( 2 xIxIxL yyxx

• LOG can be used for finding the characteristic scale for a given image locationscale for a given image location.• LOG can be used for finding scale invariant regions by searching 3D (location + scale) extremaregions by searching 3D (location + scale) extremaof the LOG.LOG i l d f d d t ti• LOG is also used for edge detection.

Page 18: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

LOG detector : FlowchartLOG detector : Flowchart

)()( yyxx II

List of

(x, y, s)

Page 19: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

LOG detector : ResultLOG detector : Result

Page 20: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Difference of Gaussian (DOG) Difference of Gaussian (DOG) Detector Detector [Lowe, 2004][Lowe, 2004]

Approximate LOG using DOG for computational efficiency

),x(D )x(I*)),x(G)k,x(G(

k = 21/KK = 0, 1, 2, … , constant

Consider the region where the DOG response is greater thanDOG response is greater than a threshold and the scale lies in a predefined range ssin a predefined range maxmin s,s

Page 21: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

DOG detector : FlowchartDOG detector : Flowchart

X is selected if it is largerif it is larger or smaller than all neighbors.

Page 22: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

DOG detector : ResultDOG detector : Result

Page 23: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Local DescriptorsLocal Descriptorspp

• We have detected the interest points in an imageWe have detected the interest points in an image.• How to match the points across different images of the same object? 

Use Local DescriptorsUse Local Descriptors

Slide credit: Fei Fei Li

Page 24: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

List of local feature descriptorsList of local feature descriptorspp

• Scale Invariant Feature Transform (SIFT)• Speed‐Up Robust Feature (SURF)p p ( )• Histogram of Oriented Gradient (HOG)• Gradient Location Orientation Histogram (GLOH)• Gradient Location Orientation Histogram (GLOH)• PCA‐SIFT• Pyramidal HOG (PHOG)• Pyramidal Histogram Of visual Words (PHOW)Pyramidal Histogram Of visual Words (PHOW)• Others….

Should be robust to viewpoint change or illumination changeg

Page 25: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT SIFT [Lowe, 2004][Lowe, 2004]

Step 1: Detect interesting points using DOG.

832 DOG extrema

Page 26: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT : Step 2SIFT : Step 2ppStep 2: Accurate keypoint localization

‐ Aim : reject the low contrast points and the points that lie on the edge.g

Low contrast points elimination:Fit keypoint at      to nearby data using quadratic approximation.

21( )T T

TD DD D

x

l l h l l i f h fi d f i

2( )2

TD x D x x xx x

Calculate the local maxima of the fitted function.12

2ˆ D Dx

Discard local minima 

2x x

ˆ( ) 0.03D x ( ) 0.03D x

Page 27: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT : Step 2SIFT : Step 2Eliminating edge response:

ppg g p

DOG gives strong response along edges – Eliminate those responsesSolution: check “cornerness” of each keypointSolution: check  cornerness  of each keypoint.• On the edge one of principle curvatures is much bigger than anotheranother.

• High cornerness No dominant principle curvature component.• Consider the concept of Hessian and Harris corner• Consider the concept of Hessian and Harris corner

IIHessian 

yyxy

xyxx

IIII

HMatrix

r)1r(

)H(Det)H(Tr 22 Harris 

cornerDiscard points with response below thresholdr)H(Detcorner 

criterionresponse below threshold

Page 28: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT : Step 2SIFT : Step 2pp

729 out of 832 are left after contrast thresholding

536 out of 729 are left after cornerness thresholding536 out of 729 are left after cornerness thresholdingSlide credit: David Lowe

Page 29: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT : Step 3SIFT : Step 3ppStep 3: Orientation Assignment

‐ Aim : Assign constant orientation to each keypoint based on local image property to obtain rotational invariance.g p p y

To transformTo transform relative data accordingl

Th i d d i i f di f i h

accordingly

The magnitude and orientation of gradient of an image patch I(x,y) at a particular scale is:

22 ))1y,x(I)1y,x(I())y,1x(I)y,1x(I()y,x(m

)1(I)1(I)y,1x(I)y,1x(I)1y,x(I)1y,x(Itan)y,x( 1

Page 30: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT : Step 3SIFT : Step 3ppStep 3: Orientation Assignment

• Create weighted (magnitude +Create weighted (magnitude + Gaussian) histogram of local gradient directions computed at g ad e t d ect o s co puted atselected scale

• Assign dominant orientation of the region as that of the peak ofthe region as that of the peak of smoothed histogram

• For location of multiple peaks multiply key pointmultiply key point

Slide credit: David Lowe

Page 31: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT : Step 4SIFT : Step 4ppAlready obtained precise location, scale and orientation to each keypoin

Step 4: Local image descriptorAim – Obtain local descriptor that is highly distinctive yetAim – Obtain local descriptor that is highly distinctive yet invariant to variation like illumination and affine change

• Consider a rectangular grid 16*16 in the direction of the• Consider a rectangular grid 16*16 in the direction of the dominant orientation of the region.Di id th i i t 4*4 b i• Divide the region into 4*4 sub‐regions.

• Consider a Gaussian filter above the regionwhich gives higher weights to pixel closerto the center of the descriptor.p

Page 32: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT : Step 4SIFT : Step 4ppStep 4: Local image descriptor

b d h f h b• Create 8 bin gradient histograms for each sub‐regionWeighted by magnitude and Gaussian window ( σ is half the 

i d i )window size)

Feature vector (128)( )8*4*4 = 128

Finally normalize 128 dim vector to make it illumination invariantFinally, normalize 128 dim vector to make it illumination invariant

Page 33: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT : Some ResultSIFT : Some ResultObject detectionj

Page 34: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

SIFT : Some ResultSIFT : Some ResultPanorama 

Page 35: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

GLOHGLOHFirst 3 steps – same as SIFTStep 4 – Local image descriptorStep 4  Local image descriptor

• Consider log‐polar location grid with 3 different radii and 8 angular direction for two of them in total 17 location binangular direction for two of them, in total 17 location bin• Form histogram of gradients having 16 bins

F f t t f 272 di i (17*16)• Form a feature vector of 272 dimension (17*16)• Perform dimensionality reduction and project the features to a 128 dimensional space.

192192 correct matches ( ll ) d(yellow) and 208 false matchesmatches (blue).

Page 36: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

Some other examplesSome other examplespp

SURFPHOW

HOG

Page 37: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

ReferenceReference1. Kristen Grauman and Bastian Leibe, Visual Object Recognition, Synthesis Lectures 

on Artificial Intelligence and Machine Learning, April 2011, Vol. 5, No. 2, Pages 1‐g g, p , , , g181.

2. Beaudet, “Rotationally invariant image operators”,  in  International Joint Conference on Pattern Recognition,  pp. 579‐583., 1978.

3. Förstner, W. and Gülch, E., “A fast operator for detection and precise location of distinct points corners and centers of circular features” in ISPRS Inter commissiondistinct points, corners and centers of circular features , in ISPRS Inter commission Workshop’, pp. 281‐305, 1987.

4. Harris, C. and Stephens, M., “A combined corner and edge detector”, in ‘Alvey4. Harris, C. and Stephens, M.,  A combined corner and edge detector , in  Alvey Vision Conference’, pp. 147–151, 1988.

5. Lindeberg, T., ‘Scale‐space theory: A basic tool for analyzing structures at different scales’, Journal of Applied Statistics 21(2), pp. 224–270, 1994.

6. Lowe, D., ‘Distinctive image features from scale‐invariant keypoints’, International J l f C t Vi i 60(2) 91 110 2004Journal of Computer Vision 60(2), pp. 91–110, 2004.

7. Mikolajczyk, K. and Schmid, C., ‘A performance evaluation of local descriptors’, IEEE Transactions on Pattern Analysis & Machine Intelligence 27(10) 31–37 2005IEEE Transactions on Pattern Analysis & Machine Intelligence 27(10), 31 37, 2005.

Page 38: Feature Detectors and Descriptors - Indian Institute of ...vplab/courses/CV_DIP/PDF/Feature.pdf · No change in Slide credit: any direction Fei ... derivatives I x I y I x 2. ...

THANK YOUTHANK YOUTHANK YOUTHANK YOU