Orientation Tracking and Panorama Reconstruction Using Projected Gradient Descent