Improvement of Retinal Images Affected by Cataracts

Eye fundus images are used in clinical diagnosis for the detection and assessment of retinal disorders. When retinal images are degraded by scattering due to opacities of the eye tissues, the precise detection of abnormalities is complicated depending on the grading of the opacity. This paper presents a concept proof study on the use of the contrast limited adaptive histogram equalization (CLAHE) technique for better visualization of eye fundus images for different levels of blurring due to different stages of cataracts. Processing is performed in three different color spaces: RGB, CIELAB and HSV, with the aim of finding which one better enhances the missed diagnostic features due to blur. The experimental results show that some fundus features not observable by naked eye can be detected in some of the space color processed with the proposed method. In this work, we also develop and provide an online image process, which allows clinicians to tune the default parameters of the algorithm for a better visualization of the characteristics of fundus images. It also allows the choice of a region of interest (ROI) within the images that provide better visualization of some features than those enhanced by the processing of the full picture.


Introduction
Cataract is a common eye condition which cause vision loss due to opacity of the crystalline lens. Its development is related with genetics, aging, systemic or ocular pathologies, or injuries [1]. The loss of vision is manifested by a reduction in contrast due to scattering at the tissues. This pathology not only limits vision to patients, but also can impede visualization of the eye fundus, confusing or complicating the diagnosis of ocular pathologies such as age-related macular degeneration or Stargardt disease [2], retinal detachment, diabetic retinopathy [3], or visceral leishmaniasis [4]. Systemic illness, such as diabetes, not only affects the eye fundus, inducing retinal hemorrhages and venous tortuosity, but also causes cataract development [3]. A crystalline lens might present different stages of cataracts, which cause a shift in the color temperature of retinal images to warmer temperatures and a reduction of the contrast due to intraocular scattering.
Detecting the finer details of the fundus images is very important for eye doctors to provide an accurate diagnosis. Improvement of blurred eye fundus images has been Photonics 2022, 9, 251 2 of 12 studied within the past decades to detect early stages of pathological processes that affect the retina. Most of these studies have focused on increasing the contrast of the arteriovenous tree to detect vascular diseases such as diabetic retinopathy [5][6][7][8]. Moreover, the ongoing efforts primarily focus on automatization of the detection thanks to artificial intelligence and neural networks not only in fundus photographs but also in Optical Coherence Tomography (OCT) images [9][10][11].
OCT [12,13] and Scanning Laser Ophthalmoscopy (SLO) [14] have changed clinical practice and opened new areas of understanding. However, they are not available to all eye care centers whereas the fundus cameras are. Retinal fundus images are widely and routinely used in the clinic to diagnose and monitor many ocular diseases.
Different studies have researched the improvement of the quality of retinal images aiming to color improvement for detection of the blood vessels, but only a few have included some slightly blurry images due to cataracts [13,15,16]. Moreover, the processing was performed on a grey level image or on the green channel to improve vessel detection. To our knowledge, a method focused on the improvement of color retinal images blurred by different grades of cataracts designed to facilitate the clinical evaluation of retinal diseases has not been provided.
The aim of this work is to preset a method to improve blurred images of the eye fundus degraded by cataracts for easing the clinical assessment of retinal pathologies. The method uses the CLAHE (contrast limited histogram equalization) algorithm, which enhances the local contrast of the images [17]. We show the improvement in terms of feature identification achieved in images blurred by cataracts of different severity in three different color spaces, RGB, CIELAB and HSV. The processed images are easier to interpret, showing better delimitation of retinal exudates, unseeing microaneurysm or hyalinized vessels, among other features.
The scheme of the paper is as follows. In Section 2, we provide the grading cataractous opacities leading to different levels of blur in the eye fundus images, the materials used to acquire the images and the methodology proposed. In Sections 3 and 4, we present the results and the discussion. Finally, in Section 5, we present the conclusions.

