Aiming at the problems as neglecting edge information and long time computing for traditional 2D Otsu algorithm, an improved algorithm based on the average variance and neighborhood information was proposed. Firstly, 2D histogram was reconstructed with the median filtering, and then a new 2D threshold selection function was defined with the average variance, finally, binarization method was used to segment image. The experimental results show that the improved algorithm can obtain better segmentation results compared with traditional 2D Otsu method and the fast recursive algorithm, the running time is reduced to be 1.55% and 40.69% of that of the traditional 2D Otsu algorithm and the fast recursive algorithm, respectively.