## 2 Gaussian Color Mapping Image Segmentation Algorithms
### Gaussian Color Mapping Algorithm  
#### 2.2.1 Color Mapping Model  
The traditional UV image processing method is that the UV image, after image type conversion, uses the threshold segmentation method to obtain a facular binary image. The grayscale image threshold segmentation method has the advantages of faster operating speed and lower computational complexity [15; 16; 17]. Figure 2 gives the images after the segmentation of three different colors in the facular area using the traditional threshold segmentation algorithm. Obviously, except for the white light spot, the segmentation of other facular is not ideal. The fundamental reason for this result is that the algorithm mentioned above does not make full use of three-channel color information, which leads to unsatisfactory segmentation results for some color target areas [18]. In contrast, although most color image segmentation algorithms can accurately segment the color spot area, the algorithm has higher computational complexity and spends a great computational cost. Aiming at the problem that the traditional facular area segmentation effect is not ideal and considering the advantages of the threshold segmentation algorithm, this paper  
Figure 1: Schematic diagram of UV video processing flow. Figure 2: Image segmentation. (**a**) Red facular image. (**b**) Red facular image after segmentation. (**c**) Blue facular image. (**d**) Blue facular image after segmentation. (**e**) White facular image. (**f**) White facular image after segmentation. proposes a facular area segmentation algorithm based on color mapping. Color mapping is used to preprocess the color image, and the purpose is to convert the color of the facular area into white. The UV image after the color mapping process can effectively use a threshold segmentation algorithm to segment the facular area. Taking the blue-green facular as an example, Figure 3 shows the images of the R, G, and B channels in the blue-green spot UV image. The boxes in figures are the built-in feature of the UV imager. It can be seen from the figure that the grayscale difference between each area in different channels is very different. For two areas with similar colors, there may be one of the three channels, or one of the upper channels, that has a larger grayscale difference. Therefore, the three color channels can be fully utilized before image segmentation to enhance the grayscale difference in pixels in each area. The built-in facular area of the UV imager has limited imaging colors and known pixels. The RGB values of UV images can be mapped to a new image plane through Gaussian functions. By defining the peak value and average value of the Gaussian function, the target color area is mapped to another specific color area. The mapped image does not retain the original RGB value, but due to the continuity of the Gaussian function, the color gamut of the original image is preserved to a great extent, and the image contrast is improved. The formula is defined as follows:  
\[g_{i}=T_{i}(f_{r},f_{g},f_{b}),\ i=1,2,3 \tag{1}\]  
\[T(x)=A_{c}e^{-\frac{(x-\mu_{C})}{2\delta^{2}}} \tag{2}\]  
The schematic diagram of the light spot color image mapping model is shown in Figure 4.  
In the above equation, \(F=\left\{f_{r},f_{g},f_{b}\right\}\) is the input image and \(G=\left\{g_{1},g_{2},g_{3}\right\}\) is the mapped image. \(T\) is the mapping function of the pixel RGB value. \(\mu_{C}\) represents the gray value of the three channels in the facular area, \(c\in\left\{R,G,B\right\}\). \(A_{C}\) is used to describe the target gray value of the pixels in the facular area of the three channels. Based on different application scenarios, setting different values (\(A_{C}\leq 255\)) can map pixels in facular areas to different color planes. \(\delta\) is a constant, which represents the variance of the mapping function. In this model, \(\delta\) will be called the mapping parameter. Figure 5 is a schematic diagram of the RGB color cube. Take Figure 3a as an example; \(\mu\) is the RGB value of the blue-green.