Optical pattern recognition under variations of illumination is an important issue. The sliced orthogonal nonlinear generalized (SONG) correlation has been proposed as an optical pattern recognition tool to discriminate with high efficiency between objects. But, at the same time, the SONG correlation is very sensitive to gray-scale image variations. In a previous work, we expanded the definition ofthe SONG correlation to the Weighted SONG (WSONG) correlation to modify the discrimination capability in a controlled way. Here, we propose to use the WSONG when pattern recognition is obtained by means of optical correlation under nonuniform illumination. The calculation of the WSONG correlation requires the summation of many linear correlations between binary images. To implement it optically, we use a time sequential joint transform correlator.