A method and system for selecting the color of a vehicle camouflage paint film

By converting the background image to the L*a*b* color space and using the K-mean algorithm for clustering, the color problem of vehicle camouflage paint film that the existing technology cannot meet the requirements of the national military standard is solved, and better color selection and background fusion is achieved.

CN115049855BActive Publication Date: 2025-04-22ARMY ENG UNIV OF PLA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210655158.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-10
Publication Date
2025-04-22
Estimated Expiration
2042-06-10

AI Technical Summary

Technical Problem

The existing background advantage color extraction algorithm cannot meet the color standards of military vehicle camouflage paint films that the national military standard requires.

Method used

By converting the background image to the L*a*b* color space, using the K-mean algorithm to group the pixel points in the background color space map, iteratively update the cluster center until the cluster center does not change, and the preset standard color corresponding to the output cluster center is used as the vehicle paint color.

Benefits of technology

The fusion of color selection and background image is improved, and the color standard of military vehicle camouflage paint film that meets the requirements of the national military standard.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115049855B_ABST
    Figure CN115049855B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and system for selecting the color of a vehicle camouflage paint film, the method comprising: converting a background image into L * a * b * Color space; initialize M preset standard colors, each preset standard color is L * a * b * The three-dimensional vector corresponding to the chromaticity value; Initialize the N cluster centers of the K-mean algorithm; Group each pixel in the background color space map according to the current cluster centers; Calculate the L of all pixels in each group separately * a * b * The average value of the three-dimensional vector; the cluster center is updated according to each average value; if the updated cluster center is not exactly the same as the cluster center before the update, then return to the step of "grouping each pixel point in the background color space map according to the current cluster centers"; otherwise, the N preset standard colors corresponding to the updated cluster center are used as the vehicle painting color. The present invention improves the integration of color selection and background image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle camouflage, and in particular to a method and system for selecting the color of a vehicle camouflage paint film. Background Art

[0002] Camouflage military targets can effectively reduce the target's conspicuity and improve the target's battlefield survivability. The first problem in computer camouflage design is to extract the dominant background color.

[0003] GJB 798-90 Camouflage Paint Film Color specifies the standard color of camouflage paint film for military vehicles with the ground as the background. The existing background advantage color extraction algorithms do not meet the requirements of the military standard for the color of camouflage paint film for military vehicles. Summary of the invention

[0004] The purpose of the present invention is to provide a method and system for selecting the color of a vehicle camouflage paint film, which improves the integration of color selection and background image.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] A method for selecting the color of a vehicle camouflage paint film, comprising:

[0007] Get the background image;

[0008] Convert the background image to L * a * b * Color space, obtain the background color space map;

[0009] Initialize M preset standard colors, each preset standard color is L * a * b * The three-dimensional vector corresponding to the chromaticity value;

[0010] Initialize the N cluster centers of the K-mean algorithm, where the N cluster centers are N preset standard colors of different colors;

[0011] Grouping each pixel point in the background color space map according to each current cluster center;

[0012] Calculate L for all pixels in each group separately * a * b * The average value of a three-dimensional vector;

[0013] Update the cluster centers according to the average values;

[0014] Determine whether the cluster center after update is exactly the same as the cluster center before update;

[0015] If the updated cluster center is not completely the same as the cluster center before the update, the updated cluster center is used as the current cluster center, and the process returns to the step of "grouping each pixel point in the background color space map according to the current cluster centers";

[0016] If the updated cluster center is exactly the same as the cluster center before the update, the N preset standard colors corresponding to the updated cluster center are used as the vehicle paint colors.

[0017] Optionally, N is 3 and M is 30.

[0018] Optionally, updating the cluster centers according to the average values ​​specifically includes:

[0019] Calculate the Euclidean distances between the average value of the i-th group and M preset standard colors respectively, and use the preset standard color corresponding to the minimum Euclidean distance as the i-th standardized color;

[0020] The obtained N standardized colors are used as updated cluster centers.

