Presentation is loading. Please wait.

Presentation is loading. Please wait.

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Computer Vision – Lecture 17 Structure-from-Motion 21.01.2009 Bastian Leibe RWTH Aachen.

Similar presentations


Presentation on theme: "Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Computer Vision – Lecture 17 Structure-from-Motion 21.01.2009 Bastian Leibe RWTH Aachen."— Presentation transcript:

1 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Computer Vision – Lecture 17 Structure-from-Motion 21.01.2009 Bastian Leibe RWTH Aachen http://www.umic.rwth-aachen.de/multimedia leibe@umic.rwth-aachen.de TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A AA A A A A Many slides adapted from Svetlana Lazebnik, Martial Hebert, Steve Seitz

2 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Course Outline Image Processing Basics Segmentation & Grouping Object Recognition Local Features & Matching Object Categorization 3D Reconstruction  Epipolar Geometry and Stereo Basics  Camera calibration & Uncalibrated Reconstruction  Structure-from-Motion Motion and Tracking 2

3 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: A General Point Equations of the form How do we solve them? (always!)  Apply SVD  Singular values of A = square roots of the eigenvalues of A T A.  The solution of Ax=0 is the nullspace vector of A.  This corresponds to the smallest singular vector of A. 3 SVD Singular valuesSingular vectors B. Leibe

4 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Properties of SVD Frobenius norm  Generalization of the Euclidean norm to matrices Partial reconstruction property of SVD  Let  i i=1,…,N be the singular values of A.  Let A p = U p D p V p T be the reconstruction of A when we set  p+1,…,  N to zero.  Then A p = U p D p V p T is the best rank-p approximation of A in the sense of the Frobenius norm (i.e. the best least-squares approximation). 4 B. Leibe

5 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Camera Parameters Intrinsic parameters  Principal point coordinates  Focal length  Pixel magnification factors  Skew (non-rectangular pixels)  Radial distortion Extrinsic parameters  Rotation R  Translation t (both relative to world coordinate system) Camera projection matrix  General pinhole camera: 9 DoF  CCD Camera with square pixels: 10 DoF  General camera: 11 DoF 5 B. Leibe ss

6 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Calibrating a Camera Goal Compute intrinsic and extrinsic parameters using observed camera data. Main idea Place “calibration object” with known geometry in the scene Get correspondences Solve for mapping from scene to image: estimate P=P int P ext 6 B. Leibe Slide credit: Kristen Grauman XiXi xixi

7 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Camera Calibration (DLT Algorithm) P has 11 degrees of freedom. Two linearly independent equations per independent 2D/3D correspondence. Solve with SVD (similar to homography estimation)  Solution corresponds to smallest singular vector. 5 ½ correspondences needed for a minimal solution. 7 B. Leibe Slide adapted from Svetlana Lazebnik Solve with …?

8 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Two independent equations each in terms of three unknown entries of X. Stack equations and solve with SVD. This approach nicely generalizes to multiple cameras. Recap: Triangulation – Linear Algebraic Approach 8 B. Leibe Slide credit: Svetlana Lazebnik O1O1 O2O2 x1x1 x2x2 X? R1R1 R2R2 Stack equations and solve with …?

9 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Epipolar Geometry – Calibrated Case 9 B. Leibe X xx’ Camera matrix: [I|0] X = (u, v, w, 1) T x = (u, v, w) T Camera matrix: [R T | –R T t] Vector x’ in second coord. system has coordinates Rx’ in the first one. t The vectors x, t, and Rx’ are coplanar R Slide credit: Svetlana Lazebnik

10 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Epipolar Geometry – Calibrated Case 10 B. Leibe X xx’ Slide credit: Svetlana Lazebnik Essential Matrix (Longuet-Higgins, 1981)

11 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Epipolar Geometry – Uncalibrated Case The calibration matrices K and K’ of the two cameras are unknown We can write the epipolar constraint in terms of unknown normalized coordinates: 11 B. Leibe X xx’ Slide credit: Svetlana Lazebnik

12 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Epipolar Geometry – Uncalibrated Case 12 B. Leibe X xx’ Slide credit: Svetlana Lazebnik Fundamental Matrix (Faugeras and Luong, 1992)

