An Optic Disc Segmentation Method Based on Active Contour Tracking

An Optic Disc Segmentation Method Based on Active Contour Tracking

Zhongliang Luo* Yingbiao Jia  Jiazhong He

School of Information Science and Engineering, Shaoguan University, Shaoguan 512005, China

School of Physics and Mechanical Engineering, Shaoguan University, Shaoguan 512005, China

Corresponding Author Email:
10 February 2018
16 April 2019
1 September 2019
| Citation



This paper attempts to find a way to complete optic disc segmentation in retinal images both accurately and efficiently. For this purpose, an optic disc segmentation method was designed based on active contour tracking. Firstly, the original retinal image was denoised, and its contrast was enhanced. Then, the center of optic disc was preliminarily identified by least squares method. Next, the region of interest (ROI) was determined based on the features and center of optic disc. Finally, the actual boundaries of optic disc were obtained by active contour tracking. Our method was tested on 522 retinal images from four representative public databases on retinal images, namely, Digital Retinal Images for Vessel Extraction (DRIVE), Structured Analysis of the Retina (STARE), Drishti-GS1 and Messidor. The experimental results show that our method achieved a segmentation accuracy of 100%, 92.6%, 99%, 95.7%, respectively, on the four databases, and exhibited better robustness and speed than the two contrastive methods. Our method was especially effective in retinal images with mild diseases or poor contrast. The research findings lay the basis for prediction and computer-aided diagnosis of fundus diseases.


optic disc segmentation, retinal image, active contour tracking, least squares method

1. Introduction

The optic disc represents the beginning of the optic nerve and the entry point for the major blood vessels that supply the retina. In retinal images like Figure 1, the optic disc is often the brightest part with light yellow or white color, taking the shape of a circle or a slightly eccentric vertical ellipse. The shape, area and depth of optic disc are important indicators of fundus health, and are often employed to predict and diagnose eye diseases, such as diabetic retinopathy and glaucoma [1-3]. However, the positioning and segmentation of optic disc are no easy task, owing to individual differences, fundi diseases, retinal vascular occlusion, uneven illumination, noises, or blurred edges [4].

Traditionally, optic disc images are usually positioned and segmented manually, which is time-consuming and prone to human errors. What is worse, the positioning and segmentation results may not be accurate or effective, hindering the analysis of retinal image and diagnosis of eye diseases. To solve the problem, many techniques have been adopted to improve the traditional methods, aiming to predict or diagnose eye diseases precisely in a short time. For instance, the digital image processing has often been used, because it can reduce doctors’ workload, quickly output objective and accurate results, and support repeated use.

In essence, the positioning of optic disc requires the measurement of optic disc center, and the segmentation relies on the detection of optic disc boundaries. The existing optic disc segmentation methods roughly falls into three categories: some are based on the shape of optic disc, some are based on the appearance of optic disc, and some are based on the structure of retinal vessels and the appearance of optic disc.

The shape-based methods generally consider the optic disc as a circle or ellipse [5-7], and rely on circular and elliptical templates to complete the segmentation. But the actual optic disc is not always a regular circle or ellipse. For optic disc images in the Messidor database, the mean goodness of fitting to regular circle is 92% and that to regular ellipse is 97% [8].

The appearance-based methods take full advantage of the relative brightness of optic disc in retinal image. For example, Sinthanayothin et al. [9] detected optic disc in retinal images, based on the law that the pixels of optic disc are much brighter than those of retinal vessels. Lu [10] designed multiple line operators in specific directions to capture circular brightness structures. Walter and Klein [11] segmented the brightest region in retinal image, taking this region as optic disc. Morales et al. [12] obtained the binary mask of optic disc through stochastic watershed transform. Cheng [13] adopted support vector machines (SVMs) to differentiate between optic disc pixels from the other pixels on the super-pixel level. The above methods can segment optic disc correctly in normal retinal images. However, these approaches are no longer robust if the optic disc is blurred by large bright spots, affected by nonuniform illumination, or deformed by illness.

