For reducing the effect of undulate background in dim infrared targets detection, an anisotropic method is presented for infrared background prediction. According to differences of local gradient character among target region, smooth background region and undulate background region, the edge stopping function of anisotropic partial differential equations is improved to an increasing function with the value of the direction grads. Then the mean of the two least values of the edge stopping function is derived as the prediction value of the background. Simulation results show that the method selectively retains the smooth background region and the undulate background region, and achieves good prediction of background.