A method is presented to obtain, from a retinal image, data characterizing the optic cup, such as data indicating the location and/or size of the optic cup in relation to the optic disc. A disc region of the retinal image of an eye, is expressed as a weighted sum of a plurality of pre-existing “reference” retinal images in a library, with the weights being chosen to minimize a cost function. The data characterizing the cup of the eye is obtained from cup data associated with the pre-existing disc images and the corresponding weights. The cost function includes (i) a construction error term indicating a difference between the disc region of the retinal image and a weighted sum of the reference retinal images, and (ii) a cost term, which may be generated using a weighted sum over the reference retinal images of a difference between the reference retinal images and the disc region of the retinal image.