[0021] Optionally, updating the cluster centers according to the average values ​​specifically includes:

[0022] Construct a mapping error matrix set, wherein the mapping error matrix set includes N! mapping error matrices obtained according to different row permutations and combinations; each mapping error matrix is ​​a matrix of N rows and M columns, and each row element in each mapping error matrix is ​​the Euclidean distance between the average value of a group and M preset standard colors, and the preset standard colors corresponding to the column elements with the same number of columns in the mapping error matrix are the same;

[0023] Taking the maximum value of the elements in the mapping error matrix as the distance threshold;

[0024] For each mapping error matrix, starting from the first row, determine the standardized color of each row in turn: save the minimum value in the i-th row, use the preset standard color corresponding to the minimum value in the i-th row as the i-th standardized color, and set the elements in the column where the minimum value in the i-th row is located as the distance threshold;

[0025] Calculate the square mean of the N minimum values ​​determined from each mapping error matrix respectively to obtain N! square means;

[0026] The N standardized colors corresponding to the minimum values ​​of the N! square means are used as the updated cluster centers.

[0027] The present invention discloses a vehicle camouflage paint film color selection system, comprising:

[0028] A background image acquisition module, used to acquire a background image;

[0029] L * a * b * The color space conversion module is used to convert the background image into L * a * b * Color space, obtain the background color space map;

[0030] M preset standard color initialization module, used to initialize M preset standard colors, each preset standard color is L * a * b * The three-dimensional vector corresponding to the chromaticity value;

[0031] The cluster center initialization module is used to initialize the N cluster centers of the K-mean algorithm, and the N cluster centers are N preset standard colors of different colors;

[0032] A pixel grouping module, used for grouping each pixel in the background color space map according to each current cluster center;

[0033] The average value calculation module of each group is used to calculate the L of all pixels in each group respectively. * a * b * The average value of a three-dimensional vector;

[0034] A cluster center updating module is used to update the cluster center according to each average value;

[0035] A judgment module, used to judge whether the cluster center after updating is exactly the same as the cluster center before updating;

[0036] Return module, if the updated cluster center is not exactly the same as the cluster center before the update, it is used to take the updated cluster center as the current cluster center and return to the pixel grouping module;

[0037] The vehicle paint color output module is used to use the N preset standard colors corresponding to the updated cluster centers as the vehicle paint colors if the updated cluster centers are exactly the same as the cluster centers before the update.

[0038] Optionally, N is 3 and M is 30.

[0039] Optionally, the cluster center updating module specifically includes:

[0040] The standardized color determination unit of each group is used to calculate the Euclidean distance between the average value of the i-th group and M preset standard colors, and take the preset standard color corresponding to the minimum Euclidean distance as the i-th standardized color;

[0041] The first cluster center updating unit is used to use the obtained N standardized colors as updated cluster centers.

[0042] Optionally, the cluster center updating module specifically includes:

[0043] A mapping error matrix set construction unit is used to construct a mapping error matrix set, wherein the mapping error matrix set includes N! types of mapping error matrices obtained according to different row permutations and combinations; each mapping error matrix is ​​a matrix of N rows and M columns, and each row element in each mapping error matrix is ​​the Euclidean distance between the average value of a group and M preset standard colors, and the preset standard colors corresponding to the column elements with the same number of columns in the mapping error matrix are the same;

[0044] a distance threshold determination unit, configured to take the maximum value of the elements in the mapping error matrix as the distance threshold;

[0045] The standardized color determination unit for each row is used to determine the standardized color of each row in turn, starting from the first row, for each mapping error matrix: save the minimum value in the i-th row, use the preset standard color corresponding to the minimum value in the i-th row as the i-th standardized color, and set all elements in the column where the minimum value in the i-th row is located as the distance threshold;

[0046] A square mean value calculation unit, used to respectively calculate the square mean values ​​of the N minimum values ​​determined from each mapping error matrix to obtain N square means;

