A method for automatically generating digital camouflage CAD patterns for shelters and special vehicles

Through greedy algorithms and random selection mechanisms, digital camouflage patterns are automatically generated in the CAD models of square cabins and special vehicles, and the problems of low efficiency and color proportion deviation are solved, and efficient and accurate digital camouflage patterns are achieved and diversity improvement is achieved. .

CN114065322BActive Publication Date: 2024-12-03THE 28TH RES INST OF CHINA ELECTRONICS TECH GROUP CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111374383.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2024-12-03
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

The digital camouflage pattern design of traditional square cabins and special vehicles is inefficient, the color ratio is difficult to accurately meet the standard requirements, and it is difficult to achieve pattern diversity.

Method used

The greedy algorithm and random selection mechanism are used to extract contours according to the CAD models of the cabin and special vehicles, divide grids, combine patterns in the digital camouflage library, and automatically select and place colors to ensure the accuracy of color proportions and pattern diversity.

Benefits of technology

It improves the design efficiency and quality of digital camouflage products, reduces design deviations, increases the diversity and accuracy of patterns, and improves the overall efficiency of the spraying process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114065322B_ABST
    Figure CN114065322B_ABST
Patent Text Reader

Abstract

The present invention provides a method for automatically generating digital camouflage CAD patterns for shelters and special vehicles, comprising: digitally encoding the CAD pattern to be sprayed and the camouflage pattern in the digital camouflage library; then selecting the most suitable spray color in real time during the digital camouflage filling process according to the greedy selection algorithm of the filling color; finally, calculating the artificial intervention factor of each digital camouflage pattern in the camouflage library in real time, and then randomly selecting the camouflage pattern according to the artificial intervention factor, so as to realize the rapid random selection and filling of the digital camouflage pattern. Finally, the rapid automatic generation of digital camouflage patterns for shelters and special vehicles is realized, the digital camouflage design time is shortened, and the pattern design diversity and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of automatic generation of digital camouflage patterns, and in particular to a method for automatically generating digital camouflage CAD patterns for shelters and special vehicles. Background Art

[0002] Digital camouflage is a new type of camouflage pattern composed of "pixels". This new pattern uses the principles of visual psychology and can adapt to the concealment needs in a variety of environmental backgrounds, and has obvious advantages in concealment. As the demand for stealth in military shelters and special vehicle equipment continues to increase, the proportion of shelters and special vehicle products that require digital camouflage spraying continues to increase. The design of digital camouflage patterns for traditional shelters and special vehicles relies on manual grid division of the floor plans of the shelters and special vehicles in CAD software, and then manually calculating the color ratio after dragging the grid pattern in the template library to the CAD grid vertex. In the actual production process, the efficiency is low, and there is often a certain deviation between the color ratio and the actual standard requirements. At the same time, in order to improve design efficiency and ensure the color ratio, the same batch of products often only fine-tune the product pattern, which is difficult to meet the design requirements of digital camouflage product patterns with a certain diversity. Summary of the invention

[0003] Purpose of the invention: The technical problem to be solved by the present invention is to address the deficiencies of the prior art and to provide a method that can automatically generate digital camouflage spray patterns in the CAD models of shelters and special vehicles according to the color ratio required for spraying according to the patterns in the digital camouflage template library, so as to improve the design quality and design efficiency of digital camouflage products.

[0004] The present invention specifically provides a method for automatically generating digital camouflage CAD patterns for shelters and special vehicles, comprising the following steps:

[0005] Step 1: extract the outlines of the shelter and the special vehicle according to their CAD models, and encode the CAD models of the shelter and the special vehicle and the patterns in the digital camouflage library;

[0006] Step 2: Based on the spray color ratio requirement and the current pattern ratio of each color, a greedy algorithm is used to obtain the optimal color selection of the pattern to be sprayed;

[0007] Step 3, according to the current filling result, set the manual intervention factor of each pattern in the digital camouflage library, and randomly select a pattern from the pattern library according to the manual intervention factor;

[0008] Step 4: randomly select a placement position in the unfilled area of ​​the shelter and special vehicle CAD pattern, and perform interference check on the pattern placement until the shelter and special vehicle are completely filled with the digital camouflage pattern.

