Glaucoma is a vision-threatening condition resulting from increased intraocular pressure, leading to optic nerve damage and potential vision loss. Early detection is crucial, but in Indonesia, over half of glaucoma cases are diagnosed at severe stages. One of the approaches for early detection is by using characteristics visible in a fundus image as indicators. With this approach, the segmentation of optic disc and optic cup plays an important role to extract features such as cup-to-disc ratios or rim-to-disc ratios as an indication for glaucoma. Almustofa (2021) proposed an automated glaucoma detection method using these segmentations but only tested it on limited datasets, namely Drishti-GS and REFUGE Training Set. This study presents an optimized method by incorporating the REFUGE Validation and Test sets. Optic disc segmentation attains F-Scores of 0.979 $\pm 0.005$ for Drishti-GS and 0.942 $\pm$ 0.026 for REFUGE. Optic cup segmentation achieves F-Scores of 0.948 $\pm$ 0.020 in Drishti-GS and 0.843 $\pm$ 0.068 in REFUGE datasets. These results demonstrate the improved performance of the optimized method for glaucoma detection.