Background and Method
Cataract classification: Many grading systems have been proposed to classify cataract severity. In this work, we follow the Lens Opacity Classification System II, LOCS II [18], which has four grades, classified depending on the quality of the retinal fundus images, and is commonly used in clinical settings, as well as in some methods for automatic grading [19].  [20]. These images present two different sizes (2592 × 1728 and 2464 × 1632). They were organized in three groups of five images, with groups corresponding to mild, moderate and severe cataracts, respectively. The classification, which followed LOCS II, was performed by two clinicians independently, with both clinicians being in agreement regarding the cataract stage of the images selected. The second set of 17 JPG retinal images was taken from the private database of images of the Universitary Hospital of Santiago de Compostela (obtained with a Midriatic Retinographer NIDEK CO., LTD at the Ophthalmology Service). Before taking the images, the permission Photonics 2022, 9, 251 3 of 12 to use them for research purposes was explained to each patient, and written informed consent was obtained. The study was conducted in accordance with the tenets of the Declaration of Helsinki. From the hospital database, we preset one image representative to each cataract stage to show how the algorithm can help to assess a better diagnostic (although the algorithm showed comparable results for all the images processes with our software). The size of these images was 2976 × 2976 pixels.
Computational Technique: A wide range of image processing techniques have been suggested to perform image enhancement of clear retinal images. Contrast Enhancement (CE) via histogram equalization (HE) is a method that expands the intensity distribution of a gray image to utilize all the dynamic range of the picture [21]. The method is particularly useful for dark images but not for images with varying contrast characteristics. Here, Adaptive Histogram Equalization (AHE) [22] and, later, CLAHE become more efficient [23,24]. CLAHE is designed to work adaptively on the image by enhancing contrast in several small regions called tiles or blocks. The contrast is enhanced at each tile followed by a clipping. Both parameters must be determined by the user.
Image processing: We developed the algorithm in Matlab 2021a. It consists of 5 steps: 1.
The JPG image is split to RGB channels. RGB channels are converted to CIE 1976 lab (CIELAB) or HSV [25,26] channels.

2.
Local histogram equalization is performed in the R and G channels of RGB, L channel for CIELAB, and V channel for HSV, respectively. 3.
We use the Matlab built-in function adapthisteq() that uses CLAHE to enhance the contrast in the channels. This function needs three input parameters: 'NBins' is number of bins of the histogram used to improve contrast, 'NumTiles' is the size of the rectangular region where the local contrast enhancement will be performed and 'ClipLimit' is a contrast factor that avoids the oversaturation in some regions of the image. Below, we explain how we chose the default values for retinal images affected by the same stage of cataract.

4.
Median filtering of processed channels for noise removal: We used the Matlab built-in function medfilt2() over a region of 11 × 11 pixels to remove high-frequency noise amplified during the local histogram equalization.

5.
RGB merging, and CIELAB or HSV to RGB conversion. Figure 1 shows the block diagram of the method.
by two clinicians independently, with both clinicians being in agreement regarding the cataract stage of the images selected. The second set of 17 JPG retinal images was taken from the private database of images of the Universitary Hospital of Santiago de Compostela (obtained with a Midriatic Retinographer NIDEK CO., LTD at the Ophthalmology Service). Before taking the images, the permission to use them for research purposes was explained to each patient, and written informed consent was obtained. The study was conducted in accordance with the tenets of the Declaration of Helsinki. From the hospital database, we preset one image representative to each cataract stage to show how the algorithm can help to assess a better diagnostic (although the algorithm showed comparable results for all the images processes with our software). The size of these images was 2976 × 2976 pixels. Computational Technique: A wide range of image processing techniques have been suggested to perform image enhancement of clear retinal images. Contrast Enhancement (CE) via histogram equalization (HE) is a method that expands the intensity distribution of a gray image to utilize all the dynamic range of the picture [21]. The method is particularly useful for dark images but not for images with varying contrast characteristics. Here, Adaptive Histogram Equalization (AHE) [22] and, later, CLAHE become more efficient [23,24]. CLAHE is designed to work adaptively on the image by enhancing contrast in several small regions called tiles or blocks. The contrast is enhanced at each tile followed by a clipping. Both parameters must be determined by the user.
Image processing: We developed the algorithm in Matlab 2021a. It consists of 5 steps: 1. The JPG image is split to RGB channels. RGB channels are converted to CIE 1976 lab (CIELAB) or HSV [25,26] channels. 2. Local histogram equalization is performed in the R and G channels of RGB, L channel for CIELAB, and V channel for HSV, respectively. 3. We use the Matlab built-in function adapthisteq() that uses CLAHE to enhance the contrast in the channels. This function needs three input parameters: 'NBins' is number of bins of the histogram used to improve contrast, 'NumTiles' is the size of the rectangular region where the local contrast enhancement will be performed and 'ClipLimit' is a contrast factor that avoids the oversaturation in some regions of the image. Below, we explain how we chose the default values for retinal images affected by the same stage of cataract. 4. Median filtering of processed channels for noise removal: We used the Matlab builtin function medfilt2() over a region of 11 × 11 pixels to remove high-frequency noise amplified during the local histogram equalization. 5. RGB merging, and CIELAB or HSV to RGB conversion.  After merging, CIELAB and HSV provide color images close to true color, while RGB merging provides false color images. It is possible to adjust the color balance to obtain true color images, but we did not add this additional step in this work because we believe After merging, CIELAB and HSV provide color images close to true color, while RGB merging provides false color images. It is possible to adjust the color balance to obtain true color images, but we did not add this additional step in this work because we believe that image details can be more easily detected by eye professionals without this image alteration. The software (Cataract.deHaze_v1.exe) can be downloaded for its use at the webpage of the research group, https://photonics4life.es/software/ (accessed on 6 April 2022).
How to choose CLAHE parameters: -NTiles and NBins: NTiles defines the block size or local region around a pixel for which the histogram is equalized. This size should be larger than the size of features to

