I am trying to apply a local contrast enhancement technique given in a research paper but after observing the output, I am really not sure whether I am applying it correctly.
Following is a preprocessing technique taken from research paper-
Fundus images show significant variability in lighting within the image due to the curvature of the retina. To counter this unfavor- able characteristic, a local contrast enhancement is implemented. Prior to this, the ROI is padded using the technique described in Soares et al. (2006) to prevent the excessive contrast enhancement at the border. In the case of DRIVE, a Gaussian filter with kernel of 65 × 65 pixels, zero mean and standard deviation of size 10 is applied to the fundus image. For the HRF data set, is increased to 60, corresponding to the larger image size when compared to DRIVE. Finally, the output from the convolution is subtracted from the original image (Fig. 2):
N(w, h) = I(w, h) − G(w, h), (1)
where N is the normalized image, I is the original image, and G is the Gaussian blurred image.
I have padded the image using the technique described in Soares et al(2006),below is my image-
and the output, I am getting-
Below is the output from the research paper-
I really don’t think the second picture in the above image is in any way remotely similar to my output(even ignoring the output in padded region)
Also, I don’t know how to crop the FOV based on the mask as shown in the third picture so not posting that output.
Below is my code-
from PIL import Image from skimage.filters import gaussian def gaussian_blur(img): image = np.array(img) image_blur = cv2.GaussianBlur(a,(65,65),10) new_image = a- image_blur new_image = new_image*255 return new_image new_img = gaussian_blur(a)