A nonlinear measure for template matching is introduced to accommodate the signal amplitude variation of the targeting objects in noisy images. The pixels in the image area corresponding to the template are partitioned into two groups: the brighter pixels and the darker ones. The proposed measure is defined as the difference of the numbers of the brighter pixels in the object and the background. It is compared with the classical normalized covariance for the stability of the response and the success rate under the white Gaussian noise and the impulsive one, verifying its superiority. The proposed measure is tested also for a set of real images, where the target objects have disparate backgrounds. It is proved to have better performance than the normalized covariance, by comparing the correct match responses with the maximum of the mismatch responses, as well as the receiver operating characteristics.