13 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Problem: poor numerical conditioning Recap: The Eight-Point Algorithm 13 B. Leibe x = (u, v, 1) T, x’ = (u’, v’, 1) T Minimize: under the constraint |F| 2 = 1 Slide credit: Svetlana Lazebnik

14 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Normalized Eight-Point Algorithm 1. Center the image data at the origin, and scale it so the mean squared distance between the origin and the data points is 2 pixels. 2. Use the eight-point algorithm to compute F from the normalized points. 3. Enforce the rank-2 constraint using SVD. 4. Transform fundamental matrix back to original units: if T and T’ are the normalizing transformations in the two images, than the fundamental matrix in original coordinates is T T F T’. 14 B. Leibe [Hartley, 1995] Slide credit: Svetlana Lazebnik SVD Set d 33 to zero and reconstruct F

15 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Comparison of Estimation Algorithms 15 B. Leibe 8-pointNormalized 8-pointNonlinear least squares Av. Dist. 12.33 pixels0.92 pixel0.86 pixel Av. Dist. 22.18 pixels0.85 pixel0.80 pixel Slide credit: Svetlana Lazebnik

16 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Epipolar Transfer Assume the epipolar geometry is known Given projections of the same point in two images, how can we compute the projection of that point in a third image? 16 B. Leibe x1x1 x2x2 x3x3 l 32 l 31 l 31 = F T 13 x 1 l 32 = F T 23 x 2 Slide credit: Svetlana Lazebnik

17 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Recap: Active Stereo with Structured Light Optical triangulation  Project a single stripe of laser light  Scan it across the surface of the object  This is a very precise version of structured light scanning 17 B. Leibe Digital Michelangelo Project http://graphics.stanford.edu/projects/mich/ Slide credit: Steve Seitz

18 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Topics of This Lecture Structure from Motion (SfM)  Motivation  Ambiguity Affine SfM  Affine cameras  Affine factorization  Euclidean upgrade  Dealing with missing data Projective SfM  Two-camera case  Projective factorization  Bundle adjustment  Practical considerations Applications 18 B. Leibe

19 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Structure from Motion Given: m images of n fixed 3D points x ij = P i X j, i = 1, …, m, j = 1, …, n Problem: estimate m projection matrices P i and n 3D points X j from the mn correspondences x ij 19 x1jx1j x2jx2j x3jx3j XjXj P1P1 P2P2 P3P3 B. Leibe Slide credit: Svetlana Lazebnik

20 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 What Can We Use This For? 20 B. Leibe E.g. movie special effects Video Video Credit: Stefan Hafeneger

21 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Structure from Motion Ambiguity If we scale the entire scene by some factor k and, at the same time, scale the camera matrices by the factor of 1/k, the projections of the scene points in the image remain exactly the same:  It is impossible to recover the absolute scale of the scene! 21 B. Leibe Slide credit: Svetlana Lazebnik

22 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Structure from Motion Ambiguity If we scale the entire scene by some factor k and, at the same time, scale the camera matrices by the factor of 1/k, the projections of the scene points in the image remain exactly the same. More generally: if we transform the scene using a transformation Q and apply the inverse transformation to the camera matrices, then the images do not change 22 B. Leibe Slide credit: Svetlana Lazebnik

23 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Reconstruction Ambiguity: Similarity 23 B. Leibe Slide credit: Svetlana Lazebnik Images from Hartley & Zisserman

24 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Reconstruction Ambiguity: Affine 24 B. Leibe Slide credit: Svetlana Lazebnik Images from Hartley & Zisserman

25 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Reconstruction Ambiguity: Projective 25 B. Leibe Slide credit: Svetlana Lazebnik Images from Hartley & Zisserman

26 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Projective Ambiguity 26 B. Leibe Slide credit: Svetlana Lazebnik Images from Hartley & Zisserman

27 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 From Projective to Affine 27 B. Leibe Slide credit: Svetlana Lazebnik Images from Hartley & Zisserman

28 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 From Affine to Similarity 28 B. Leibe Slide credit: Svetlana Lazebnik Images from Hartley & Zisserman