[0009] Step 1 includes: according to the digital camouflage spraying standard (the digital camouflage spraying standard is a national military standard, which mainly stipulates the requirements for digital camouflage spraying), the contour boundary of the shelter and special vehicle CAD pattern is extracted through CAD secondary development, and according to the minimum color block size requirement of digital camouflage, the shelter and special vehicle are divided into 10cm*10cm grids, and each 10cm*10cm grid is defined as the minimum cell; along the XY directions in the CAD pattern, X is the default X-axis direction of the shelter and special vehicle CAD pattern, the X-axis direction is usually the vehicle's travel direction, and Y is the default Y-axis direction of the shelter and special vehicle CA pattern, which is usually the vehicle's height direction, the grid is incrementally encoded, and each grid is replaced by a 3-variable array (int x, int y, bool n), where x represents the grid code in the X direction, y represents the grid code in the Y direction, and n is a bool variable, using 0 or 1 to correspond to the grid being able to fill or not being able to fill the area, and the 3-variable array corresponding to each grid (int x, int y, bool n) is replaced by a 3-variable array ... n) times for storage.

[0010] Step 1 includes: according to the digital camouflage spraying standard requirements, commonly used digital camouflage patterns are stored in a CAD format as a digital camouflage library, and the area of ​​each digital camouflage pattern in the digital camouflage library is calculated. The area calculation method of each digital camouflage pattern is the minimum number of cells contained in the camouflage pattern, and the smallest block of the digital camouflage pattern closest to the zero point in the X direction is used as the initial origin block. If there are more than two groups of color blocks close to the origin in the X direction, the smallest block closest to the Y direction is used as the initial origin block;

[0011] In the order of X direction first and then Y direction, the minimum unit grid of each camouflage pattern in the digital camouflage library is sequentially traversed, and the minimum unit grid is incrementally encoded to mark the starting coordinates of each minimum cell in the X and Y directions relative to the initial origin block, and the vector coordinate value of each minimum cell of each camouflage pattern is stored;

[0012] Each digital camouflage pattern is represented by a set of two-dimensional arrays, and the maximum capacity of each column of the two-dimensional array is the calculated contour area of ​​each digital camouflage color block.

[0013] In step 2, the greedy algorithm is used to obtain the optimal color selection of the pattern to be sprayed, including the following steps:

[0014] Step 2-1, according to the requirements of digital camouflage spraying, set the spraying ratios of the three spraying colors of the digital camouflage pattern to be sprayed as S1%, S2%, (1-S1-S2)% in sequence, and the total minimum number of cells in the CAD graphics of the camouflage pattern to be sprayed is N S ;

[0015] Step 2-2, cumulatively calculate the number of grids filled with three colors NS1 , N S2 , N S3 , calculate the ratio of the number of minimum cells filled with the current three colors to the total number of minimum cells, which is N S1 / N S , N S2 / N S , N S3 / N S ;

[0016] Step 2-3, before each determination of the color to be sprayed, first determine whether (N S1 / S+N S2 / S+N S3 / S)≤1-θ%, θ% is the spraying error ratio that digital camouflage can allow. If it is satisfied, jump to the next step in sequence, otherwise jump to step 2-6;

[0017] Step 2-4, get Max(S1-N S1 / N S , S2-N S2 / N S , S3-N S3 / N S ), that is, the difference between the current proportion of the three colors and the target proportion. The color corresponding to the maximum value is the fill color to be selected for the next color block. Max means taking the maximum value;

[0018] Step 2-5, record and feedback the color selection results;

[0019] Step 2-6, when (N S1 / S+N S2 / S+N S3 / S)≥1-θ%, then take Max(S1%, S2%, (1-S1-S2)%) to fill the smallest unfilled cells in all patterns with the color with the largest proportion.

[0020] Step 3 includes:

[0021] Step 3-1, based on the color selection result in step 2-6, calculate the minimum number of cells in the CAD pattern of the shelter and the special vehicle that have been filled with the same color as the selected color, and record the manual intervention factor Δ = (S1-N S1 / N S ) / S1;

