Surface reconstruction from segmented image