## 3 Materials and Methods
### Obtaining Regions of Interest  
Obtaining regions of interest used the methodology proposed by [PERSON] et al [32], as shown in Figure 6. (i) The first step required the binarization of the captured images, which was done using the Hue, Saturation, Value (HSV) color space model. This change in the color space model allowed obtaining the frequency of each color in the visible spectrum with component H, the purity of color  
Figure 4: Images acquired by vision system.  
Figure 5: Mapping averages of the red, green, blue (RGB) channels for four classes of bell peppers.  
with component S, and the proximity of the pixel to black and white with component V. The thresholds used to segment the background of the samples were \(122\leq\text{H}\leq 255\), \(127\leq\text{S}\leq 255\), and \(-0\leq\text{V}\leq 255\) using a range from 0 to 255. (ii) The second step was segmentation of images of each view of bell pepper using a component connection algorithm, and later all the small regions smaller than 400 pixels that did not correspond to the binarized image of the sample were discriminated. (iii) The last step was to use respective masks to obtain regions of interest due to its color. Table 1 shows the four ranges of the Hue parameters to identify the pixel areas with green (\(47\leq\text{H}\leq 118\)), yellow (\(32\leq\text{H}\leq 46\)), orange (\(15\leq\text{H}\leq 32\)), and red (\(155\leq\text{H}\leq 241\)) hue of the images. Most of the masks except the red mask one used the range from 0 to 255 for the S and V components to identify the different color regions. The red mask used a smaller range of the S component that allowed the areas with orange and red pixels to be correctly identified. These thresholds were obtained using the 50 samples where each of its segmented images was analyzed. These masks identify the pixels corresponding to the green, yellow, orange, and red shades.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{4}{c}{**Green Mask**} \\ \hline
**H min** & **H max** & **S min** & **S max** & **V min** & **V max** \\ \hline
47 & 118 & 0 & 255 & 0 & 255 \\ \hline  & \multicolumn{4}{c}{**Yellow Mask**} \\ \hline
**H min** & **H max** & **S min** & **S max** & **V min** & **V max** \\ \hline
32 & 46 & 0 & 255 & 0 & 255 \\ \hline  & \multicolumn{4}{c}{**Orange Mask**} \\ \hline
**H min** & **H max** & **S min** & **S max** & **V min** & **V max** \\ \hline
15 & 32 & 0 & 255 & 0 & 255 \\ \hline  & \multicolumn{4}{c}{**Red Mask**} \\ \hline
**L min** & **L min** & **L min** & **L min** & **L min** \\ \hline
241 & 155 & 11 & 247 & 0 & 255 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Segmentation mask thresholds.  
Figure 6: Pre-processing of images: (**i**) binarization of the image captured from the fruit; (**ii**) segmentation of the image and discrimination of areas; (**iii**) obtaining segmented sample applying the green mask of interest region; (**iv**) obtaining segmented sample applying the yellow mask of interest region; (**v**) obtaining segmented sample applying the orange mask of interest region; and (**vi**) obtaining segmented sample applying the red mask of interest region.