[0022] Step 3-2, set the random selection factor θ = 2*Δ-1;

[0023] Step 3-3, set the probability of selection of each pattern in the digital camouflage library to Among them A Xis the total area of ​​the color blocks in the current camouflage library, n is the total number of patterns in the digital camouflage library, It is the sum of the areas of all the smallest cells in the camouflage library.

[0024] Step 3 also includes: according to the calculation result of the selection probability of each pattern in the camouflage library, the probability value is retained to 3 decimal places, all natural numbers in (0-1000] are set as the random number value interval, the value interval size of each color block is set to 1000*Px in turn, and the value interval of each color block is set from 0 to 1000 in turn. When selecting a pattern in the camouflage library, a random number of (0-1000] is randomly generated, and according to the corresponding value space of the random number, the color block corresponding to the value space is selected as the selected camouflage pattern.

[0025] Step 4 includes: after selecting the camouflage pattern and pattern color to be placed, according to the number N of the smallest cells in the unfilled area of ​​the current pattern, set [1-N] groups of random numbers, and according to the generated random numbers, determine the smallest cell of the pattern to be placed in the order of increasing coordinates of each smallest unfilled cell in the pattern from small to large, and record it as A.

[0026] Step 4 also includes: sequentially traversing the vector coordinates (B) of each minimum cell B of the pattern to be placed in the digital camouflage library In ,B 2n ), add the coordinates of the smallest cell A (A1, A2) to the vector coordinates of each smallest cell in B to obtain the new coordinates (A1+B In ,A2+B 2n ), and determine whether the minimum cell in the cabin and special vehicle CAD pattern corresponding to the new coordinates can be filled. If all can be filled, the color blocks obtained by superimposing the vector coordinates of each minimum cell in A and A and B are marked as unfillable areas, and the area is filled according to the color selection result of step 3; if it cannot be filled, the color block placement process is canceled, and the minimum cell to be placed is reselected. If the cumulative number of placement failures exceeds c times, it means that there is no suitable placement area for the color block, and the pattern is temporarily deleted from the pattern library, and step 4 is re-executed until feedback is that the pattern is successfully placed.

[0027] Beneficial effects: The present invention can effectively realize the rapid production of digital camouflage patterns for shelters and special vehicles, and reduce the design time and production preparation time of digital camouflage. At the same time, through the automatic pattern generation algorithm, the accuracy of the color production ratio of the pattern can be effectively guaranteed, and the design deviation can be reduced. The randomness of the algorithm can effectively ensure that the repetition rate of the digital camouflage pattern is greatly reduced. While improving the overall spraying efficiency of the digital camouflage for shelters and special vehicles, the accuracy and diversity of the pattern are increased, and the overall improvement of the spraying process of the shelters and digital camouflage is systematically brought about. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more clear.

[0029] Figure 1 This is an example of the minimum cell division after the CAD outline of the shelter and special vehicle is automatically extracted;

[0030] Figure 2 This is a schematic diagram of the cabin and special vehicle CAD cells divided and enlarged step by step;

[0031] Figure 3 It is a camouflage pattern in the commonly used digital camouflage library;

[0032] Figure 4 This is an enlarged schematic diagram of the camouflage pattern after the cells are divided;

[0033] Figure 5 The vector encoding coordinates of a pattern in the camouflage pattern library;

[0034] Figure 6 This is a CAD pattern of a special cabin vehicle that is being filled with digital camouflage.

[0035] Figure 7 It is a diagram of the architecture of the method of the present invention. DETAILED DESCRIPTION

[0036] like Figure 7 As shown, the present invention specifically provides a method for automatically generating digital camouflage CAD patterns for shelters and special vehicles, comprising the following steps:

