The crucial procedure of contour extraction for corneal endothelium image is to segment cell regions from background. The single threshold algorithm is not effective because the image differs very much in illumination. In this paper, an adaptive thresholding algorithm with window n*n was introduced. It was then combined with the thinning algorithm to extract the cell contour. The processing results indicate the efficacy of the algorithm.