Implementation of Fuzzy C-Means (FCM) Clustering Based Camouflage Image Generation Algorithm

Camouflage plays a fundamental role in modern electrical confrontation. Two important elements of camouflage are camouflage colors and camouflage textures. Many methods were presented to extract the main colors of the background. However, there are few methods to extract the background textures at present. The traditional methods based on watershed segmentation or background contour segmentation are computationally complex and time-consuming, being difficult to meet the real-time requirements. In this paper, a camouflage generation algorithm based on rectangle blocks scrambling and Fuzzy C-Means (FCM) clustering method is proposed. The algorithm consists of three modules, namely (1) the rectangle blocks segmentation module, (2) the rectangle scrambling module, and (3) the extraction of background dominant colors. Firstly, the texture features of the background image are simulated by rectangle blocks segmentation and scrambling algorithm, which avoids the complex calculation process and the loss of textures information compared with traditional algorithms based on description operators for background textures extraction. Next, Fuzzy C-Means (FCM) method is used to extract the main colors of background image with high accuracy and fast speed. In addition, experiments show that the proposed algorithm reduces the computing time and presents better concealment effect by retaining the similar domain colors. Compared with the template traversal algorithm and the watershed segmentation algorithm, the proposed algorithm features reduced computing time by more than 50%, and an increased similarity between the generated texture and background texture to more than 90%.


I. INTRODUCTION
Camouflage is an essential way in modern electrical confrontation, which can merge the target into the surrounding environment by extracting the dominant colors and texture features of background. The automatic and intelligent camouflage generation algorithm has become an important research field at present. Camouflage colors and camouflage textures are two important factors in camouflage generation. The main challenge of camouflage image generation is how to The associate editor coordinating the review of this manuscript and approving it for publication was Varuna De Silva . effectively extract the domain colors of the background while maintaining textures of the environment images.
Presently, there are several approaches to extract the domain colors of the background image. A traditional method is histogram quantification, which cannot distinguish pixels with the same brightness and different colors [1]. An approach proposed recently is spectral reflectance of real-scene objects [2], the deviation of colors information was eliminated, but complex calculation made the extraction of dominant colors for background image extremely difficult. Another method to extract the domain colors of the background is recursive overlapping of pattern templates, which can accurately extract the main colors of background VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ image, but this algorithm is not widely used in different conditions [3].
For the present camouflage studies, most attentions were paid to the extraction of the main colors, while the design of textures is ignored. According to [3], the dominant colors extracted from different images were filled into the same camouflage texture. The domain colors were well integrated with that of background, but the shape and size of camouflage patches were not in harmony with background textures. Marica, et al. adopted a digital camera method to identify the dominant colors of background [4], and this method was suitable for fixed targets, however, it is not suitable for moving targets. Besides, a recursive overlapping method was used to generate camouflage, but the textures distribution of the generated camouflage was uneven, in addition, the generated camouflage had a large area of monochromatic patches. Thus, the texture similarity between the generated texture and background texture was not satisfying. The texture similarity of the background and generated texture can be measured by WSSIM method [5].
In this paper, a camouflage algorithm suitable for the visible light adaptive camouflage system is proposed. Rectangle blocks scrambling and Fuzzy C-Means (FCM) clustering method are combined in the proposed camouflage algorithm. The organization of other contents of this paper is as follows. The proposed algorithm flow is presented in Section II. Following that, the principle and process of the rectangle blocks scrambling algorithm are analyzed in Section III. In Section IV, the principle and specific process of FCM clustering algorithm are disclosed, and Gray morphology closure operation to smooth the generated camouflage images are also demonstrated in Section IV. Then Section V shows the experimental results and discussions. Finally, the performances comparison with counterparts are summarized in the Conclusion part. Firstly, two-dimensional matrices of the R, G and B channels are obtained respectively from the background picture, which benefits faster texture extraction process while preserves good local texture features. Secondly, the pixels in the matrices are randomly recombined by logistic blocks scrambling method, then the dominant colors of three scrambling images are extracted by FCM clustering method, and the original pixels are replaced by the dominant colors [6], [7].  Next, three clustered images are synthesized into RGB color image. There are many obvious edges of the rectangle blocks in the camouflage image generated by above algorithms, therefore, erosion operation and dilation operation are used to smooth the obvious edges of these rectangle blocks.