[0037] In the automatic digital camouflage spraying of shelters and special vehicles, firstly, according to the digital camouflage spraying standard, the outline boundary of the shelter and special vehicle CAD drawing is extracted through CAD secondary development. According to the minimum color block size requirement of digital camouflage, the shelter and special vehicle are divided into 10cm*10cm minimum cells, and each 10cm*10cm minimum cell is defined as the minimum cell. And in this way, the minimum cell is incrementally encoded along the XY direction. In the algorithm, a 3-variable array is used to replace each minimum cell, (int x, int y, bool n). Among them, x represents the coding of the grid in the X direction, y represents the coding of the minimum cell in the Y direction, and n is a bool variable, using 0 or 1 to correspond to the minimum cell as a fillable or unfillable area. Finally, the information of all cells is stored in a two-dimensional array.

[0038] Then number the camouflage patterns in the digital camouflage library as follows: Figure 2As shown in the figure. At the same time, the area of ​​each camouflage pattern is calculated. The area of ​​each camouflage pattern is calculated by calculating the minimum number of cells contained in the camouflage pattern. Figure 3 As shown, the camouflage pattern numbered 1 corresponds to an area of ​​44, and the camouflage pattern numbered 3 corresponds to an area of ​​6.

[0039] In the present invention, a two-dimensional array is used to represent each digital camouflage color block, and the maximum capacity of each column of the array is the calculated contour area of ​​each color block. The specific representation method is:

[0040] STEP 1: Take the smallest block of the digital camouflage pattern closest to the zero point in the X direction as the initial origin block. If there are multiple groups of color blocks close to the origin in the X direction, take the smallest block closest to the Y direction as the initial origin block.

[0041] STEP 2: Traverse each minimum cell in the order of X direction first and then Y direction, and mark the starting coordinates of each minimum cell in the X and Y directions relative to the initial origin block in an incremental coding manner.

[0042] STEP 3 uses an array to store the vector coordinates of each minimum cell.

[0043] Furthermore, the color selection greedy algorithm of the present invention mainly comprises the following steps:

[0044] STEP1 First, according to the requirements of digital camouflage spraying, set the proportions of the three colors of digital camouflage to S1%, S2%, (1-S1-S2)%, and the total number of CAD graphics grids of the camouflage pattern to be sprayed is N. S .

[0045] STEP2 Accumulate and calculate the number of grids filled with each color N S1 , N S2 , N S3 , based on the last selection result, calculate the proportion of the three colors filled grids to the total number of grids is N S1 / N S , N S2 / N S , N S3 / N S .

[0046] STEP3 Before filling the grid each time, first determine (N S1 / S+N S2 / S+N S3 / S)≤1-θ%(θ%digital camouflage spraying error ratio allowed). If yes, jump to the next step, otherwise jump to STEP 6.

[0047] STEP4 Get Max(S1-N S1 / NS , S2-N S2 / N S , S3-N S3 / N S ), that is, the three color blocks can select the difference between the current color proportion and the target proportion, and the color corresponding to the maximum value is taken as the fill color to be selected for the next color block. If the difference between the current proportion and the target proportion of the two colors is the same, the sequence jumps to step 5.

[0048] STEP5: Record the color selection results, feedback the results, and jump to the pattern random selection process

[0049] STEP6 When (N S1 / S+N S2 / S+N S3 / S)≥1-θ%, then take the color corresponding to MAX(S1%, S2%, (1-S1-S2)%) as the selected color (that is, fill the color of the graphic gaps with the maximum color ratio to reduce the number of executions of the pattern selection algorithm), fill all unfilled cells in the pattern with the maximum color ratio, and the entire algorithm process ends.

[0050] Furthermore, after determining the color selection result, it is necessary to select color blocks from the digital camouflage library to fill in the fillable area. Due to the requirements for diversity in the digital camouflage spraying of military shelters and special vehicles, a certain degree of randomness is required when selecting patterns from the pattern library and placing patterns on the shelter and special vehicle CAD drawings. However, for a simple random pattern selection algorithm, as the number of unfillable areas increases, the number of pattern placement failures will continue to increase when the pattern is placed after detection by the interference check algorithm. And as the number of unfillable areas increases, the larger the selected pattern, the greater the probability of placement failure, and the slower the entire algorithm runs. Therefore, when selecting a pattern for filling, the random algorithm needs to have a certain intervention mechanism to accelerate convergence as much as possible while retaining a certain degree of randomness in the pattern selection. The details are as follows:

[0051] STEP 1: Calculate the proportion N of the current color in the pattern based on the color selection result in claim 6. S1 / N S The ratio of the difference between the target ratio S1 and the target ratio S1, that is, Δ = (S1-N S1 / N S ) / S1. The higher the Δ value, the more areas that can be filled in the pattern. To speed up the filling speed, choosing a larger color block is more conducive to convergence. The smaller the Δ value, the more areas that cannot be filled in the pattern. In this case, a smaller pattern should be chosen as much as possible.

[0052] STEP2 is to speed up the program running speed and improve the convergence of the algorithm. θ=2*Δ-1 is used as the random selection factor. That is, when the fillable area is larger than the unfillable area, the θ value is greater than 0; when the fillable area is smaller than the unfillable area, the θ value is less than 0.

[0053] STEP3: In the random algorithm selection, set the probability of each color block being selected to Among them A X The sum of the selected patterns of each color block is 1. When the fillable area is larger than the unfillable area, the larger the pattern, the greater the probability of being selected, and the probability value decreases as the fillable area decreases. When the fillable area is smaller than the unfillable area, the smaller the pattern, the greater the probability of being selected, and the probability value increases as the fillable area decreases.

[0054] Furthermore, according to the calculation result of the probability of each color block in step 6, three decimal places are retained, and the random number value interval is set to (0-1000], and the value interval size of each color block is set to 1000*Px in turn, and the value interval of each color block is set from 1 to 1000 in turn, and a random number is generated from (0-1000] in the algorithm, and the color block corresponding to the value space is selected according to the corresponding value space of the random number, and placed on the CAD pattern of the shelter and the special vehicle.

[0055] The random placement algorithm of the digital camouflage pattern of the present invention mainly comprises the following steps: after selecting the color block to be placed, according to the number N of the minimum cells in the unfilled area of ​​the current pattern, a group of random numbers (0-N) is set, and according to the generated random numbers, the coordinates of each minimum cell in the pattern are increased from small to large, and the minimum cell of the pattern to be placed is determined, which is recorded as A. Then, the vector coordinates (B) of each minimum cell of the color block B to be placed are traversed in sequence. In ,B 2n ), add the coordinates of A (A1, A2) to the vector coordinates of each minimum cell in B, and determine the new coordinates (A1+B In ,A2+B 2n ). And according to the calculated new coordinates, it is judged whether the minimum cell corresponding to the coordinates in the digital camouflage pattern can be filled. If all of them can be filled, the color blocks obtained by superimposing the vector coordinates of each minimum cell in A and A and B are marked as unfillable areas, and the areas are filled according to the color selection result in claim 5; if they cannot be filled, the color block placement process is canceled, and the digital camouflage pattern placement algorithm is re-executed to reselect the minimum cell to be placed. If the cumulative number of placement failures exceeds 3 times, it means that the color block may not have a suitable placement area, and the selection result is fed back to the algorithm, the pattern is temporarily deleted from the pattern library, and the pattern random selection algorithm in the pattern library is re-executed until the feedback pattern placement is successful.

[0056] Example:

[0057] like Figure 1 In an automatic generation algorithm of digital camouflage CAD patterns for shelters and special vehicles, the CAD model of the shelter or special vehicle to be sprayed is first obtained, and the contour boundary of the shelter and special vehicle CAD drawing is first extracted through CAD secondary development, and the extreme values ​​(Xmax, Xmin), (Ymax, Ymin) of the model in the XY direction are obtained; a rectangular area of ​​[Xmax-Xmin, Ymax-Ymin] size is generated on the shelter and special vehicle CAD pattern, and a grid pattern is generated in the XY direction at an interval of 10 cm as shown in FIG. Figure 2 As shown, a total of [Xmax-Xmin] / 10* [Ymax-Ymin]*10 cells are generated, and then each minimum cell is traversed in the XY direction in turn. The three attributes of each color block (int x, int y, bool n) are stored in the algorithm in turn. That is: the coordinate value of the X and Y directions, whether it can be filled. Among them, the attribute of whether it can be filled, if the grid is within the CAD outline in the initial state, it can be filled, and if the grid is completely outside the CAD outline, it is set to 0, which means it cannot be filled.