[0047] The second cluster center updating unit is used to use the N standardized colors corresponding to the minimum values ​​of the N square means as updated cluster centers.

[0048] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0049] The present invention discloses a method and system for selecting the color of a vehicle camouflage paint film, which converts the background image into L * a * b * Color space to obtain the background color space map, due to L * a * b * The color space is a uniform color space. The pixels in the background color space map are grouped using the K-mean algorithm. The N preset standard colors corresponding to the cluster centers output when the iteration stops are used as vehicle paint colors, which improves the integration of color selection and background images. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0051] Figure 1 A schematic flow chart of a method for selecting a vehicle camouflage paint film color according to the present invention;

[0052] Figure 2 is background image sample 1;

[0053] Figure 3 is the three-color normalized color map of background image sample 1;

[0054] Figure 4 is the five-color standardized color map of background image sample 1;

[0055] Figure 5 is background image sample 2;

[0056] Figure 6 is the three-color normalized color map of background image sample 2;

[0057] Figure 7 is the five-color standardized color map of background image sample 2;

[0058] Figure 8 The present invention is a schematic diagram of the structure of a vehicle camouflage paint film color selection system. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] The purpose of the present invention is to provide a method and system for selecting the color of a vehicle camouflage paint film, which improves the integration of color selection and background image.

[0061] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0062] Figure 1 FIG. 1 is a flow chart of a method for selecting a color of a vehicle camouflage paint film according to the present invention. Figure 1As shown, a method for selecting the color of a vehicle camouflage paint film comprises:

[0063] Step 101: Get a background image.

[0064] The background image is a background image of the ground taken from a high altitude with texture features.

[0065] Step 102: Convert the background image to L * a * b * Color space, get the background color space map.

[0066] Step 103: Initialize M preset standard colors, each preset standard color is L * a * b * A three-dimensional vector corresponding to the chromaticity values.

[0067] Step 104: Initialize N cluster centers of the K-mean algorithm, where the N cluster centers are N different preset standard colors.

[0068] The cluster center is represented as Among them, 2≤N≤n, n represents the total number of samples, and n is the number of pixels in the image.

[0069] The colors of the typical deformed camouflage patterns of army equipment specified in GJB4004-2000 are all three colors, so N=3 is selected. It can be simulated to prove that the minimum root mean square error of extracting the standardized five-color map has no obvious advantage over the three-color map. Sometimes, the root mean square error increases due to the forced increase of clustering points using standardized colors. The average number of iterations for extracting the standardized five-color map is generally slightly greater than that for the three-color map. In summary, a scheme for extracting three standard colors is established. In order to reduce the number of iterations, three non-repeated colors are randomly selected from the 30 standard colors given in "Table 3-Chromametric data and near-infrared brightness factor of camouflage paint film color" of "GJB 798-90 Camouflage paint film color" as the initial clustering center. The relevant data are shown in Table 1.

[0070] Table 1 Chromatographic data of camouflage paint film color

[0071]

[0072]

[0073] In the present invention, M=30, and the M preset standard colors are the 30 standard colors in Table 1. Initialize the three cluster centers of the K-mean algorithm, and the three cluster centers are three different standard colors randomly selected from the 30 standard colors in Table 1.

[0074] The standardized color L in Table 1* a * b * The chromaticity value is set to a three-dimensional vector s_colour j =(L * j ,a * j ,b * j ), 1≤j≤30, so the randomly selected initial cluster center is also a three-dimensional vector.

[0075] Step 105: group each pixel in the background color space map according to the current cluster centers.

[0076] Wherein, step 105 specifically includes: according to the current cluster center L * a * b * Chromaticity value, calculate which group each pixel in the background color space map should belong to. The basic principle of calculating the clustering model is the minimum Euclidean distance principle, that is, the point is divided into the group with the closest distance to the cluster center.

[0077]

[0078] pattern xy Represents the cluster category of the pixel sample in the xth row and yth column in the image, and the Euclidean distance between the sample and the kth cluster center Among them, Lab xy L represents the pixel sample in row x and column y in the image. * a * b * value.

