Visible light adaptive camouflage generation method, system, device and storage medium
By generating camouflage images using clustering and cubic spline interpolation algorithms, the problems of low efficiency and poor adaptability in existing camouflage generation technologies are solved, achieving efficient integration with the background environment and preservation of color and texture.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-28
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies struggle to achieve real-time adaptability to the background environment when generating visible light camouflage patterns. Furthermore, they suffer from low generation efficiency, uneven texture distribution, or damage to original texture features, all of which negatively impact camouflage effectiveness.
Clustering algorithms are used to extract the main color of the background image, and cubic spline interpolation is combined to generate random curved borders. A basic patch color distribution matrix library is generated through random matrix processing and then stitched together to form a camouflage image that blends with the environment.
It enables the rapid generation of camouflage patterns that blend seamlessly with the environment, improves processing efficiency, preserves the color and texture features of the original image, and has strong adaptability.
Smart Images

Figure CN115249277B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of optics, and in particular to a method, system, device, and storage medium for generating visible light adaptive camouflage patterns. Background Technology
[0002] In modern warfare, visible light camouflage can effectively conceal strategic targets and movement trajectories, reduce the destruction rate of military equipment, and enhance survivability. Traditional methods of applying camouflage paint to the surface of military targets reduce the contrast and outline features between the target and the background. However, for mobile military targets, the camouflage effect of traditional static camouflage paint will be affected as the background changes, increasing the risk of target exposure.
[0003] Currently, background-based adaptive camouflage generation methods mainly consider the main colors and textures of the background image. Camouflage patterns generated by using color blocks and deformed patterns of main colors similar to the background image are similar in color to the background, effectively blurring the target outline; however, the texture may not blend seamlessly with the background. Another method involves desaturating the background image, dividing it into equally sized patches according to a certain rule, and then rearranging them. However, if the patch size is too large, the texture distribution becomes uneven, easily resulting in large areas of monochromatic patches, reducing camouflage performance. If the patch size is too small, the original texture features are destroyed, causing incompatibility with the background environment. Furthermore, the generated camouflage size is limited, resulting in poor adaptability. Using sample-based texture synthesis technology, camouflage images of any size that blend with the background image can be synthesized based on the texture of the background image. However, in the synthesis process, the synthesis of each pixel requires multiple matching to find the best synthesized pixel. Moreover, the quality of texture synthesis is also related to the size of the selected matching neighborhood, and the ideal result cannot be obtained in one go. This affects the efficiency of camouflage generation and makes it difficult to meet the requirements of real-time performance. Summary of the Invention
[0004] Therefore, it is necessary to provide a visible light adaptive camouflage generation method, system, device, and storage medium to address the aforementioned technical problems.
[0005] In a first aspect, embodiments of the present invention provide a visible light adaptive camouflage pattern generation method, comprising the following steps:
[0006] Clustering algorithms are used to decolorize the background image and extract the main color, thus obtaining the main color distribution matrix;
[0007] The statistical characteristics of the background image after color reduction are calculated using the primary color distribution matrix, and a color distribution random matrix is generated based on the statistical characteristics. A background color image is then generated based on the color distribution matrix.
[0008] The background image is processed using a cubic spline interpolation algorithm to generate a random curved border logic matrix, and a basic patch color distribution matrix library is obtained through the random curved border logic matrix.
[0009] A basic patch color distribution matrix is randomly selected from the basic patch color distribution matrix library. The basic patch color distribution matrix and the background image are combined to generate basic patches. The basic patches are then stitched together to obtain a camouflage image.
[0010] Furthermore, the step of using a clustering algorithm to decolorize the background image and extract the primary color to obtain the primary color distribution matrix includes:
[0011] The dominant color of the background image is extracted using the K-means clustering algorithm, and k pixels are randomly selected from the background image as cluster centers.
[0012] Based on the cluster centers, obtain k distance matrices and generate corresponding membership logic matrices;
[0013] By setting the number of cluster centers, the pixels of the background image are clustered according to their RGB values. The RGB value of any cluster center is a primary color. The primary color distribution matrix corresponding to the primary color is generated through the membership logic matrix.
[0014] Furthermore, the step of calculating the statistical characteristics of the background image after color reduction using the primary color distribution matrix, generating a color distribution random matrix based on the statistical characteristics, and generating a background image based on the color distribution matrix includes:
[0015] The probability of each primary color in the background image after color reduction is calculated using the primary color distribution matrix, and an equally probable random matrix is generated as the color distribution random matrix.
[0016] Based on the probability of each primary color and the range to which the element values in the color distribution random matrix belong, a color distribution matrix for the background image is generated.
[0017] The background image is generated by filling with the primary color, so that the color statistical characteristics of the background image are the same as those of the background image after color reduction.
[0018] Furthermore, the background image is processed using a cubic spline interpolation algorithm to generate a random curved border logic matrix, and a basic patch color distribution matrix library is obtained through the random curved border logic matrix, including:
[0019] A random array is generated based on the size of the background image. The random array is then processed using a cubic spline interpolation algorithm to generate a random curve. Finally, the random curve is used to generate a random curve border logic matrix.
[0020] Perform a bitwise AND operation between the random curved border logic matrix and the main color distribution matrix to weaken the straight boundaries of the original patches and generate a basic patch color distribution matrix.
[0021] The basic patch color distribution matrix is mirrored and rotated at multiple angles, and a basic patch color distribution matrix library is generated through patch expansion.
[0022] On the other hand, embodiments of the present invention also provide a visible light adaptive camouflage generation system, comprising:
[0023] The background image decolorization and segmentation module is used to decolorize the background image and extract the main color using a clustering algorithm to obtain the main color distribution matrix.
[0024] The background image generation module is used to calculate the statistical characteristics of the background image after color reduction through the main color distribution matrix, generate a color distribution random matrix based on the statistical characteristics, and generate a background image based on the color distribution matrix.
[0025] The basic patch color distribution module is used to process the background image using a cubic spline interpolation algorithm to generate a random curved border logic matrix, and to obtain a basic patch color distribution matrix library through the random curved border logic matrix.
[0026] The camouflage image generation module is used to randomly select a basic patch color distribution matrix from the basic patch color distribution matrix library, combine the basic patch color distribution matrix with the background image to generate basic patches, and stitch the basic patches together to obtain a camouflage image.
[0027] Furthermore, the background image desaturation and segmentation module includes a primary color clustering unit, which is used for:
[0028] The dominant color of the background image is extracted using the K-means clustering algorithm, and k pixels are randomly selected from the background image as cluster centers.
[0029] Based on the cluster centers, obtain k distance matrices and generate corresponding membership logic matrices;
[0030] By setting the number of cluster centers, the pixels of the background image are clustered according to their RGB values. The RGB value of any cluster center is a primary color. The primary color distribution matrix corresponding to the primary color is generated through the membership logic matrix.
[0031] Furthermore, the background image generation module includes a statistical processing unit, which is used for:
[0032] The probability of each primary color in the background image after color reduction is calculated using the primary color distribution matrix, and an equally probable random matrix is generated as the color distribution random matrix.
[0033] Based on the probability of each primary color and the range to which the element values in the color distribution random matrix belong, a color distribution matrix for the background image is generated.
[0034] The background image is generated by filling with the primary color, so that the color statistical characteristics of the background image are the same as those of the background image after color reduction.
[0035] Furthermore, the basic patch color distribution module includes a patch expansion unit, which is used for:
[0036] A random array is generated based on the size of the background image. The random array is then processed using a cubic spline interpolation algorithm to generate a random curve. Finally, the random curve is used to generate a random curve border logic matrix.
[0037] Perform a bitwise AND operation between the random curved border logic matrix and the main color distribution matrix to weaken the straight boundaries of the original patches and generate a basic patch color distribution matrix.
[0038] The basic patch color distribution matrix is mirrored and rotated at multiple angles, and a basic patch color distribution matrix library is generated through patch expansion.
[0039] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0040] Clustering algorithms are used to decolorize the background image and extract the main color, thus obtaining the main color distribution matrix;
[0041] The statistical characteristics of the background image after color reduction are calculated using the primary color distribution matrix, and a color distribution random matrix is generated based on the statistical characteristics. A background color image is then generated based on the color distribution matrix.
[0042] The background image is processed using a cubic spline interpolation algorithm to generate a random curved border logic matrix, and a basic patch color distribution matrix library is obtained through the random curved border logic matrix.
[0043] A basic patch color distribution matrix is randomly selected from the basic patch color distribution matrix library. The basic patch color distribution matrix and the background image are combined to generate basic patches. The basic patches are then stitched together to obtain a camouflage image.
[0044] This invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the following steps:
[0045] Clustering algorithms are used to decolorize the background image and extract the main color, thus obtaining the main color distribution matrix;
[0046] The statistical characteristics of the background image after color reduction are calculated using the primary color distribution matrix, and a color distribution random matrix is generated based on the statistical characteristics. A background color image is then generated based on the color distribution matrix.
[0047] The background image is processed using a cubic spline interpolation algorithm to generate a random curved border logic matrix, and a basic patch color distribution matrix library is obtained through the random curved border logic matrix.
[0048] A basic patch color distribution matrix is randomly selected from the basic patch color distribution matrix library. The basic patch color distribution matrix and the background image are combined to generate basic patches. The basic patches are then stitched together to obtain a camouflage image.
[0049] The beneficial effects of this application are as follows: This invention discloses a visible light adaptive camouflage pattern generation method, system, device, and storage medium. The method processes a background environment image to obtain basic patches similar to the environment's color and texture features, expands these patches to reduce their repetition rate, and then stitches them together to form a camouflage image of appropriate size. This achieves rapid generation of effective digital camouflage patterns. This digital camouflage can be used as a static camouflage design method and is also applicable to visible light adaptive camouflage systems. The clustering color reduction algorithm proposed in this invention reduces image color while extracting monochrome patches, improving image processing efficiency. Furthermore, by proposing to fill pixels outside the patch area with a background color pattern that has the same statistical characteristics as the original image, the statistical characteristics of the patches are ensured not to change. In addition, the random curved border generation scheme based on cubic spline interpolation algorithm and element replacement of logical matrix proposed in this embodiment of the invention effectively solves the problem of flat boundary of basic patches, improves the integration of the generated camouflage with the environment, and finally proposes to use basic patches to splice together to form a camouflage image, which retains the color and texture features of the original image, and the generated camouflage image can be arbitrarily adjusted according to the requirements. Attached Figure Description
[0050] Figure 1 This is a flowchart illustrating a visible light adaptive camouflage generation method disclosed in one embodiment;
[0051] Figure 2 This is a schematic diagram of the process of obtaining the main color distribution matrix by main color clustering in one embodiment;
[0052] Figure 3 This is a schematic diagram of a process for obtaining a background color image through the statistical characteristics of the primary color, as disclosed in one embodiment.
[0053] Figure 4 This is a schematic diagram of a process for expanding a basic patch, as disclosed in one embodiment.
[0054] Figure 5 This is a structural block diagram of a visible light adaptive camouflage generation system in one embodiment;
[0055] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0056] To counter enemy high-tech reconnaissance and surveillance, it is necessary to focus on developing adaptive camouflage technologies that enable targets to blend into their surrounding natural background around the clock, throughout the entire process, and at all times.
[0057] In one embodiment, such as Figure 1 As shown, a visible light adaptive camouflage pattern generation method is provided, including the following steps:
[0058] Step 101: Use a clustering algorithm to decolorize the background image and extract the main color to obtain the main color distribution matrix;
[0059] Step 102: Calculate the statistical characteristics of the background image after color reduction using the primary color distribution matrix, generate a color distribution random matrix based on the statistical characteristics, and generate a background color image based on the color distribution matrix;
[0060] Step 103: Process the background image using a cubic spline interpolation algorithm to generate a random curved border logic matrix, and obtain a basic patch color distribution matrix library through the random curved border logic matrix.
[0061] Step 104: Randomly select a basic patch color distribution matrix from the basic patch color distribution matrix library, combine the basic patch color distribution matrix with the background color image to generate basic patches, and stitch the basic patches together to obtain a camouflage image.
[0062] Specifically, this embodiment obtains basic patches with similar color and texture features to the environment by processing the background image, expands these patches to reduce their repetition rate, and then stitches them together to form a camouflage image of appropriate size. This achieves rapid generation of effective digital camouflage, which can be used as a static camouflage design method and is also applicable to visible light adaptive camouflage systems. The clustering color reduction algorithm proposed in this invention reduces image color while extracting monochrome patches, improving image processing efficiency. Furthermore, by proposing to fill pixels outside the patch area with a background color pattern that has the same statistical characteristics as the original image, the statistical characteristics of the patches are ensured not to change. In addition, the random curved border generation scheme based on cubic spline interpolation and element replacement of the logical matrix proposed in this embodiment effectively solves the problem of flat boundaries of basic patches, improving the integration of the generated camouflage with the environment. Finally, the proposed method of stitching together basic patches to form a camouflage image preserves the color and texture features of the original image and allows for arbitrary adjustment of the generated camouflage image as needed.
[0063] In one embodiment, such as Figure 2 As shown, the process of obtaining the dominant color distribution matrix through dominant color clustering includes:
[0064] Step 201: Extract the main color of the background image using the K-means clustering algorithm, and randomly select k pixels from the background image as cluster centers;
[0065] Step 202: Based on the cluster centers, obtain k distance matrices and generate corresponding membership logic matrices;
[0066] Step 203: By setting the number of cluster centers, the pixels of the background image are clustered according to their RGB values. The RGB value of any cluster center is a primary color. The primary color distribution matrix corresponding to the primary color is generated through the membership logic matrix.
[0067] Specifically, firstly, based on the fact that a typical camouflage image consists of patches of 3 to 5 colors, the number of cluster centers, *n*, is set. Then, *k* pixels are randomly selected from the original background image as initial cluster centers. Based on the center of each cluster, the distances between all objects and these center objects are calculated, resulting in *k* distance matrices. A membership logic matrix is generated based on the minimum distance. The cluster centers are then updated by using the mean of the RGB components of each cluster as the new cluster center. The distance matrices and membership logic matrices are recalculated. This process is iterated until each cluster center no longer changes. Finally, the dominant color vector and the corresponding dominant color distribution matrix are output.
[0068] The main difference between the K-means clustering algorithm and existing technologies is that the K-means clustering algorithm does not need to change the structure of the original data during the image clustering and color reduction process. The resulting clustering and color reduction results simultaneously perform image segmentation by color. The color histogram of the color-reduced image is used to fill the out-of-domain areas of the monochrome patches, ensuring that the statistical characteristics of the generated camouflage image are close to the original image. The addition of random curved borders weakens the flat boundaries. The basic patches retain the main colors and texture features of the original image, taking into account both the color and texture blending of the camouflage and the background.
[0069] In one embodiment, such as Figure 3 As shown, obtaining the background color image through the statistical characteristics of the primary color includes the following steps:
[0070] Step 301: Calculate the probability of each primary color in the background image after color reduction using the primary color distribution matrix, and generate an equally probable random matrix as the color distribution random matrix;
[0071] Step 302: Generate the color distribution matrix of the background image based on the probability of each primary color and the interval to which the element values in the color distribution random matrix belong;
[0072] Step 303: Generate the background image by filling with the primary color, so that the color statistical characteristics of the background image are the same as those of the background image after color reduction.
[0073] Specifically, after the background image is processed by the clustering and color reduction module to obtain the main color and the main color distribution matrix, the background image generation module obtains the probability of the main color by calculating the number of 1s in the main color distribution matrix and the total number of pixels. Then, it generates the background image color distribution matrix by using a random matrix with equal probability between 0 and 1. After color filling according to the color distribution matrix, the background image is obtained.
[0074] In one embodiment, such as Figure 4 As shown, the process for expanding a basic plaque includes:
[0075] Step 401: Generate a random array based on the size of the background image, process the random array using a cubic spline interpolation algorithm to generate a random curve, and use the random curve to generate a random curve border logic matrix.
[0076] Step 402: Perform a bitwise AND operation between the random curved border logic matrix and the main color distribution matrix to weaken the straight boundaries of the original patches and generate a basic patch color distribution matrix.
[0077] Step 403: Mirror the basic patch color distribution matrix and rotate it at multiple angles to generate a basic patch color distribution matrix library through patch expansion.
[0078] Specifically, after knowing the number of pixels in the background image, a random array is generated based on the pixel count of the background image's width and height. Cubic spline interpolation is then performed on the random array to obtain a smooth random curve. Next, based on the data points of the smooth curve, elements of the all-one matrix are replaced to generate a random curve border. This method generates a binary random curve border image. Further, a bitwise AND operation is performed between the binary random curve border and the primary color distribution matrix. The resulting matrix is then mirrored and rotated at multiple angles to obtain a basic patch color distribution matrix library. A distribution matrix is selected from the basic patch color distribution matrix library using two random matrices. After determining the splicing positions of the generated patches, color filling is performed according to the color distribution matrix to generate patches and splice them into a camouflage pattern.
[0079] Specifically, two random matrices are used to determine the position of the color distribution matrix in the library and the position of the generated patch image in the camouflage image to be generated. After selecting the basic patch color distribution matrix, the position with a value of 1 is filled with the corresponding primary color, and the position with a value of 0 is filled with the pixel of the corresponding position of the background color image to ensure that the statistical characteristics of the generated basic patch are close to the original decolorized image.
[0080] It should be understood that although the steps in the flowchart above are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart above may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0081] In one embodiment, such as Figure 5 As shown, this embodiment discloses a visible light adaptive camouflage generation system, including:
[0082] Background image decolorization and segmentation module 501 is used to decolorize the background image and extract the main color using a clustering algorithm to obtain the main color distribution matrix;
[0083] The background image generation module 502 is used to calculate the statistical characteristics of the background image after color reduction through the main color distribution matrix, generate a color distribution random matrix based on the statistical characteristics, and generate a background image based on the color distribution matrix.
[0084] The basic patch color distribution module 503 is used to process the background image using a cubic spline interpolation algorithm to generate a random curved border logic matrix, and to obtain a basic patch color distribution matrix library through the random curved border logic matrix.
[0085] The camouflage image generation module 504 is used to randomly select a basic patch color distribution matrix from the basic patch color distribution matrix library, combine the basic patch color distribution matrix and the background image to generate basic patches, and stitch the basic patches together to obtain a camouflage image.
[0086] In one embodiment, such as Figure 5 As shown, the background image color reduction and segmentation module 501 includes a primary color clustering unit 5011, which is used for:
[0087] The dominant color of the background image is extracted using the K-means clustering algorithm, and k pixels are randomly selected from the background image as cluster centers.
[0088] Based on the cluster centers, obtain k distance matrices and generate corresponding membership logic matrices;
[0089] By setting the number of cluster centers, the pixels of the background image are clustered according to their RGB values. The RGB value of any cluster center is a primary color. The primary color distribution matrix corresponding to the primary color is generated through the membership logic matrix.
[0090] In one embodiment, such as Figure 5 As shown, the background image generation module 502 includes a statistical processing unit 5021, which is used for:
[0091] The probability of each primary color in the background image after color reduction is calculated using the primary color distribution matrix, and an equally probable random matrix is generated as the color distribution random matrix.
[0092] Based on the probability of each primary color and the range to which the element values in the color distribution random matrix belong, a color distribution matrix for the background image is generated.
[0093] The background image is generated by filling with the primary color, so that the color statistical characteristics of the background image are the same as those of the background image after color reduction.
[0094] In one embodiment, such as Figure 5 As shown, the basic patch color distribution module 503 includes a patch expansion unit 5031, which is used for:
[0095] A random array is generated based on the size of the background image. The random array is then processed using a cubic spline interpolation algorithm to generate a random curve. Finally, the random curve is used to generate a random curve border logic matrix.
[0096] Perform a bitwise AND operation between the random curved border logic matrix and the main color distribution matrix to weaken the straight boundaries of the original patches and generate a basic patch color distribution matrix.
[0097] The basic patch color distribution matrix is mirrored and rotated at multiple angles, and a basic patch color distribution matrix library is generated through patch expansion.
[0098] Specific limitations regarding the visible light adaptive camouflage generation system can be found in the limitations of the visible light adaptive camouflage generation method described above, and will not be repeated here. Each module in the aforementioned visible light adaptive camouflage generation system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0099] Figure 6 An internal structural diagram of a computer device in one embodiment is shown. Figure 6 As shown, the computer device includes a processor, memory, network interface, input device, and display screen connected via a system bus. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system and may also store computer programs. When executed by the processor, these computer programs enable the processor to implement anomaly detection methods. The internal memory may also store computer programs, which, when executed by the processor, enable the processor to implement anomaly detection methods. The display screen can be an LCD screen or an e-ink screen. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0100] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0101] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0102] Clustering algorithms are used to decolorize the background image and extract the main color, thus obtaining the main color distribution matrix;
[0103] The statistical characteristics of the background image after color reduction are calculated using the primary color distribution matrix, and a color distribution random matrix is generated based on the statistical characteristics. A background color image is then generated based on the color distribution matrix.
[0104] The background image is processed using a cubic spline interpolation algorithm to generate a random curved border logic matrix, and a basic patch color distribution matrix library is obtained through the random curved border logic matrix.
[0105] A basic patch color distribution matrix is randomly selected from the basic patch color distribution matrix library. The basic patch color distribution matrix and the background image are combined to generate basic patches. The basic patches are then stitched together to obtain a camouflage image.
[0106] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0107] The dominant color of the background image is extracted using the K-means clustering algorithm, and k pixels are randomly selected from the background image as cluster centers.
[0108] Based on the cluster centers, obtain k distance matrices and generate corresponding membership logic matrices;
[0109] By setting the number of cluster centers, the pixels of the background image are clustered according to their RGB values. The RGB value of any cluster center is a primary color. The primary color distribution matrix corresponding to the primary color is generated through the membership logic matrix.
[0110] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0111] The probability of each primary color in the background image after color reduction is calculated using the primary color distribution matrix, and an equally probable random matrix is generated as the color distribution random matrix.
[0112] Based on the probability of each primary color and the range to which the element values in the color distribution random matrix belong, a color distribution matrix for the background image is generated.
[0113] The background image is generated by filling with the primary color, so that the color statistical characteristics of the background image are the same as those of the background image after color reduction.
[0114] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0115] A random array is generated based on the size of the background image. The random array is then processed using a cubic spline interpolation algorithm to generate a random curve. Finally, the random curve is used to generate a random curve border logic matrix.
[0116] Perform a bitwise AND operation between the random curved border logic matrix and the main color distribution matrix to weaken the straight boundaries of the original patches and generate a basic patch color distribution matrix.
[0117] The basic patch color distribution matrix is mirrored and rotated at multiple angles, and a basic patch color distribution matrix library is generated through patch expansion.
[0118] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0119] Clustering algorithms are used to decolorize the background image and extract the main color, thus obtaining the main color distribution matrix;
[0120] The statistical characteristics of the background image after color reduction are calculated using the primary color distribution matrix, and a color distribution random matrix is generated based on the statistical characteristics. A background color image is then generated based on the color distribution matrix.
[0121] The background image is processed using a cubic spline interpolation algorithm to generate a random curved border logic matrix, and a basic patch color distribution matrix library is obtained through the random curved border logic matrix.
[0122] A basic patch color distribution matrix is randomly selected from the basic patch color distribution matrix library. The basic patch color distribution matrix and the background image are combined to generate basic patches. The basic patches are then stitched together to obtain a camouflage image.
[0123] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0124] The dominant color of the background image is extracted using the K-means clustering algorithm, and k pixels are randomly selected from the background image as cluster centers.
[0125] Based on the cluster centers, obtain k distance matrices and generate corresponding membership logic matrices;
[0126] By setting the number of cluster centers, the pixels of the background image are clustered according to their RGB values. The RGB value of any cluster center is a primary color. The primary color distribution matrix corresponding to the primary color is generated through the membership logic matrix.
[0127] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0128] The probability of each primary color in the background image after color reduction is calculated using the primary color distribution matrix, and an equally probable random matrix is generated as the color distribution random matrix.
[0129] Based on the probability of each primary color and the range to which the element values in the color distribution random matrix belong, a color distribution matrix for the background image is generated.
[0130] The background image is generated by filling with the primary color, so that the color statistical characteristics of the background image are the same as those of the background image after color reduction.
[0131] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0132] A random array is generated based on the size of the background image. The random array is then processed using a cubic spline interpolation algorithm to generate a random curve. Finally, the random curve is used to generate a random curve border logic matrix.
[0133] Perform a bitwise AND operation between the random curved border logic matrix and the main color distribution matrix to weaken the straight boundaries of the original patches and generate a basic patch color distribution matrix.
[0134] The basic patch color distribution matrix is mirrored and rotated at multiple angles, and a basic patch color distribution matrix library is generated through patch expansion.
[0135] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.
[0136] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0137] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for generating visible light adaptive camouflage pattern, characterized in that, The method comprises the following steps: The background image is desaturated and the main colors are extracted by using a clustering algorithm to obtain a main color distribution matrix; Statistical characteristics of the desaturated background image are calculated based on the main color distribution matrix, and a color distribution random matrix is generated based on the statistical characteristics, and a base color image is generated based on the color distribution random matrix; The background image is processed by using a cubic spline interpolation algorithm to generate a random curve border logical matrix, and a basic patch color distribution matrix library is obtained based on the random curve border logical matrix; A basic patch color distribution matrix is randomly selected from the basic patch color distribution matrix library, and the basic patch color distribution matrix and the base color image are combined to generate a basic patch, and the basic patch is spliced to obtain a camouflage pattern image; The background image is processed by using a cubic spline interpolation algorithm to generate a random curve border logical matrix, and a basic patch color distribution matrix library is obtained based on the random curve border logical matrix, comprising: A random array is generated based on the size of the background image, the random array is processed by using a cubic spline interpolation algorithm to generate a random curve, and the random curve is used to generate a random curve border logical matrix; The random curve border logical matrix is subjected to an AND operation with the main color distribution matrix to weaken the flat boundary of the original patch and generate a basic patch color distribution matrix; The basic patch color distribution matrix is subjected to mirror flipping and multi-angle rotation to generate a basic patch color distribution matrix library through patch expansion.
2. The method of claim 1, wherein, The background image is desaturated and the main colors are extracted by using a clustering algorithm to obtain a main color distribution matrix, comprising: The main colors of the background image are extracted by using a K-means clustering algorithm, and k pixels are randomly selected from the background image as clustering centers; Based on the clustering centers, k distance matrices are obtained, and corresponding membership logical matrices are generated; The pixels of the background image are clustered based on RGB values by setting the number of clustering centers, and the RGB value of any clustering center is a main color, and the main color distribution matrix corresponding to the main color is generated based on the membership logical matrix.
3. The method of claim 1, wherein, Statistical characteristics of the desaturated background image are calculated based on the main color distribution matrix, and a color distribution random matrix is generated based on the statistical characteristics, and a base color image is generated based on the color distribution random matrix, comprising: The probabilities of each main color of the desaturated background image are calculated based on the main color distribution matrix, and an equal-probability random matrix is generated as the color distribution random matrix; Based on the probabilities of each main color and the interval to which the element value in the color distribution random matrix belongs, a color distribution matrix of the base color image is generated; The base color image is generated by filling the main colors, so that the color statistical characteristics of the base color image are the same as those of the desaturated background image.
4. A visible light adaptive camouflage pattern generation system, characterized by, It comprises: A background image desaturation and segmentation module is used to desaturate the background image and extract the main colors by using a clustering algorithm to obtain a main color distribution matrix; The base color image generation module is configured to calculate statistical characteristics of the background image after color reduction based on the primary color distribution matrix, and generate a color distribution random matrix based on the statistical characteristics, and generate a base color image based on the color distribution random matrix; The base patch color distribution module is configured to process the background image by using a cubic spline interpolation algorithm to generate a random curve frame logical matrix, and obtain a base patch color distribution matrix library based on the random curve frame logical matrix; The camouflage image generation module is configured to randomly select a base patch color distribution matrix from the base patch color distribution matrix library, combine the base patch color distribution matrix with the base color image to generate a base patch, and splice the base patch to obtain a camouflage image. The base patch color distribution module includes a patch expansion unit, which is configured to: generate a random array based on the size of the background image, process the random array by using a cubic spline interpolation algorithm to generate a random curve, and generate a random curve frame logical matrix based on the random curve; perform a bit-wise AND operation on the random curve frame logical matrix and the primary color distribution matrix to weaken the flat boundary of the original patch and generate a base patch color distribution matrix; mirror flip and multi-angle rotate the base patch color distribution matrix to generate a base patch color distribution matrix library through patch expansion.
5. The visible light adaptive camouflage pattern generation system of claim 4, wherein, The background image color reduction and segmentation module includes a primary color clustering unit, which is configured to: extract the primary colors of the background image by using a K-means clustering algorithm, and randomly select k pixels as clustering centers from the background image; obtain k distance matrices and generate corresponding membership logical matrices based on the clustering centers; cluster the pixels of the background image according to RGB values by setting the number of clustering centers, and the RGB value of any clustering center is a primary color, and the primary color distribution matrix corresponding to the primary color is generated based on the membership logical matrix.
6. The visible light adaptive camouflage pattern generation system of claim 4, wherein, The base color image generation module includes a statistical processing unit, which is configured to: calculate the probability of each primary color of the background image after color reduction based on the primary color distribution matrix, and generate an equiprobable random matrix as the color distribution random matrix; generate a color distribution matrix of the base color image based on the probability of each primary color and the interval to which the element value in the color distribution random matrix belongs; generate the base color image by primary color filling, so that the color statistical characteristics of the base color image are the same as those of the background image after color reduction.
7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 3.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 3.