A stray light compensated nonuniformity correction (SLCNUC) method is proposed for infrared (IR) cameras. The proposed approach formulates thermal stray light compensation functions according to the internal temperature changes of the IR camera. To derive the compensation functions, we analyze the variations of the NUC parameters over the entire range of internal temperatures and determine the function coefficients by using a least squares method. Compared with the existing NUC methods used in previous studies, the major advantage of the proposed method is its effective reduction of nonuniformity even in highly accumulated thermal stray light situations. Experiments and comparisons performed with real IR images show that the proposed method maintains lower spatial noise over a wide internal temperature range of the IR camera. It is shown that the proposed NUC achieves an 18 dB higher peak signal-to-noise ratio than that of the conventional reference-based NUC method.