Photometric stereo is a widely-used non-contact optical technology for surface shape measurement in industry. However, it is subject two limitations: (1) all light directions used should be known; (2) reflection on the surface to be measured should obey the Lambertian model. In this paper, an extended photometric stereo is proposed to overcome these limitations. Firstly, initial light directions are estimated in terms of normals of those points on the silhouette; secondly, an iterative process is established to refine alternately both the normals and all light directions, with specular pixels removed; at last, the final surface shape is worked out by integrating the normals. Experimental results show the considerable feasibility of this algorithm.