7

As a prepossessing requirement of my project I have to remove skin hairs from the image. For this I found an already existing program. The implementation is done in Matlab.

The above link quotes the following

  1. It identifies the dark hair locations by a generalized grayscale morphological closing operation,
  2. It verifies the shape of the hair pixels as thin and long structure, and replace the verified pixels by a bilinear interpolation, and
  3. It smooths the replaced hair pixels with an adaptive median filter.

As for the above part which mentions generalized grayscale morphological closing operation I could not find out what it meant and not being able to implement it in Matlab either

Currently what I need to do is simply

  1. Identify hair pixels
  2. Verify hair pixels
  3. Replace hair pixels with neighboring skin pixels

I was wondering if you could suggest any methods that could be used for the implementation of this algorithm (edge detection and such) as currently so far all attempts havent worked out properly. Any matlab functions that could be used would be very helpful as well. Also was wondering on what method that I could use to verify the pixels as thin and long structures

Updated : As I am new to image processing I do not have any prior knowledge of what methods to use on how to identify the hair pixels, verify them and replace them with neighboring pixels, thus the requesting of guidance

1

2 Answers 2

3

I will assume that you understand what a grayscale image is and operations upon it are. If not, edit your question to clarify.

The Matlab Image Processing Toolbox includes the imclose function. Morphological closing is explained on Wikipedia. The Internet is awash with information about mathematical morphology for image processing.

EDIT after comment

This page gives a general introduction for mathematical morphology for image processing. One view of what you are trying to do is remove noise from your image, where that noise is expressed as long(-ish) thin(-ish) dark elements against a light background -- if, that is, the hairs are dark and the skin is light. This isn't an application I've looked at so I can't provide any more help. Have fun.

1
  • Updated the question, well yes while I do actually know what an grayscale image is I do not have any knowledge of what operations that can be used upon it. Had a look at the Morphologically close image operator in matlab, what it does is replace pixels with disks or any other desired shape correct? Can you explain how it would serve my purpose in identifying the hair pixels and replacing them with the neighboring pixels
    – MilindaD
    Feb 27, 2012 at 17:39
0

The sequence of operations are 1.Identify hair pixels 2. Verify hair pixels 3. Replace hair pixels with neighboring skin pixels. This is mainly because morphological open filters are grayscale or scalar filters. Thus the problem in color images can be solved by either finding a good color space (usually tough as your background varies), or perform closing(like the answer above states: if hair is dark and background is light) filter on each channel and interpolate over the others, which is the current solution.

Thus we can have a look at what matlab gives with what is mentioned in the paper to detect the elongated hair structures:

se1 = strel('line',10,90);
se2 = strel('line',10,180);
figure, imshow(imclose(imclose(I,se1),se2),[]) % this closing is done channel wise independently. 

For complex backgrounds a good color space features is necessary. Here is works more or less since the color image is ordered(red>green>blue , or some such order - you can verify this) Input image from the website Line filtered image

The problem now is to interpolate over the missing values since the closing leaves some artifacts. one can use interpolation median filtering as suggested in Lee T, Ng V, Gallagher R, Coldman A, McLean D. DullRazor: A software approach to hair removal from images. Computers in Biology and Medicine 1997;27:533-543.

Another simple idea would be perform rgb2gray(I) -> Morhological closing using linear structures -> map back grayscale to RGB tones. The mapping back is simple if the background color space does not change too much and is robust!

Not the answer you're looking for? Browse other questions tagged or ask your own question.