As the angle and intensity of light may change in practical cases, it is difficult to measure the illumination of an image. Taking into account the characteristics of the image illumination conditions, we propose a new method based on bilateral-filtering algorithm to enhance the illumination invariant from the face image, then estimate the compensation image by dividing the original image, and finally normalize the image by the well-known Retinex method. The proposed algorithm has been evaluated based on the Yale face database B by using PCA. Experimental results indicate that our algorithm can reach high recognition rates especially when the number of training samples is small, and the computing time is less. We believe that the proposed method can be practically applied to real time face recognition system.