[0058] Furthermore, by counting the minimum number of cells whose fillable attribute is 1, the total area N storing the pattern to be filled can be obtained. S

[0059] Furthermore, each pattern in the digital camouflage library, such as Figure 3 As shown, each pattern is encoded in order from large to small, and in the algorithm, the area of ​​each pattern is stored according to the encoding of each pattern, and in subsequent accesses of the algorithm, the area of ​​the pattern corresponding to the encoding can be quickly decelerated according to the encoding of each pattern.

[0060] Furthermore, each pattern is traversed according to the pattern code to obtain the maximum and minimum values ​​of the pattern outline in the XY direction, and each pattern is divided into grids every 10 cm along the XY direction. Figure 4 As shown, all color block patterns are divided into a grid consisting of N minimum cells.

[0061] Furthermore, coordinates are assigned to each grid in the order of X first and Y second, and vector encoding is performed. The two-dimensional array style is as follows: Figure 5 As shown, the shape is [(0,0), (1,-1), (1,0), (1,1)(2,-1), (2,0)], and the vector coordinates of each color block are stored in the form of an array in the algorithm.

[0062] Furthermore, the required pattern color ratio and the allowable ratio error of spraying are obtained according to the type of digital camouflage pattern of the shelter and special vehicle to be sprayed, as shown in Table 1, which are the common requirements for the color ratio of digital camouflage spraying of shelters and special vehicles. In the present invention, the three spraying color ratios are stored as S1%, S2%, and (1-S1-S2)% respectively.

[0063] Table 1

[0064]

[0065] Further, according to the color block selection algorithm in claim 5, the area N of the area currently filled with three colors is obtained. S1 , N S2 , N S3 If (N S1 / S+N S2 / S+N S3 / S)≤1-θ%, compare and calculate Max(S1-N S1 / N S , S2-N S2 / N S , S3-N S3 / N S ), obtain the color with the largest difference between the target filling ratio and the filled ratio in the shelter and special vehicle patterns, and regard this color as the color that needs to be filled most urgently.

[0066] Furthermore, the color is stored in the algorithm, and according to the algorithm for selecting the pattern to be filled in claim 6, the current filling progress of the color is calculated Δ=(S1%-N Si / N S ) / S1%, where S1% is the target fill ratio of the current color, N Si is the total area filled with the current color, N S is the total area of ​​the pattern to be filled.

[0067] Further, the random selection ratio factor θ=2*Δ-1 of the pattern in the current digital camouflage library is calculated, and each pattern in the digital camouflage library is traversed in sequence according to the number, and the random selection probability of selecting each pattern is calculated. Where Px is the random selection probability of the Xth pattern in the digital camouflage library, A X is the area of ​​the Xth pattern, n is the total number of patterns in the digital camouflage library, is the sum of the theta powers of each pattern.

[0068] Furthermore, the selection probability Px of all color blocks is retained to 3 decimal places, and a group of random numbers [0, 1000] is set, and the order is The random number of the area is assigned to the i-th color block.

[0069] Further, a random number [0, 1000] is randomly generated, and the corresponding pattern in the area where the random number is located is the pattern selected in the digital camouflage pattern library. In the algorithm, all vector coordinates of the selected pattern can be obtained according to the pattern number and stored in the algorithm.

[0070] Further, get the number N of all currently unfilled minimum cells X , set (0, N X ] group of random numbers, after a random number is randomly generated, traverse each minimum cell in the order of X first and Y second, with coordinate values ​​from large to small, until the ρth minimum cell is found, and select the color block as the target to place the color block

[0071] Further, get the number N of all currently unfilled minimum cells X , set (0, N X ] group of random numbers. After a random number is randomly generated, each minimum cell is traversed in the order of X first and Y second, with coordinate values ​​from large to small, until the ρth minimum cell is found, and the color block is selected as the target to place the color block.