[0079] Step 106: Calculate L of all pixels in each group separately * a * b * The mean of a three-dimensional vector.

[0080] Step 106 specifically includes: calculating L of all pixels in each group * a * b * The average of the elements in a three-dimensional collection of vectors.

[0081] According to step 105, each pixel in the background color space image corresponds to a cluster category value pattern xy , calculate the center value of all points belonging to this category, which is equivalent to L * a * b *In a three-dimensional vector space, find the average value of the elements in a three-dimensional vector set formed by clustering multiple points. Then the central value of all sample values ​​belonging to the kth class after the i-th iteration is:

[0082]

[0083] Represents the pixel point L corresponding to the group of the k-th cluster center after the i-th iteration * a * b * The center value (average value) of the three-dimensional vector, num(k) represents the number of pixels in the group corresponding to the k-th cluster center.

[0084] Step 107: Update the cluster centers according to the average values.

[0085] As an embodiment, step 107 specifically includes:

[0086] The cluster center of the present invention is used as the color sorting of the camouflage paint film, which should meet the provisions of the national military standard. According to the minimum Euclidean distance criterion, the Euclidean distance between the average value of the i-th group and the M preset standard colors is calculated respectively, and the preset standard color corresponding to the minimum Euclidean distance is used as the i-th standardized color. The obtained N standardized colors are used as the updated cluster center. That is, the cluster center is calculated Compared with the national military standard color s_colour given in Table 1 j The closest color is used as the cluster center for the next iteration

[0087]

[0088] s_colour l Indicates the L corresponding to the lth standard color in the image * a * b * Chromaticity value, the Euclidean distance between the standard color and the kth cluster center is expressed as

[0089] Since the background colors with similar colors are divided into two clusters according to the k-mean algorithm, they are likely to be the same color after color standardization, which reduces the total number of clusters and reduces the clustering effect. In the application, the method of minimizing the square mean of the mapping error between the cluster center and the selected standardized color is used to reduce the error between the cluster center and the standardized color and make the best standard color selection decision.

[0090] As another embodiment, step 107 specifically includes:

[0091] A mapping error matrix set is constructed, and the mapping error matrix set includes N! mapping error matrices obtained according to different row permutations and combinations; each mapping error matrix is ​​a matrix with N rows and M columns, and each row element in each mapping error matrix is ​​the Euclidean distance between the average value of a group and M preset standard colors, and the column elements with the same number of columns in the mapping error matrix correspond to the same preset standard colors.

[0092] The mapping error matrix distance represents the Euclidean distance between N cluster centers and 30 standard color coordinate values, which is an N×30 matrix. ij Represents the Euclidean distance between the i-th cluster center and the j-th standard color.

[0093]

[0094] In order to select the optimal standard color without duplication, it is necessary to select an element in each row of the mapping error matrix, and these elements are in different columns, and their square mean is minimized.

[0095]

[0096] RMS distance Represents elements of N different columns The square mean of .

[0097] Then the number of columns where these N elements are located is s i is the selected standardized color number. In order to traverse all possibilities, it is necessary to calculate Therefore, the algorithm is improved, and the basic idea is to try to select the minimum value of each row as the final selected value.

[0098] The maximum value of the elements in the mapping error matrix is ​​taken as the distance threshold.

[0099] For each mapping error matrix, starting from the first row, determine the standardized color of each row in turn: save the minimum value in the i-th row, use the preset standard color corresponding to the minimum value in the i-th row as the i-th standardized color, and replace all elements in the column where the minimum value in the i-th row is located with the distance threshold. The specific method is: first select the minimum value from the first row, and then set all elements in the column where the element is located as the distance threshold to ensure that the elements in the column will not be selected by other rows, avoiding repeated selection of standard colors; select the minimum value in the second row to save, and also set all elements in the column where the element is located to the maximum value; and so on. After calculation, a smaller square mean will be obtained.