The structure/appearance-based methods take account of vessel direction, brightness, optic disc boundaries and size of bright regions to segment optic disc [14-16]. For instance, Youssif et al. [14] presented an algorithm to detect optic disc, which firstly matches the directional filtering template with the structure of blood vessels, and then identifies optic disc from candidate regions with similar shape and grayscale to optic disc. Based on global Hough transform, Zhang and Zhao [15] developed a fast optic disc detection method utilizing vessel distribution and direction. Foracchia et al. [16] constructed a geometrical model based on vessel structure for optic disc detection, in which the major vessels are viewed as the common vertices of parabolas, the center of optic disc is seen as the center of the model. The above methods boast a high accuracy in normal retinal images, but often fail on abnormal retinal images. Moreover, the high accuracy comes at the cost of a long computation time [14].

To sum up, there is not yet a strategy that can complete optic disc segmentation in retinal images both accurately and efficiently. To make up for this gap, this paper develops a novel optic disc segmentation method coupling active contour tracking and level set method, eliminating the need for reinitialization. The proposed method was verified on public databases like Digital Retinal Images for Vessel Extraction (DRIVE), Structured Analysis of the Retina (STARE), Drishti-GS1 and Messidor, and proved to have a mean accuracy of above 90%.

The remainder of this paper is organized as follows: Section 2 describes the proposed optic disc segmentation method; Section 3 carries out experimental verification of the method and analyzes the experimental results; Section 4 puts forward the research conclusions.

2. Our Optic Disc Segmentation Method

This section mainly introduces the three steps of our optic disc segmentation method.

2.1 Image preprocessing

As shown in Figure 1, a color retinal image contains three channels: Red, Blue and Green. The Red channel features high brightness and low contrast, the Blue channel has low brightness, low contrast and some noise points, and the Green channel boasts a high contrast. In general, the Green channel presents optic disc and retinal vessels clearer than the other channels, which facilitates the detection of optic disc. Therefore, the Green channel image was selected for optic disc segmentation.

Figure 1. Color retinal image and its RGB channels

Original retinal images are often too blurry and dark for object detection. Therefore, the Green channel image was enhanced in two steps: noise suppression by adjusting the magnitude of curvelet coefficients of different sub-band images [17], and nonlinear enhancement of contrast.

2.2 Positioning of optic disc and extraction of region of interest (ROI)

To position optic disc, the center of the brightest and least eccentric region was searched for in the preprocessed Green channel image, which has been converted into a binary image by adaptive threshold. The optic disc positioning and ROI extraction is explained in Figure 2, where O is the center of optic disc, and A~D are the midpoints on the left, right, up and lower edges of optic disc, respectively. The least squares method was adopted to fit the optic disc with a circle, due to its simplicity and rapidity. The center of the circle was a rough estimation of the centroid of the optic disc.

Figure 2. The optic disc positioning and ROI extraction

The circle fitted by least squares method [18] can be expressed as:

${{(x-{{x}_{o}})}^{2}}+{{(y-{{y}_{o}})}^{2}}={{r}^{2}}$          (1)

where, (xo, yo) are the coordinates of circle center; r is radius of the circle.

Let a=-2xo, b=-2yo, and $c=x_{o}^{2}+y_{o}^{2}-{{r}^{2}}$. Then, the curve equation can be rewritten as:

${{x}^{2}}+{{y}^{2}}+ax+by+c=0$    (2)

The coordinates of circle center and radius can be derived from parameters a, b and c:


