Shape Reconstruction from Apparent Contours: Theory and Algorithms