770 likes | 1.04k Views
Advanced Computer Vision . Chapter 7 S TRUCTURE FROM M OTION. What Is Structure from Motion?. Study of visual perception. Process of finding the three-dimensional structure of an object by analyzing local motion signals over time. A method for creating 3D models from
E N D
Advanced Computer Vision Chapter 7 STRUCTUREFROM MOTION Structure from Motion
What Is Structure from Motion? • Study of visual perception. • Process of finding the three-dimensional structure of an object by analyzing local motion signals over time. • A method for creating 3D models from 2D pictures of an object. Structure from Motion
Example Picture 1 Picture 2 Structure from Motion
Example (cont). 3D model created from the two images Structure from Motion
7.1 Triangulation • A problem of estimating a point’s 3D location when it is seen from multiple cameras is known as triangulation. Structure from Motion
Triangulation (cont). • Find the 3D point p that lies closest to all of the 3D rays corresponding to the 2D matching feature locations {xj} Structure from Motion
Triangulation (cont). • Find the 3D point p that lies closest to all of the 3D rays corresponding to the 2D matching feature locations {xj} observed by cameras {Pj =Kj[Rj| tj] } tj = -Rjcj cj is the jth camera center. Structure from Motion
Triangulation (cont). • It is a converse of pose estimation problem. • Given projection matrices, 3D points can be computed from their measured image positions in two or more views. Structure from Motion
Triangulation (cont). Structure from Motion
Triangulation (cont). Structure from Motion
Triangulation (cont). Structure from Motion
Triangulation (cont). • x = PX {P =K[R|t] } Structure from Motion
Triangulation (cont). Figure 7.7: 3D point triangulation by finding the points p that lies nearest to all of the optical rays Structure from Motion
Triangulation (cont). • The rays originate at cj in a direction • The nearest point to p on this ray, which is denoted as qj, minimizes the distance. which has a minimum at Hence, (p-cj) - Structure from Motion
Triangulation (cont). • The squared distance between p and qj is • The optimal value for p, which lies closest to all of the rays, can be computed as a regular least square problem by summing over all the rj2 and finding the optimal value of p, (p-cj) - Structure from Motion
Triangulation (cont). Structure from Motion
Triangulation (cont). Structure from Motion
Triangulation (cont). • If we use homogeneous coordinates p=(X,Y,Z,W), the resulting set of equation is homogeneous and is solved as singular value decomposition (SVD). • If we set W=1, we can use regular linear least square, but the resulting system may be singular or poorly coordinated (i.e. all of the viewing rays are parallel). Structure from Motion
Singular Value Decomposition (SVD). Structure from Motion
Singular Value Decomposition (SVD). Rotation Rotation Structure from Motion
Singular Value Decomposition (SVD). • Solution is the eigenvector corresponding to the minimum eigenvalue of AAT • AAT= UΣVT VΣTUT = U(ΣΣT)UT • It is also the eigenvector corresponding to the minimum eigenvalue of A Structure from Motion
Least Square Structure from Motion
Linear Least Square Problem Structure from Motion
Linear Least Square Problem • Minimize F(X): • Partial differential over X0, X1: • Solve X0, X1 by combining two equations Structure from Motion
7.2Two-Frame Structure from Motion • In 3D reconstruction we have always assumed that either 3D points position or the 3D camera poses are known in advance. Structure from Motion
Two-Frame Structure from Motion (cont). Figure 7.8: Epipolar geometry: The vectors t=c1 – c0, p – c0and p-c1 are co-planar and the basic epipolar constraint expressed in terms of the pixel measurement x0and x1 Structure from Motion
Two-Frame Structure from Motion (cont). • Figure shows a 3D point p being viewed from two cameras whose relative position can be encoded by a rotation R and a translation t. • We do not know anything about the camera positions, without loss of generality. • We can set the first camera at the origin c0=0 and at a canonical orientation R0=I Structure from Motion
Two-Frame Structure from Motion (cont). • The observed location of point p in the first image, is mapped into the second image by the transformation : the ray direction vectors. Structure from Motion
Two-Frame Structure from Motion (cont). • Taking the cross product of both the sides with t in order to annihilate it on the right hand side yields • Taking the dot product of both the sides with yields Structure from Motion
Two-Frame Structure from Motion (cont). • The right hand side is triple product with two identical entries • We therefore arrive at the basic epipolar constraint : essential matrix Structure from Motion
Two-Frame Structure from Motion (cont). • The essential matrix E maps a point in image 0 into a line in image 1 since Structure from Motion
Two-Frame Structure from Motion (cont). • All such lines must pass through the second epipolee1, which is therefore defined as the left singular vector of E with 0 singular value, or, equivalently the projection of the vector t into image 1. • The transpose of these relationships gives us the epipolar line in the first image as and e0 as the zero value right singular vector E. Structure from Motion
Two-Frame Structure from Motion (cont). Structure from Motion
Two-Frame Structure from Motion (cont). • Given the relationship • If we have n corresponding measurements {(xi0,xi1)}, we can form N homogeneous equations in the elements of E= {e00…..e22} Structure from Motion
Two-Frame Structure from Motion (cont). Find min||AE||, E = least eigenvector of ATA. Variants E’: enforcing the rank two constraint in E → Structure from Motion
Two-Frame Structure from Motion (cont). • t is eigenvector correspended to min eignvalue under no noise: • Estimate R from t: Structure from Motion
Two-Frame Structure from Motion (cont). • With , we get • Under no noise ( ): → • However, you can flip both V,U signs and still get a valid SVD: Structure from Motion
Two-Frame Structure from Motion (cont). • If the measurements have noise, the terms that are product of measurement have their noise amplified by the other element in the product, which lead to poor scaling. • In order to deal with this, a suggestion is that the point coordinate should be translated and scaled so that their centroid lies at the original variance is unity; i.e. Structure from Motion
Two-Frame Structure from Motion (cont). such that and n= number of points. Once the essential matrix has been computed from the transformed coordinates; the original essential matrix E can be recovered as Structure from Motion
Projective Reconstruction (cont). • In the unreliable case, we do not know the calibration matrices Kj, so we cannot use the normalized ray directions. • We have access to the image coordinate xj, so essential matrix becomes: • fundamental matrix: Structure from Motion
Projective Reconstruction (cont). • Just like essential matrix, fundamental matrix can be written as follow with rank 2: • And ( can not be recovered from F) Structure from Motion
Projective Reconstruction (cont). • As equations on P.37, F can be written as: • Therefore, • : singular value matrix with the smallest value replaced by middle value • We can form pair projective matrices as follow and reconstruct scene by triangulation: Structure from Motion
View Morphing • Application of basic two-frame structure from motion. • Also known as view interpolation. • Used to generate a smooth 3D animation from one view of a 3D scene to another. • To create such a transition: smoothly interpolate camera matrices, i.e., camera position, orientation, focal lengths. More effect is obtained by easing in and easing out camera parameters. • To generate in-between frames: establish full set of 3D correspondences or 3D models for each reference view. Structure from Motion
View Morphing • Triangulate set of matched feature points in each image . • As the 3D points are re-projected into their intermediate views, pixels can be mapped from their original source images to their new views using affine projective mapping. • The final image then composited using linear blend of the two reference images as with usual morphing. Structure from Motion
7.3 Factorization • n 3D points are seen in m views • q =(u,v,1): 2D image point • p =(x,y,z,1): 3D scene point • Π : projection matrix • π : projection function • qij is the projection of the i -th point on image j • λij projective depth of qij Structure from Motion
Projection Models Structure from Motion
Projection Models Structure from Motion
Orthographic Projection Structure from Motion
Orthographic Projection Structure from Motion
Perspective Projection Structure from Motion