# Hair Removal Combining Saliency, Shape and Color
## 2 The Proposed Method  
The proposed method, as mentioned above, is based on three elements: the notion of visual saliency, shape, and color. Indeed, since the saliency of an item is the element for it stands out from its neighbors [30], its use allows to enucleate the most relevant subsets and to focus on the hair regions especially. Moreover, since hair regions have a well-defined structure, the shape-oriented operations of the mathematical morphology, that \"simplify image data, preserving their essential shape characteristics and eliminating irrelevancies\" [31], lend themselves well to detect the hair object. On the other hand, the properties of the color model can result essential to distinguish between no-hair and hair regions when information related to saliency and shape is not enough to manage ambiguous cases [11].  
The method consists of five main steps as described in the diagram shown in Figure 2. The step \"Hair object detection\" is the main step and is preceded by three preliminary steps, called \"size reduction\", \"Pseudo-Hair detection\" and \"Border and corner component detection\" aimed respectively at reducing the image size, determining the initial candidate regions to consider as hair regions, called pseudo-hair, and determining the components located on the frame of the image. The \"Hair object detection\" step is followed by the hair removal step and the resizing called \"Inpainting and rescaling\". Specifically, the method can be briefly described as follows.  
**Step 1. Size reduction--**The first step is devoted to limit the computation burden of the successive steps by reducing the size of the input image with a scale factor \(s\) equal to the ratio of a fixed value, say _Maxdim_, and the number of columns. To perform this, we resort to the classical and most common bicubic downsampling, implemented by the Matlab command _intresize_ with bicubic option and scale factor \(s\). The size reduction step is an optional but highly recommended operation since it significantly limits the computation time.  
**Step 2. Pseudo-Hair detection--**This step is based on top-hat transformation, i.e., a morphological operator capable of extracting small elements and details from  
Figure 2: Flowchart of the proposed method (HR-SSC).  
a grayscale image, commonly used for feature extraction, background equalization, and other enhancement operations. There are two types of transformation: the white top-hat transformation, defined as the difference between the original image and its aperture by a structuring element, and the black top-hat transformation (or bottom-hat transformation), defined dually as the difference between the closure by a structuring element and the original image [32; 33]. Following [19; 34], to obtain the binarized version HR initially containing the pseudo-hair components, we apply a bottom-hat filter in the red band R of the RGB image and then the Otsu threshold method [35] by the Matlab command _imbinarize_. Then, if HR is not empty, the actual hair regions are determined during the successive steps 3-5.  
Indeed, the components currently detected in HR (i.e., the so-called pseudo-hair components) can correspond to hair regions but can also correspond to portions of other types of artifacts survived this preliminary treatment, such as marker ink signs, dark spots belonging to the lesion, marker colored disks [34], and regions wrongly identified. These regions not corresponding to hair regions are called no-hair regions in the following, and if they exist, they are detected and eliminated in the successive steps. In Figure 3b some examples of pseudo-hair are shown, where the no-hair regions are approximatively indicated by a red arrow.