It is a difficult task to binarize image under uneven illumination, and this problem is always met in the image recognition system, such as two-dimensional barcode scanning terminal. In this paper, an efficient approach is proposed to binarize image which can tolerant uneven illumination and different light intensity. The method initializes thresholds with local average gray level and adjusts thresholds by calculating light density ratio. Due to characteristic of our approach, it can even obtain a sound result by limiting number of iterations which will seriously reduce computations and space cost. According to experiments, we can find that our method can achieve a good performance and meet the real-time requirement and quality demand for barcode scanning terminal.