CS 376b Introduction to Computer Vision 04 / 28 / 2008 Instructor: Michael Eckmann.

Slides:



Advertisements
Similar presentations
Matching in 2D Readings: Ch. 11: Sec alignment point representations and 2D transformations solving for 2D transformations from point correspondences.
Advertisements

CS 376b Introduction to Computer Vision 04 / 21 / 2008 Instructor: Michael Eckmann.
Mapping: Scaling Rotation Translation Warp
CS 102 Computers In Context (Multimedia)‏ 04 / 20 / 2009 Instructor: Michael Eckmann.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
CS 376 Introduction to Computer Graphics 02 / 07 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 24 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 09 / 2007 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 04 / 11 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 04 / 16 / 2008 Instructor: Michael Eckmann.
2D/3D Geometric Transformations CS485/685 Computer Vision Dr. George Bebis.
CS 376b Introduction to Computer Vision 03 / 26 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 04 / 04 / 2008 Instructor: Michael Eckmann.
CS485/685 Computer Vision Prof. George Bebis
CS 376b Introduction to Computer Vision 02 / 27 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 11 / 17 / 2008 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 26 / 2007 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 02 / 25 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 04 / 01 / 2008 Instructor: Michael Eckmann.
Object Recognition Using Geometric Hashing
CS 376b Introduction to Computer Vision 04 / 14 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 04 / 09 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 11 / 12 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 04 / 15 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 03 / 04 / 2008 Instructor: Michael Eckmann.
MSU CSE 803 Fall 2008 Stockman1 CV: 3D sensing and calibration Coordinate system changes; perspective transformation; Stereo and structured light.
CS 376b Introduction to Computer Vision 03 / 04 / 2008 Instructor: Michael Eckmann.
MSU CSE 803 Stockman CV: Matching in 2D Matching 2D images to 2D images; Matching 2D images to 2D maps or 2D models; Matching 2D maps to 2D maps.
CS 206 Introduction to Computer Science II 04 / 06 / 2009 Instructor: Michael Eckmann.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm Lecture #15.
1 Fingerprint Classification sections Fingerprint matching using transformation parameter clustering R. Germain et al, IEEE And Fingerprint Identification.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 04 / 02 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 04 / 29 / 2008 Instructor: Michael Eckmann.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Transformations of Objects – 2D Part I.
Transformations Jehee Lee Seoul National University.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 17 / 2010 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 02 / 22 / 2008 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 03 / 21 / 2008 Instructor: Michael Eckmann.
Spatial Modeling – some fundamentals for Robot Kinematics ME 3230.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
CS 376 Introduction to Computer Graphics 02 / 23 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 26 / 2010 Instructor: Michael Eckmann.
Geometric Hashing: A General and Efficient Model-Based Recognition Scheme Yehezkel Lamdan and Haim J. Wolfson ICCV 1988 Presented by Budi Purnomo Nov 23rd.
CS 376b Introduction to Computer Vision 03 / 18 / 2008 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 03 / 2010 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 03 / 02 / 2007 Instructor: Michael Eckmann.
Lecture 5: Introduction to 3D
CS 376b Introduction to Computer Vision 03 / 31 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 03 / 17 / 2008 Instructor: Michael Eckmann.
776 Computer Vision Jan-Michael Frahm Spring 2012.
Instructor: Mircea Nicolescu Lecture 9
CS 206 Introduction to Computer Science II 04 / 08 / 2009 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 04 / 07 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
Nearest-neighbor matching to feature database
FP1 Matrices Transformations
Nearest-neighbor matching to feature database
Application: Geometric Hashing
Geometric Hashing: An Overview
CV: Matching in 2D Matching 2D images to 2D images; Matching 2D images to 2D maps or 2D models; Matching 2D maps to 2D maps MSU CSE 803 Stockman.
Presentation transcript:

CS 376b Introduction to Computer Vision 04 / 28 / 2008 Instructor: Michael Eckmann

Michael Eckmann - Skidmore College - CS 376b - Spring 2008 Today’s Topics Comments/Questions Chapter 11 – 2D matching –2D transformations shear reflection –General Affine –matching in 2d (models to images)‏ several methods

Michael Eckmann - Skidmore College - CS Spring 2007 Geometric Transformations (2D)‏ Translations Rotations Scaling Homogeneous Coordinates Shearing Reflections

