A shortest path approach to optic disc detection in retinal fundus images

Supplementary Files

Figure 1: Example of algorithm flow.
Figure 2: Sampling of correctly detected images from the DRIVE database.
Figure 3: Correctly identified OD location in images from the DIARETDB1 database.
Figure 4: Correctly detected OD location in images from the Messidor database
Figure 5: All incorrectly detected images.
Figure 6: Corrected Images

How to Cite

Wigdahl J, Guimaraes P, Ruggeri A. A shortest path approach to optic disc detection in retinal fundus images. MAIO [Internet]. 2017 Jul. 7 [cited 2022 Jun. 25];1(4):29-42. Available from: https://www.maio-journal.com/index.php/MAIO/article/view/43

Copyright notice

Authors who publish with this journal agree to the following terms:

  1. Authors retain copyright and grant the journal right of first publication, with the work twelve (12) months after publication simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work’s authorship and initial publication in this journal.

  2. After 12 months from the date of publication, authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.


graph theory; optic disc; retinal imaging; shortest path; template matching


Aim: To evaluate a new algorithm to detect the optic disc in retinal fundus images on a number of publicly available datasets.  Optic Disc detection is an important first step in many automated algorithms, either to be masked out of future processing or for the use in optic disc related disease such as glaucoma and papilledema.

Methods: We propose a new method for optic disc detection that converts the retinal image into a graph and exploits vessel enhancement methods to calculate edge weights in finding the shortest path between pairs of points on the periphery of the image.  The line segment with the maximum number of shortest paths is considered the optic disc location, with refinement from a combination template matching approach in the found region. The method was tested on three publicly available datasets: DRIVE, DIARETDB1, and Messidor consisting of 40, 89, and 1200 images.  All images were acquired at a 45°-50° field of view.

Results: The method achieves an accuracy of 100, 98.88, and 99.42% on the DRIVE, DIARETDB1, and Messidor databases respectively.

Conclusions: The method performs as well or better than state-of-the-art methods on these datasets.  Processing takes an average of 32 seconds (+-1.2) to detect the optic disc, with 26 of those seconds used for the vessel enhancement process.   The accuracy over a wide variety of images shows that the method is robust and would be optimal for retinal analysis systems that perform vessel enhancement as part of their processing.  



Kanski JJ, Bowling B. Clinical ophthalmology: a systematic approach. Elsevier Health Sciences; 2011 Apr 28.

Witt N, Wong TY, Hughes AD, Chaturvedi N, Klein BE, Evans R, McNamara M, Thom SA, Klein R: Abnormalities of retinal microvascular structure and risk of mortality from ischemic heart disease and stroke. Hypertension 47:975–981, 2006 DOI: 10.1161/01.HYP.0000216717.72048.6c

James M, Turner DA, Broadbent DM, Vora J, Harding SP. Cost effectiveness analysis of screening for sight threatening diabetic eye disease. BMJ 2000;320:1627-31 PMID:10856062

Philip S., Fleming A. D., Goatman K. A., Fonseca S., Mcnamee P., Scotland G. S., Prescott G. J., Sharp P. F., and Olson J. A., The efficacy of automated “disease/no disease” grading for diabetic retinopathy in a systematic screening programme, Br. J. Ophthalmol., vol. 91, pp. 1512–1517, 2007.

Fleming A. D., Philip S., Goatman K. A., Williams G. J.,. Olson J. A, and Sharp P. F., Automated detection of exudates for diabetic retinopathy screening, Phys. Med. Biol., vol. 52, pp. 7385– 7396, 2007.

Niemeijer M., van Ginneken B., Staal J., Suttorp-Schulten M. S. A., and Abràmoff M. D., Automatic detection of red lesions in digital color fundus photographs, IEEE Trans. Med. Imag., vol. 24, no. 5, pp. 584–592, May 2005.

Quigley HA, Brown AE, Morrison JD, Drance SM: The size and shape of the optic disk in normal human eyes. Arch Ophthalmol 108:51–57, 1990.

Welfer D, Scharcanski J, Marinho D. Fovea center detection based on the retina anatomy and mathematical morphology. Comput Methods Programs Biomed 2011;104(3):397–409.

Abramoff MD, Garvin MK, Sonka M. 2010. Retinal imaging and image analysis. IEEE Reviews in Biomedical Engineering 3:169_208 DOI 10.1109/RBME.2010.2084567.

Echegaray S, Zamora G, Yu H, Luo W, Soliz P, Kardon R (2011) Automated analysis of optic nerve images for detection and staging of papilledema. Invest Ophthalmol Vis Sci 52:7470– 7478.

Joshi V. S., Garvin M. K., Reinhardt J. M., and Abramoff M. D., Automated method for the identification and analysis of vascular tree structures in retinal vessel network, inProc. SPIE Conf. Med. Imag., 2011, vol. 7963, no. 1, pp. 1–11.

Merickel Jr MB, Abràmoff MD, Sonka M, Wu X. Segmentation of the optic nerve head combining pixel classification and graph search. InMedical Imaging 2007 Mar 8 (pp. 651215-651215). International Society for Optics and Photonics.

Haleem MS, Han L, Van Hemert J, Li B. 2013. Automatic extraction of retinal features from colour retinal images for glaucoma diagnosis: a review. Computerized Medical Imaging and Graphics 37:581_596 DOI 10.1016/j.compmedimag.2013.09.005.

Youssif AA-HA-R, Ghalwash AZ, Ghoneim AASA-R. 2008. Optic disc detection from normalized digital fundus images by means of a vessels' direction matched filter. IEEE Transactions on Medical Imaging 27:11_18 DOI 10.1109/TMI.2007.900326.

