A method for generating a chess board
By segmenting and hexagonal gridding of remote sensing images using the trained remote sensing image segmentation model, and matching and filling with the hexagonal grid network, the existing war chess board generation problems are solved, and efficient and automated chess board generation is achieved.
Patent Information
- Application Number
- CN202111531773.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-12-14
AI Technical Summary
The existing method of generating war chess boards is inefficient and costly, and relies on manual production.
The trained remote sensing image segmentation model is used to segment and hexagonal grids, and match and fill the hexagonal grid network to generate a war chess board.
It improves the efficiency of chess board generation, reduces costs, and realizes an automated chess board generation process.
Smart Images

Figure CN114332110B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for generating a war game board, and belongs to the technical field of computer-aided war game deduction. Background Art
[0002] War games include hexagonal maps, chess pieces and a complete set of rules. War game simulation is known as the "magician" directing war. The players can make full use of scientific methods such as statistics, probability theory, game theory, etc. to simulate, simulate and simulate the entire process of war. It is an important means for military training, command and combat evaluation.
[0003] With the continuous progress of computer science, computer-based war game simulation systems have become the main platform for studying modern warfare. Computer war games have many advantages, such as simple operation and replayability. However, the generation of computer war game boards is often done manually at this stage, which is inefficient and costly. Summary of the invention
[0004] The purpose of this application is to provide a method for generating a war chess board to solve the problems of low efficiency and high cost of existing methods.
[0005] To achieve the above purpose, the present application proposes a technical solution for a method for generating a war chess board, comprising the following steps:
[0006] 1) Obtain the remote sensing image of the chessboard to be generated;
[0007] 2) inputting the remote sensing image of the chessboard to be generated into the trained remote sensing image segmentation model to obtain the segmented remote sensing image; when performing the convolution operation, the remote sensing image segmentation model sets a sliding window based on the hexagonal grid area according to the size of the convolution kernel, and the sliding window slides according to the set step size and the set direction;
[0008] 3) Draw a hexagonal grid network of the chessboard according to the remote sensing image of the chessboard to be generated;
[0009] 4) matching the remote sensing image segmented in step 2) with the hexagonal grid network of the war chess board drawn in step 3); the matching process is the matching process of the remote sensing image identification and the war chess elements;
[0010] 5) Fill each hexagonal grid in the hexagonal grid network with war chess elements according to the matching results, thereby generating a war chess board; the war chess elements include linear elements and surface elements.
[0011] The technical solution of the method for generating a war chess board of the present invention has the beneficial effect that: the present invention uses a trained remote sensing image segmentation model to segment the remote sensing image, and when a convolution operation is performed during the segmentation process, the convolved area is a hexagonal grid area in the remote sensing image, and finally the segmented remote sensing image is hexagonally gridded by matching with a hexagonal grid grid network, and then the hexagonally gridded remote sensing image is filled with war chess elements to generate a war chess board. The present invention directly generates a war chess board through a remote sensing image, thereby improving the efficiency of generating a war chess board.
[0012] Furthermore, when the remote sensing image segmentation model performs a convolution operation, the pixel value of the hexagonal grid area is determined by the pixel value of each pixel point contained in the hexagonal grid area.
[0013] Furthermore, the remote sensing image segmentation model also includes a step of expanding the incomplete hexagonal grid area into a complete hexagonal grid area when performing the convolution operation.
[0014] Furthermore, the process of drawing the hexagonal grid network of the chess board includes:
[0015] Determine the size of the hexagonal grid based on the tactical or training level of the game;
[0016] Determine the length and width of the hexagonal grid network according to the ground resolution of the remote sensing image to be generated for the war chess board;
[0017] Determining the number of hexagonal cells based on the size of the hexagonal cells and the length and width of the hexagonal grid network;
[0018] Draw a hexagonal grid network based on the number and size of hexagonal cells.
[0019] Furthermore, the number of hexagonal grids is:
[0020] M=(int(L / C)+1)*(int(W / C)+1);
[0021] Among them, M is the number of hexagonal grids; L is the length of the hexagonal grid network; W is the width of the hexagonal grid network; C is the size of the hexagonal grid.
[0022] Furthermore, in the step 5), when filling the surface elements, if the area corresponding to a certain hexagonal grid is an undivided area or the area corresponding to a certain hexagonal grid contains multiple surface elements, the average pixel value of all pixels in the hexagonal grid is calculated, the average pixel value and the pixel value of the chess element are compared, and the chess element corresponding to the pixel value of the chess element closest to the average pixel value is taken as the chess element to be filled in the hexagonal grid.
[0023] Furthermore, in step 5), when filling the river element, it is determined whether the river element is a linear element. If it is a linear element, the hexagonal grid edge closest to the river is found, and the river is continuously quantized to the hexagonal grid boundary, and the flow trend of the river remains unchanged.
[0024] Furthermore, in the step 5), when filling the road elements, the road elements are matched to the centers of the hexagonal grids, and the lines connecting the centers of all the hexagonal grids are the quantized roads.
[0025] Furthermore, the remote sensing image segmentation model is a U-Net neural network model. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a flow chart of the method for generating a chessboard of a war game of the present invention;
[0027] Figure 2 Schematic diagram of the convolution operation based on the hexagonal grid of the present invention;
[0028] Figure 3 It is a schematic diagram of the hexagonal grid expansion of the present invention;
[0029] Figure 4 It is a schematic diagram of segmentation of remote sensing images of the present invention;
[0030] Figure 5 It is a schematic diagram of filling surface elements of a war chess map according to the present invention. DETAILED DESCRIPTION
[0031] Example of a method for generating a chess board:
[0032] The main idea of the present invention is that, in order to improve the efficiency of generating a war chess board, the present invention first segments the remote sensing image based on a remote sensing image segmentation model of hexagonal grid area convolution, then matches the segmented remote sensing image with the hexagonal grid network of the war chess board, fills in elements on the hexagonal grid network of the war chess board, and completes the production of the war chess board.
[0033] Specifically, the chessboard generation method is as follows: Figure 1 As shown, the following steps are included:
[0034] 1) Train the remote sensing image segmentation model based on hexagonal grid region convolution to obtain a trained remote sensing image segmentation model.
[0035] In this embodiment, the data set used to train the remote sensing image segmentation model is the BDCI remote sensing image data set. The data set needs to be preprocessed before training. The purpose of the preprocessing is to enable it to be correctly input into the remote sensing image segmentation model.
[0036] The preprocessing of the dataset includes dataset clipping and dataset enhancement. The dataset clipping is to clip the remote sensing images and labels according to a regular grid to avoid memory overflow caused by the remote sensing images being too large. Then the clipped dataset is enhanced, including physical operations such as rotation and mirroring of the clipped dataset to change the geometry. The purpose is to obtain sufficient sample data and avoid overfitting during model training.
[0037] The remote sensing image segmentation model uses the U-Net neural network model. When the chessboard is generated, it does not focus on the results of each pixel segmentation, but only on the segmentation results behind each hexagonal grid area. Therefore, when using the U-Net network to train the remote sensing image segmentation model, in order to speed up the training speed and improve the network's expression ability, its convolution operation is defined as convolution based on the hexagonal grid area, that is, the remote sensing image segmentation model is in the convolution process, such as Figure 2 As shown, the convolution area is a hexagonal grid area.
[0038] During the convolution operation, a sliding window is set based on the size of the convolution kernel and the hexagonal grid area is used as the basic unit. The sliding window slides according to the set step size and the set direction. Each time it slides, a convolution operation is performed, and the average value of the pixels in the hexagonal grid area is used as the pixel value of the hexagonal grid area.
[0039] For example, according to the size of the 3*3 convolution kernel, the sliding window is set based on the hexagonal grid area as the basic unit, and the size of the convolution hexagonal grid area is set to be LL = 8 pixels in length and width, such as Figure 2 As shown in the figure, the average value of the pixels contained in each black hexagonal grid area is used as the pixel value of the hexagonal grid to participate in the traditional convolution operation. Figure 2 The hexagonal grid area in the white dotted frame in the figure shows that the convolution operation has moved to the right by a set step size, and the set step size is LL / 2. The sliding window moves to the right by a set step size to perform a convolution operation. When the sliding window moves to the white area, the average value of the pixels contained in the hexagonal grid area in the white dotted frame of each hexagonal grid is used as the pixel value of the hexagonal grid area, participating in the traditional convolution operation. The edge processing method of the image is shown in 3.
[0040] like Figure 3 As shown, for the incomplete hexagonal grid area at the edge of the image, it is directly expanded into a complete hexagonal grid area for convolution; wherein the hexagonal grid area convolution is essentially to expand it into a hexagonal grid area in units of pixels for convolution. Of course, it is also possible to determine whether the incomplete hexagonal grid area is discarded or expanded according to the size of the incomplete hexagonal grid area, and the present invention does not limit this.
[0041] Of course, as other implementations, the pixel values of the hexagonal grid area can also be weighted based on a Gaussian function as the pixel values of the hexagonal grid area to perform convolution on the hexagonal grid area. The specific method of the convolution kernel is adjusted according to the network structure, and the present invention does not limit this.
[0042] 2) Obtain the remote sensing image of the chessboard to be generated, and input the remote sensing image of the chessboard to be generated into the trained remote sensing image segmentation model to obtain the following Figure 4 The segmented remote sensing image shown.
[0043] 3) Draw the hexagonal grid network of the chess board.
[0044] The specific process of drawing the hexagonal grid network of the chess board is:
[0045] a. Determine the granularity of the hexagonal grid according to the tactical level or training level of the war game. The granularity is also the size C (unit: m). Generally, C = 20 m is taken for the daily training level. The size of the hexagonal grid in the war game board is much larger than the hexagonal grid area in the convolution process of the remote sensing image segmentation model. The hexagonal grid area in the convolution process is a pixel-level area, while the size of the hexagonal grid in the war game board is meter-level.
[0046] b. Determine the length L (unit: m) and width W (unit: m) of the hexagonal grid network according to the ground resolution R (actual distance: m / pixel) of the remote sensing image of the chessboard to be generated;
[0047] c. Determine the number of hexagonal grids M based on the size C of the hexagonal grid, and the length L and width W of the hexagonal grid network:
[0048] M=(int(L / C)+1)*(int(W / C)+1);
[0049] Among them, int is the rounding function;
[0050] d. Draw the hexagonal grid network of the chess board according to the number M and size C of hexagonal grids.
[0051] 4) Matching the segmented remote sensing image obtained in step 2) and the hexagonal grid network of the chessboard drawn in step 3), and filling the hexagonal grids in the hexagonal grid network of the chessboard with elements.
[0052] The matching process of the segmented remote sensing image and the hexagonal grid network of the chessboard is shown in Table 1:
[0053] Table 1. Correspondence between dataset identifiers and chess board elements
[0054]
[0055] From Table 1, we can see that the buildings in the segmented remote sensing images are the residential areas on the chessboard, and the cultivated land and forest land in the segmented remote sensing images are the vegetation on the chessboard.
[0056] According to the matching results, each hexagonal grid in the hexagonal grid network is filled with war chess elements. The specific process is: start traversing from the upper left corner of the remote sensing image, traverse row by row, traverse each hexagonal grid, and then determine the element content to be filled in each hexagonal grid through the rules.
[0057] In the specific filling process, the surface elements and line elements are filled according to the following rules:
[0058] 1. When filling in surface elements, if the area corresponding to a hexagonal grid contains multiple surface elements, the number of pixel values of each element in the hexagonal grid area is calculated, and the element type with the most pixel values is taken as the element to be filled in the game. For example: when the area corresponding to a hexagonal grid contains three surface elements: settlement, vegetation and water, the surface element with the most pixels is calculated to be settlement, so the hexagonal grid unit is filled with settlement. Figure 5 Shown is a schematic diagram of the surface feature filling of the war game map.
[0059] 2. When filling river features, determine whether the width of the river is less than 2m based on the segmented image information and the ground resolution R. If the width is greater than or equal to 2m, the river feature is determined to be a planar feature and filled in the same way as planar features. If the width is less than 2m, the river feature is determined to be a linear feature. The quantitative filling principles for linear features are as follows:
[0060] a. Find the hexagonal grid edge closest to the river and quantify the linear river to the hexagonal grid boundary;
[0061] b. Quantified linear rivers can retain the original flow trend as much as possible and can be connected sequentially, that is, the river is a continuous river and the flow trend remains unchanged.
[0062] 3. When filling road features, the quantified road must pass through the center of the hexagonal grid. Therefore, according to the results of remote sensing image segmentation, the road features are matched to the center of the hexagonal grid, and the connecting lines in all hexagonal grids are the quantified roads.
[0063] 5) Generate a wargame map (wargame map is also known as a wargame board) based on the filled hexagonal grid network, and export it into a usable wargame map file (shapefile file).
[0064] The present invention can construct a war chess board based on remote sensing image segmentation, and can construct a war chess board more efficiently than the traditional method.
Claims
1. A method for generating a war chess board, characterized in that: The following steps are involved: 1) Obtain remote sensing images of the chessboard to be generated; 2) Inputting the remote sensing image of the chessboard to be generated into the trained remote sensing image segmentation model to obtain the segmented remote sensing image; when performing the convolution operation, the remote sensing image segmentation model sets a sliding window based on the hexagonal grid area according to the size of the convolution kernel, and the sliding window slides according to the set step size and the set direction; 3) Draw the hexagonal grid network of the chessboard based on the remote sensing image of the chessboard to be generated; 4) Matching the remote sensing image segmented in step 2) with the hexagonal grid network of the chessboard drawn in step 3); the matching process is the process of matching the remote sensing image dataset identifier and the chessboard element according to the set dataset identifier and chessboard element correspondence table; The correspondence table includes pixel values and categories of the remote sensing image and types and element types of the corresponding elements of the chessboard, as well as corresponding relationships; 5) Fill each hexagonal grid in the hexagonal grid network with war chess elements according to the matching results, thereby generating a war chess board; the war chess elements include linear elements and surface elements.
2. The method for generating a chessboard according to claim 1, characterized in that: When the remote sensing image segmentation model performs a convolution operation, the pixel value of the hexagonal grid area is determined by the pixel value of each pixel point contained in the hexagonal grid area.
3. The method for generating a chessboard according to claim 1, characterized in that: When performing the convolution operation, the remote sensing image segmentation model also includes the step of expanding the incomplete hexagonal grid area into a complete hexagonal grid area.
4. The method for generating a chessboard according to claim 1, characterized in that: The process of drawing the hexagonal grid network of the chess board includes: Determine the size of the hexagonal grid based on the tactical or training level of the game; Determine the length and width of the hexagonal grid network according to the ground resolution of the remote sensing image to be generated for the war chess board; Determining the number of hexagonal cells based on the size of the hexagonal cells and the length and width of the hexagonal grid network; Draw a hexagonal grid network based on the number and size of hexagonal cells.
5. The method for generating a chessboard according to claim 4, characterized in that: The number of hexagonal grids is: M=(int(L / C)+1)* (int(W / C)+1); Among them, M is the number of hexagonal grids; L is the length of the hexagonal grid network; W is the width of the hexagonal grid network; C is the size of the hexagonal grid.
6. The method for generating a chessboard according to claim 1, characterized in that: In the step 5), when filling the planar elements, if the area corresponding to a certain hexagonal grid contains multiple planar elements, the pixel value of each planar element in the hexagonal grid is calculated, and the planar element with the largest pixel value is used as the planar element filled in the hexagonal grid.
7. The method for generating a chessboard according to claim 1, characterized in that: In step 5), when filling the river element, it is determined whether the river element is a linear element. If it is a linear element, the hexagonal grid edge closest to the river is found, and the river is continuously quantized to the hexagonal grid boundary, and the flow trend of the river remains unchanged.
8. The method for generating a war chess board according to claim 1, characterized in that: In the step 5), when filling the road elements, the road elements are matched to the centers of the hexagonal grids, and the lines connecting the centers of all the hexagonal grids are the quantized roads.
9. The method for generating a chessboard according to claim 1, characterized in that: The remote sensing image segmentation model is the U-Net neural network model.
Citation Information
Patent Citations
Method for modeling terrain property of Wargame map by grid matrix
CN105045976A
UNET network-based multi-source perception fusion remote sensing image segmentation method and application
CN111192267A