## 2 Materials and Methods
### Data Preprocessing
Figure 9 depicts the comparison of RoI before and after red channel extraction. The next step is to enhance the optic disc area from the background. To do this, we perform filtering, contrast adjustment, and artifacts removal, then subsequently, morphological reconstruction. We use a moving average filter (filtering) to smooth out the RoI texture so it then enhances the boundaries between the optic disc and the background. Moreover, the adjustment to the contrast will intensify the difference, since the optic disc  
Figure 8: The flow process of pretreatment. Figure 9: Red channel extraction. RoI before the extraction (**a**) and the RoI after the extraction leaving only a red channel on the image (**b**). area (where the brightest pixels mostly lie) will become brighter while the background will get less bright [6]. After some experiments, we empirically set the kernel of the average filter to 20 by 20. To further enhance the presence of the optic disc, the unnecessary artifacts surrounding the optic disc area are removed by combining the top hat and bottom hat methods. Following this process is morphological reconstruction. This step is to reconstruct the optic disc area after artifact removal. After the pretreatment, the optic disc is now ready to be extracted. To separate the optic disc from its background, an active contour [46] is used. We empirically set the iteration to 400 times, as this gave the best result for all images. Figure 10a shows the result of the segmented optic disc. Despite the pretreatment process to optimize the segmentation process, in some cases, the segmentation process still failed to extract only the optic disc region. To solve this problem, a region selection process is conducted by eliminating the regions that do not satisfy the requirements. This special case is depicted in Figure 10b. After leading a successful OD segmentation, we continued our experiment in blood vessel segmentation. Since blood vessels were not clearly appearing, we applied an enhancement process to the blood vessel to increase the quality of the image. Determining a method that was able to enhance the contrast of blood vessels was very difficult because the blood vessels were often of low intensity. This study required a method that was able to enhance the specific area. Adaptive histogram equalization had the ability to enhance the specific area by calculating the cumulative distribution function (CDF). However, this method produced high complexity and needed a long time [50]. Contrast limited adaptive histogram equalization (CLAHE), which works by finding the histogram limit value for enhancing the specific area, was considered to resolve this limitation [51]. The limit value was called a clip limit, describing the highest maximum limit of a histogram. The clip limit can be calculated by using Equation (2),  
\[\beta=\frac{M}{N}\Big{(}1+\frac{\alpha}{100}\left(S_{max}-1\right)\Big{)} \tag{1}\]  
with \(M\) being region size, \(N\) being the grayscale value, and \(\alpha\) defining the clip factor, which has a range value of 0 to 100. After removing the noises and enhancing the quality of the image, we performed Otsu thresholding [52] to find the specific blood vessel area, followed by a closing morphological operation to remove artifacts. The Otsu thresholding method can be defined as follows,  
\[\sigma_{B}^{2}(k^{*})=\underset{1\leq k\leq L}{\max}\sigma_{B}^{2}(k) \tag{2}\]  
Figure 3:0 Illustration of (**a**) the segmented optic disc is presented as a binary image. The white part is the optic disc while the black is the background and (**b**) the part on the side of the image is the artifacts included in the segmentation process yielding an incorrect representation of the optic disc. Figure 3:1  
with \(\mu_{T}\omega(k)\) is the total mean value which can be calculated by using Equation (4), \(\mu(k)\) defines the first cumulative moment value which can be formulated as Equation (5), and \(\omega(k)\) is the zeroth cumulative moment value formulated in Equation (6).