29 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Hierarchy of 3D Transformations With no constraints on the camera calibration matrix or on the scene, we get a projective reconstruction. Need additional information to upgrade the reconstruction to affine, similarity, or Euclidean. 29 B. Leibe Projective 15dof Affine 12dof Similarity 7dof Euclidean 6dof Preserves intersection and tangency Preserves parallellism, volume ratios Preserves angles, ratios of length Preserves angles, lengths Slide credit: Svetlana Lazebnik

30 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Topics of This Lecture Structure from Motion (SfM)  Motivation  Ambiguity Affine SfM  Affine cameras  Affine factorization  Euclidean upgrade  Dealing with missing data Projective SfM  Two-camera case  Projective factorization  Bundle adjustment  Practical considerations Applications 30 B. Leibe

31 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Structure from Motion Let’s start with affine cameras (the math is easier) 31 B. Leibe center at infinity Slide credit: Svetlana Lazebnik Images from Hartley & Zisserman

32 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Orthographic Projection Special case of perspective projection  Distance from center of projection to image plane is infinite  Projection matrix: 32 B. Leibe Slide credit: Steve Seitz Image World

33 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Affine Cameras 33 B. Leibe Orthographic Projection Parallel Projection Slide credit: Svetlana Lazebnik

34 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Affine Cameras A general affine camera combines the effects of an affine transformation of the 3D space, orthographic projection, and an affine transformation of the image: Affine projection is a linear mapping + translation in inhomogeneous coordinates 34 B. Leibe x X a1a1 a2a2 Projection of world origin Slide credit: Svetlana Lazebnik

35 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Affine Structure from Motion Given: m images of n fixed 3D points: x ij = A i X j + b i, i = 1,…, m, j = 1, …, n Problem: use the mn correspondences x ij to estimate m projection matrices A i and translation vectors b i, and n points X j The reconstruction is defined up to an arbitrary affine transformation Q (12 degrees of freedom): We have 2mn knowns and 8m + 3n unknowns (minus 12 dof for affine ambiguity).  Thus, we must have 2mn >= 8m + 3n – 12.  For two views, we need four point correspondences. 35 B. Leibe Slide credit: Svetlana Lazebnik

36 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Affine Structure from Motion Centering: subtract the centroid of the image points For simplicity, assume that the origin of the world coordinate system is at the centroid of the 3D points. After centering, each normalized point x ij is related to the 3D point X i by 36 B. Leibe Slide credit: Svetlana Lazebnik

37 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Affine Structure from Motion Let’s create a 2m × n data (measurement) matrix: 37 B. Leibe Cameras (2 m) Points (n) C. Tomasi and T. Kanade. Shape and motion from image streams under orthography: A factorization method. IJCV, 9(2):137-154, November 1992.Shape and motion from image streams under orthography: A factorization method. Slide credit: Svetlana Lazebnik

38 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Affine Structure from Motion Let’s create a 2m × n data (measurement) matrix: The measurement matrix D = MS must have rank 3! 38 B. Leibe C. Tomasi and T. Kanade. Shape and motion from image streams under orthography: A factorization method. IJCV, 9(2):137-154, November 1992.Shape and motion from image streams under orthography: A factorization method. Slide credit: Svetlana Lazebnik Cameras (2 m × 3) Points (3 × n)

39 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Factorizing the Measurement Matrix 39 B. Leibe Slide credit: Martial Hebert

40 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Factorizing the Measurement Matrix Singular value decomposition of D: 40 Slide credit: Martial Hebert

41 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Factorizing the Measurement Matrix Singular value decomposition of D: 41 Slide credit: Martial Hebert

42 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Factorizing the Measurement Matrix Obtaining a factorization from SVD: 42 Slide credit: Martial Hebert

43 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Factorizing the Measurement Matrix Obtaining a factorization from SVD: 43 Slide credit: Martial Hebert This decomposition minimizes |D-MS| 2

44 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Affine Ambiguity The decomposition is not unique. We get the same D by using any 3×3 matrix C and applying the transformations M → MC, S → C -1 S. That is because we have only an affine transformation and we have not enforced any Euclidean constraints (like forcing the image axis to be perpendicular, for example). We need a Euclidean upgrade. 44 B. Leibe Slide credit: Martial Hebert

45 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Estimating the Euclidean Upgrade Orthographic assumption: image axes are perpendicular and scale is 1. This can be converted into a system of 3m equations: 45 B. Leibe x X a1a1 a2a2 a 1 · a 2 = 0 |a 1 | 2 = |a 2 | 2 = 1 Slide adapted from S. Lazebnik, M. Hebert

