# Implementation of Adaptive Real-Time Camouflage System in Visible-Light Band
## 2 Methods
### The Dominant Color Feature-Matching Algorithm  
Here, a new algorithm for color matching is presented. In order to evaluate the similarity metric between the target and the environment, we calculated the distance between dominant colors using correlation coefficient.  
We exploited hue, saturation, and luminance (HSL) color space, as H, S, an L components can be individually controlled with an intuitive color representation to the way humans perceive colors [8]. In this method, the colors are divided into 12 types of hue (H), 2 types of saturation (S), and 3 types of luminance (L). Counting the number of pixels in the divided color gamut interval, in which the top five colors with the maximum number of pixels are used as the dominant colors, is sufficient in order to describe the total color information [9].  
The steps we proposed to implement the dominant color feature matching algorithm are as follows:  
1. Extract the RGB values (R, G, B) of each pixel in the local environmental image.
2. Transform the RGB values (R, G, B) of each pixel in the local environment image into the HSL space to obtain the corresponding HSL values (H, S, L). The conversion formula of RGB and HSL color space is as follows [10]: \[H=\left\{\begin{array}{c}\arccos\left\{\frac{(R-G)=(R-B)}{2\sqrt{(R-G)^{2}+(R- B)(G-B)}}\right\}R\
eq\text{Gand}R\
eq B\\ 2\pi-\arccos\left\{\frac{(R-G)+(R-B)}{2\sqrt{(R-G)^{2}+(R-B)(G-B)}}\right\}B>G \end{array}\right.\] (1) \[S=1-3\div(R+G+B)\times\min(R,G,B)\] (2) \[L=(R+G+B)/3\] (3)  
where \(H\in[0^{\circ},\ 360^{\circ}]\), \(L,S\in[0,\ 1]\).  
1. Obtain the dominant color feature matrix of the environment image according to the HSL color gamut interval. The dominant colors are expressed as the dominant colors feature matrix, which contains 26 elements. Each element corresponds to the sum of pixels in the divided color gamut interval, as shown in Table 1.
2. Normalize the dominant colors feature matrix, which means to divide F[i] by the total number of pixels, with F[i] being the number of times a pixel having color i appears in the image.
3. Obtain the camouflage image with the highest similarity to the environment image. On the basis of the optimal matching theory, the similarity measure of the camouflage image and the target image can be computed by the correlation coefficient. Then, the retrieved result is ranked according to the value of similarity. The formula of correlation coefficient is as follows [11]: \[r=\frac{\sum\limits_{i}{(x_{i}-x_{m})(y_{i}-y_{m})}}{\sqrt{\sum\limits_{i}{(x_ {i}-x_{m})^{2}}}\sqrt{\sum\limits_{i}{(y_{i}-y_{m})^{2}}}},\] (4) where \(x_{i}\) is the intensity of the \(i_{th}\) pixel in environmental image, \(y_{i}\) is the intensity of the \(i_{th}\) pixel in camouflage image, \(x_{m}\) is the mean intensity of environmental image, and \(y_{m}\) is the mean intensity of camouflage image.  
It is worthwhile comparing the proposed dominant color feature matching algorithm and other relevant counterparts such as the automatic image allocation method proposed by [PERSON] et al. [12], which features image feature value extraction, dimensionality reduction, classification, and evaluation. Compared with traditional methods, the accuracy and sensitivity can be improved by the proposed algorithm.