This is not perfect, but slightly better than the results you got:
I = rgb2gray(imread('06.jpg'));
se = strel('disk',5);
hairs = imbothat(I,se);
BW = hairs > 15;
BW2 = imdilate(BW,strel('disk',2));
replacedImage = roifill(I,BW2);
ll = edge (replacedImage,'canny');
The problem in the code you posted comes from the hairs image:
It is in fact a grayscale image with a majority of non-zero pixels:
When passing hairs to roifill, non-zero pixels indicate the regions to fill in the image. In other words, you are filling the majority of the image, instead of filling only the pixels corresponding to the hairs.
In my code I am creating BW as a binary image: roifill will fill pixels whose intensity values in hairs is greater than 15. Take a look at the histogram of hairs:
Most pixels have intensity < 50.
Dilating the BW image ensures that we are smearing the hairs and a little more.