Fundus Preprocessing
A few algorithm to enhance fundus images are included in maples_dr.preprocessing.
Warning
The preprocessing algorithms require the opencv-python package to be installed.
- clahe_preprocessing(fundus, mask=None)
Preprocessing based on Contrast Limited Adaptive Histogram Equalization (CLAHE).
This algorithm was used to annotate MAPLES-DR anatomical and pathological structures.
- fundus_roi(fundus, blur_radius=5, morphological_clean=False, smoothing_radius=0, final_erosion=4)
Compute the region of interest (ROI) of a fundus image.
Parameters:
- fundus:
The fundus image.
- blur_radius:
The radius of the median blur filter.
By default: 5.
- morphological_clean:
Whether to perform morphological cleaning. (small objects removal and filling of the holes not on the border)
By default: False.
- smoothing_radius:
The radius of the Gaussian blur filter.
By default: 0.
- final_erosion:
The radius of the disk used for the final erosion.
By default: 4.
- returns:
The ROI mask.
- median_preprocessing(fundus)
Preprocessing based on median filtering.
This algorithm is often used as a preprocessing step for automatic vessel segmentation.
- Parameters:
fundus (ndarray) – The fundus image as a BGR numpy array (height, width, 3).
- Return type:
The preprocessed fundus image.
- preprocess_fundus(fundus, preprocessing)
Preprocess a fundus image.
- Parameters:
fundus (ndarray) – The fundus image to preprocess.
preprocessing (Preprocessing | str) – The preprocessing algorithm to apply. See
maples_dr.config.Preprocessing
for the available options.
- Return type:
The preprocessed fundus image.