Classification method, device, electronic device and storage medium of 3D voxel model
By constructing a voxel classification matrix and using neural network models to identify the type of voxel model, the problem of model classification management in voxel sandbox games is solved, efficient automatic classification is achieved, and the cost of manual participation is reduced.
Patent Information
- Application Number
- CN202110309408.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-23
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-03-23
AI Technical Summary
In voxel sandbox games, as the number of 3D voxel models increases, how to efficiently classify, manage and query models has become a problem. The existing technology relies on manual model types, which is costly and inefficient.
By obtaining element identification information and status information of each square of the voxel model to be classified, using this information to construct a voxel classification matrix, and identifying the type of voxel model through a neural network model to achieve automatic classification.
This method can quickly deal with the identification and classification of large-scale voxel models, reduce or eliminate manual participation, reduce labor and time costs, and improve efficiency.
Smart Images

Figure CN113033655B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a classification method, device, electronic device and storage medium for a 3D voxel model. Background Art
[0002] Sandbox games are a type of game with a high degree of freedom, allowing players to create various structures using in-game resources. Voxel sandbox games are an important subcategory of sandbox games. Their feature is that the entire game world is abstracted as a 3D grid, and game users can add or delete material blocks at any position in the grid to create 3D voxel models. In voxel sandbox games, as the number of created 3D voxel models increases, the speed of model creation is also accelerating. How to classify, manage and query the created 3D voxel models has become a difficult problem.
[0003] At present, models are generally classified by label information attached to the data of 3D voxel models, and these label information include model types. Among them, the model type can be determined by the game user when creating the model. If the creator does not determine the model type, the model type needs to be manually determined later.
[0004] However, with the massive increase in model data and the increasing diversity of 3D voxel models, it is extremely difficult to manually determine the model type for classification of 3D voxel models. It not only requires a large amount of manpower and time costs, but also requires a high level of model recognition ability. Therefore, there is an urgent need for a convenient and efficient method to classify 3D voxel models. Summary of the invention
[0005] The main technical problem solved by the present application is to provide a classification method, device, electronic device and storage medium for a 3D voxel model, which can realize the classification of 3D voxel models in a convenient and efficient way.
[0006] In order to solve the above problems, the first aspect of the present application provides a classification method for a 3D voxel model, the method comprising: obtaining element identification information and status information of each block of the voxel model to be classified; obtaining voxel classification information of each block using the element identification information and status information of the multiple blocks; constructing a voxel classification matrix of the voxel model through the voxel classification information of the each block; and identifying the type of the voxel model using the voxel classification matrix through a neural network model.
[0007] In order to solve the above problems, the second aspect of the present application provides a classification device for a 3D voxel model, including: a data acquisition module, used to obtain element identification information and status information of each block of the voxel model to be classified; and used to obtain voxel classification information of each block using the element identification information and status information of the multiple blocks; a construction module, used to construct a voxel classification matrix of the voxel model through the voxel classification information of the each block; and an identification module, used to identify the type of the voxel model using the voxel classification matrix through a neural network model.
[0008] In order to solve the above problem, the third aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the 3D voxel model classification method of the first aspect.
[0009] In order to solve the above-mentioned problem, the fourth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, and when the program instructions are executed by a processor, the classification method of the 3D voxel model of the above-mentioned first aspect is implemented.
[0010] The beneficial effects of the present invention are as follows: Different from the prior art, the classification method of 3D voxel models provided by the present application first obtains the element identification information and status information of each block of the voxel model to be classified; obtains the voxel classification information of each block using the element identification information and status information of multiple blocks; constructs the voxel classification matrix of the voxel model through the voxel classification information of each block; and identifies the type of the voxel model using the voxel classification matrix through a neural network model. The present application processes the data of each block of the voxel model to obtain a voxel classification matrix including the voxel classification information of each block, and implements the classification of the voxel model through a neural network model, which can reduce or eliminate the need for manual participation, and can implement the type determination and classification of the voxel model, and the classification method of the present application can quickly process a large number of voxel model identification and classification, which is convenient and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a flow chart of an embodiment of a classification method of a 3D voxel model provided by the present application;
[0012] Figure 2 yes Figure 1 The architecture diagram of a specific embodiment of step S14;
[0013] Figure 3 is a schematic diagram of a specific embodiment of step S12;
[0014] Figure 4is a flow chart of another embodiment of the classification method of the 3D voxel model provided by the present application;
[0015] Figure 5 It is a flowchart of another embodiment of the classification method of the 3D voxel model provided by the present application;
[0016] Figure 6a-6e It is a schematic diagram corresponding to an embodiment of a sample expansion processing method provided in this application;
[0017] Figure 7 It is a schematic diagram of a framework of an embodiment of a classification device for a 3D voxel model provided by the present application;
[0018] Figure 8 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0019] Fig. 9 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0020] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0021] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0022] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0023] In this application,
[0024] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of a classification method for a 3D voxel model provided by the present application. Specifically, the following steps may be included:
[0025] Step S11: Obtain element identification information and status information of each block of the voxel model to be classified.
[0026] Among them, voxel is the abbreviation of volume pixel. Conceptually similar to the smallest unit pixel in two-dimensional space, it is the smallest unit in the division of three-dimensional space. Blocks are the building blocks of voxel models. Game users can create voxel models by adding or deleting blocks, as well as selecting and using different types of blocks. Each block has element identification information and status information. Element identification information may include block type information, material information, material information, and other information that can identify different types of blocks. The status information may specifically include block direction information, integrity information, transparency information, color information, etc.
[0027] Specifically, the voxel model can be described by a three-dimensional matrix, an element identification information matrix and a state information matrix. The element identification information matrix of the voxel model includes element identification information of each block, and the state information matrix includes state information corresponding to each block in the element identification information matrix.
[0028] After obtaining the element identification information and state information of each block of the voxel model to be classified, step S12 is performed.
[0029] Step S12: using the element identification information and state information of the multiple blocks to obtain the voxel classification information of each block.
[0030] After the element identification information and state information of each block have been obtained, the voxel classification information of each block of the voxel model is obtained based on the element identification information and state information. The voxel classification information of the block may be the category of the block, or may be a code corresponding to the category of the block.
[0031] In a specific embodiment, before step S12, it is also necessary to build a corresponding table of the element identification information, state information and voxel classification of the block. Then, based on the element identification information and state information of each block, the voxel classification information of each block is searched from the corresponding table. In this corresponding table, the element identification information of all types of blocks in the voxel model and all state information that may appear in the corresponding type of blocks are included, and the combination of the element identification information and state information of each type of block corresponds to the block voxel classification. It can be understood that the combination of element identification information and state information of multiple blocks can correspond to the same block voxel classification. Among them, the voxel classification of the block is a predefined category, which can be determined according to the characteristics of the voxel model. For example, if the voxel model is a building voxel model, the predefined category can be divided into ordinary blocks, stair or roof blocks, air blocks and special blocks according to the characteristics of the building voxel model. If the voxel model is a voxel vehicle model, the predefined category can be divided into tire blocks, body blocks, etc. according to the model of the voxel vehicle model. After building a correspondence table between the element identification information and state information of a block and the voxel classification of the block, the voxel classification information corresponding to the block is obtained in the correspondence table through the element identification information and state information of the block.
[0032] Step S13: constructing a voxel classification matrix of the voxel model through the voxel classification information of each block.
[0033] After obtaining the voxel classification information of each block, a voxel classification matrix of the voxel model is constructed. For a specific voxel model, the voxel classification matrix includes the voxel classification information of all blocks of the voxel model. In other embodiments, the voxel classification matrix may also include the position information of each block in the voxel model.
[0034] Step S14: Identify the type of the voxel model using the voxel classification matrix through the neural network model.
[0035] After obtaining the voxel classification matrix of the blocks of the voxel model, the type of the voxel model is identified through the neural network model to obtain the classification of the voxel model.
[0036] See also Figure 2 , Figure 2 yes Figure 1 In this embodiment, the neural network model is a multi-layer neural network model, which is different from a general neural network model in that it uses multi-layer 3D convolution layers for feature extraction, wherein 3D convolution is an extension of 2D convolution in dimension.
[0037] In this embodiment, by processing the data of each block of the voxel model, a voxel classification matrix including the voxel classification information of each block is obtained, and the classification of the voxel model is realized through a neural network model, which can reduce or eliminate the need for human participation, and can realize the type determination and classification of the voxel model. The classification method of the present application can quickly handle a large number of voxel model recognition and classification, which is convenient and efficient.
[0038] In a specific implementation scenario, the voxel model is a building voxel model, and the blocks are material blocks or building material blocks. Different building voxel models can be created by using different blocks and building at different locations. The building voxel model is described by a set of equal-sized three-dimensional matrices, specifically the element identification information matrix (Block_ID w *h*l ) and the state information matrix (Block_data w*h*l ), where w, l and h are the sizes of the game space in width, length and height respectively. Matrix Block_ID w*h*l It is used to describe the element identification information of the block corresponding to each position in the space, that is, the block identification code (Block_ID). In voxel games, all different types of blocks have unique Block_IDs, which are usually integers. All Block_IDs in the game can be saved in the Block_ID list, and any Block_ID can be selected from the Block_ID list for use. The matrix Block_data w*h*l It is used to describe Block_ID w*h*l Status information of each block in the , such as the orientation of the block. w*h*l and Block_data w*h*l The values are all integer type.
[0039] Block_ID w*h*l and Block_data w*h*l The two matrices are mapped into a voxel classification matrix Category_ID through custom mapping rules. w*h*l*n . Category_ID w*h*l*n The first three dimensions are related to Block_ID w*h*l and Block_data w*h*l The newly added dimension n is the number of possible IDs of the custom Category_ID, which can also be called the number of channels or the number of block types. Category_ID is encoded in one-hot form.
[0040] See also Figure 3 , Figure 3This is a schematic diagram of a specific embodiment of step S12. In a voxel game, all Block_IDs and their combinations with Block_Data in the building voxel model have corresponding voxel classification information Category_ID in advance. A mapping table in the form of Table 1 is constructed. For the building voxel model to be classified, its Block_ID w*h*l and Block_ID w *h*l Matrix, find all existing Block_IDs in the matrix and the corresponding Category_IDs of Block_ID in Table 1, and form Category_ID w*h*l*n matrix.
[0041] Table 1:
[0042] Block_ID Block_data Category_ID 0 0 [1,0,0,...,0] 1 0 [0,1,0,...,0] 1 1 [0,1,0,...,0] ... ... ... x y [0,0,0,...,0]
[0043] Through the matrix conversion processing in this embodiment, the process of classifying the 3D building voxel model is as follows:
[0044] c=f(Block_ID w*h*l ,Block_Data w*h*l )
[0045] become:
[0046] c=f(Category_ID w*h*l*n )
[0047] Among them, c is the type of model and f is the classification algorithm.
[0048] The voxel classification matrix Category_ID of the building voxel model w*h*l*n The data is input into a multi-layer neural network model for type recognition to obtain the type of the building voxel model, for example, one of the building voxel model types such as a house, a tower, a castle or a temple.
[0049] This embodiment can realize the automatic classification of building voxel models, realize the automation of building voxel model classification tasks, and has a high classification performance (ROC-AUC=0.85). At the same time, the classification method of this embodiment can avoid relying on software rendering and reduce manual dependence, reduce the influence of manual subjective judgment on classification accuracy, and with the continuous increase of voxel models, the labor and time investment will not increase linearly, saving costs.
[0050] See also Figure 4 , Figure 4 This is a flow chart of another embodiment of the classification method of the 3D voxel model provided by the present application. Specifically, it may include the following steps:
[0051] Step S41: Mapping the voxel model to a preset space.
[0052] In this embodiment, the preset space can accommodate each voxel model individually, that is, the size of the preset space should be greater than or equal to any voxel model.
[0053] Generally speaking, in a game, the preset space size can be set to a fixed size. Each voxel model is mapped to the preset space, and then the information collection of step S42 is performed.
[0054] Step S42: collecting the position information of each unit in the preset space, and the element identification information and state information of the block of the voxel model corresponding to each unit.
[0055] When a voxel model is mapped to a preset space, the preset space includes all blocks of the voxel model. Except for the blocks of the voxel model, the rest of the preset space is air elements. Corresponding to the blocks, the air elements can correspond to air blocks. Information is collected for all units in the preset space, including the location information of each unit, the element identification information of the blocks, and the status information. All the above units include all blocks of the voxel model in the preset space and other units except the voxel model.
[0056] Step S43: using the element identification information and state information of the multiple blocks to obtain the voxel classification information of each unit.
[0057] Each unit in the preset space corresponds to a block, and the element identification information and state information of the multiple blocks obtain the voxel classification information of each unit, that is, obtain the voxel classification information of each block.
[0058] Step S44: using the voxel classification information of each unit, construct a voxel classification matrix of the preset space relative to the voxel model.
[0059] After obtaining the voxel classification information of each unit in the preset space, a voxel classification matrix of the preset space relative to the voxel model is constructed, that is, a voxel classification matrix of the voxel model in the preset space is constructed. When the preset spaces are of the same size, different voxel models in the preset spaces of the same size can ensure that the formats of the voxel classification matrices corresponding to the different voxel models are the same, so as to facilitate step S45, and identify the type of the voxel model through the neural network model.
[0060] Specifically, a voxel classification matrix of the preset space relative to the voxel model is constructed according to the arrangement order of each unit of the preset space, so that the voxel classification matrix includes not only the voxel classification information of each unit, but also the position information of each unit in the preset space. The voxel classification matrix including the voxel classification information and position information of each unit can realize the type recognition and classification of the voxel model in the preset space through step S45.
[0061] Step S45: Identify the type of the voxel model using the voxel classification matrix through the neural network model.
[0062] This step is the same as step S14. Figure 1 , Figure 2 The related text description of step S14 will not be repeated here.
[0063] This embodiment maps the voxel model to the preset space, collects the position information of each unit in the preset space, and the element identification information and status information of the blocks of the voxel model corresponding to each unit, obtains the voxel classification information of each unit using the element identification information and status information of multiple blocks, and constructs the voxel classification matrix of the preset space relative to the voxel model using the voxel classification information of each unit, thereby obtaining the voxel classification matrix of the preset space including the voxel model, that is, the voxel classification matrix of the voxel model. The factor that different voxel models have different formats of voxel classification matrices due to different shapes, sizes, and different numbers of blocks is eliminated. The discrete matrix of the voxel model is processed to obtain a voxel classification matrix with the same format, and the voxel classification matrix with the unified format is recognized by the neural network model to realize the type, thereby realizing the automation of voxel model classification.
[0064] See also Figure 5 , Figure 5 This is a flow chart of another embodiment of the classification method of the 3D voxel model provided by the present application. The specific steps include:
[0065] Step S51: Obtain a sample voxel model of a labeled type.
[0066] The sample voxel model has type annotation information. For example, the architectural voxel model has type annotation information such as house, tower, castle or temple. The number of existing sample voxel models is limited. In order to improve the generalization ability of the classification method of 3D voxel models, sample data augmentation can be achieved by performing sample expansion processing on the sample voxel model.
[0067] The method of performing sample expansion processing on the sample voxel model includes at least one of scaling, translating, folding and rotating the sample voxel model, specifically including any one of scaling, translating, folding and rotating the sample voxel model, or a combination of multiple thereof. When a sample voxel model of a certain labeled type is expanded, its size or coordinates will change, but its type remains unchanged.
[0068] In a specific embodiment, the sample voxel model is scaled, translated, folded, and rotated to perform sample expansion processing, see Figure 6a-6e , Figure 6a-6e is a schematic diagram corresponding to an embodiment of a sample expansion processing method provided by the present application. Figure 6a is a schematic diagram of the sample voxel model without expansion processing. Figure 6b is a schematic diagram of the sample voxel model being scaled. Figure 6c is a schematic diagram of the sample voxel model translation processing. Figure 6d It is a schematic diagram of the sample voxel model being folded. Figure 6e It is a schematic diagram of the rotation processing of the sample voxel model.
[0069] In this embodiment, the sample voxel model is mapped to the preset space, the size of the sample voxel model is not greater than the size of the preset space, and the sample voxel model is expanded in the preset space. Assuming that the sizes of the preset space in three dimensions are W, L, and H, respectively, and the sizes of the sample voxel model in three dimensions are w, l, and h, then w≤W, l≤L, h≤H. And in the process of sample expansion processing, the sizes of the sample voxel model in three dimensions are less than or equal to the sizes of the preset space.
[0070] In one embodiment, in combination Figure 6b , the scaling process may include: scaling the voxel model so that the scaled size is [wi,li,hi], where wi∈[min(a,w),W], and min represents the minimum value. Then the range of values for scaling in the length direction, the lower limit is the minimum value between the constant a and the size w of the sample voxel model in the length dimension, and the upper limit is the size W of the preset space in the length dimension. For a length dimension greater than the constant a, the sample voxel model will be scaled between the constant a and the preset space size. For a sample voxel model whose length dimension is less than or equal to the constant a, no reduction operation will be performed, and only the sample voxel model can be enlarged. The value of constant a can be set according to actual needs, for example, it can be 5, 10, 15, etc. Constant a is mainly to control the size of the scaled voxel model not to be too small, so that the size of the voxel model after the sample expansion process is within a reasonable size range. For the scaling process in the other two dimensions, refer to the scaling process in the length direction.
[0071] Specifically, scaling can be achieved by performing a matrix linear transformation on the sample voxel model. For each non-air element or non-air block, its position in the preset space matrix is [pw, pl, ph], which will be transformed according to the scaling ratio [vw, vl, wh], and the transformation method is as follows:
[0072]
[0073] The scaling ratio is obtained by vw = wi / w, vl = li / l, vh = hi / h. The new coordinates [v w p w ,v l p l ,v h p h ], and round it to get the new sample voxel model size of [wi,li,hi]. The size of the sample voxel model obtained after the scaling transformation changes, and the points missing due to scaling can be filled by the K-nearest neighbor algorithm.
[0074] In one embodiment, in combination Figure 6c , the translation process may include: translating the origin of the building entity to a position [pw, pl, ph] in the building matrix, where pw∈[0, Ww], pl∈[0, Ll], ph=0. That is, the sample voxel model is translated under the condition that the size of the sample voxel model does not exceed the preset space size and the sample voxel model is located on the ground, or the height of the sample voxel model in the height dimension is 0.
[0075] In one embodiment, in combination Figure 6d The folding process may include: for each element in the sample voxel model matrix, whose position in the building matrix is [pw, pl, ph], it will be folded to [W-pw, pl, ph] according to the plane w=W / 2.
[0076] In one embodiment, in combination Figure 6e The rotation process may include: for each element in the sample voxel model, set its position in the building matrix to [pw, pl, ph], and perform three right-angle rotations on the sample voxel model: θ = 90°, 180°, 270°, expressed in the form of a matrix, the transformation method is as follows:
[0077]
[0078] After rotation, the new coordinates [cosθp w +sinθp w ,sinθp l+cosθp l ,p h ], the coordinate values are rounded to get the rotated coordinates. For example, if the voxel model is a building voxel model, it is generally a cube, and right-angle rotation will not change the size of the voxel model matrix.
[0079] It is understandable that the specific process of scaling, translation, folding and rotation in this embodiment of the present application is not limited to the process in the above specific embodiment. Through the four sample expansion processes of scaling, translation, folding and rotation in this embodiment, the number of sample voxel models is increased by about 3 orders of magnitude, that is, 10 to the third power. The data volume of the sample voxel model is enriched, and the generalization ability of the classification method of the 3D voxel model is improved.
[0080] Step S52: Obtain element identification information and status information of each block of the sample voxel model.
[0081] This step is the same as step S11. Figure 1 The related text description of step S11 will not be repeated here.
[0082] Step S53: using the element identification information and status information of the multiple blocks to obtain the voxel classification information of each block.
[0083] This step is the same as step S12. Figure 1 The related text description of step S12 will not be repeated here.
[0084] Step S54: constructing a voxel classification matrix of the sample voxel model through the voxel classification information of each block.
[0085] This step is the same as step S13. Figure 1 The related text description of step S13 will not be repeated here.
[0086] In the previous specific embodiment, the sample voxel model is expanded by scaling, translating, folding and rotating the sample voxel model. In other specific embodiments, based on the principle that the sample voxel model type remains unchanged after scaling, translating, folding and rotating the sample voxel model, the voxel classification matrix corresponding to the sample voxel model is transformed accordingly to obtain multiple voxel classification matrices, that is, the number of voxel classification matrices is expanded to obtain voxel classification matrices of more orders of magnitude, and each voxel classification matrix corresponds to the label type of the voxel model.
[0087] Step S55: training the neural network model through the voxel classification matrix of the sample voxel model and the labeled type.
[0088] This step combines Figure 2 , each voxel classification matrix of a sample voxel model has a corresponding labeled type. Based on the voxel classification matrix of the sample voxel model, a predicted type is obtained through a multi-layer neural network model. By comparing the predicted type with the labeled type, the error is calculated, and the weight of the multi-layer neural network model is reversely optimized through the error, so as to obtain the optimized weight and realize the training of the neural network model. The voxel classification matrices of a large number of sample voxel models are used to train the neural network model, and the weights are continuously optimized, thereby improving the classification performance of the entire classification method. The trained and optimized neural network model can automatically identify and classify voxel models.
[0089] Step S56: Identify the type of the voxel model using the voxel classification matrix through the neural network model.
[0090] The neural network model obtained after training with the voxel classification matrix of the sample voxel model has optimized weights. For voxel models of unknown types, the type of the voxel model can be identified by using the voxel classification matrix of the trained neural network model to obtain the type of the unknown voxel model. When the voxel model is collected and entered into the database, the present embodiment can automatically classify the voxel model, reduce manual dependence, improve work efficiency and save costs.
[0091] See also Figure 7 , Figure 7 It is a schematic diagram of a framework of an embodiment of a classification device for a 3D voxel model provided by the present application. The classification device 70 for a 3D voxel model includes: a data acquisition module 71, which is used to acquire the element identification information and state information of each block of the voxel model to be classified, and is also used to acquire the voxel classification information of each block using the element identification information and state information of multiple blocks; a construction module 72, which is used to construct a voxel classification matrix of the voxel model through the voxel classification information of each block; and an identification module 73, which is used to identify the type of the voxel model using the voxel classification matrix through a neural network model.
[0092] In other embodiments, before the step of using the element identification information and status information of multiple blocks to obtain the voxel classification information of each block, the data acquisition module 71 is also used to build a correspondence table of the element identification information, status information and voxel classification of the block, and to search for the voxel classification information of each block from the correspondence table based on the element identification information and status information of each block.
[0093] In other embodiments, the data acquisition module 71 is also used to map the voxel model to the preset space, and is also used to collect the position information of each unit of the preset space, as well as the element identification information and state information of the block of the voxel model corresponding to each unit, and is used to obtain the voxel classification information of each unit using the element identification information and state information of multiple blocks. The construction module 72 is also used to construct a voxel classification matrix of the preset space relative to the voxel model using the voxel classification information of each unit. The construction module 72 is used to construct the voxel classification matrix of the preset space relative to the voxel model according to the arrangement order of each unit of the preset space.
[0094] In a specific embodiment, the data acquisition module 71 is used to obtain the sample voxel model of the labeled type, and is also used to obtain the element identification information and state information of each block of the sample voxel model, and is used to obtain the voxel classification information of each block using the element identification information and state information of multiple blocks. The construction module 72 is used to construct the voxel classification matrix of the sample voxel model through the voxel classification information of each block. The identification module 73 is used to train the neural network model through the voxel classification matrix of the sample voxel model and the labeled type.
[0095] Furthermore, the data acquisition module 71 is also used to perform sample expansion processing on the sample voxel model; wherein the expansion processing method includes at least one of scaling, translating, folding and rotating the sample voxel model. Specifically, the size of the sample voxel model is not larger than the size of the preset space, and the data acquisition module 71 is used to perform sample expansion processing on the sample voxel model within the preset space. In addition, the data acquisition module 71 can also be used to expand the number of voxel classification matrices.
[0096] In the above embodiment, the voxel model includes a building voxel model, the data acquisition module 71 acquires the element identification information and state information of each block of the voxel model to be classified, and then uses the element identification information and state information of multiple blocks to acquire the voxel classification information of each block; the construction module 72 constructs the voxel classification matrix of the voxel model through the voxel classification information of each block; the recognition module uses the voxel classification matrix through the neural network model to identify the type of the voxel model. The classification device 70 of the 3D voxel model realizes the automatic classification of the voxel model, which can reduce or eliminate the need for manual participation to realize the type determination and classification of the voxel model, and the classification method of the present application can quickly process a large number of voxel model recognition and classification, which is convenient and efficient.
[0097] See also Figure 8 , Figure 81 is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device 80 includes a memory 81 and a processor 82 coupled to each other, and the processor 82 is used to execute program instructions stored in the memory 81 to implement the steps of any of the above-mentioned background replacement method embodiments. In a specific implementation scenario, the electronic device 80 may include but is not limited to: a microcomputer, a server.
[0098] Specifically, the processor 82 is used to control itself and the memory 81 to implement the steps of any of the above-mentioned graph data partitioning method embodiments. The processor 82 may also be referred to as a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip having signal processing capabilities. The processor 82 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In addition, the processor 82 may be implemented by an integrated circuit chip.
[0099] In the above scheme, the processor 82 obtains the element identification information and status information of each block of the voxel model to be classified, and then obtains the voxel classification information of each block using the element identification information and status information of multiple blocks; constructs the voxel classification matrix of the voxel model through the voxel classification information of each block; uses the voxel classification matrix to identify the type of the voxel model through the neural network model to achieve automatic classification of the voxel model, which can reduce or eliminate the need for human participation to achieve the type determination and classification of the voxel model, and the classification method of the present application can quickly process a large number of voxel model identification and classification, which is convenient and efficient.
[0100] See also Fig. 9 , Fig. 9 The computer-readable storage medium 90 stores program instructions 900 that can be executed by a processor, and the program instructions 900 are used to implement the steps of any of the above-mentioned 3D voxel model classification method embodiments.
[0101] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0102] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0103] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A classification method for a 3D voxel model, characterized in that: include: A correspondence table of element identification information and state information of a building block and voxel classification of the building block; Obtaining element identification information and status information of each block of the voxel model to be classified; the element identification information includes type information, material information or material information of the block, and the status information includes direction information, integrity information, transparency information or color information of the block; Acquiring voxel classification information of each block by using the element identification information and state information of the plurality of blocks, comprising: searching the voxel classification information of each block from the corresponding table based on the element identification information and state information of each block; the voxel classification information is used to determine the category of the block; Constructing a voxel classification matrix of the voxel model through the voxel classification information of each block; The type of the voxel model is identified using the voxel classification matrix through a neural network model.
2. The classification method of 3D voxel model according to claim 1, characterized in that: The step of obtaining element identification information and status information of each block of the voxel model to be classified includes: Mapping the voxel model to a preset space; Collecting the position information of each unit of the preset space, and the element identification information and state information of the block of the voxel model corresponding to each unit; The step of acquiring voxel classification information of each block by using element identification information and status information of the plurality of blocks comprises: Using the element identification information and state information of the plurality of blocks, the voxel classification information of each unit is acquired; The step of constructing a voxel classification matrix of the voxel model through the voxel classification information of each block comprises: The voxel classification information of each of the units is used to construct a voxel classification matrix of the preset space relative to the voxel model.
3. The classification method of 3D voxel model according to claim 2, characterized in that: The step of constructing a voxel classification matrix of the preset space relative to the voxel model by using the voxel classification information of each of the units comprises: A voxel classification matrix of the preset space relative to the voxel model is constructed according to the arrangement order of each unit of the preset space.
4. The classification method of 3D voxel model according to claim 2, characterized in that: Before the step of identifying the type of the voxel model by using the voxel classification matrix through the neural network model, the method further includes: Obtain sample voxel models of labeled types; Obtaining element identification information and status information of each block of the sample voxel model; Acquire voxel classification information of each block using element identification information and state information of the plurality of blocks; Constructing a voxel classification matrix of the sample voxel model through the voxel classification information of each block; The neural network model is trained through the voxel classification matrix of the sample voxel model and the labeled types.
5. The classification method of 3D voxel model according to claim 4, characterized in that: The step of obtaining a sample voxel model of a labeled type includes: Perform sample expansion processing on the sample voxel model; wherein the expansion processing method includes at least one of scaling, translating, folding and rotating the sample voxel model.
6. The classification method of 3D voxel model according to claim 5, characterized in that: The size of the sample voxel model is not larger than the size of the preset space, The step of performing sample expansion processing on the sample voxel model comprises: Performing sample expansion processing on the sample voxel model in the preset space.
7. The classification method of 3D voxel model according to claim 4, characterized in that: The step of constructing a voxel classification matrix of the sample voxel model through the voxel classification information of each block includes: The number of the voxel classification matrix is expanded.
8. The classification method of a 3D voxel model according to any one of claims 1 to 7, characterized in that: The voxel model includes a building voxel model.
9. A classification device for a 3D voxel model, characterized in that: include: A data acquisition module, used to build a correspondence table between element identification information and state information of a block and voxel classification of the block; and, used to obtain element identification information and state information of each block of the voxel model to be classified, wherein the element identification information includes type information, material information or texture information of the block, and the state information includes direction information, integrity information, transparency information or color information of the block; as well as The method is used to obtain voxel classification information of each block by using the element identification information and state information of the plurality of blocks, including: searching the voxel classification information of each block from the corresponding table based on the element identification information and state information of each block; the voxel classification information is used to determine the category of the block; A construction module, used for constructing a voxel classification matrix of the voxel model through the voxel classification information of each block; An identification module is used to identify the type of the voxel model using the voxel classification matrix through a neural network model.
10. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the 3D voxel model classification method according to any one of claims 1 to 8.
11. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the 3D voxel model classification method according to any one of claims 1 to 8 is implemented.