[0100] The square means of the N minimum values ​​determined from each mapping error matrix are calculated respectively to obtain N! square means.

[0101] N! means N factorial.

[0102] The N standardized colors corresponding to the minimum values ​​of the N! square means are used as the updated cluster centers.

[0103] In order to select from a larger range of small square means, the row arrangement of the mapping error matrix is ​​changed, and the above operation is performed again, that is, the square mean corresponding to each mapping error matrix in the mapping error matrix set is calculated. When N=3, there are 6 kinds of row arrangements of the mapping error matrix. After 6 operations, a set of square means will be obtained, and the minimum value will be selected in the set. The columns where these elements corresponding to the minimum value are located are the selected standardized color numbers. After this improvement, the amount of calculation is compressed to a great extent and the operation efficiency is improved. Although there may be an error between the obtained minimum value and the actual minimum value, the error can be ignored. In addition, before performing the iterative algorithm, attention should be paid to removing isolated points to reduce the error caused by small probability pixels to the overall pixel classification.

[0104] Step 108: Determine whether the updated cluster center is completely the same as the cluster center before the update.

[0105] Step 109: If the updated cluster center is not completely the same as the cluster center before the update, the updated cluster center is used as the current cluster center, and the process returns to step 105 to continue the iteration.

[0106] Step 110: If the updated cluster center is exactly the same as the cluster center before the update, that is Then stop the iteration and output the clustering model Pattern (pattern xy composition) and standard color cluster centers The matrix Center is constructed, and the N preset standard colors corresponding to the updated cluster centers are used as vehicle paint colors.

[0107] After color clustering is completed, the pixel points in the image are reassigned according to the output clustering category Pattern matrix and Center matrix. * a * b * The color space is converted to RGB color space, and the background image after clustering is displayed. By comparing the background image after clustering with the background image before clustering, it can be seen that the background image after clustering is visually close to the color of the background image before clustering.

[0108] Experimental verification of a vehicle camouflage paint film color selection method of the present invention:

[0109] Two high-altitude background image samples with texture features are selected for experiment, and the size of both images is 1024 × 575. A vehicle camouflage paint film color selection method of the present invention extracts and standardizes the dominant background color.

[0110] Figure 2 is background image sample 1, Figure 3 is the three-color normalized color map of background image sample 1, Figure 4 is the five-color standardized color map of background image sample 1; Figure 5 is background image sample 2, Figure 6 is the three-color normalized color map of background image sample 2, Figure 7 The five-color normalized color map of background image sample 2.

[0111] from Figure 2-Figure 7 It can be seen that the extracted standardized color map is visually close to the original background image color, and the standardized five-color map has more significant regional division than the three-color map.

[0112] The standardized colors selected by the vehicle camouflage paint film color selection method of the present invention are shown in Table 2. From the results, when five colors are selected, the problem of the same color type is more likely to occur. Therefore, from the color selection results, selecting three colors can meet the problem of integration with the background, and is also beneficial to the actual coating operation. The GJB404-2000 Army Equipment Deformed Camouflage Atlas also selects three colors for different environmental backgrounds, which indirectly confirms the effectiveness of the method of the present invention. Figure 2 The selected result is close to the background color of the grassland pattern in the atlas. Figure 5 The selected result is close to the background color of the desert pattern.

[0113] Table 2 Selected standardized colors

[0114]

[0115]

[0116] The root mean square error function is selected as the evaluation function to quantitatively describe the fusion effect of the standardized color map and the background image. The root mean square error (RMSE) between the original background image R and the standardized color clustering map B can be expressed as:

[0117]

[0118] Among them, X×Y is the size of the original background image, R x,y With B x,y Respectively represent the pixel values ​​of the xth row and yth column in the original background image and the clustered image. Both images use the RGB space model, so it is necessary to calculate the corresponding root mean square error S on the three channels of R, G, and B. R , S G , S R The root mean square error of the two images is defined as the average of the root mean square errors on the three channels.