46 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Estimating the Euclidean Upgrade This can be converted into a system of 3m equations: Let Then this translates to 3m equations in L  Solve for L  Recover C from L by Cholesky decomposition: L = CC T  Update M and S: M = MC, S = C -1 S 46 B. Leibe Slide adapted from S. Lazebnik, M. Hebert

47 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Algorithm Summary Given: m images and n features x ij For each image i, center the feature coordinates. Construct a 2m × n measurement matrix D:  Column j contains the projection of point j in all views  Row i contains one coordinate of the projections of all the n points in image i Factorize D:  Compute SVD: D = U W V T  Create U 3 by taking the first 3 columns of U  Create V 3 by taking the first 3 columns of V  Create W 3 by taking the upper left 3 × 3 block of W Create the motion and shape matrices:  M = U 3 W 3 ½ and S = W 3 ½ V 3 T (or M = U 3 and S = W 3 V 3 T ) Eliminate affine ambiguity 47 Slide credit: Martial Hebert

48 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Reconstruction Results 48 B. Leibe C. Tomasi and T. Kanade. Shape and motion from image streams under orthography: A factorization method. IJCV, 9(2):137-154, November 1992.Shape and motion from image streams under orthography: A factorization method. Slide credit: Svetlana Lazebnik Image Source: Tomasi & Kanade

49 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Dealing with Missing Data So far, we have assumed that all points are visible in all views In reality, the measurement matrix typically looks something like this: 49 B. Leibe Cameras Points Slide credit: Svetlana Lazebnik

50 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Dealing with Missing Data Possible solution: decompose matrix into dense sub- blocks, factorize each sub-block, and fuse the results  Finding dense maximal sub-blocks of the matrix is NP-complete (equivalent to finding maximal cliques in a graph) Incremental bilinear refinement 50 (1)Perform factorization on a dense sub-block F. Rothganger, S. Lazebnik, C. Schmid, and J. Ponce. Segmenting, Modeling, and Matching Video Clips Containing Multiple Moving Objects. PAMI 2007.Segmenting, Modeling, and Matching Video Clips Containing Multiple Moving Objects. Slide credit: Svetlana Lazebnik

51 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Dealing with Missing Data Possible solution: decompose matrix into dense sub- blocks, factorize each sub-block, and fuse the results  Finding dense maximal sub-blocks of the matrix is NP-complete (equivalent to finding maximal cliques in a graph) Incremental bilinear refinement 51 (1)Perform factorization on a dense sub-block (2) Solve for a new 3D point visible by at least two known cameras (linear least squares) F. Rothganger, S. Lazebnik, C. Schmid, and J. Ponce. Segmenting, Modeling, and Matching Video Clips Containing Multiple Moving Objects. PAMI 2007.Segmenting, Modeling, and Matching Video Clips Containing Multiple Moving Objects. Slide credit: Svetlana Lazebnik

52 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Dealing with Missing Data Possible solution: decompose matrix into dense sub- blocks, factorize each sub-block, and fuse the results  Finding dense maximal sub-blocks of the matrix is NP-complete (equivalent to finding maximal cliques in a graph) Incremental bilinear refinement 52 (1)Perform factorization on a dense sub-block (2) Solve for a new 3D point visible by at least two known cameras (linear least squares) (3) Solve for a new camera that sees at least three known 3D points (linear least squares) F. Rothganger, S. Lazebnik, C. Schmid, and J. Ponce. Segmenting, Modeling, and Matching Video Clips Containing Multiple Moving Objects. PAMI 2007.Segmenting, Modeling, and Matching Video Clips Containing Multiple Moving Objects. Slide credit: Svetlana Lazebnik

53 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Comments: Affine SfM Affine SfM was historically developed first. It is valid under the assumption of affine cameras.  Which does not hold for real physical cameras…  …but which is still tolerable if the scene points are far away from the camera. For good results with real cameras, we typically need projective SfM.  Harder problem, more ambiguity  Math is a bit more involved… (Here, only basic ideas. If you want to implement it, please look at the H&Z book for details). 53 B. Leibe