[0072] Furthermore, the corresponding vector coordinates in the selected digital camouflage pattern are traversed in turn, and the coordinates of the selected minimum cell are accumulated and calculated with each vector coordinate. It is determined whether the minimum cell corresponding to each coordinate is a fillable area. If an unfillable minimum cell is encountered, the placement algorithm is terminated, and the minimum cell to be placed is randomly generated again, and a judgment is made. If the number of failed placements exceeds 3 times, the pattern is temporarily deleted from the digital camouflage pattern library, and the pattern random selection and pattern random placement processes are recalculated. Until the pattern is placed successfully. And the filled ratio of the color blocks corresponding to the current colors is re-updated, and the fillable attribute of the minimum cell in the filled area is set to 0.

[0073] Further, the above process is repeated until (N S1 / S+N S2 / S+N S3 / S)>1-θ%, fill all other unfilled minimum cells with the color that has the largest proportion of the camouflage pattern color, and keep the pattern, such as Figure 6 Shown are the camouflage patterns of the shelters and special vehicles that are being filled with digital camouflage patterns.

[0074] The present invention provides a method for automatically generating digital camouflage CAD patterns for shelters and special vehicles. There are many methods and ways to implement the technical solution. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the protection scope of the present invention. All components not specified in this embodiment can be implemented by existing technologies.

Claims

1. A method for automatically generating digital camouflage CAD patterns for shelters and special vehicles. It is characterized in that The steps include: Step 1: extract the contours of the shelter and the special vehicle according to the CAD models, and encode the CAD models of the shelter and the special vehicle and the patterns in the digital camouflage library; Step 2: Based on the spray color ratio requirement and the current pattern ratio of each color, a greedy algorithm is used to obtain the optimal color selection of the pattern to be sprayed; Step 3, according to the current filling result, set the manual intervention factor of each pattern in the digital camouflage library, and randomly select a pattern from the pattern library according to the manual intervention factor; Step 4: randomly select a placement position in the unfilled area of ​​the shelter and special vehicle CAD pattern, and perform interference check on the pattern placement until the shelter and special vehicle are completely filled with the digital camouflage pattern.

2. The method according to claim 1, It is characterized in that Step 1 includes: according to the digital camouflage spraying standard, extracting the outline boundary of the CAD pattern of the shelter and the special vehicle through the secondary development of CAD, dividing the shelter and the special vehicle into 10cm*10cm grids according to the minimum color block size requirement of the digital camouflage, and defining each 10cm*10cm grid as the minimum cell; along the XY directions in the CAD pattern, X is the default X-axis direction of the CAD pattern of the shelter and the special vehicle, the X-axis direction is usually the vehicle's traveling direction, and Y is the default Y-axis direction of the CA pattern of the shelter and the special vehicle, which is usually the vehicle's height direction, and the grids are incrementally encoded, and each grid is replaced by a 3-variable array (int x, int y, bool n), wherein x represents the grid code in the X direction, y represents the grid code in the Y direction, and n is a bool type variable, using 0 or 1 to correspond to the grid being able to fill or not being able to fill the area, and the 3-variable array (int x, int y, bool n) corresponding to each grid is stored.

3. The method according to claim 2, It is characterized in that Step 1 includes: according to the digital camouflage spraying standard requirements, the digital camouflage pattern is stored in a CAD manner as a digital camouflage library, and the area of ​​each digital camouflage pattern in the digital camouflage library is calculated. The area calculation method of each digital camouflage pattern is the minimum number of cells contained in the camouflage pattern, and the smallest block of the digital camouflage pattern closest to the zero point in the X direction is used as the initial origin block. If there are more than two groups of color blocks close to the origin in the X direction, the smallest block closest to the Y direction is used as the initial origin block; In the order of X direction first and then Y direction, the minimum unit grid of each camouflage pattern in the digital camouflage library is sequentially traversed, the minimum unit grid is incrementally encoded, the starting coordinates of the minimum cell in the X and Y directions relative to the initial origin block are marked, and the vector coordinate value of each minimum cell of each camouflage pattern is stored; Each digital camouflage pattern is represented by a set of two-dimensional arrays, and the maximum capacity of each column of the two-dimensional array is the calculated contour area of ​​each digital camouflage color block.

