Solving structure from motion