1 / 37

Structure-from-Motion

Structure-from-Motion. Determining the 3-D structure of the world, and/or the motion of a camera using a sequence of images taken by a moving camera. Equivalently, we can think of the world as moving and the camera as fixed.

deloresladd
Download Presentation

Structure-from-Motion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Structure-from-Motion • Determining the 3-D structure of the world, and/or the motion of a camera using a sequence of images taken by a moving camera. • Equivalently, we can think of the world as moving and the camera as fixed. • Like stereo, but the position of the camera isn’t known (and it’s more natural to use many images with little motion between them, not just two with a lot of motion). • We may or may not assume we know the parameters of the camera, such as its focal length.

  2. Structure-from-Motion • As with stereo, we can divide problem: • Correspondence. • Reconstruction. • Again, we’ll talk about reconstruction first. • So for the next few classes we assume that each image contains some points, and we know which points match which.

  3. Structure-from-Motion

  4. Movie

  5. Reconstruction • A lot harder than with stereo. • Start with simpler case: scaled orthographic projection (weak perspective). • Recall, in this we remove the z coordinate and scale all x and y coordinates the same amount.

  6. Announcements • Quiz on April 22 in class (a week from Thursday). • Practice problems handed out Thursday. • Reviews at office hours, possibly in seminar room across the hall from my office. • Questions about PS6

  7. First: Represent motion • We’ll talk about a fixed camera, and moving object. • Key point: Some matrix Points The image Then:

  8. Structure-from-Motion • S encodes: • Projection: only two lines • Scaling, since S can have a scale factor. • Translation, by tx/s and ty/s. • Rotation:

  9. Rotation Represents a 3D rotation of the points in P.

  10. First, look at 2D rotation (easier) Matrix R acts on points by rotating them. • Also, RRT= Identity. RT is also a rotation matrix, in the opposite direction to R.

  11. Simple 3D Rotation Rotation about z axis. Rotates x,y coordinates. Leaves z coordinates fixed.

  12. Full 3D Rotation • Any rotation can be expressed as combination of three rotations about three axes. • Rows (and columns) of R are orthonormal vectors. • R has determinant 1 (not -1).

  13. Questions?

  14. Putting it Together 3D Translation Scale Projection 3D Rotation We can just write stx as tx and sty as ty.

  15. Affine Structure from Motion

  16. Affine Structure-from-Motion: Two Frames (1)

  17. Affine Structure-from-Motion: Two Frames (2) To make things easy, suppose:

  18. Affine Structure-from-Motion: Two Frames (3) Looking at the first four points, we get:

  19. Affine Structure-from-Motion: Two Frames (5) Once we know the motion, we can use the images of another point to solve for the structure. We have four linear equations, with three unknowns.

  20. Affine Structure-from-Motion: Two Frames (7) But, what if the first four points aren’t so simple? Then we define A so that: This is always possible as long as the points aren’t coplanar.

  21. Affine Structure-from-Motion: Two Frames (8) Then, given: We have: And:

  22. Affine Structure-from-Motion: Two Frames (9) Given: Then we just pretend that: is our motion, and solve as before.

  23. Affine Structure-from-Motion: Two Frames (10) This means that we can never determine the exact 3D structure of the scene. We can only determine it up to some transformation, A. Since if a structure and motion explains the points: So does another of the form:

  24. Affine Structure-from-Motion: Two Frames (11) Note that A has the form: A corresponds to translation of the points, plus a linear transformation.

  25. Let’s take an explicit example of this. Suppose we have a cube with vertices at: (0,0,0) (10,0,0), (0,0,10)….. Suppose we transform this by rotating it by 45 degrees about the y axis. Then the transformation matrix is: [sq2 0 –sq2 0; 0 1 0 0]. Now suppose instead we had a rectanguloid with corners at (10, 0, 0) (11,0,0), (10, 0, 10) …. We can transform this rectanguloid into the first cube by transforming it as: [10 0 0 -100; 0 1 0 0; 0 0 1 0; 0 0 0 1]. Then we can apply [sq2 0 –sq2 0; 0 1 0 0] to the resulting cube, to generate the same image. Or, we could have combined these two transformations into one: [sq2 0 –sq2 0; 0 1 0 0]* [10 0 0 -100; 0 1 0 0; 0 0 1 0; 0 0 0 1] = [10sq2 0 –sq2 0; 0 1 0 0]

  26. Affine Structure-from-Motion: A lot of frames (1) I S P

  27. First Step: Solve for Translation (1) • This is trivial, because we can pick a simple origin. • World origin is arbitrary. • Example: We can assume first point is at origin. • Rotation then doesn’t effect that point. • All its motion is translation. • Better to pick center of mass as origin. • Average of all points. • This also averages all noise.

  28. More explicitly, suppose sum(p) = (0,0,0,n)^T. Then, sum(R*P) = R*(sum(P)) = R*(0,0,0,n)^T = (0,0,0,n)^T. Sum(T*R*P) = T*(0,0,0,n)^T = (ntx,nty,ntz,n)^T. (Or just look at the 2x4 projection matrix). If we subtract tx or ty from every row, then the residual is (s11,s12,s13;s21,s22,s23)*P. I = s part of matrix + t part of matrix.

  29. First Step: Solve for Translation (2)

  30. First Step: Solve for Translation (3) As if by magic, there’s no translation.

  31. Rank Theorem has rank 3. This means there are 3 vectors such that every row of is a linear combination of these vectors. These vectors are the rows of P. P S

  32. Solve for S • SVD is made to do this. D is diagonal with non-increasing values. U and V have orthonormal rows. Ignoring values that get set to 0, we have U(:,1:3) for S, and D(1:3,1:3)*V(1:3,:) for P.

  33. Linear Ambiguity (as before) = U(:,1:3) * D(1:3,1:3) * V(1:3,:) = (U(:,1:3) * A) * (inv(A) *D(1:3,1:3) * V(1:3,:))

  34. Noise • has full rank. • Best solution is to estimate I that’s as near to as possible, with estimate of I having rank 3. • Our current method does this.

  35. Weak Perspective Motion Row 2k and 2k+1 of S should be orthogonal. All rows should be unit vectors. (Push all scale into P). P Choose A so (U(:,1:3) * A) satisfies these conditions. S =(U(:,1:3)*A)*(inv(A) *D(1:3,1:3)*V(1:3,:))

  36. Related problems we won’t cover • Missing data. • Points with different, known noise. • Multiple moving objects.

  37. Final Messages • Structure-from-motion for points can be reduced to linear algebra. • Epipolar constraint reemerges. • SVD important. • Rank Theorem says the images a scene produces aren’t complicated (also important for recognition).

More Related