[0119]

[0120] The K-mean algorithm is always restricted by the initial value and the iteration termination condition, which makes the final results not completely the same. The experiment was conducted 100 times for both images. The minimum root mean square error obtained in the experiment was selected as the optimal value, and the average number of iterations of the experiment was calculated, as shown in Table 3.

[0121] Table 3 Minimum root mean square error and number of iterations

[0122]

[0123]

[0124] The minimum root mean square error between the image obtained by the invention after color standardization and the original image is low, and the image has good fusion with the background. The reason is that the initialization cluster center is selected from the standard color, and the color is standardized in each iteration, so that the sample convergence is increased. Another advantage of the invention is that the number of iterations is small and the convergence speed is fast, because after the color standardization after each iteration, the result is closer to the final cluster center.

[0125] The present invention clusters the color values ​​in the background color space, extracts the background representative color, and selects the color closest to the dominant background color from the standard colors as the paint film color of the vehicle, providing an effective basis for the selection of camouflage paint film colors for military vehicles.

[0126] For the method of the present invention, the minimum root mean square error of extracting the standardized five-color map has no obvious advantage over the three-color map. Sometimes, the root mean square error increases due to the forced increase of cluster points using standardized colors. The average number of iterations for extracting the standardized five-color map is generally slightly greater than that for the three-color map. In summary, a scheme for extracting three standard colors is established.

[0127] Figure 8 FIG. 1 is a schematic diagram of a vehicle camouflage paint film color selection system according to the present invention. Figure 8 As shown, the present invention discloses a vehicle camouflage paint film color selection system, comprising:

[0128] The background image acquisition module 201 is used to acquire a background image.

[0129] L * a * b * The color space conversion module 202 is used to convert the background image into L * a * b * Color space, get the background color space map.

[0130] The M preset standard color initialization module 203 is used to initialize M preset standard colors, each preset standard color is L * a * b * A three-dimensional vector corresponding to the chromaticity values.

[0131] The cluster center initialization module 204 is used to initialize N cluster centers of the K-mean algorithm, where the N cluster centers are N different preset standard colors.

[0132] The pixel point grouping module 205 is used to group each pixel point in the background color space map according to the current cluster centers.

[0133] The group average calculation module 206 is used to calculate the L of all pixels in each group. * a * b * The mean of a three-dimensional vector.

[0134] The cluster center updating module 207 is used to update the cluster center according to each average value.

[0135] The judgment module 208 is used to judge whether the cluster center after the update is completely the same as the cluster center before the update.

[0136] Return module 209 , if the updated cluster center is not completely the same as the cluster center before updating, is used to use the updated cluster center as the current cluster center and return to pixel grouping module 205 .

[0137] The vehicle paint color output module 210 is used to use the N preset standard colors corresponding to the updated cluster centers as the vehicle paint colors if the updated cluster centers are completely the same as the cluster centers before the update.

[0138] N is 3 and M is 30.

[0139] As an embodiment, the cluster center updating module 207 specifically includes:

[0140] The standardized color determination unit of each group is used to calculate the Euclidean distance between the average value of the i-th group and M preset standard colors, and use the preset standard color corresponding to the minimum Euclidean distance as the i-th standardized color.

[0141] The first cluster center updating unit is used to use the obtained N standardized colors as updated cluster centers.

[0142] As another embodiment, the cluster center updating module 207 specifically includes:

[0143] The mapping error matrix set construction unit is used to construct a mapping error matrix set, wherein the mapping error matrix set includes N! types of mapping error matrices obtained according to different row permutations and combinations; each mapping error matrix is ​​a matrix of N rows and M columns, and each row element in each mapping error matrix is ​​the Euclidean distance between the average value of a group and M preset standard colors, and the column elements with the same number of columns in the mapping error matrix correspond to the same preset standard colors.

[0144] The distance threshold determination unit is used to take the maximum value of the elements in the mapping error matrix as the distance threshold.

