I am currently trying to extract blood vessels from an image of the eye. So far, I have been able to display the blood vessels, but there is still a significant amount of noise around the image - it seems like salt and pepper noise. I want to try and highlight the blood vessels even more so only they appear. I am currently using OpenCV in Python.
I have tried to use different types of blur such as Median Blur. I also tried Open, Close, Dilation, and Erosion, but the noise still remains. I am not sure what the next step could be.
Here is my code:
r = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
threshold=cv2.adaptiveThreshold(r, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 91, 2.)
ret,f6 = cv2.threshold(threshold,0,250,cv2.THRESH_BINARY)
morph_img = cv2.morphologyEx(f6, cv2.MORPH_CLOSE, kernel)
imagem = cv2.bitwise_not(morph_img)
imagem2 = cv2.bilateralFilter(imagem,9,55,55)
imagem3 = cv2.medianBlur(imagem2,5)
imagem3 = cv2.bilateralFilter(imagem3,7,55,55)
imagem3 = cv2.dilate(imagem3,kernel,iterations=5)
imagem3 = cv2.medianBlur(imagem3,5)
return imagem3
I would just like to see the blood vessels on the black screen. It needs to be so that the blood vessels are also continuous as well.
This is the current image I am able to produce:

Original Image