4. The method according to claim 3, It is characterized in that In step 2, the greedy algorithm is used to obtain the optimal color selection of the pattern to be sprayed, including the following steps: Step 2-1, according to the requirements of digital camouflage spraying, set the spraying ratios of the three spraying colors of the digital camouflage pattern to be sprayed as S1%, S2%, (1-S1-S2)% in sequence, and the total minimum number of cells in the CAD graphics of the camouflage pattern to be sprayed is N S ; Step 2-2, cumulatively calculate the number of grids filled with three colors N S1 , N S2 , N S3 , calculate the ratio of the number of minimum cells filled with the current three colors to the total number of minimum cells, which is N S1 / N S , N S2 / N S , N S3 / N S ; Step 2-3, before each determination of the color to be sprayed, first determine whether (N S1 / S+N S2 / S+N S3 / S)≤1-θ%, θ% is the spraying error ratio that digital camouflage can allow. If it is satisfied, jump to the next step in sequence, otherwise jump to step 2-6; Step 2-4, get Max(S1-N S1 / N S , S2-N S2 / N S , S3-N S3 / N S ), that is, the difference between the current proportion of the three colors and the target proportion. The color corresponding to the maximum value is the fill color to be selected for the next color block. Max means taking the maximum value; Step 2-5, record and feedback the color selection results; Step 2-6, when (N S1 / S+N S2 / S+N S3 / S)≥1-θ%, then Max(S1%, S2%, (1-S1-S2)%) is taken to fill the smallest unfilled cells in all patterns with the color with the largest proportion.

5. The method according to claim 4, It is characterized in that Step 3 includes: Step 3-1, based on the color selection result in step 2-6, calculate the minimum number of cells in the CAD pattern of the shelter and the special vehicle that have been filled with the same color as the selected color, and record the manual intervention factor Δ = (S 1 -N S1 / N S ) / S 1 ; Step 3-2, set the random selection factor θ = 2*Δ-1; Step 3-3, set the probability of selection of each pattern in the digital camouflage library to Among them A X is the total area of ​​the color blocks in the current camouflage library, n is the total number of patterns in the digital camouflage library, It is the sum of the areas of all the smallest cells in the camouflage library.

6. The method according to claim 5, It is characterized in that Step 3 also includes: according to the calculation result of the selection probability of each pattern in the camouflage library, the probability value is retained to 3 decimal places, all natural numbers in (0-1000] are set as the random number value interval, the value interval size of each color block is set to 1000*Px in turn, and the value interval of each color block is set from 0 to 1000 in turn. When selecting a pattern in the camouflage library, a random number of (0-1000] is randomly generated, and according to the corresponding value space of the random number, the color block corresponding to the value space is selected as the selected camouflage pattern.

7. The method according to claim 6, It is characterized in that Step 4 includes: after selecting the camouflage pattern and pattern color to be placed, according to the number N of the smallest cells in the unfilled area of ​​the current pattern, set [1-N] groups of random numbers, and according to the generated random numbers, determine the smallest cell of the pattern to be placed in the order of increasing coordinates of each smallest unfilled cell in the pattern from small to large, and record it as A.

8. The method according to claim 7, It is characterized in that Step 4 also includes: sequentially traversing the vector coordinates (B) of each minimum cell B of the pattern to be placed in the digital camouflage library In ,B 2n ), the coordinates of the smallest cell A (A 1 ,A 2 ) is added to the vector coordinates of each minimum cell in B to obtain the new coordinates (A 1 +B In ,A 2 +B 2n ), and determine whether the minimum cell in the cabin and special vehicle CAD pattern corresponding to the new coordinates can be filled. If all can be filled, the color blocks obtained by superimposing the vector coordinates of each minimum cell in A and A and B are marked as unfillable areas, and the area is filled according to the color selection result of step 3; if it cannot be filled, the color block placement process is canceled, and the minimum cell to be placed is reselected. If the cumulative number of placement failures exceeds c times, it means that there is no suitable placement area for the color block, and the pattern is temporarily deleted from the pattern library, and step 4 is re-executed until feedback is that the pattern is successfully placed.