Results
In Figures 2-4, we show images selected from the public database obtained as representative cases of mild, moderate and severe cataracts, and processed in the three color spaces, RGB, CIELAB and HSV.
In Figures 5-8, we show four images obtained under no cataract, mild, moderate and severe cataracts levels, taken at the Ophthalmology Service of the University Hospital of the University of Santiago de Compostela. These images were chosen to show the enhancement obtained for different grades of cataracts in retinas showing different pathological features. These figures are labeled with small letters placed close to pathological details for discussion.
In Figure 9, we show a snapshot of the interface of the software. In the menu, the retinal image must be loaded. The processed image appears in the screen automatically. The default parameters needed by the CLAHE algorithm are set as those explained above, but the program makes it possible to choose all of them depending on the characteristics of the pictures provided by different retinographers. The program also allows the selection of rectangular regions of interest (ROI) within the image where details want to be detected.
In Figure 10, we show the results of applying the algorithm for the CIELAB color space in the region of the optic disc, allowing for an improved visualization of its vascularization, which may help in the early detection of neovascularization associated to pathologies such as proliferative diabetic retinopathy.                   In Figure 9, we show a snapshot of the interface of the software. In the me retinal image must be loaded. The processed image appears in the screen autom The default parameters needed by the CLAHE algorithm are set as those explained but the program makes it possible to choose all of them depending on the charac of the pictures provided by different retinographers. The program also allows th tion of rectangular regions of interest (ROI) within the image where details wa detected.  In Figure 9, we show a snapshot of the interface of the software. In the me retinal image must be loaded. The processed image appears in the screen automa The default parameters needed by the CLAHE algorithm are set as those explained but the program makes it possible to choose all of them depending on the charact of the pictures provided by different retinographers. The program also allows th tion of rectangular regions of interest (ROI) within the image where details wan detected.   In Figure 10, we show the results of applying the algorithm for the CIELAB colo space in the region of the optic disc, allowing for an improved visualization of its vascu larization, which may help in the early detection of neovascularization associated to pa thologies such as proliferative diabetic retinopathy.   Figure 2, the RGB space helps the detection o the damaged region in the nasal parafovea. In the third row of Figure 3, the image ob tained in the CIELAB space shows clearly how the peripapillary exudates. In this image the RGB version shows the presence of hemorrhage in the inferotemporal arcade wit greater detail. In Figure 4 (severe cataract,) the software allows the detection of the opti disc and vasculature, and the visualization of the macular region with enough quality t detect relevant lesions. Figures 5-8 show the results obtained from some of the images obtained at the Uni versitary Hospital of Santiago de Compostela. Again, the increase of the contrast and vis ualization of details is noticeable for the RGB and CIELAB images, allowing for a faste identification of most of the retinal structures.