II. THE PROPOSED ALGORITHM FLOW
For the same background picture, three different algorithms are used on the same software to generate camouflage images, the experimental results are shown in Fig. 3 and Fig. 4. It can be seen from Fig. 3 that with the increase of picture pixels, the similarity between the generated camouflage image and the background image first increases and then decreases. And the texture generated by the proposed algorithm in this paper has the highest similarity. This shows  that the new algorithm has better performance. At the same time, it can be seen from Fig. 4 that with the increase of the image pixels, the calculation time of the three algorithms to generate camouflage textures gradually increases. Doubling the pixel count results in 50% longer execution time.
We also compared the proposed algorithm with the traditional template-based traversal algorithm and watershedbased segmentation algorithm [8]. The algorithm based on template traversal need to extract and fill the dominant colors of each block traversed by template, while the proposed algorithm only needs to extract and fill the main colors once. So, the algorithm is simpler and more efficient. The process of image segmentation based on watershed segmentation algorithm is more complex than that of the proposed algorithm. So the calculation speed of the proposed algorithm is superior than template based traversal algorithm and watershed based segmentation algorithm.
The proposed algorithm reduces the calculation time by more than 50% compared with the template-based traversal algorithm and watershed-based segmentation algorithm, which has smaller computational complexity and higher similarity. The statistical data between this algorithm and other two algorithms is shown in TABLE 1. From TABLE 1, we can see that the calculation time of these three algorithms are 1.5 s, 3 s and 2.5 s respectively, and the proposed algorithm has the minimum calculation time. It can be seen that the proposed algorithm has the highest similarity compared with the template-based traversal algorithm and watershed-based segmentation algorithm.

III. RECTANGLE BLOCKS SCRAMBLING A. RECTANGLE BLOCKS SEGMENTATION
The input images are obtained from on-line database. Then its RGB channels are extracted separately. The gray images of R, G and B channels display in Fig. 5. In order to keep the texture features of the input image, the pixels of image are scrambled according to the rectangular block segmentation method [9]. The diagram of this segmentation method is shown in Fig. 6, where an original image with the size of M * N is divided into 25 rectangle blocks with the same size of a * b, then these rectangle blocks will be disorganized randomly according to the rectangle blocks scrambling algorithm [10]- [12].

B. RECTANGLE BLOCKS SCRAMBLING
In order to disorder the rectangular blocks after the image was segmented, rectangle blocks scrambling algorithm is used to reorganize the segmented image [14], [15]. A set of random non-repeated sequence are created according to VOLUME 9, 2021 logistic iterative formula.
where x i (i=0,1,2. . . ) and x i+1 are the i-th input value and the i+1)-th output value, respectively. And it is required that x i ∈ (0, 1) , x i+1 ∈ (0, 1) Then the position of the segmented rectangle blocks is recombined by using the generated random sequence [13]. The implementation steps of the algorithm are as follows.
Firstly, the gray image is presented by a two-dimensional matrix T, which is initialized as a zero matrix, with k * l pixels. Then, random non-repeated sequence is generated, x1, x2, . . . , xi, where i=k * l, using equation (1), where xi is initially set as 0.3. Elements the matrix T are update according to the randomly generated xi. In this way, the two-dimensional matrix T can be scrambled. To verify the algorithm's performance, the desert image is taken as the input image, and the processing results are shown in Fig. 7. It can be seen that the pixels of the input image can be reorganized randomly by the algorithm, while the local texture features can be retained.

IV. EXTRACTION AND SMOOTHING OF THE DOMAIN COLORS IN THE BACKGROUND A. COLOR CLUSTERING BASED ON FCM ALGORITHM
First, three channels of the input image have been scrambled with the algorithms described above. Second, FCM clustering algorithm is used to extract the domain colors of the input image, then the clustered gray images of the three channels are obtained. Finally, the output image is synthesized by the clustered gray images. In this way, we obtained the preliminary camouflage image.
For the FCM clustering algorithm [16]- [21], the sample data is divided into c categories, and the initial clustering center (C i ) or membership matrix(U ) is set. Each element in the membership matrix U , i.e. u ij , can be expressed by At the same time, the objective function(J ) of the dissimilarity index can be expressed as [22]- [24].
where, n is the number of data points and c is the number of the clusters, which can be determined through several iterations by comparing the main color image and the background. Further, the value of u ij is within (0,1), ci is the cluster center of the i-th cluster and d ij = |ci − xj| is the distance between the j-th sample data and the i-th cluster center. And m is the membership index, its value is usually 2 or 3. when the derivative of the objective function equals to zero, the expressions of cluster center and membership degree will be obtained as follows [25]- [27].
The specific operation process of FCM clustering algorithm is as follows.
(1) The membership matrix U is initialized with random numbers with values between 0 and 1, while the constraint conditions of formula (2) should be met.
(2) The C cluster centers are calculated by formula (4).
(3) The value of objective function is obtained according to the initial membership u and the value of clustering center. If the difference between the value of the current objective function and the value of the previous calculation is less than threshold, or when the iteration reaches certain times, then the algorithm will stop.
(4) The new membership matrix J is calculated by formula (2), then return to step (2).
Taking the pixels data of gray image as the input data of the above algorithm, we obtained the clustering centers of the input image pixel. Then the pixels are set into the color values of the clustering centers to which those pixels belong. Finally, the extraction of the dominant colors of the input image is completed.

