## 2 Materials and Methods
### Proposed Method
#### 2.2.2 Feature Extraction Stage  
* Size (_d_)  
At the end of the conditioning stage, the image contains all possible cases of melanoma, these cases are quantified, and, for each possible case, the four descriptors of the ABCD rule are estimated. The first descriptor to be estimated is size (_d_). The contour is marked, the area is calculated, and the quotient is calculated to assess the size. The value obtained is compared with the range determined during training and, if it is a case of melanoma, the evaluation of the other descriptors is continued. Otherwise, the next possible case of melanoma is passed. Algorithm 3 shows the corresponding pseudocode for size evaluation. The threshold determined for the size is defined according to the relationship between the original dimensions, the equivalent pixels in the quantification of the area, and the data reported by the World Health Organization (WHO). Figure 4: Removal of skin and noise from the original image. (**a**) original image, (**b**) results obtained after applying the Gaussian filter, (**c**) final results obtained after applying mathematical morphology. ```
1:Input:\(I_{a}\), input image. 2:Output:\(d\), estimated value for edge. 3:procedureget_Size(\(I_{a}\))
4:\(I_{b}=convert\_RGBtoGRAY(I_{a})\)
5:\(I_{c}=get\_Contours(I_{b})\)
6:\(I_{d}=get\_Area(I_{c})\)
7:\(I_{e}=get\_Area(I_{a})\)
8:\(d=\frac{I_{d}}{I_{e}}\)
9:return\(d\)\(\triangleright\) The recovered value. ```  
**Algorithm 3** Proposed method to evaluate size (\(d\)), showing lines 1-7. \(\bullet\) Color (\(c\))  
The color dispersion (\(c\)) is estimated with the histogram of the \(h\) channel. The difference between our descriptor and those reported in the literature [16] is the color space used in combination with the channel. Algorithm 4 shows the corresponding pseudocode for color evaluation. ```
1:Input:\(I_{a}\), input image. 2:Output:\(c\), estimated value for color. 3:procedureget_color(\(I_{a}\))
4:\(I_{b}=convert\_RGBto HSV(I_{a})\)
5:\(h,s,v=get\_Split(I_{b})\)
6:\(hist=get\_Histogram(h)\)
7:\(c=0\)
8:for each\(i=0\)to\(255\)do
9:if\(hist(i)\
eq 0\)then
10:\(c=c+1\)
11:return\(c\)\(\triangleright\) The recovered value. ```  
**Algorithm 4** Proposed method to evaluate color dispersion (\(c\)), showing lines 1-9. \(\bullet\) Symmetry (\(a\))  
The contour of the possible case of melanoma is identified, then an ellipse is placed, and then it is inscribed in the identified contour to estimate the symmetry. A rectangle is established in such a way that the ellipse is inscribed in the rectangle. Once the rectangle is drawn, the midpoints of the sides are determined, and the axes are placed at these points. The semiplanes formed by the axes are compared to assign a weighting. First, the longest axis is used to divide the image into two, and these semi-planes are compared. Then, the other axis is used to do the same. The two scores obtained are compared, and the highest value is chosen, with a maximum value of 1 and a minimum of 0. The final value is added as input of the multilayer perceptron as well as the size, color, and edge. An example of symmetry verification is shown in Figures 5 and 6. Algorithm 5 shows the corresponding pseudocode for the evaluation of symmetry. ```
1:Input:\(I_{a}\), input image. 2:Output:\(a\), estimated value for symmetry. 3:procedureget_symmetry(\(I_{a}\))
4:\(I_{b}=convert\_RGBtoGRAY(I_{a})\)
5:\(I_{c}=get\_Contours(I_{b})\)
6:\(I_{d}=circumscribed\_Ellipse(I_{c})\)
7:\(I_{e}=circumscribed\_Rectangle(I_{d})\)
8:\(p=get\_Conrors(I_{e})\)
9:forall\(semiplane(1,2,3,4)\)do
10:\(mp_{x0}=\frac{p[0,0]+p[1,0]}{2}\)
11:\(mp_{y0}=\frac{p[0,1]+p[1,1]}{2}\)
12:\(mp_{y2}=\frac{p[2,0]+p[3,0]}{2}\)
13:\(mp_{y2}=\frac{p[2,1]+p[3,1]}{2}\)
14:\(SemiP_{1}=semiplane(I_{c},[p[0,0],p[0,1]],[mp_{x0},mp_{y0}],[mp_{x2},mp_{y2}],p[ 3,0],p[3,1])\)
15:\(a_{1}=similarity(SemiP_{1},semiP_{2})\)
16:\(a_{2}=similarity(SemiP_{2},semiP_{3})\)
17:\(a=get\_Highest(a_{1},a_{2})\)
18:return\(a\)\(\triangleright\) The recovered value.