Feature-based object recognition Prof. Noah Snavely CS1114

Slides:



Advertisements
Similar presentations
Feature extraction: Corners
Advertisements

Presented by Xinyu Chang
CSE 473/573 Computer Vision and Image Processing (CVIP)
TP14 - Local features: detection and description Computer Vision, FCUP, 2014 Miguel Coimbra Slides by Prof. Kristen Grauman.
Object Recognition using Invariant Local Features Applications l Mobile robots, driver assistance l Cell phone location or object recognition l Panoramas,
Image alignment Image from
Instructor: Mircea Nicolescu Lecture 13 CS 485 / 685 Computer Vision.
IBBT – Ugent – Telin – IPI Dimitri Van Cauwelaert A study of the 2D - SIFT algorithm Dimitri Van Cauwelaert.
Object Recognition with Invariant Features n Definition: Identify objects or scenes and determine their pose and model parameters n Applications l Industrial.
Fast High-Dimensional Feature Matching for Object Recognition David Lowe Computer Science Department University of British Columbia.
Robust and large-scale alignment Image from
Patch Descriptors CSE P 576 Larry Zitnick
CS4670: Computer Vision Kavita Bala Lecture 10: Feature Matching and Transforms.
Feature extraction: Corners 9300 Harris Corners Pkwy, Charlotte, NC.
Lecture 6: Feature matching CS4670: Computer Vision Noah Snavely.
Affine Linear Transformations Prof. Graeme Bailey (notes modified from Noah Snavely, Spring 2009)
Object Recognition with Invariant Features n Definition: Identify objects or scenes and determine their pose and model parameters n Applications l Industrial.
Lecture 4: Feature matching
Automatic Image Alignment (feature-based) : Computational Photography Alexei Efros, CMU, Fall 2005 with a lot of slides stolen from Steve Seitz and.
Feature extraction: Corners and blobs
Distinctive image features from scale-invariant keypoints. David G. Lowe, Int. Journal of Computer Vision, 60, 2 (2004), pp Presented by: Shalomi.
Object Recognition Using Distinctive Image Feature From Scale-Invariant Key point D. Lowe, IJCV 2004 Presenting – Anat Kaspi.
Detecting Patterns So far Specific patterns (eyes) Generally useful patterns (edges) Also (new) “Interesting” distinctive patterns ( No specific pattern:
Lecture 3a: Feature detection and matching CS6670: Computer Vision Noah Snavely.
Automatic Image Alignment (feature-based) : Computational Photography Alexei Efros, CMU, Fall 2006 with a lot of slides stolen from Steve Seitz and.
Lecture 10: Robust fitting CS4670: Computer Vision Noah Snavely.
Sebastian Thrun CS223B Computer Vision, Winter Stanford CS223B Computer Vision, Winter 2005 Lecture 3 Advanced Features Sebastian Thrun, Stanford.
Lecture 6: Feature matching and alignment CS4670: Computer Vision Noah Snavely.
Computing transformations Prof. Noah Snavely CS1114
Robust fitting Prof. Noah Snavely CS1114
Distinctive Image Features from Scale-Invariant Keypoints By David G. Lowe, University of British Columbia Presented by: Tim Havinga, Joël van Neerbos.
Computer vision.
Final Exam Review CS485/685 Computer Vision Prof. Bebis.
Object Tracking/Recognition using Invariant Local Features Applications l Mobile robots, driver assistance l Cell phone location or object recognition.
Lecture 4: Feature matching CS4670 / 5670: Computer Vision Noah Snavely.
Feature extraction: Corners 9300 Harris Corners Pkwy, Charlotte, NC.
776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2013.
Lecture 7: Features Part 2 CS4670/5670: Computer Vision Noah Snavely.
Lecture 8: Feature matching CS6670: Computer Vision Noah Snavely.
Fitting image transformations Prof. Noah Snavely CS1114
Project 3 questions? Interest Points and Instance Recognition Computer Vision CS 143, Brown James Hays 10/21/11 Many slides from Kristen Grauman and.
Lecture 5: Image Interpolation and Features
Local features: detection and description
Distinctive Image Features from Scale-Invariant Keypoints
776 Computer Vision Jan-Michael Frahm Spring 2012.
Image matching by Diva SianDiva Sian by swashfordswashford TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAA.
Announcements Project 1 Out today Help session at the end of class.
Optimization and least squares Prof. Noah Snavely CS1114
Lecture 14: Feature matching and Transforms CS4670/5670: Computer Vision Kavita Bala.
Blob detection.
Invariant Local Features Image content is transformed into local feature coordinates that are invariant to translation, rotation, scale, and other imaging.
SIFT.
Lecture 5: Feature detection and matching CS4670 / 5670: Computer Vision Noah Snavely.
Recognizing objects Prof. Noah Snavely CS1114
776 Computer Vision Jan-Michael Frahm Spring 2012.
SIFT Scale-Invariant Feature Transform David Lowe
Lecture 07 13/12/2011 Shai Avidan הבהרה: החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
Image Features: Points and Regions
TP12 - Local features: detection and description
Lecture 4: Harris corner detection
Local features: detection and description May 11th, 2017
Feature description and matching
Features Readings All is Vanity, by C. Allan Gilbert,
Object recognition Prof. Graeme Bailey
Announcements Project 1 Project 2 (panoramas)
Lecture 5: Feature detection and matching
Announcement Project 1 1.
Feature descriptors and matching
Presented by Xu Miao April 20, 2005
Lecture 11: Image alignment, Part 2
Presentation transcript:

Feature-based object recognition Prof. Noah Snavely CS1114

Administrivia  Assignment 4 due tomorrow, A5 will be out tomorrow, due in two parts  Quiz 4 next Tuesday, 3/31  Prelim 2 in two weeks, 4/7 (in class) –Covers everything since Prelim 1 –There will be a review session next Thursday or the following Monday (TBA) 2

Invariant local features  Find features that are invariant to transformations –geometric invariance: translation, rotation, scale –photometric invariance: brightness, exposure, … Feature Descriptors (Slides courtesy Steve Seitz)

Why local features?  Locality –features are local, so robust to occlusion and clutter  Distinctiveness: –can differentiate a large database of objects  Quantity –hundreds or thousands in a single image  Efficiency –real-time performance achievable 4

More motivation…  Feature points are used for: –Image alignment (e.g., mosaics) –3D reconstruction –Motion tracking –Object recognition –Robot navigation –…

SIFT Features  Scale-Invariant Feature Transform

SIFT descriptor  Very complicated, but very powerful  (The details aren’t all that important for this class.)  128 dimensional descriptor Adapted from a slide by David Lowe

Properties of SIFT  Extraordinarily robust matching technique –Can handle significant changes in illumination Sometimes even day vs. night (below) –Fast and efficient—can run in real time –Lots of code available

Do these two images overlap? NASA Mars Rover images

Answer below

Sony Aibo SIFT usage: Recognize charging station Communicate with visual cards Teach object recognition

SIFT demo 12

How do we do this?  Object matching in three steps: 1.Detect features in the template and search images 2.Match features: find “similar-looking” features in the two images 3.Find a transformation T that explains the movement of the matched features 13

Step 1: Detecting SIFT features  SIFT gives us a set of feature frames and descriptors for an image 14 img = imread(‘futurama.png’); [frames, descs] = sift(img);

15 sift Step 1: Detecting SIFT features

16 img = imread(‘futurama.png’); [frames, descs] = sift(img); % frames has a column for each % feature: [ x ; y ; scale ; orient ] % % descs also has a column for each % feature: 128-dimensional % vector describing the local % appearance of the feature Step 1: Detecting SIFT features

(The number of features will very likely be different). 17 sift Step 1: Detecting SIFT features

Step 2: Matching SIFT features  How do we find matching features? 18 ? ?

Step 2: Matching SIFT features  Answer: for each feature in image 1, find the feature with the closest descriptor in image 2  Called nearest neighbor matching 19

Simple matching algorithm [frames1, descs1] = sift(img1); [frames2, descs2] = sift(img2); nF1 = length(frames1); nF2 = length(frames2); for i = 1:nF1 minDist = Inf; minIndex = -1; for j = 1:nF2 diff = descs1(i,:) – descs2(j,:); dist = diff * diff’; if dist < minDist minDist = dist; minIndex = j; end fprintf(‘closest feature to %d is %d\n’, i, minIndex); end 20

What problems can come up?  Not all features in image 1 are present in image 2 –Some features aren’t visible –Some features weren’t detected  We might get lots of incorrect matches  Slightly better version: –If the closest match is still too far away, throw the match away 21

Matching algorithm, Take 2 nF1 = length(frames1); nF2 = length(frames2); for i = 1:nF1 minDist = inf; minIndex = -1; for j = 1:nF2 diff = descs1(i,:) – descs2(j,:); dist = diff * diff’; if dist < minDist minDist = dist; minIndex = j; end if minDist < threshold fprintf(‘closest feature to %d is %d\n’, i, minIndex); end 22

Matching SIFT features 23

Matching SIFT features  Output of the matching step: Pairs of matching points [ x 1 y 1 ]  [ x 1 ’ y 1 ’ ] [ x 2 y 2 ]  [ x 2 ’ y 2 ’ ] [ x 3 y 3 ]  [ x 3 ’ y 3 ’ ] … [ x k y k ]  [ x k ’ y k ’ ] 24

Step 3: Find the transformation  How do we draw a box around the template image in the search image?  Key idea: there is a transformation that maps template  search image! 25

 Refresher: earlier, we learned about 2D linear transformations 26 Image transformations

 Examples: 27 scale rotation

Image transformations  To handle translations, we added a third coordinate (always 1) (x, y)  (x, y, 1)  “Homogeneous” 2D points 28

Image transformations  Example: 29 translation

Image transformations  What about a general homogeneous transformation?  Called a 2D affine transformation 30

Solving for image transformations  Given a set of matching points between image 1 and image 2… … can we solve for an affine transformation T mapping 1 to 2? 31

Solving for image transformations  T maps points in image 1 to the corresponding point in image 2 32 (1,1,1)

How do we find T ?  We already have a bunch of point matches [ x 1 y 1 ]  [ x 1 ’ y 1 ’ ] [ x 2 y 2 ]  [ x 2 ’ y 2 ’ ] [ x 3 y 3 ]  [ x 3 ’ y 3 ’ ] … [ x k y k ]  [ x k ’ y k ’ ]  Solution: Find the T that best agrees with these known matches  This problem is called (linear) regression 33

An Algorithm: Take 1 1.To find T, randomly guess a, b, c, d, e, f, check how well T matches the data 2.If it matches well, return T 3.Otherwise, go to step 1 Q: What does this remind you of? There are much better ways to solve linear regression problems 34

Linear regression  Simplest case: fitting a line 35

Linear regression  Even simpler case: just 2 points 36

Linear regression  Even simpler case: just 2 points  Want to find a line y = mx + b  x 1  y 1, x 2  y 2  This forms a linear system: y 1 = mx 1 + b y 2 = mx 2 + b  x’s, y’s are knowns  m, b are unknown  Very easy to solve 37

Multi-variable linear regression  What about 2D affine transformations? –maps a 2D point to another 2D point  We have a set of matches [ x 1 y 1 ]  [ x 1 ’ y 1 ’ ] [ x 2 y 2 ]  [ x 2 ’ y 2 ’ ] [ x 3 y 3 ]  [ x 3 ’ y 3 ’ ] … [ x 4 y 4 ]  [ x 4 ’ y 4 ’ ] 38

 Consider just one match [ x 1 y 1 ]  [ x 1 ’ y 1 ’ ] ax 1 + by 1 + c = x 1 ’ dx 1 + ey 1 + f = y 1 ’  How many equations, how many unknowns? 39 Multi-variable linear regression

Finding an affine transform  Need 3 matches  6 equations  This is just a bigger linear system, still (relatively) easy to solve  Really just two linear systems with 3 equations each (one for a,b,c, the other for d,e,f) 40