54 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Topics of This Lecture Structure from Motion (SfM)  Motivation  Ambiguity Affine SfM  Affine cameras  Affine factorization  Euclidean upgrade  Dealing with missing data Projective SfM  Two-camera case  Projective factorization  Bundle adjustment  Practical considerations Applications 54 B. Leibe

55 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Projective Structure from Motion Given: m images of n fixed 3D points x ij = P i X j, i = 1, …, m, j = 1, …, n Problem: estimate m projection matrices P i and n 3D points X j from the mn correspondences x ij 55 x1jx1j x2jx2j x3jx3j XjXj P1P1 P2P2 P3P3 B. Leibe Slide credit: Svetlana Lazebnik

56 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Projective Structure from Motion Given: m images of n fixed 3D points z ij x ij = P i X j, i = 1,…, m, j = 1, …, n Problem: estimate m projection matrices P i and n 3D points X j from the mn correspondences x ij With no calibration info, cameras and points can only be recovered up to a 4x4 projective transformation Q: X → QX, P → PQ -1 We can solve for structure and motion when 2mn >= 11m +3n – 15 For two cameras, at least 7 points are needed. 56 B. Leibe Slide credit: Svetlana Lazebnik

57 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Projective SfM: Two-Camera Case Assume fundamental matrix F between the two views  First camera matrix: [I|0]Q -1  Second camera matrix: [A|b]Q -1 Let, then And So we have 57 B. Leibe b : epipole ( F T b = 0 ), A = –[b × ]F Slide adapted from Svetlana Lazebnik F&P sec. 13.3.1

58 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Projective SfM: Two-Camera Case This means that if we can compute the fundamental matrix between two cameras, we can directly estimate the two projection matrices from F. Once we have the projection matrices, we can compute the 3D position of any point X by triangulation. How can we obtain both kinds of information at the same time? 58 B. Leibe

59 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Projective Factorization If we knew the depths z, we could factorize D to estimate M and S. If we knew M and S, we could solve for z. Solution: iterative approach (alternate between above two steps). 59 B. Leibe Cameras (3 m × 4) Points (4 × n) D = MS has rank 4 Slide credit: Svetlana Lazebnik

60 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Sequential Structure from Motion Initialize motion from two images using fundamental matrix Initialize structure For each additional view:  Determine projection matrix of new camera using all the known 3D points that are visible in its image – calibration 60 B. Leibe Cameras Points Slide credit: Svetlana Lazebnik

61 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Sequential Structure from Motion Initialize motion from two images using fundamental matrix Initialize structure For each additional view:  Determine projection matrix of new camera using all the known 3D points that are visible in its image – calibration  Refine and extend structure: compute new 3D points, re-optimize existing points that are also seen by this camera – triangulation 61 B. Leibe Cameras Points Slide credit: Svetlana Lazebnik

62 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Initialize motion from two images using fundamental matrix Initialize structure For each additional view:  Determine projection matrix of new camera using all the known 3D points that are visible in its image – calibration  Refine and extend structure: compute new 3D points, re-optimize existing points that are also seen by this camera – triangulation Refine structure and motion: bundle adjustment Sequential Structure from Motion 62 B. Leibe Cameras Points Slide credit: Svetlana Lazebnik

63 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Bundle Adjustment Non-linear method for refining structure and motion Minimizing mean-square reprojection error 63 B. Leibe x1jx1j x2jx2j x3jx3j XjXj P1P1 P2P2 P3P3 P1XjP1Xj P2XjP2Xj P3XjP3Xj Slide credit: Svetlana Lazebnik

64 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Bundle Adjustment Seeks the Maximum Likelihood (ML) solution assuming the measurement noise is Gaussian. It involves adjusting the bundle of rays between each camera center and the set of 3D points. Bundle adjustment should generally be used as the final step of any multi-view reconstruction algorithm.  Considerably improves the results.  Allows assignment of individual covariances to each measurement. However…  It needs a good initialization.  It can become an extremely large minimization problem. Very efficient algorithms available. 64 B. Leibe