[0145] The standardized color determination unit for each row is used to determine the standardized color of each row in turn, starting from the first row, for each mapping error matrix: save the minimum value in the i-th row, use the preset standard color corresponding to the minimum value in the i-th row as the i-th standardized color, and set the elements in the column where the minimum value in the i-th row is located as the distance threshold.

[0146] The square mean value calculation unit is used to respectively calculate the square mean values ​​of the N minimum values ​​determined from each mapping error matrix to obtain N square mean values.

[0147] The second cluster center updating unit is used to use the N standardized colors corresponding to the minimum values ​​of the N square means as updated cluster centers.

[0148] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0149] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for selecting the color of a vehicle camouflage paint film, characterized in that: include: Get the background image; Transform the background image to L * a * b * Color space, obtain the background color space map; Initialize M preset standard colors, each preset standard color is L * a * b * The three-dimensional vector corresponding to the chromaticity value; Initialize the N cluster centers of the K-mean algorithm, where the N cluster centers are N preset standard colors of different colors; Grouping each pixel point in the background color space map according to each current cluster center; Calculate all pixels in each group separately L * a * b * The average value of a three-dimensional vector; Update the cluster centers according to the average values; Determine whether the cluster center after update is exactly the same as the cluster center before update; If the updated cluster center is not completely the same as the cluster center before the update, the updated cluster center is used as the current cluster center, and the process returns to the step of "grouping each pixel point in the background color space map according to the current cluster centers"; If the updated cluster center is exactly the same as the cluster center before the update, the N preset standard colors corresponding to the updated cluster center are used as the vehicle paint colors; The updating of the cluster centers according to the average values ​​specifically includes: Calculate the Euclidean distances between the average value of the i-th group and M preset standard colors respectively, and use the preset standard color corresponding to the minimum Euclidean distance as the i-th standardized color; The obtained N standardized colors are used as updated cluster centers.

2. The method for selecting the color of a vehicle camouflage paint film according to claim 1, characterized in that: N is 3 and M is 30.

3. A method for selecting the color of a vehicle camouflage paint film, characterized in that: include: Get the background image; Transform the background image to L * a * b * Color space, obtain the background color space map; Initialize M preset standard colors, each preset standard color is L * a * b * The three-dimensional vector corresponding to the chromaticity value; Initialize the N cluster centers of the K-mean algorithm, where the N cluster centers are N preset standard colors of different colors; Grouping each pixel point in the background color space map according to each current cluster center; Calculate all pixels in each group separately L * a * b * The average value of a three-dimensional vector; Update the cluster centers according to the average values; Determine whether the cluster center after update is exactly the same as the cluster center before update; If the updated cluster center is not completely the same as the cluster center before the update, the updated cluster center is used as the current cluster center, and the process returns to the step of "grouping each pixel point in the background color space map according to the current cluster centers"; If the updated cluster center is exactly the same as the cluster center before the update, the N preset standard colors corresponding to the updated cluster center are used as the vehicle paint colors; The updating of the cluster centers according to the average values ​​specifically includes: Construct a mapping error matrix set, wherein the mapping error matrix set includes the N ! A mapping error matrix; each mapping error matrix is ​​a matrix of N rows and M columns, each row element in each mapping error matrix is ​​the Euclidean distance between the average value of a group and M preset standard colors, and the column elements with the same number of columns in the mapping error matrix correspond to the same preset standard colors; Taking the maximum value of the elements in the mapping error matrix as the distance threshold; For each mapping error matrix, starting from the first row, determine the standardized color of each row in turn: save the minimum value in the i-th row, use the preset standard color corresponding to the minimum value in the i-th row as the i-th standardized color, and set the elements in the column where the minimum value in the i-th row is located as the distance threshold; Calculate the square mean of the N minimum values ​​determined from each mapping error matrix respectively, and obtain N ! Square mean; Will N The N standardized colors corresponding to the minimum values ​​of the square means are used as the updated cluster centers.

