This paper proposes an enhanced illumination compensation algorithm, which can compensate for the uneven illuminations on human faces and reconstruct face images in normal lighting conditions. To detect the illumination category, based on 65 categories in YaleB database, the images processed using Block-based Histogram Equalization (BHE) is compared with the original face image processed using histogram equalization (HE). Based on the identified illumination category, a quadratic model is used to reconstruct an image that will visually be under normal illumination. In order to avoid the effect of light source intensity on face images, we used HE method. Experimental results show that, by using our enhanced algorithm for lighting compensation, the face recognition rate using principal component analysis can be improved to 98.91%.