Discussion
In Figure 5, corresponding to non-cataract, the original image is clear. After pro cessing, details arise in the RGB and CIELAB images, whereas not much improvemen can be seen for the HSV images, in which the optic disk is missing. The processed imag allows a good visualization of the fibrovascular proliferations (a), hemorrhages (b) and hyalinized vessels (c). Note the excellent visualization of blood flow fragmentation in superior temporal vessel (d), specially for the RGB case, due to the false color. The exten sion of the hard exudates (e) is easier to delimit, being higher than expected considerin the unprocessed image. The processed image shows an unseeing microaneurysm (f) and microhemorrhage (g).
In Figure 6, a good enhancement can be observed between the original retinograph and the processed images, mainly for the RGB and CIELAB color spaces. The processed images clearly show the superficial retinal vascular plexus (a). The presence of preretina hemorrhagic (b) and neovascularization (c) can also be observed. The optic nerve is we defined. Figure 7 shows an intense blurring in the original retinography, while the processed images in RGB and CIELAB allow a good visualization of the optic nerve (a), retinal ves sels (b), chorioretinal tapetum (c), fibrovascular tissue (d) and hemorrhage (e). In addition   Figure 2, the RGB space helps the detection of the damaged region in the nasal parafovea. In the third row of Figure 3, the image obtained in the CIELAB space shows clearly how the peripapillary exudates. In this image, the RGB version shows the presence of hemorrhage in the inferotemporal arcade with greater detail. In Figure 4 (severe cataract,) the software allows the detection of the optic disc and vasculature, and the visualization of the macular region with enough quality to detect relevant lesions. Figures 5-8 show the results obtained from some of the images obtained at the Universitary Hospital of Santiago de Compostela. Again, the increase of the contrast and visualization of details is noticeable for the RGB and CIELAB images, allowing for a faster identification of most of the retinal structures.

Discussion
In Figure 5, corresponding to non-cataract, the original image is clear. After processing, details arise in the RGB and CIELAB images, whereas not much improvement can be seen for the HSV images, in which the optic disk is missing. The processed image allows a good visualization of the fibrovascular proliferations (a), hemorrhages (b) and hyalinized vessels (c). Note the excellent visualization of blood flow fragmentation in a superior temporal vessel (d), specially for the RGB case, due to the false color. The extension of the hard exudates (e) is easier to delimit, being higher than expected considering the unprocessed image. The processed image shows an unseeing microaneurysm (f) and microhemorrhage (g).
In Figure 6, a good enhancement can be observed between the original retinography and the processed images, mainly for the RGB and CIELAB color spaces. The processed images clearly show the superficial retinal vascular plexus (a). The presence of preretinal hemorrhagic (b) and neovascularization (c) can also be observed. The optic nerve is well defined. Figure 7 shows an intense blurring in the original retinography, while the processed images in RGB and CIELAB allow a good visualization of the optic nerve (a), retinal vessels (b), chorioretinal tapetum (c), fibrovascular tissue (d) and hemorrhage (e). In addition, the impacts of photocoagulation (f) can be better identified. Macula visualization (g) is much better than in the original image, making it possible to observe the health of pigmentary epithelium and the shining of the epiretinal membrane (h), which are not visible in the original image. In addition, it is easier to identify hyalinized vessels (i) and blow flow fragmentation in the superior temporal vessel (j).
In Figure 8, the processed image in RGB and CIELAB shows very good resolution, enabling the observation of the optic disc (a), macula (b), superficial retinal vascular plexus (c) and chorioretinal tapetum (d) in comparison to the unprocessed image.
All retinal features and pathologies were analyzed by the clinicians, who are the coauthors of this work. They agreed and recognized the different retinal features and did not find artifacts that could resemble retinal details. Artifacts in the shape of lines or squares appear always in severe cataracts. In mild and moderate cataract images, artifacts appear in the blurry regions close to the edges of the images. Therefore, the appearance of these artifacts is closely related to the degree of blurriness of the image. The spatial frequency of the lines or squares depends on the block size. The bigger the value of NTiles, the higher the frequency of the artifacts.
Finally, in Figure 11, we show the grey profiles along one vessel in two of the images presented in this work, which clearly show the enhancement of details for the different colormaps. These profiles are commonly used for automatic detection of vasculature in retinal images [10].
Photonics 2022, 9,251 10 of 12 the impacts of photocoagulation (f) can be better identified. Macula visualization (g) is much better than in the original image, making it possible to observe the health of pigmentary epithelium and the shining of the epiretinal membrane (h), which are not visible in the original image. In addition, it is easier to identify hyalinized vessels (i) and blow flow fragmentation in the superior temporal vessel (j). In Figure 8, the processed image in RGB and CIELAB shows very good resolution, enabling the observation of the optic disc (a), macula (b), superficial retinal vascular plexus (c) and chorioretinal tapetum (d) in comparison to the unprocessed image.
All retinal features and pathologies were analyzed by the clinicians, who are the coauthors of this work. They agreed and recognized the different retinal features and did not find artifacts that could resemble retinal details. Artifacts in the shape of lines or squares appear always in severe cataracts. In mild and moderate cataract images, artifacts appear in the blurry regions close to the edges of the images. Therefore, the appearance of these artifacts is closely related to the degree of blurriness of the image. The spatial frequency of the lines or squares depends on the block size. The bigger the value of NTiles, the higher the frequency of the artifacts.
Finally, in Figure 11, we show the grey profiles along one vessel in two of the images presented in this work, which clearly show the enhancement of details for the different colormaps. These profiles are commonly used for automatic detection of vasculature in retinal images [10].

