Recovering 3D Shape and Motion from Image Streams using Nonlinear Least Squares