Skin Detection using HSV color space V. A. OLIVEIRA, A. CONCI Computation Institute – Universidade Federal Fluminense – UFF – Niteri, Brazil. {victor_oliveira , aconci}@ic.uff.br Abstract — This work describes an implementation for skin detection which relies on the H channel to characterize the skin colors range. The openCv library is used for image processing. The program initially converts RGB images to HSV one. The H channel is used to characterize the colors range for skin detection. To illustrate the approach we compare this with others. Keywords: skin-detection; HSV color space; openCv; I. INTRODUCTION Skin detection in images is a theme that is present in many applications. This is the first step for faces recognition, for example. Other application is for naked detection, in the internet. This work presents a system for automatic skin detection. This system was implemented and compare quantitatively with others. II. ALGORITHM FOR SKIN DETECTION The Figure 4 illustrates the algorithm steps. This was implemented using the language C and openCv library. First, the image in RGB was converted to HSV color space, because it is more related to human color perception [1]. The skin in channel H is characterized by values between 0 and 50, in the channel S from 0.23 to 0.68 for Asian and Caucasian ethnics [2]. In this work we used images from different Caucasian people, from different places of the world. Figure 1 illustrates one of the original image processed. Figure 1: Original image. After some tests we proposed to use only the channel H with values ranging between 6 and 38 and a mix of morphological and smooth filters. Figure 2 show the same image of figure 1 convert from RGB to HSV, considering now each channel HSV represented on the R, G and B channels. Figure 2: Image in HSV. Figure 3 illustrates an intermediary image, where all pixels classified as skin (using the range in channel H already established) were set to value 255, and non-skin pixels was fixed to 0. Figure 3: An intermediary image. In the image of figure 3 there are has many noises, in the classification of pixels like skin and non-skin. Next step minimize these noises, using a 5x5 structuring element in morphological filters. First, we used the structuring element with a dilatation filter that expands the areas in the skin regions. After that the same structuring element was used to erode the image and reduce all the imperfections that the dilatation created. These techniques were used, by approximation, to fill all the spaces that were by H channel range supposed that is skin or non-skin.