I'm working with hair removal on skin images. Searching the literature, the means to achieve my goal, is by applying some techniques of segmentation and noise removal in images. Which I'm applying to. An example image I work for is this:
ApplyingtheGaussianDiferenceoftheimageIhavetheoutput:
importcv2importnumpyasnp#readtheinputfileimg=cv2.imread('014.bmp')#runa5x5gaussianblurthena3x3gaussianblrblur5=cv2.GaussianBlur(img,(5,5),0)blur3=cv2.GaussianBlur(img,(3,3),0)DoGim=blur5-blur3cv2.imwrite('014-DoG.jpg',DoGim)
ThenIusethemorphologicaloperator:cv2.morphologyExtoremovethenoisesfromtheimage,leavingonlythehairs,sothatlater,Icanapplyamasktoremovethosehairs.However,theoutputforboth%of%and%of%donotmeettheexpecitative.
importnumpyasnpimportmatplotlib.pyplotaspltimportcv2pic=cv2.imread('014DoG.jpg')img2gray=cv2.cvtColor(pic,cv2.COLOR_RGB2GRAY)#Removehairwithopeningkernel=np.ones((5,5),np.uint8)opening=cv2.morphologyEx(img2gray,cv2.MORPH_OPEN,kernel)plt.imshow(opening,cmap='gray')plt.show()
Open:
Close:
Can anyone help me remove these noises and get rid of hairs?