Corneal endothelium images obtained by in vivo specular microscopy provide important information to assess the health status of the cornea. Estimation of clinical parameters, such as cell density, polymegethism, and pleomorphism, requires accurate cell segmentation. State-of-the-art techniques to automatically segment the endothelium are error-prone when applied to images with low contrast and/or large variation in cell size. Here, we propose an automatic method to segment the endothelium. Starting with an oversegmented image comprised of superpixels obtained from a stochastic watershed segmentation, the proposed method uses intensity and shape information of the superpixels to identify and merge those that constitute a cell, using Support Vector Machines. We evaluated the automatic segmentation on a dataset of in vivo specular microscopy images (Topcon SP-1P), obtaining 95.8merged cells and 2.0the parameter estimation against the results of the vendor's builtin software, obtaining a statistically significant better precision in all parameters and a similar or better accuracy. The parameter estimation was also evaluated on three other datasets from different imaging modalities (confocal microscopy, phasecontrast microscopy, and fluorescence confocal microscopy) and tissue types (ex vivo corneal endothelium and retinal pigment epithelium). In comparison with the estimates of the datasets' authors, we achieved statistically significant better accuracy and precision in all parameters except pleomorphism, where a similar accuracy and precision were obtained.