B. EROSION AND DILATION OPERATIONS
To smooth the generated camouflage image, i.e. eliminating the noise and scattered points of the clustered images, erosion and dilation operations are employed.
The erosion operation of the input image f, using the structural element b [28], is expressed by where ( ) is the symbol of erosion operation, D f and D b are the domains of f and b respectively. While, the dilation operation of the input image f, using the structural element b, is expressed by where ⊕ is the symbol of dilation operation. Therefore, successive dilation and erosion operations are carried out, and then the closure operation is completed, which can be presented by

V. EXPERIMENTAL RESULTS AND DISCUSSION
In order to verify the effectiveness of the proposed algorithm, experiments were performed based on three different background images. Fig. 8 is a schematic diagram of the implementation of the proposed algorithm in this paper, where Fig. 8(a), (b) and (c) are jungle, desert and snow images respectively, Fig. 8(d), (e) and (f) are the generated camouflage images by the three kinds of background images. Fig. 8(g), (h) and (i) are the images after camouflage by the three camouflage images. It can be seen from this experiment that the target without camouflage is very conspicuous in the background, but the target after concealment maintains the same color and texture features as the background. Meanwhile, we compared the camouflage performance of the proposed algorithm with the template traversal algorithm and the watershed segmentation algorithm, which were previously published and well conducted [26]. The experimental results are shown in Fig. 9, where, Fig. 9(a) is the background image, Fig. 9(b) is the camouflage texture generated by the  proposed algorithm, Fig. 9(c), (d) are the camouflage textures generated by the template traversal algorithm and the watershed segmentation algorithm respectively. It can be seen that the camouflage images generated by this algorithm are more similar to the background images in color and texture features compared with other algorithms. At the same time, we also compare the calculation time of the three different algorithms through experiments. It is easy to see from Table 1 that the proposed algorithm in this paper has more advantages in calculation time than the traditional algorithms.
Besides, improved WSSIM method is used to test the camouflage image generated by the proposed algorithm in this paper [7]. First, the values of WSSIM are calculated between background and camouflage texture for the R, G and B channels respectively. Second, the average of WSSIM for each pair of the background image and camouflage texture is calculated, which effectively indicate the texture similarity between the background image and the generated image [29], [30]. The background and the camouflage textures generated by the proposed algorithm, the template traversal algorithm and the watershed segmentation algorithm are shown in Fig. 9. And TABLE 2 lists the test results. As can be seen from TABLE 2, the texture (b) generated by the proposed algorithm is more similar to the background than texture (c) generated by the template traversal algorithm and texture (d) generated by the watershed segmentation algorithm according to the average value of WSSIM. And the textures similarity of the proposed algorithm even increases to more than 90% in texture (b).

VI. CONCLUSION
A camouflage generation algorithm based on rectangle blocks scrambling and FCM clustering algorithm is proposed in this paper. First, the whole pixels of the background image are recombined by the rectangle blocks scrambling algorithm, while the logical texture features are retained. Then the FCM clustering method is used to extract the background domain colors. This method can accurately obtain the dominant colors of the background image, which has higher calculation efficiency than histogram quantification method. And, the closure operation is used to smooth the edge of the segmented blocks. In addition, we also compared the proposed algorithm with template-based traversal algorithm and watershed segmentation method. The calculation time of these three algorithms are 1.5 s, 3 s and 2.5 s separately. Compared with other conventional ones, the proposed algorithm presents an increased similarity between the generated texture and the background texture to more than 90%. Experimental results show that the camouflage images generated by the proposed algorithm can be well integrated with the background.