65 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Projective Ambiguity If we don’t know anything about the camera or the scene, the best we can get with this is a reconstruction up to a projective ambiguity Q.  This can already be useful.  E.g. we can answer questions like “at what point does a line intersect a plane”? If we want to convert this to a “true” reconstruction, we need a Euclidean upgrade.  Need to put in additional knowledge about the camera (calibration) or about the scene (e.g. from markers).  Several methods available (see F&P Chapter 13.5 or H&Z Chapter 19) 65 B. Leibe Images from Hartley & Zisserman

66 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Self-Calibration Self-calibration (auto-calibration) is the process of determining intrinsic camera parameters directly from uncalibrated images. For example, when the images are acquired by a single moving camera, we can use the constraint that the intrinsic parameter matrix remains fixed for all the images.  Compute initial projective reconstruction and find 3D projective transformation matrix Q such that all camera matrices are in the form P i = K [R i | t i ]. Can use constraints on the form of the calibration matrix: square pixels, zero skew, fixed focal length, etc. 66 B. Leibe Slide credit: Svetlana Lazebnik

67 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Practical Considerations (1) 1. Role of the baseline  Small baseline: large depth error  Large baseline: difficult search problem Solution  Track features between frames until baseline is sufficient. 67 B. Leibe Large BaselineSmall Baseline Slide adapted from Steve Seitz

68 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Practical Considerations (2) 2. There will still be many outliers  Incorrect feature matches  Moving objects  Apply RANSAC to get robust estimates based on the inlier points. 3. Estimation quality depends on the point configuration  Points that are close together in the image produce less stable solutions.  Subdivide image into a grid and try to extract about the same number of features per grid cell. 68 B. Leibe

69 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 General Guidelines Use calibrated cameras wherever possible.  It makes life so much easier, especially for SfM. SfM with 2 cameras is far more robust than with a single camera.  Triangulate feature points in 3D using stereo.  Perform 2D-3D matching to recover the motion.  More robust to loss of scale (main problem of 1-camera SfM). Any constraint on the setup can be useful  E.g. square pixels, zero skew, fixed focal length in each camera  E.g. fixed baseline in stereo SfM setup  E.g. constrained camera motion on a ground plane  Making best use of those constraints may require adapting the algorithms (some known results are described in H&Z). 69 B. Leibe

70 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Topics of This Lecture Structure from Motion (SfM)  Motivation  Ambiguity Affine SfM  Affine cameras  Affine factorization  Euclidean upgrade  Dealing with missing data Projective SfM  Two-camera case  Projective factorization  Bundle adjustment  Practical considerations Applications 70 B. Leibe

71 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Commercial Software Packages boujou (http://www.2d3.com/)http://www.2d3.com/ PFTrack (http://www.thepixelfarm.co.uk/)http://www.thepixelfarm.co.uk/ MatchMover (http://www.realviz.com/)http://www.realviz.com/ SynthEyes (http://www.ssontech.com/)http://www.ssontech.com/ Icarus (http://aig.cs.man.ac.uk/research/reveal/icarus/)http://aig.cs.man.ac.uk/research/reveal/icarus/ Voodoo Camera Tracker (http://www.digilab.uni-hannover.de/)http://www.digilab.uni-hannover.de/ 71 B. Leibe

72 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 boujou demo (We have a license available, so if you want to try it for interesting projects, contact us.) 72 B. Leibe

73 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Applications: Matchmoving 73 B. Leibe Putting virtual objects into real-world videos Original sequenceTracked features SfM resultsFinal video Videos from Stefan Hafeneger

74 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Another Example: The Campanile Movie 74 VideoVideo from SIGGRAPH’97 Animation Theatre http://www.debevec.org/Campanile/#movie http://www.debevec.org/Campanile/#movie

75 Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 References and Further Reading A (relatively short) treatment of affine and projective SfM and the basic ideas and algorithms can be found in Chapters 12 and 13 of More detailed information (if you really want to implement this) and better explanations can be found in Chapters 10, 18 (factorization) and 19 (self-calibration) of B. Leibe 75 D. Forsyth, J. Ponce, Computer Vision – A Modern Approach. Prentice Hall, 2003 R. Hartley, A. Zisserman Multiple View Geometry in Computer Vision 2nd Ed., Cambridge Univ. Press, 2004


Download ppt "Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Computer Vision – Lecture 17 Structure-from-Motion 21.01.2009 Bastian Leibe RWTH Aachen."

Similar presentations


Ads by Google