Michael Eckmann - Skidmore College - CS Spring 2007 Homogeneous Coordinates Transformations on homogeneous coordinates TRANSLATION: (x 2, y 2 ) = (x 1 + t x, y 1 + t y )‏ ( x 2 ) = ( 1 0 t x ) ( x 1 )‏ ( y 2 ) ( 0 1 t y ) ( y 1 )‏ ( 1 ) ( ) ( 1 )‏ SCALING: (x 2, y 2 ) = (s x x 1, s y y 1 )‏ ( x 2 ) = ( s x 0 0 ) ( x 1 ) ( y 2 ) ( 0 s y 0 ) ( y 1 )‏ ( 1 ) ( ) ( 1 )‏

Michael Eckmann - Skidmore College - CS Spring 2007 Homogeneous Coordinates Transformations on homogeneous coordinates ROTATION: (x 2, y 2 ) = (x 1 cos(B) – y 1 sin(B), y 1 cos(B) + x 1 sin(B) )‏ ( x 2 ) = (cos(B) – sin(B) 0 ) ( x 1 )‏ ( y 2 ) (sin(B) cos(B) 0 ) ( y 1 )‏ ( 1 ) ( ) ( 1 )‏ These three transform matrices are sometimes written as –T(t x,t y )‏ –S(s x,s y )‏ –R(B)‏

Michael Eckmann - Skidmore College - CS Spring 2007 from Shapiro and Stockman fig. 11.8

Michael Eckmann - Skidmore College - CS Spring 2007 from Shapiro and Stockman fig & table 11.1

Michael Eckmann - Skidmore College - CS Spring 2007 from Shapiro and Stockman fig & table 11.2

Michael Eckmann - Skidmore College - CS Spring 2007 using control points to determine transformation For this example, the book assumes that the scaling is already taken care of due to some controlled imaging environment, so we only need to compute the rotation and translation which is a matrix of the form: ( u 1 ) = (cos(B) – sin(B) u 0 ) ( x 1 )‏ ( v 1 ) (sin(B) cos(B) v 0 ) ( y 1 )‏ ( 1 ) ( ) ( 1 )‏ Given the matches we already have, we can take a pair of matches and compute the angle to rotate like so. Assume ( u 1, v 1 ) and ( x 1, y 1 ) match and ( u 2, v 2 ) and ( x 2, y 2 ) match, we can compute the angle of the vector ( u 2, v 2 ) - ( u 1, v 1 ) and the angle of the vector ( x 2, y 2 ) - ( x 1, y 1 ) and subtract them to get the angle B.

Michael Eckmann - Skidmore College - CS Spring 2007 using control points to determine transformation Given the matches we already have, we can take a pair of matches and compute the angle to rotate like so. Assume ( u 1, v 1 ) and ( x 1, y 1 ) match and ( u 2, v 2 ) and ( x 2, y 2 ) match, we can compute the angle of the vector ( u 2, v 2 ) - ( u 1, v 1 ) and the angle of the vector ( x 2, y 2 ) - ( x 1, y 1 ) and subtract them to get the angle B. Let's do this for this pair of matches: –(8,17) matches (10,12) and –(16,26) matches (10,24) –a1 = arctan((26-17)/(16-8)) = radians –a2 = arctan((24-12)/(10-10)) = radians –B = a2-a1 = radians

Michael Eckmann - Skidmore College - CS Spring 2007 using control points to determine transformation Now that we know B, how many pairs of matches are necessary to determine this transform: ( u 1 ) = (cos(B) – sin(B) u 0 ) ( x 1 )‏ ( v 1 ) (sin(B) cos(B) v 0 ) ( y 1 )‏ ( 1 ) ( ) ( 1 )‏

Michael Eckmann - Skidmore College - CS Spring 2007 using control points to determine transformation Now that we know B, how many pairs of matches are necessary to determine this transform: ( u 1 ) = (cos(B) – sin(B) u 0 ) ( x 1 )‏ ( v 1 ) (sin(B) cos(B) v 0 ) ( y 1 )‏ ( 1 ) ( ) ( 1 )‏ Just need to use 1 pair of matching points (2 equations and 2 unknowns) to determine the translation in u and v.

Michael Eckmann - Skidmore College - CS Spring 2007 Shearing Y shear: (1 0 0)‏ (sh y 1 0)‏ (0 0 1)‏ X shear: (1 sh x 0)‏ (0 1 0)‏ (0 0 1)‏ Examples of what these do on the board to a rectangle.

Michael Eckmann - Skidmore College - CS Spring 2007 Reflections About the y-axis: (-1 0 0)‏ (0 1 0)‏ (0 0 1)‏ About the x-axis: (1 0 0)‏ (0 -1 0)‏ (0 0 1)‏ About the z-axis: (-1 0 0)‏ (0 -1 0)‏ (0 0 1)‏ Examples of what these do on the board. About the line y=x: (0 1 0)‏ (1 0 0)‏ (0 0 1)‏ About the line y=-x: (0 -1 0)‏ (-1 0 0)‏ (0 0 1)‏

