Real-time confocal microscopy was used to obtain images of the surface cells of the cornea in vivo in human subjects and in non-human primates. The surface cells represent the barrier between the tear layer and the internal cellular environment and as such, the state of these cells is indicative of the health of the cornea. In our study, confocal microscopy of the surface cells revealed prominent, centrally located nuclei. With the use of a series of image analysis procedures, the nuclei were located automatically and distances to the nearest neighbors were determined. Comparison of these procedures in 8 human corneas and 1 non-human primate cornea showed that unaided computer analysis of the surface cells was as accurate as manual location of the cell nuclei. The distribution of nearest-neighbor distances was found to be best fitted by a gamma distribution. Simulation of a condition marked by loss of surface cells demonstrated that the alpha (shape) and beta (scale) parameters could be used to compare the distribution of nearest-neighbor distances. Thus, confocal microscopy coupled with these image analysis and statistical procedures could provide an objective, quantitative approach to monitoring the epithelial barrier under clinical and experimental conditions, for example during post-surgical or post-traumatic healing or in the evaluation of the efficacy of topical therapeutic agents.