Approximation of the maximal solution of the shape from shading problem