Michael Eckmann - Skidmore College - CS Spring 2007 General Affine Transformations A general affine transformation allows any combination of translation, rotation, scaling, shearing and reflection. The general form of an affine transformation matrix is therefore: (a 11 a 12 a 13 )‏ (a 21 a 22 a 23 )‏ (0 0 1 )‏ How many pairs of matching points would it take to determine a general affine transformation?

Michael Eckmann - Skidmore College - CS Spring 2007 General Affine Transformations We have 6 unknowns, so we need 6 equations (or more) which can be generated from 3 matching pairs of points. How does that give us 6 equations? Since there may be some error in the matches or coordinates, a better way to determine the transform would be to use a least squares approach (again if your error is Gaussian with mean=0). Similarly to how we computed a least squares error equation for lines, we can do: error(a 11, a 12, a 13, a 21, a 22, a 23 ) = Sum((a 11 x j + a 12 y j + a 13 - u j ) 2 + (a 21 x j + a 22 y j + a 23 - v j ) 2 )‏

Michael Eckmann - Skidmore College - CS Spring 2007 General Affine Transformations (equations from Shapiro and Stockman)‏

Michael Eckmann - Skidmore College - CS Spring D object recognition via affine mapping Our text describes 3 techniques to determine an affine transformation from a model to an image. Local Feature Focus method Pose Clustering Geometric Hashing

Michael Eckmann - Skidmore College - CS Spring 2007 Local Feature Focus method This is a process to determine if an object model appears in an image and if so, what is the general affine transform between the model and the image. The model has a set of focus features, which are major features that should be able to be found in an image of this object easily (as long as they are not occluded). The model also has a set of nearby features for each focus feature to allow verification of a correct focus feature match and to help determine position and orientation. See figure

Michael Eckmann - Skidmore College - CS Spring 2007 Pose Clustering This is another process to determine if an object model appears in an image and if so, what is the general affine transform between the model and the image. The model has a set of features and the image has a set of features. These need to be matched. The general idea of pose clustering is to take every possible pair of matching points and compute an RST transform then check for clusters of RST transforms. To get less redundancy and more accuracy, instead of doing every possible pair we can –filter our features by type, where a certain type of feature will only match a feature of the same type (ex. fig )‏

Michael Eckmann - Skidmore College - CS Spring 2007 Pose Clustering To get less redundancy and more accuracy, instead of doing every possible pair we can –filter our features by type, where a certain type of feature will only match a feature of the same type –then only use pairs of matching points that satisfy the above Compute the RST transforms as before but now for a smaller set of matching pairs. For each RST transform with specific computed parameters, count the number of other RST transforms that are within some distance of the transform parameters. There are n-1 distance computations for each of n parameter sets of RST transforms. Or can use binning (like Hough) --- this will be faster but bins need to be chosen well to capture similar parameter sets in the same bin.

Michael Eckmann - Skidmore College - CS Spring 2007 Geometric Hashing The last two procedures allowed us to determine if a particular model object was found in an image. What if we had many models that we wanted to check against our images? If use pose clustering or local feature focus method, then each model would have to be checked separately to determine if it's in the image. Geometric hashing allows us to check among a large database of models to determine if any of them are in the image.

Michael Eckmann - Skidmore College - CS Spring 2007 Geometric Hashing It requires a large amount of offline preprocessing of the models as well as a fair amount of space. But this allows for fairly fast online recognition in the average case. Given: large database of models described by feature points in some 2d coordinate system and an image with features extracted from it. Assuming affine transformations only, we want to know which model(s) are in the image and what position and orientation the models are in in the image.

Michael Eckmann - Skidmore College - CS Spring 2007 Geometric Hashing Each model M is stored as an ordered set of feature points. Any 3 non-collinear points E = (A, B, C) form a basis for an affine coordinate system. D = xi(B-A) + eta(C-A) + A Any point D in M can be represented as (xi,eta) pairs w.r.t. the basis E. These (xi,eta) pairs are the affine coordinates of the point D. If we apply an affine transformation to the points in M, (xi,eta) will be the same for each point in M, given the same basis E.

Michael Eckmann - Skidmore College - CS Spring 2007 Geometric Hashing A hash table is created, indexed on (xi,eta), and stores a list of all the M,E pairs where some D in M has (xi,eta) affine coordinates w.r.t. E. The online recognition step uses the hash table above and an Accumulator array indexed on M,E pairs.