Hoover A, Goldbaum M. 2003. Locating the optic nerve in a retinal image using the fuzzy convergence of the blood vessels. IEEE Transactions on Medical Imaging 22:951_958 DOI 10.1109/TMI.2003.815900.

Foracchia M, Grisam E, Ruggeri A (2004) Detection of optic disc in retinal images by means of a geometrical model of vessel structure. IEEE Trans Med Imaging 23:1189–1195.

Niemeijer M, Abràmoff MD, Van Ginneken B. 2009. Fast detection of the optic disc and fovea in color fundus photographs. Medical Image Analysis 13:859_870 DOI 10.1016/j.media.2009.08.003.

Mahfouz AE, Fahmy AS. Fast localization of the optic disc using projection of image features. IEEE Transactions on Image Processing. 2010 Dec;19(12):3285-9.

Welfer D, Scharcanski J, Kitamura CM, Dal Pizzol MM, Ludwig LW, Marinho DR. 2010. Segmentation of the optic disk in color eye fundus images using an adaptive morphological approach. Computers in Biology and Medicine 40:124_137 DOI 10.1016/j.compbiomed.2009.11.009.

Aquino A, Gegúndez-Arias ME, Marín D. 2010. Detecting the optic disc boundary in digital fundus images using morphological, edge detection, and feature extraction techniques. IEEE Transactions on Medical Imaging 29:1860_1869 DOI 10.1109/TMI.2010.2053042.

Qureshi RJ, Kovacs L, Harangi B, Nagy B, Peto T, Hajdu A (2012) Combining algorithms for automatic detection of optic disc and macula in fundus images. Comput Vis Image Underst 116:138–145

Yu H, Barriga ES, Agurto C, Echegaray S, Pattichis MS, Bauman W, Soliz P. 2012. Fast localization and segmentation of optic disk in retinal images using directional matched filtering and level sets. IEEE Transactions on Information Technology in Biomedicine 16:644_657 DOI 10.1109/TITB.2012.2198668.

Pereira C, Gonçalves L, Ferreira M. Optic disc detection in color fundus images using ant colony optimization. Medical & biological engineering & computing. 2013 Mar 1;51(3):295-303.

Yu T, Ma Y, Li W. 2015. Automatic localization and segmentation of optic disc in fundus image using morphology and level set. In: Medical information and communication technology (ISMICT), 2015 9th international symposium on. IEEE, 195_199.

Rahebi J, Hardalaç F. A new approach to optic disc detection in human retinal images using the firefly algorithm. Medical & biological engineering & computing. 2016 Mar 1;54(2-3):453-61.

Abdullah et al. (2016), Localization and segmentation of optic disc in retinal images using circular Hough transform and grow-cut algorithm. PeerJ 4:e2003; DOI 10.7717/peerj.2003

Zuiderveld K., (1994) Contrast limited adaptive histogram equalization, in Graphics Gems IV, P. S. Heckbert, Ed., pp. 474–485, Academic Press, Boston, Mass, USA.

Frangi, A.F., Niessen, W.J., Vincken, K.L., Viergever, M.A., 1998. Multiscale vessel enhancement filtering. In: Proc. Med. Image Comput. Assist. Interv., vol. 1496, pp. 130–137.

Dijkstra, E. W. (1959). "A note on two problems in connexion with graphs". Numerische Mathematik. 1: 269–271. doi:10.1007/BF01386390.

Staal J, Abramoff MD, Niemeijer M, Viergever MA, Ginneken BV. 2004. Ridge-based vessel segmentation in color images of the retina. IEEE Transactions on Medical Imaging 23:501_509 DOI 10.1109/TMI.2004.825627.

Kauppi T, Kalesnykiene V, Kamarainen J-K, Lensu L, Sorri I, Raninen A, Voutilainen R, Pietilä J, Kälviäinen H, Uusitalo H. 2007. DIARETDB1 diabetic retinopathy database and evaluation protocol. Medical Image Understanding and Analysis 2007:61 DOI 10.5244/C.21.15.

Decenciere E, Zhang X, Cazuguel G, La¸ B, Cochener B, Trone C, Gain P, Ordónez- Varela J- R, Massin P, Erginay A. 2014. Feedback on a publicly distributed image database: the Messidor database. Image Analysis and Stereology 33(3):231_234 DOI 10.5566/ias.1155.

Sinthanayothin C, Boyce JF, Cook HL, Williamson TH (1999) Automated localization of the optic disc, fovea, and retinal blood vessels from digital color fundus images. Br J Ophthalmol 83:902–910.

Walter T, Klein JC, Massin P, Erginary A (2002) A contribution of image processing to the diagnosis of diabetic retinopathy-detection of exudates in color fundus images of human retina. IEEE Trans Med Imaging 21:1236–1243.

Zubair M, Yamin A, Khan SA. 2013. Automated detection of optic disc for the analysis of retina using color fundus image. In: Imaging systems and techniques (IST), 2013 IEEE international conference on. Piscataway: IEEE, 239_242.

Saleh MD, Salih ND, Eswaran C, Abdullah J. 2014. Automated segmentation of optic disc in fundus images. In: 2014 IEEE 10th International Colloquium on signal processing & its applications (CSPA). Piscataway: IEEE, 145_150.

[30] Staal J, Abramoff MD, Niemeijer M, Viergever MA, Ginneken BV. 2004. Ridge-based vessel segmentation in color images of the retina. IEEE Transactions on Medical Imaging 23:501_509 DOI 10.1109/TMI.2004.825627.

Staal J, Abramoff MD, Niemeijer M, Viergever MA, Ginneken BV. 2004. Ridge-based vessel segmentation in color images of the retina. IEEE Transactions on Medical Imaging 23:501_509 DOI 10.1109/TMI.2004.825627.