4. A vehicle camouflage paint film color selection system, characterized in that: include: A background image acquisition module, used to acquire a background image; L * a * b * A color space conversion module is used to convert the background image into L * a * b * Color space, obtain the background color space map; M preset standard color initialization module is used to initialize M preset standard colors, each preset standard color is L * a * b * The three-dimensional vector corresponding to the chromaticity value; The cluster center initialization module is used to initialize the N cluster centers of the K-mean algorithm, and the N cluster centers are N preset standard colors of different colors; A pixel grouping module, used for grouping each pixel in the background color space map according to each current cluster center; The average value calculation module for each group is used to calculate the average value of all pixels in each group. L * a * b * The average value of a three-dimensional vector; A cluster center updating module is used to update the cluster center according to each average value; A judgment module, used to judge whether the cluster center after updating is exactly the same as the cluster center before updating; Return module, if the updated cluster center is not exactly the same as the cluster center before the update, it is used to take the updated cluster center as the current cluster center and return to the pixel grouping module; The vehicle paint color output module is used to use the N preset standard colors corresponding to the updated cluster center as the vehicle paint color if the updated cluster center is exactly the same as the cluster center before the update; The cluster center updating module specifically includes: The standardized color determination unit of each group is used to calculate the Euclidean distance between the average value of the i-th group and M preset standard colors, and take the preset standard color corresponding to the minimum Euclidean distance as the i-th standardized color; The first cluster center updating unit is used to use the obtained N standardized colors as updated cluster centers.

5. The vehicle camouflage paint film color selection system according to claim 4, characterized in that: N is 3 and M is 30.

6. A vehicle camouflage paint film color selection system, characterized in that: include: A background image acquisition module, used to acquire a background image; L * a * b * A color space conversion module is used to convert the background image into L * a * b * Color space, obtain the background color space map; M preset standard color initialization module is used to initialize M preset standard colors, each preset standard color is L * a * b * The three-dimensional vector corresponding to the chromaticity value; The cluster center initialization module is used to initialize the N cluster centers of the K-mean algorithm, and the N cluster centers are N preset standard colors of different colors; A pixel grouping module, used for grouping each pixel in the background color space map according to each current cluster center; The average value calculation module for each group is used to calculate the average value of all pixels in each group. L * a * b * The average value of a three-dimensional vector; A cluster center updating module is used to update the cluster center according to each average value; A judgment module, used to judge whether the cluster center after updating is exactly the same as the cluster center before updating; Return module, if the updated cluster center is not exactly the same as the cluster center before the update, it is used to take the updated cluster center as the current cluster center and return to the pixel grouping module; The vehicle paint color output module is used to use the N preset standard colors corresponding to the updated cluster center as the vehicle paint color if the updated cluster center is exactly the same as the cluster center before the update; The cluster center updating module specifically includes: A mapping error matrix set construction unit is used to construct a mapping error matrix set, wherein the mapping error matrix set includes the mapping error matrix sets obtained according to different row permutations and combinations. N ! A mapping error matrix; each mapping error matrix is ​​a matrix of N rows and M columns, each row element in each mapping error matrix is ​​the Euclidean distance between the average value of a group and M preset standard colors, and the column elements with the same number of columns in the mapping error matrix correspond to the same preset standard colors; a distance threshold determination unit, configured to take the maximum value of the elements in the mapping error matrix as the distance threshold; The standardized color determination unit for each row is used to determine the standardized color of each row in turn, starting from the first row, for each mapping error matrix: save the minimum value in the i-th row, use the preset standard color corresponding to the minimum value in the i-th row as the i-th standardized color, and set all elements in the column where the minimum value in the i-th row is located as the distance threshold; A square mean calculation unit is used to calculate the square mean of the N minimum values ​​determined from each mapping error matrix to obtain N ! Square mean; The second cluster center updating unit is used to use the N standardized colors corresponding to the minimum values ​​of the N square means as updated cluster centers.