The aim of this paper is to devise an automatic algorithm locating the fovea center in retinal fundus images. We locate the fovea center as the region of minimum vessel density within a search region defined from anatomical priors, i.e., knowledge on the structure of the retina. Vessel density is computed from a binary vessel map, providing good invariance against image quality. Priors include the approximate distance from the optic disc, expressed in multiple of the disc diameter for generality. The disc is located automatically. We learn the distribution of disc-macula distances from clinical annotations on a sample of images independent of the test sample. We use the same sample of images to optimize the standard deviation of the Gaussian mask, which is used to weigh vessel density for cost estimation. We tested performance on a sample of 116 fundus images from the Tayside diabetic screening programme (TENOVUS) and 303 fundus images from MESSIDOR public data set. To test resilience to quality variations, TENOVUS images were divided into three quality groups and MESSIDOR images were divided into images with no risk of macula edema and with risk of macula edema. Algorithm result on TENOVUS images show good localization performance with all groups compared to manual ground truth annotations (92% estimates within 0.5 disc diameters of ground truth location with good quality, 70% with poor quality images). For MESSIDOR images, our algorithm recorded an accuracy of 80% for images with no risk of macula edema and 59% for images with risk of macula edema.