$\left\{ \begin{align}  & {{x}_{o}}=-\frac{a}{2} \\ & {{y}_{o}}=-\frac{b}{2} \\ & r=\frac{1}{2}\sqrt{{{a}^{2}}+{{b}^{2}}-4c} \\\end{align} \right.$   (3)

The least squares method finds the best matching equation of the sample points that minimizes the sum of squares for error (SSE). Here, the SSE can be expressed as the function Q (a, b, c) about parameters a, b and c, all of which must be greater than or equal to zero. The minimum SSE can be obtained using the function Q (a, b, c) when the partial derivatives of a, b and c are zeros, and substituting the extreme points into the function. In this way, the a, b and c that minimizes the function value can be acquired.

The distance from a sample point (xi, yi) i∈(1,2,3,…,N) to the circle center can be computed by:

${{d}_{i}}^{2}$=${{({{x}_{i}}-{{x}_{o}})}^{2}}+{{({{y}_{i}}-{{y}_{o}})}^{2}}$          (4)

The difference between the square of distance of the sample point to circle edge and the square of radius can be described as:

${{\delta }_{i}}=d_{i}^{2}-{{r}^{2}}$=${{({{x}_{i}}-{{x}_{o}})}^{2}}+{{({{y}_{i}}-{{y}_{o}})}^{2}}-{{r}^{2}}$=$x_{i}^{2}+y_{i}^{2}+a{{x}_{i}}+b{{y}_{i}}+c$     (5)


Taking Q(a, b, c) as the sum of δi squares, the a, b and c that minimizes Q(a, b, c) can be found as:

$Q(a,b,c)$=$\sum{\delta _{i}^{2}}$=${{\sum{[(x_{i}^{2}+y_{i}^{2}+a{{x}_{i}}+b{{y}_{i}}+c)]}}^{2}}$               (6)

Under the principle of minimizing the SSE, the least squares estimation for circle parameters can be expressed as:


$X={{[a\begin{matrix}   {}  \\\end{matrix}b\begin{matrix}   {}  \\\end{matrix}c]}^{T}}={{({{U}^{T}}U)}^{-1}}{{U}^{T}}V={{U}^{-1}}V$   (7)


$U=\left[ \begin{align}  & {{x}_{1}}\begin{matrix}   {} & {{y}_{1}}\begin{matrix}   {} & 1  \\\end{matrix}  \\\end{matrix} \\ & {{x}_{2}}\begin{matrix}   {} & {{y}_{2}}\begin{matrix}   {} & 1  \\\end{matrix}  \\\end{matrix} \\ & {{x}_{3}}\begin{matrix}   {} & {{y}_{3}}\begin{matrix}   {} & 1  \\\end{matrix}  \\\end{matrix} \\\end{align} \right]$, $V=\left[ \begin{align}  & -x_{1}^{2}-y_{1}^{2} \\ & -x_{2}^{2}-y_{2}^{2} \\ & -x_{3}^{2}-y_{3}^{2} \\\end{align} \right]$    (8)


where, (x1, y2), (x2, y2) and (x3, y3) are the coordinates of three of the four points A~D. The circle center of each case was computed, and the mean value of all four cases was taken as the center of optic disc.

In the target image, only the ROI is useful in our research. Hence, the image was cropped into the square covering the position of optic disc (Figure 2(d)).

2.3 Optic disc segmentation by active contour tracking

Actual optic discs are not necessarily regular circles or ellipses. Based on the ROI image, the actual boundaries of optic disc were detected by active contour tracking, rather than view optic disc as a circle or ellipse.

The edge detection has long been a research hotspot. The snake model developed by Kass has been widely used in edge detection, moving object tracking and other fields [19]. The snake model was later extended by Kichenassamy and Caselles [20], who applied level set method to active contour tracking and model solving, ensuring that the curve topology changes through evolution. The extension improves the snake model’s tolerance of texture features and immunity to local optimal trap. Li [21] proposed a level set method without reinitialization: a penalty term is added to the energy function, keeping the level set function as a symbolic distance function through evolution, eliminating the need for repeated reinitializations.

In the light of the features of retinal image, the active contour tracking was coupled with level set method without reinitialization to detect the boundaries of optic disc.

In image segmentation, the active contour model approximates the target edge through dynamic evolution of the initial curve. Thus, the external energy of the image can be defined to approximate the zero level set to target edge [21].

For retinal image I, the edge indicator function can be described as:

$g=\frac{1}{1+|\nabla {{G}_{\sigma }}*I{{|}^{2}}}$       (9)

The ROI image energy can be expressed as [18, 21]

$E(\varphi )=\mu P(\varphi )+{{E}_{g,\lambda ,v}}(\varphi )$=$\mu \int\limits_{\Omega }{\frac{1}{2}}{{(|\nabla \varphi |-1)}^{2}}dxdy$+$\lambda {{L}_{g}}(\varphi )+v{{A}_{g}}(\varphi )$=$\mu \int\limits_{\Omega }{\frac{1}{2}}{{(|\nabla \varphi |-1)}^{2}}dxdy$+$\lambda \int\limits_{\Omega }{g\delta (\varphi )}|\nabla \varphi |dxdy$+$v\int\limits_{\Omega }{H(-\varphi )}dxdy$    (10)

where, Ω is the image field; λ>0 and v are constants; φ(x, y, t) is a symbolic distance function; d is the shortest distance from point (x, y) to curve; φ(x, y, t)d; P(φ) is the penalty term that maintains the level set function as a symbolic distance function; μ is the penalty weight; δ(⋅) is a Dirac delta function; H(⋅) is a Heaviside step function.

The evolution of symbolic distance function φ is accompanied by internal energy μP(φ), which keeps the evolution close to the predefined set of values of the function. Meanwhile, the external energy Eg,λ,v(φ) drives the moving points to the zero level set.

Using variational inference, we have:

$\frac{\partial E}{\partial \phi }=-\mu [\Delta \phi -div(\frac{\nabla \phi }{|\nabla \phi |})]-\lambda \delta (\phi )div(g\frac{\nabla \phi }{|\nabla \phi |})-vg\delta (\phi )$     (11)

where, △ is the Laplace operator. To minimize the energy E, the Euler-Lagrange formula $\frac{\partial E}{\partial \varphi}$ must equal zero.

Then, the gradient flow, the evolution of the level set function, can be obtained by the method of steepest descent:

$\frac{\partial \phi }{\partial t}=\mu [\Delta \phi -div(\frac{\nabla \phi }{|\nabla \phi |})]+\lambda \delta (\phi )div(g\frac{\nabla \phi }{|\nabla \phi |})+vg\delta (\phi )$          (12)

where, the second and third terms on the right are the zero-level curve approaching the target edge. The gradient flow in the internal energy μP(φ) can be described as:

$\Delta \phi -div(\frac{\nabla \phi }{|\nabla \phi |})=div[(1-\frac{1}{|\nabla \phi |})\nabla \phi ]$      (13)

where, $1-\frac{1}{|\nabla \phi|}$ is the diffusion rate. If |∇ϕ|>1, the diffusion is positive and the gradient needs to be reduced; if |∇ϕ|<1, the diffusion is negative and the gradient needs to be increased.

According to finite-difference method, the term $\frac{\partial \phi}{\partial t}$ in formula (12) was subjected to forward difference, while $\frac{\partial \phi}{\partial x}$ and $\frac{\partial \phi}{\partial y}$ to center difference. Then, formula (12) can be rewritten as:

$\frac{\phi _{i,j}^{k+1}-\phi _{i,j}^{k}}{\tau }=L(\phi _{i,j}^{k})$    (14)

To ensure convergence, the time step τ and the penalty weight μ must satisfy:

τ.μ≤1/4            (15)

2.4 Flow of our method

Our optic disc segmentation method is implemented in six steps as shown in Figure 3 below.

Figure 3. The flow of our method.

3. Experiments and Results Analysis

3.1 Databases

Our method was compared with Hough circle detection and least squares ellipse fitting through experiments on four representative public databases on retinal images, namely, the DRIVE, the STARE, Drishti-GS1 and Messidor. The DRIVE offers 40 retinal images (565×548 pixels), the STARE contains 400 retinal images (605×700 pixels), Drishti-GS1 provides 101 retinal images (2047×1748 pixels) and Messidor hosts 1200 retinal images of three different sizes (2240×1488 pixels, 1440×960 pixels and 2304×1356 pixels). All four databases have some abnormal retinal images. The image properties of each database are summed up in Table 1. The experiments were carried out on Matlab R2012b on a personal computer (3.2GHz; 4GB RAM).

Table 1. Image properties of the four experimental databases






Normal image





Diseased image





Total images





3.2 Evaluation of segmentation method

The experiments and validation of our method has been carried out on 4 different public databases. Various quantitative evaluation have been applied to the optic disc segmentation results. Among them, the average segmentation accuracy rate, running time and overlapping ratio are considered as the performance metric [3, 5, 9, 22, 23].

The overlapping ratio (R) is calculated using following formula [5, 22, 23]:

$R=\frac{Area({{A}_{M}}\bigcap {{A}_{T}})}{Area({{A}_{M}}\bigcup {{A}_{T}})}$      (16)

where, AM is the optic disc area manually segmented and AT is optic disc area which is segmented by algorithms in the paper. The value of R varies between 0 and 1. The greater the value, the larger the overlap between segmented optic disc area and the manual one.

3.3 Segmentation results

Figure 4 displays some experimental results, marked with blue asterisks in Figure 4(b), of optic disc positioning. The ROI image in Figure 4(c) was processed by active contour tracking to obtain the boundaries of optic disc. The acquired boundaries are shown as white lines in Figure 4(d).

The segmentation performance of the proposed algorithm on the four databases were compared in terms of average accuracy and average time (Table 2).

Table 2. Average accuracy and average time on four databases






Test Number





Optic Disc Detected





Average Accuracy/%





Average Time/s





The segmented results of Hough circle detection and least squares ellipse fitting are compared with those of our method on DRIVE database are contrasted in Figure 5 and Table 3 below.

Table 3. The test results of the three methods on DRIVE database


Hough Circle

Ellipse fitting

Our Method

Average Accuracy/%




Average Time/s




Average R




(a) Original image (b) Optic disc positioning (c) ROI image (d) Results of our method

Figure 4. Some experimental results

(a) Original image (b) Least squares ellipse fitting (c) Hough circle detection (d) Results of our method

Figure 5. Some results of the three methods on DRIVE database

3.4 Discussion

As shown in Table 2 and Figure 4, our method has achieved accuracies of 100%, 92.6% , 99% and 95.7% in the DRIVE, STARE, Drishti-GS1 and Messidor databases respectively. Nevertheless, the positioning and segmentation accuracies of our method were relatively low on the STARE, due to the heavy presence of abnormal retinal images. Some of the images contain serious lesions and even destroyed optic discs.

The results on Messidor database show that segmentation accuracy is severely affected by low contrast and bright edges in the images. Our method managed to achieve a relatively high accuracy, as it has enhanced the contrast and reduced the edge brightness in advance (Figure 4(d)). However, even our method could not correctly detect optic disc when the image contains serious eye diseases.

As shown in Table 3 and Figure 5, our method outperformed the two contrastive approaches in the experiment on the DRIVE database.

Comparing Figure 4 and Figure 5, it is learned that both Hough circle detection and least squares ellipse fitting managed to detect the boundaries of optic disc. However, their results were regular circle or ellipse, which deviate from the actual shape. In addition, our method was 10 times faster than Hough circle detection. To sum up, our method is an effective way to segment optic disc, capable of outputting close-to-reality boundaries and a high overlapping ratio.

4. Conclusions

The speed and accuracy of optic disc positioning and segmentation are critical to the diagnosis of fundus diseases. However, many difficulties arise from uneven illumination and low contrast of retinal image, the influence of bright spot lesions and pathological changes. To overcome the difficulties, this paper proposes an optic disc segmentation method that identifies the center of optic disc by least squares method and detects the boundaries of optic disc through active contour tracking. The proposed method was compared with two other approaches on 4 public databases. The results show that our method achieved higher segmentation accuracy and lower computing complexity than the contrastive methods, and remained effect despite the low contrast or mild pathological changes in retinal images. Future research will try to improve the accuracy of our method on retinal images with severe lesions.


The authors would like to specially thank the management teams of the DRIVE, the STARE and Drishti-GS1 and Messidor databases for providing retinal fundus image databases. These databases were download from these publicly available links.

This work was supported by the Natural Science Foundation of Guangdong Province (Grant No. 2016A030307044, S2012040007376, 2016A030307045).


[1] Thakur, N., Juneja, M. (2018). Survey on segmentation and classification approaches of optic cup and optic disc for diagnosis of glaucoma. Biomedical Signal Processing and Control, 42: 162-189.

[2] Zou, B., Chen, C., Zhu, C., Duan, X., Chen, Z. (2018). Classified optic disc localization algorithm based on verification model. Computers & Graphics, 70: 281-287.

[3] Chakravarty, A., Sivaswamy, J. (2017). Joint optic disc and cup boundary extraction from monocular fundus images. Computer Methods and Programs in Biomedicine, 147: 51-61.

[4] Olson, J.A., Sharp, P.F., Fleming, A., Philip, S. (2008). Evaluation of a system for automatic detection of diabetic retinopathy from color fundus photographs in a large population of patients with diabetes. Diabetes Care, 31(8): e63.

[5] Li, A., Niu, Z., Cheng, J., Yin, F., Wong, D.W.K., Yan, S.C., Liu, J. (2018). Learning supervised descent directions for optic disc segmentation. Neurocomputing, 275(1): 350-357.

[6] Sekhar, S., Ai-Nuaimy, W., Nandi, A.K. (2008). Automated localization of retinal optic disk using hough transform. IEEE International Symposium on Biomedical Imaging, 1577-1580.

[7] Pallawala, P., Hsu, W., Lee, M.L., Eong, K. (2004). Automated optic disc localization and contour detection using ellipse fitting and wavelet transform. European Conference on Computer Vision, 139-151.

[8] Decenciere, E., Zhang, X., Cazuguel, G., Lay, B., Cochener, B., Trone, C., Gain, P., Ordonez, R., Massin, P., Erginay, A., Charton, B., Klein, J. (2014). Feedback on a publicly distributed image database: The messidor database. Image Analysis & Stereology, 33(3): 231-234.

[9] Rashmi, P., Puhan, N.B., Ganapati, P. (2017). Robust and accurate optic disk localization using vessel symmetry line measure in fundus images. Biocybernetics and Biomedical Engineering, 37: 466-476

[10] Lu, S. (2011). Accurate and efficient optic disc detection and segmentation by a circular transformation. IEEE Trans Med Imaging, 30(12): 2126-2133.

[11] Walter, T., Klein, J. (2001). Segmentation of color fundus images of the human retina: Detection of the optic disc and the vascular tree using morphological techniques. International Symposium on Medical Data Analysis, 282-287.

[12] Morales, S., Naranjo, V., Angulo, J., Alcaniz, M. (2013). Automatic detection of optic disc based on PCA and mathematical morphology. IEEE Transactions on Medical Imaging, Institute of Electrical and Electronics Engineers, 32(4): 786-796.

[13] Cheng, J., Liu, J., Xu, Y., Yin, F., Wong, D.W.K., Tan, N., Tao, D.C., Cheng, C., Aung, T., Wong, T. (2013). Superpixel classification based optic disc and optic cup segmentation for glaucoma screening. IEEE Transactions on Medical Imaging, 32(6): 1019-1032.

[14] Youssif, A.R., Ghalwash, A.Z., Ghoneim, A.R. (2008). Optic disc detection from normalized digital fundus images by means of a vessels' direction matched filter. IEEE Transactions on Medical Imaging, 27(1): 11-18.

[15] Zhang, D., Zhao, Y. (2014). Novel accurate and fast optic disc detection in retinal images with vessel distribution and directional characteristics. IEEE Journal of Biomedical and Health Informatics, 20(1): 333-342.

[16] Foracchia, M., Grisan, 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(10): 1189-1195.

[17] Luo, Z., Lin, T. (2009). Algorithm of adaptive image de-noising based on curvelet transform. Systems Engineering and Electronics, 31(3): 515-517.

[18] Luo, Z., Jia, Y. (2016). The bovine iris location method based on dynamic contour tracking and least square principle. International Journal of Signal Processing, Image Processing and Pattern Recognition, 9(7): 275-284.

[19] Kass, M., Witkin, A., Terzopoulos, D. (1988). Snakes: Active contour models. International Journal of Computer Vision, 1(4): 32l-331.

[20] Caselles, V., Kimmel, R., Sapiro, G. (1997). Geodesic active contours. International Journal of Computer Vision, 22(1): 61-79.

[21] Li, C., Xu, C., Gui, C., Fox, M.D. (2005). Level set evolution without reinitialization: A new variational formulation. Proceeding of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 430-436.

[22] Dai, B., Wu, X., Bu, W. (2017). Optic disc segmentation based on variational model with multiple energies. Pattern Recognition, 64: 226-235.

[23] Sarathi, M.P, Dutta, M.K, Singh, A., Travieso, C.M. (2016). Blood vessel inpainting based technique for efficient localization and segmentation of optic disc in digital fundus images. Biomedical Signal Processing and Control, 25: 108-117.