In this paper, we present an extremely simple algorithm for shape from
shading, which can be implemented in 25 lines of C code. The algorit
hm is very fast, taking 0.2 seconds on a Sun SparcStation-1 for a 128
x 128 image, and is purely local and highly parallelizable (parallel i
mplementation included). In our approach, we employ a linear approxima
tion of the reflectance function, as used by others. However. the main
difference is that we first use the discrete approximations for surfa
ce normal, p and q, using finite differences, and then linearize the r
eflectance function in depth, Z(x, y), instead of p and q. The algorit
hm has been tested on several synthetic and real images of both Lamber
tian and specular surfaces. and good results have been obtained.