3. Research methodology

This section describes four main stages: preprocessing, segmentation, features extraction, and classification. We have started by reading an RGB image, as for example, as shown in Figure 1.

#### 3.1 Preprocessing stage

The preprocessing stage consists of four sequential steps described as follows:

#### 3.1.1 Step 1

For each channel in the RGB image, a 2-D median filtering for noise reduction with mask of size 5 ˜ 5 is implemented and their associated results are depicted in Figure 2.

Figure 1. Input image [32].

Diagnosis of Skin Lesions Based on Dermoscopic Images Using Image Processing Techniques DOI: http://dx.doi.org/10.5772/intechopen.88065

#### 3.1.2 Step 2

For hair removal, two morphological operations are applied on grayscale image f, dilation followed by an erosion with a small shape or template called a structuring element s denoted by (f ⊕ s and f Θ s, respectively). The results are depicted in Figure 3.

#### 3.1.3 Step 3

Brightness enhancement operation is applied separately on R, G, and B images. Figure 4 shows the result of the brightness enhancement operation.

#### 3.1.4 Step 4

Based on our experimental studies, the channel B is chosen because it provides better segmentation results compared to others. Therefore, the third channel (B) image is converted into a binarized form using Otsu's method, and then converted

#### Figure 2. The implantation of 2-D median filtering. R, G, B-channels, respectively.

Figure 3. Hair removal operations. R, G, B-channels, respectively.

Figure 4. Brightness enhancement. R, G, B-channels, respectively.

white pixels into black pixels and vice versa to present the pigment skin lesion. The results of this step are depicted in Figure 5.
