Fundus Preprocessing

A few algorithm to enhance fundus images are included in maples_dr.preprocessing.

Avertissement

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.

Paramètres:
  • fundus (ndarray) – The fundus image as a BGR numpy array (height, width, 3).

  • mask (ndarray | None)

Type renvoyé:

The preprocessed fundus image.

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.

Paramètres:

fundus (ndarray)

Type renvoyé:

ndarray

median_preprocessing(fundus)

Preprocessing based on median filtering.

This algorithm is often used as a preprocessing step for automatic vessel segmentation.

Paramètres:

fundus (ndarray) – The fundus image as a BGR numpy array (height, width, 3).

Type renvoyé:

The preprocessed fundus image.

preprocess_fundus(fundus, preprocessing)

Preprocess a fundus image.

Paramètres:
Type renvoyé:

The preprocessed fundus image.