Feature Detection and Matching

Similar documents
Computer Vision for HCI. Topics of This Lecture

Local Image Features

Feature Detection. Raul Queiroz Feitosa. 3/30/2017 Feature Detection 1

Leow Wee Kheng CS4243 Computer Vision and Pattern Recognition. Motion Tracking. CS4243 Motion Tracking 1

SIFT: SCALE INVARIANT FEATURE TRANSFORM SURF: SPEEDED UP ROBUST FEATURES BASHAR ALSADIK EOS DEPT. TOPMAP M13 3D GEOINFORMATION FROM IMAGES 2014

Local Image Features

Motion illusion, rotating snakes

Motion Estimation and Optical Flow Tracking

Feature Based Registration - Image Alignment

SIFT: Scale Invariant Feature Transform

Augmented Reality VU. Computer Vision 3D Registration (2) Prof. Vincent Lepetit

SUMMARY: DISTINCTIVE IMAGE FEATURES FROM SCALE- INVARIANT KEYPOINTS

Outline 7/2/201011/6/

Key properties of local features

Scale Invariant Feature Transform

The SIFT (Scale Invariant Feature

Scale Invariant Feature Transform

CS 556: Computer Vision. Lecture 3

Local features and image matching. Prof. Xin Yang HUST

EE795: Computer Vision and Intelligent Systems

A Novel Algorithm for Color Image matching using Wavelet-SIFT

Local Feature Detectors

Features Points. Andrea Torsello DAIS Università Ca Foscari via Torino 155, Mestre (VE)

Prof. Feng Liu. Spring /26/2017

Local Features: Detection, Description & Matching

BSB663 Image Processing Pinar Duygulu. Slides are adapted from Selim Aksoy

CS 556: Computer Vision. Lecture 3

Introduction. Introduction. Related Research. SIFT method. SIFT method. Distinctive Image Features from Scale-Invariant. Scale.

CS 4495 Computer Vision A. Bobick. CS 4495 Computer Vision. Features 2 SIFT descriptor. Aaron Bobick School of Interactive Computing

School of Computing University of Utah

Implementing the Scale Invariant Feature Transform(SIFT) Method

Distinctive Image Features from Scale-Invariant Keypoints

A Comparison of SIFT, PCA-SIFT and SURF

SURF. Lecture6: SURF and HOG. Integral Image. Feature Evaluation with Integral Image

Image matching. Announcements. Harder case. Even harder case. Project 1 Out today Help session at the end of class. by Diva Sian.

Visual Tracking (1) Tracking of Feature Points and Planar Rigid Objects

SIFT - scale-invariant feature transform Konrad Schindler

EE368 Project Report CD Cover Recognition Using Modified SIFT Algorithm

Comparison of Feature Detection and Matching Approaches: SIFT and SURF

A Novel Extreme Point Selection Algorithm in SIFT

Local invariant features

Automatic Image Alignment (feature-based)

Implementation and Comparison of Feature Detection Methods in Image Mosaicing

CAP 5415 Computer Vision Fall 2012

A NEW FEATURE BASED IMAGE REGISTRATION ALGORITHM INTRODUCTION

Local Patch Descriptors

Local features: detection and description. Local invariant features

Harder case. Image matching. Even harder case. Harder still? by Diva Sian. by swashford

Obtaining Feature Correspondences

Image Features: Detection, Description, and Matching and their Applications

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Harder case. Image matching. Even harder case. Harder still? by Diva Sian. by swashford

Performance Evaluation of Scale-Interpolated Hessian-Laplace and Haar Descriptors for Feature Matching

Problems with template matching

Corner Detection. GV12/3072 Image Processing.

Multi-modal Registration of Visual Data. Massimiliano Corsini Visual Computing Lab, ISTI - CNR - Italy

Evaluation and comparison of interest points/regions

Local Features Tutorial: Nov. 8, 04

3D from Photographs: Automatic Matching of Images. Dr Francesco Banterle

CS4670: Computer Vision

Local features: detection and description May 12 th, 2015

Automatic Image Alignment

Copy-Move Forgery Detection using DCT and SIFT

Object Recognition with Invariant Features

Midterm Wed. Local features: detection and description. Today. Last time. Local features: main components. Goal: interest operator repeatability

Visual Tracking (1) Pixel-intensity-based methods

Image Features. Work on project 1. All is Vanity, by C. Allan Gilbert,

Image Matching. AKA: Image registration, the correspondence problem, Tracking,

Lecture 10 Detectors and descriptors

Visual Tracking (1) Feature Point Tracking and Block Matching

CS 558: Computer Vision 4 th Set of Notes

Pictures at an Exhibition: EE368 Project

Image features. Image Features

Line, edge, blob and corner detection

SCALE INVARIANT FEATURE TRANSFORM (SIFT)

Wikipedia - Mysid

AK Computer Vision Feature Point Detectors and Descriptors

Click to edit title style

Multi-view 3D reconstruction. Problem formulation Projective ambiguity Rectification Autocalibration Feature points and their matching

Patch-based Object Recognition. Basic Idea

Stereoscopic Images Generation By Monocular Camera

Patch Descriptors. EE/CSE 576 Linda Shapiro

Automatic Image Alignment

3D Vision. Viktor Larsson. Spring 2019

Building a Panorama. Matching features. Matching with Features. How do we build a panorama? Computational Photography, 6.882

Image Features: Local Descriptors. Sanja Fidler CSC420: Intro to Image Understanding 1/ 58

A Comparison and Matching Point Extraction of SIFT and ISIFT

Lecture 6: Finding Features (part 1/2)

Fast Image Matching Using Multi-level Texture Descriptor

III. VERVIEW OF THE METHODS

EECS150 - Digital Design Lecture 14 FIFO 2 and SIFT. Recap and Outline

Lecture: RANSAC and feature detectors

Feature descriptors and matching

A Comparison of SIFT and SURF

Feature Matching and Robust Fitting

IMAGE MATCHING USING SCALE INVARIANT FEATURE TRANSFORM (SIFT) Naotoshi Seo and David A. Schug

CS231A Section 6: Problem Set 3

Distinctive Image Features from Scale-Invariant Keypoints

Faster Image Feature Extraction Hardware

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

Transcription:

and Matching CS4243 Computer Vision and Pattern Recognition Leow Wee Kheng Department of Computer Science School of Computing National University of Singapore Leow Wee Kheng (CS4243) Camera Models 1 / 38

Outline 1 Feature Detection Harris Corner Tomasi s Good Feature Comparison SIFT 2 Feature Descriptors SIFT Descriptors 3 Feature Matching 4 Summary 5 Exercise 6 Further Reading 7 Reference Leow Wee Kheng (CS4243) Camera Models 2 / 38

Feature Detection For image registration, need to obtain correspondence between images. Basic idea: detect feature points, also called keypoints match feature points in different images Want feature points to be detected consistently and matched correctly. Many features available Harris corner Tomasi s good features to track SIFT: Scale Invariant Feature Transform SURF: Speeded Up Robust Feature GLOH: Gradient Location and Orientation Histogram etc. Leow Wee Kheng (CS4243) Camera Models 3 / 38

Harris Corner Harris Corner Observation: x A shifted corner produces some difference in the image. A shifted uniform region produces no difference. So, look for large difference in shifted image. Leow Wee Kheng (CS4243) Camera Models 4 / 38

Harris Corner Suppose an image patch W at x is shifted by a small amount x. Then, the sum-squared difference at x is E(x) = [I(x i ) I(x i + x)] 2. (1) That is, E(x,y) = (x i,y i ) W x i W This is also called the auto-correlation function. Apply Taylor s series expansion to I(x i + x): [I(x i,y i ) I(x i + x,y i + y)] 2. (2) I(x i + x,y i + y) = I(x i,y i )+ I I x+ y (3) x y where I = (I x,i y ). = I(x i,y i )+I x x+i y y (4) = I(x i )+( I) x (5) Leow Wee Kheng (CS4243) Camera Models 5 / 38

Harris Corner Substituting Eq. 5 into Eq. 1 yields E(x) = W [I x x+i y y] 2 (6) = W [ I 2 x 2 x+2i x I y x y +I 2 y 2 y ] (7) = ( x) A(x) x (8) where the auto-correlation matrix A is given by (Exercise) A = W I 2 x I x I y W I x I y W. (9) W I 2 y Leow Wee Kheng (CS4243) Camera Models 6 / 38

Harris Corner A captures intensity pattern in W. Response R(x) of Harris corner detector is given by [HS88]: R(x) = deta α(tra) 2. (10) Two ways to define corners: (1) Large response The locations x with R(x) greater than certain threshold. (2) Local maximum The locations x where R(x) are greater than those of their neighbors, i.e., apply non-maximum suppression. Leow Wee Kheng (CS4243) Camera Models 7 / 38

Harris Corner Sample result (large response): Many corners are detected near each other. So, better to find local maximum. Leow Wee Kheng (CS4243) Camera Models 8 / 38

Tomasi s Good Feature Tomasi s Good Feature Shi and Tomasi considered weighted auto-correlation [ST94]: E(x) = w(x i )[I(x i ) I(x i + x)] 2 (11) x i W where w(x i ) is the weight. Then, A becomes A = W wi 2 x wi x I y W wi x I y W. (12) W wi 2 y Leow Wee Kheng (CS4243) Camera Models 9 / 38

Tomasi s Good Feature A is a 2 2 matrix. This means there exist scalar values λ 1,λ 2 and vectors v 1,v 2 such that Av i = λ i v i, i = 1,2 (13) v i are the orthonormal eigenvectors, i.e., v i v j = { 1 if i = j 0 otherwise (14) λ i are the eigenvalues; expect λ i 0. Leow Wee Kheng (CS4243) Camera Models 10 / 38

Tomasi s Good Feature 0000 1111 0000 1111 0000 1111 0000 1111 (1) (2) (3) (1) If both λ i are small, then feature does not vary much in any direction. uniform region (bad feature) (2) If the larger eigenvalue λ 1 λ 2, then the feature varies mainly in the direction of v 1. edge (bad feature) (3) If both eigenvalues are large, then the feature varies significantly in both directions. corner or corner-like (good feature) (4) In practice, I has a maximum value (e.g., 255). So, λ 1,λ 2 also have an upper bound. So, only have to check that min(λ 1,λ 2 ) is large enough. Leow Wee Kheng (CS4243) Camera Models 11 / 38

Tomasi s Good Feature Sample results (local maximum): With non-maximum suppression, detected corners are more spread out. Leow Wee Kheng (CS4243) Camera Models 12 / 38

Comparison Comparison Tomasi s good feature uses smallest eigenvalue min(λ 1,λ 2 ). Harris corner uses deta α(tra) 2 = λ 1 λ 2 α(λ 1 +λ 2 ) 2. Brown et al. [BSW05] use the harmonic mean deta tra = λ 1λ 2 λ 1 +λ 2. (15) Leow Wee Kheng (CS4243) Camera Models 13 / 38

Subpixel Corner Location Subpixel Corner Location Locations are detected keypoints are typically at integer coordinates. To get more accurate real-number coordinates, need to run subpixel algorithm. General idea: starting with an approximate location of a corner, find the accurate location that lies at the intersections of edges. Leow Wee Kheng (CS4243) Camera Models 14 / 38

Adaptive Non-maximal Suppression Adaptive Non-maximal Suppression Non-maximal suppression: look for local maximal as keypoints. Can lead to uneven distribution of detected keypoints. Brown et al. [BSW05] used adaptive non-maximal suppression: local maximal response value is significantly larger than those of its neighbors Leow Wee Kheng (CS4243) Camera Models 15 / 38

Adaptive Non-maximal Suppression Leow Wee Kheng (CS4243) Camera Models 16 / 38

Scale Invariance Scale Invariance In many applications, the scale of the object of interest may vary in different images. Simple but inefficient solution: Extract features at many different scales. Match them to the object s known features at a particular scale. More efficient solution: Extract features that are invariant to scale. Leow Wee Kheng (CS4243) Camera Models 17 / 38

SIFT SIFT Scale Invariant Feature Transform (SIFT) [Low04]. Convolve input image I with Gaussian G of various scale σ: where L(x,y,σ) = G(x,y,σ) I(x,y) (16) G(x,y,σ) = 1 2πσ 2 exp This produces L at different scales. ( x2 +y 2 2σ 2 ). (17) To detect stable keypoint, convolve image I with difference of Gaussian: D(x,y,σ) = (G(x,y,kσ) G(x,y,σ)) I(x,y) = L(x,y,kσ) L(x,y,σ). (18) Leow Wee Kheng (CS4243) Camera Models 18 / 38

SIFT Have 3 different scales within each octave (doubling of σ). Successive DOG images are subtracted to produce D. D images in a lower octave are downsampled by factor of 2. Leow Wee Kheng (CS4243) Camera Models 19 / 38

SIFT Detect local maximum and minimum of D(x,y,σ): Compare a sample point with its 8 neighbors in the same scale and 9 neighbors in the scale above and below. Select it if it is larger or smaller than all neighbors. Obtain position x,y and scale σ of keypoint. Orientation of keypoint can be computed as 1 L(x,y +1) L(x,y 1) θ(x,y) = tan L(x+1,y) L(x 1,y). (19) Gradient magnitude of keypoint can be computed as m(x,y) = (L(x+1,y) L(x 1,y)) 2 +(L(x,y +1) L(x,y 1)) 2. (20) Leow Wee Kheng (CS4243) Camera Models 20 / 38

SIFT Keypoints detected may include edge points. Edge points are not good because different edge points along an edge may look the same. To reject edge points, form the Hessian H for each keypoint [ ] Dxx D H = xy D xy D yy (21) and reject those for which trh 2 > 10. (22) deth Leow Wee Kheng (CS4243) Camera Models 21 / 38

Better Invariance Better Invariance Rotation invariance Estimate dominant orientation of keypoint. Normalize orientation. Affine invariance Fit ellipse to auto-correlation function or Hessian. Apply PCA to determine principal axes. Normalize according to principal axes. For more details, refer to [Sze10] Section 4.1.1. Leow Wee Kheng (CS4243) Camera Models 22 / 38

Feature Descriptors Feature Descriptors Why need feature descriptors? Keypoints give only the positions of strong features. To match them across different images, have to characterize them by extracting feature descriptors. What kind of feature descriptors? Able to match corresponding points across images accurately. Invariant to scale, orientation, or even affine transformation. Invariant to lighting difference. Leow Wee Kheng (CS4243) Camera Models 23 / 38

Feature Descriptors SIFT Descriptors SIFT Descriptors Compute gradient magnitude and orientation in 16 16 region around keypoint location at the keypoint s scale. Coordinates and gradient orientations are measured relative to keypoint orientation to achieve orientation invariance. Weighted by Gaussian window. Collect into 4 4 orientation histograms with 8 orientation bins. Bin value = sum of gradient magnitudes near that orientation. Leow Wee Kheng (CS4243) Camera Models 24 / 38

Feature Descriptors SIFT Descriptors Get 4 4 8 = 128 element feature vector. Normalize feature vector to unit length to reduce effect of linear illumination change. To reduce effect of nonlinear illumination change, threshold feature values to 0.2 and renormalize feature vector to unit length. Leow Wee Kheng (CS4243) Camera Models 25 / 38

Feature Descriptors Other Feature Descriptors Other Feature Descriptors Variants of SIFT: PCA-SIFT [KS04] Use PCA to reduce dimensionality. SURF (Speeded Up Robust Features) [BTVG06] Use box filter to approximate derivatives. GLOH (Gradient Location-Orientation Histogram) [MS05] Use log-polar binning structure. [MS05] found that GLOH performs the best, followed closely by SIFT. Leow Wee Kheng (CS4243) Camera Models 26 / 38

Feature Descriptors Other Feature Descriptors Sample detected SURF keypoints (without non-maximal suppression): (a) (b) (a) Low threshold gives many cluttered keypoints. (b) Higher threshold gives fewer keypoints, but still cluttered. Leow Wee Kheng (CS4243) Camera Models 27 / 38

Feature Descriptors Other Feature Descriptors Sample detected SURF keypoints. With adaptive non-maximal suppression, keypoints are well spread out. (a) (b) (a) Top 100 keypoints. (b) Top 200 keypoints Leow Wee Kheng (CS4243) Camera Models 28 / 38

Feature Matching Feature Matching Measure difference as Euclidean distance between feature vectors: ( ) 1/2 d(u,v) = (u i v i ) 2 (23) i Several possible matching strategies: Return all feature vectors with d smaller than a threshold. Nearest neighbor: feature vector with smallest d. Nearest neighbor distance ratio: NNDR = d 1 d 2 (24) d 1, d 2 : distances to the nearest and 2nd nearest neighbors. If NNDR is small, nearest neighbor is a good match. Leow Wee Kheng (CS4243) Camera Models 29 / 38

Feature Matching Sample matching results: SURF, nearest neighbors with min. distance. Some matches are correct, some are not. Can include other info such as color to improve match accuracy. In general, no perfect matching results. Leow Wee Kheng (CS4243) Camera Models 30 / 38

Feature Matching Feature matching methods can give false matches. Manually select good matches. Or use robust method to remove false matches: True matches are consistent and have small errors. False matches are inconsistent and have large errors. Nearest neighbor search is computationally expensive. Need efficient algorithm, e.g., using k-d Tree. k-d Tree is not more efficient than exhaustive search for large dimensionality, e.g., > 20. Leow Wee Kheng (CS4243) Camera Models 31 / 38

Summary Summary Harris corner detector and Tomasi s algorithm find corner points. SIFT keypoint: invariant to scale. SIFT descriptors: invariant to scale, orientation, illumination change. Variants of SIFT: PCA-SIFT, SURF, GLOH. Leow Wee Kheng (CS4243) Camera Models 32 / 38

Summary Software Available SIFT code is available in Lowe s web site: www.cs.ubc.ca/ lowe/keypoints Available in OpenCV 2.1: Corner detectors: Harris corner, Tomasi s good feature. Subpixel corner location. Feature descriptors: SURF, StarDetector. New in OpenCV 2.2: Feature descriptors: FAST, BRIEF. High-level tools for image matching. SciPy supports k-d Tree for nearest neighbor search. Fast nearest neighbor search library: mloss.org/software/view/143/ Approximate nearest neighbor search library: www.cs.umd.edu/ mount/ann/ Leow Wee Kheng (CS4243) Camera Models 33 / 38

Exercise Exercise (1) Derive the auto-correlation matrix A given in Eq. 9. Leow Wee Kheng (CS4243) Camera Models 34 / 38

Further Reading Further Reading Subpixel location of corner: [BK08] p. 319 321. Orientation and affine invariance: [Sze10] Section 4.1.1. SIFT: [Low04] SURF: [BTVG06] GLOH: [MS05] Adaptive non-maximal suppression: [Sze10] Section 4.1.1, [BSW05]. Leow Wee Kheng (CS4243) Camera Models 35 / 38

Reference Reference I Bradski and Kaehler. Learning OpenCV: Computer Vision with the OpenCV Library. O Reilly, 2008. M. Brown, R. Szeliski, and S. Winder. Multi-image matching using multi-scale oriented patches. In Proc. CVPR, pages 510 517, 2005. H. Bay, T. Tuytelaars, and L. Van Gool. SURF: Speeded up robust features. In Proc. ECCV, pages 404 417, 2006. C. Harris and M. J. Stephens. A combined corner and edge detector. In Alvey Vision Conference, pages 147 152, 1988. Leow Wee Kheng (CS4243) Camera Models 36 / 38

Reference Reference II Y. Ke and R. Sukthankar. PCA-SIFT: a more distinctive representation for local image descriptors. In Proc. CVPR, pages 506 513, 2004. D. G. Lowe. Distinctive image features from scale-invariant keypoints. Int. J. Computer Vision, 60:91 110, 2004. K. Mikolajczyk and C. Schmid. A performance evaluation of local descriptors. IEEE Trans. on PAMI, 27(10):1615 1630, 2005. Leow Wee Kheng (CS4243) Camera Models 37 / 38

Reference Reference III J. Shi and C. Tomasi. Good features to track. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pages 593 600, 1994. http://citeseer.nj.nec.com/shi94good.html, http://vision.stanford.edu/public/publication/. R. Szeliski. Computer Vision: Algorithms and Applications. Springer, 2010. Leow Wee Kheng (CS4243) Camera Models 38 / 38