Conclusions
Cataracts reduce the contrast of retinal images, impairing the identification of the structures and signs of ocular and systemic pathologies. Therefore, the development of image processing strategies oriented to remove the blur induced by cataracts of different stages is of relevance not only for visual exploration of the retina, but also for automatic diagnosis. The present work is a concept probe study where we tested the proposed algorithm with 15 images from a public database and 17 images from our own database. In these images, the clinicians involved in the study did not identify any false features that could have been induced by the image processing algorithm. Our work shows the benefits of improving the contrast of color images by applying the contrast limited histogram equalization method (CLAHE), in combination with high-frequency filtering, in specific channels of three different color spaces: the R and G channels for RGB images, L channel

Conclusions
Cataracts reduce the contrast of retinal images, impairing the identification of the structures and signs of ocular and systemic pathologies. Therefore, the development of image processing strategies oriented to remove the blur induced by cataracts of different stages is of relevance not only for visual exploration of the retina, but also for automatic diagnosis. The present work is a concept probe study where we tested the proposed algorithm with 15 images from a public database and 17 images from our own database. In these images, the clinicians involved in the study did not identify any false features that could have been induced by the image processing algorithm. Our work shows the benefits of improving the contrast of color images by applying the contrast limited histogram equalization method (CLAHE), in combination with high-frequency filtering, in specific channels of three different color spaces: the R and G channels for RGB images, L channel for CIELAB images, and H channel for HSV images. We showed that the proposed algorithm provides the visualization of features in the processed images that can be hardly seen or detected in the original ones. RGB and CIELAB images provided better results than HSV ones. RGB images obtained after processing were kept in false color because they provided a better subjective identification of retinal pathological details. CIELAB processed images only needed processing in one channel, which did not sacrifice quality. HSV images provided the worse results near the optic disc. Finally, we share the interface used in our study, which can be download from the webpage of our research group at https://photonics4life.es/software/ (accessed on 6 April 2022). Future versions of the software will be also available. Funding: This work has been funded by Ministerio de Ciencia e Innovación PID2020-115909RB-I00. Nery Garcia-Porta is supported financially by a Maria Zambrano contract at USC under the grants call for the requalification of the Spanish university system 2021-2023, funded by the European Union-NextGenerationEU.

Institutional Review Board Statement:
The study was conducted in accordance with the Declaration of Helsinki, and approved by the Ethics Committee of Universidade de Santiago de Compostela for studies involving humans.
Informed Consent Statement: Written informed consent was obtained from all subjects involved in the study.

Conflicts of Interest:
The authors declare no conflict of interest.