The variational approach to shape from shading