Target three-dimensional bounding box generation method and device, equipment and storage medium
By generating a target three-dimensional bounding box through layered analysis of mesh models, the method addresses precision issues in traditional bounding boxes, enhancing accuracy and efficiency in collision detection and ray tracing.
Patent Information
- Application Number
- CN202411169164.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-13
AI Technical Summary
Traditional three-dimensional bounding boxes exhibit insufficient precision in applications requiring accurate spatial relationship judgment, such as collision detection and ray tracing, leading to incorrect collision detection and unnecessary ray tracing calculations.
A method for generating a target three-dimensional bounding box involves determining multiple layers of a mesh model, calculating initial two-dimensional bounding boxes for each layer, and merging these to create a hierarchical structure that improves the precision of the bounding box.
The method enhances the precision of three-dimensional bounding boxes, reducing unnecessary calculations and improving computing efficiency in collision detection and ray tracing scenarios.
Smart Images

Figure CN119131291A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of three-dimensional bounding box technology, and in particular to the fields of grid cutting and three-dimensional model processing. Background Art
[0002] With the rapid development of computer technology and 3D graphics technology, 3D bounding volumes are gradually playing an increasingly important role in many fields, especially in computer graphics, collision detection, ray tracing and 3D reconstruction.
[0003] However, the problem of insufficient precision of the traditional global bounding box has gradually become prominent in some applications, especially in scenarios that require accurate spatial relationship judgment (such as collision detection or ray tracing scenarios). Summary of the invention
[0004] The present disclosure provides a method, apparatus, device and storage medium for generating a target three-dimensional bounding box.
[0005] According to one aspect of the present disclosure, a method for generating a target three-dimensional bounding box is provided, comprising:
[0006] Determine a plurality of layers corresponding to a mesh model; the mesh model includes a plurality of first mesh facets;
[0007] Determine, according to the first mesh patch, a second mesh patch corresponding to each layer in the plurality of layers; wherein the second mesh patch includes the first mesh patch and / or a mesh patch obtained by layered cutting of the first mesh patch;
[0008] Determine the initial two-dimensional bounding box corresponding to each layer according to the second mesh surface corresponding to each layer;
[0009] Performing branch processing on the initial two-dimensional bounding boxes corresponding to each layer respectively to determine the branch results corresponding to each layer; performing aggregation processing on the branch results corresponding to each layer respectively according to the first aggregation requirement to determine the target two-dimensional bounding boxes corresponding to each layer; determining the initial three-dimensional bounding boxes corresponding to each layer respectively according to the target two-dimensional bounding boxes corresponding to each layer;
[0010] Based on the second aggregation requirement and the initial three-dimensional bounding boxes corresponding to each layer, a target three-dimensional bounding box corresponding to the mesh model is determined.
[0011] According to another aspect of the present disclosure, a device for generating a target three-dimensional bounding box is provided, comprising:
[0012] A first determination module is used to determine a plurality of layers corresponding to a mesh model; the mesh model includes a plurality of first mesh facets;
[0013] A second determination module is used to determine, based on the first mesh patch, a second mesh patch corresponding to each layer in the plurality of layers; wherein the second mesh patch includes the first mesh patch and / or a mesh patch obtained by layered cutting of the first mesh patch;
[0014] A third determination module determines the initial two-dimensional bounding box corresponding to each layer according to the second mesh surface corresponding to each layer;
[0015] The fourth determination module is used to perform branch processing on the initial two-dimensional bounding boxes corresponding to each layer to determine the branch results corresponding to each layer; according to the first aggregation requirement, the branch results corresponding to each layer are aggregated to determine the target two-dimensional bounding boxes corresponding to each layer; and according to the target two-dimensional bounding boxes corresponding to each layer, the initial three-dimensional bounding boxes corresponding to each layer are determined;
[0016] The fifth determination module is used to determine a target three-dimensional bounding box corresponding to the grid model based on the second aggregation requirement and the initial three-dimensional bounding boxes corresponding to each layer.
[0017] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0018] at least one processor; and
[0019] a memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any embodiment of the present disclosure.
[0021] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to any embodiment of the present disclosure.
[0022] According to another aspect of the present disclosure, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method according to any one of the embodiments of the present disclosure is implemented.
[0023] The present application can obtain a target three-dimensional bounding box (i.e., a minimum three-dimensional bounding box) for the grid model through multiple steps such as determining multiple layers corresponding to the grid model, determining multiple first grid facets contained in the grid model, determining second grid facets corresponding to each layer in the multiple layers corresponding to the grid model, determining a hierarchical two-dimensional bounding box, calculating a hierarchical three-dimensional bounding box, and merging hierarchical three-dimensional bounding boxes, thereby improving the fineness of the three-dimensional bounding box corresponding to the obtained grid model, and thereby solving the problem of insufficient accuracy of the traditional overall bounding box in certain applications, especially in scenarios that require precise spatial relationship judgment (such as collision detection or ray tracing scenarios).
[0024] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0026] Figure 1 It is a schematic diagram of the traditional overall bounding box;
[0027] Figure 2 It is a schematic diagram of the scene where the office chair is put under the desk;
[0028] Figure 3 It is a schematic diagram of an application scenario of the method for generating a target three-dimensional bounding box proposed in an embodiment of the present disclosure;
[0029] Figure 4 is a flowchart of a method for generating a target three-dimensional bounding box according to an embodiment of the present disclosure;
[0030] Figure 5 is a schematic diagram of steps of a method for generating a target three-dimensional bounding box according to an embodiment of the present disclosure;
[0031] Figure 6 is a schematic diagram of layered cutting of each facet of a mesh model according to an embodiment of the present disclosure;
[0032] Fig. 7A is a schematic diagram of an initial two-dimensional bounding box according to an embodiment of the present disclosure;
[0033] Figure 7B is a schematic diagram of a row-by-row process of an initial two-dimensional bounding box according to an embodiment of the present disclosure;
[0034] Fig. 8A is a schematic diagram of a grid model according to an embodiment of the present disclosure;
[0035] Figure 8Bis a schematic diagram of an initial three-dimensional bounding box corresponding to a grid model according to an embodiment of the present disclosure;
[0036] Figure 8C is a schematic diagram of a target three-dimensional bounding box corresponding to a grid model according to an embodiment of the present disclosure;
[0037] Fig. 9 is a structural schematic diagram of a device 900 for generating a target three-dimensional bounding box according to an embodiment of the present disclosure;
[0038] Fig.10 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0039] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0040] For the convenience of subsequent description, some terms in this embodiment are explained below. It should be noted that these explanations are for the convenience of understanding by those skilled in the art and do not constitute a limitation on the scope of protection claimed by the present invention.
[0041] Mesh model: A mesh model is a model that uses a series of polygons (usually triangles) to describe a three-dimensional object. The description of a mesh model includes a series of facets and vertices. Depending on the number of vertices contained in each facet, the mesh model can be divided into a triangular mesh model, a quadrilateral mesh model, or a polygonal hybrid mesh model. In an example, the vertex set V = (v1, v2, ..., v n ), where each vertex is represented by three numbers in three dimensions, such as v1 = (x1, y1, z1); in one example, the face set F = (f1, f2, ..., f n ), where each face is represented by the index coordinates of the vertices contained in its directed contour in the vertex set. For example, if any mesh model is a triangle mesh model, then each face corresponding to the mesh model contains three vertex indices, such as f1 = (v1, v2, v3); or, if any mesh model is a quadrilateral mesh model, then each face corresponding to the mesh model contains four vertex indices, such as f1 = (v1, v2, v3, v4).
[0042] Bounding Volume: The basic idea of a bounding volume is to use a slightly larger polygon to approximate the object of study; the bounding box can include a two-dimensional bounding box and a three-dimensional bounding box. The three-dimensional bounding box (Bounding Volume) can refer to a cube that completely encloses the object.
[0043] Ray tracing: Ray tracing involves casting a ray into a scene and determining if and where that ray intersects the scene's geometry.
[0044] Collision detection: Collision detection refers to detecting whether there is contact or penetration between objects.
[0045] With the rapid development of computer technology and 3D graphics technology, 3D bounding boxes are gradually playing an increasingly important role in many fields, especially in computer graphics, collision detection, ray tracing and 3D reconstruction.
[0046] However, if Figure 1 The traditional overall bounding box shown in FIG. 1 has a problem of insufficient precision in some applications, especially in scenarios that require accurate spatial relationship judgment (such as collision detection or ray tracing). Figure 2 As shown, if you want to store an office chair under a desk, then usually you need to perform collision detection on the desk and chair to avoid unreasonable layout plans to avoid the display effect of penetrating the model. However, if the overall bounding box of the office chair is used, some of the originally correct storage layout plans will be detected as having collision conflicts. Alternatively, if you need to perform ray tracing on objects in the scene, then in the prior art, you can first determine whether the ray intersects with the bounding box of the object. However, if the traditional overall bounding box is used, objects that originally did not intersect with the ray will be judged to intersect with the ray, thereby greatly increasing unnecessary calculations.
[0047] Therefore, in order to solve the above problem, an embodiment of the present disclosure proposes a method for generating a target three-dimensional bounding box, wherein the target three-dimensional bounding box may be a minimum three-dimensional bounding box corresponding to a grid model.
[0048] Figure 3 Schematic diagram of an application scenario of the method for generating a target three-dimensional bounding box proposed in the embodiment of the present disclosure. Figure 3, the method for generating a target three-dimensional bounding box proposed in the embodiment of the present disclosure can be used in a system including a terminal 310, a network 320 and a server 330. In one example, the terminal 310 can send the grid model for which the target three-dimensional bounding box needs to be generated to the server 330 for processing, and the server 330 uses the method for generating a target three-dimensional bounding box proposed in the embodiment of the present disclosure to generate a target three-dimensional bounding box corresponding to the grid model, and feeds the target three-dimensional bounding box back to the terminal 310, wherein the target three-dimensional bounding box may include the minimum three-dimensional bounding box corresponding to the grid model; the terminal 310 displays or shows the target three-dimensional bounding box to the user. Among them, the terminal 310 communicates with the server 330 through the network 320; the terminal 310 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 330 can be implemented by an independent server or a server cluster consisting of multiple servers.
[0049] Figure 4 is a flowchart of a method for generating a target three-dimensional bounding box according to an embodiment of the present disclosure, comprising:
[0050] S410, determining a plurality of layers corresponding to a mesh model; the mesh model includes a plurality of first mesh patches;
[0051] S420, determining, according to the first mesh patch, a second mesh patch corresponding to each layer in the plurality of layers; wherein the second mesh patch includes the first mesh patch and / or a mesh patch obtained by layered cutting of the first mesh patch;
[0052] S430, determining initial two-dimensional bounding boxes corresponding to each layer according to the second mesh facets corresponding to each layer;
[0053] S440, respectively performing branch processing on the initial two-dimensional bounding boxes corresponding to each layer to determine the branch results corresponding to each layer; respectively performing aggregation processing on the branch results corresponding to each layer according to the first aggregation requirement to determine the target two-dimensional bounding boxes corresponding to each layer; respectively determining the initial three-dimensional bounding boxes corresponding to each layer according to the target two-dimensional bounding boxes corresponding to each layer;
[0054] S450: Determine a target three-dimensional bounding box corresponding to the mesh model based on the second aggregation requirement and the initial three-dimensional bounding boxes corresponding to each layer.
[0055] The target three-dimensional bounding box may be a minimum three-dimensional bounding box corresponding to the grid model.
[0056] The disclosed embodiment can obtain a target three-dimensional bounding box (i.e., a minimum three-dimensional bounding box) for a grid model by determining multiple layers corresponding to a grid model, determining multiple first grid facets contained in the grid model, determining second grid facets corresponding to each layer in the multiple layers corresponding to the grid model, determining a hierarchical two-dimensional bounding box, calculating a hierarchical three-dimensional bounding box, merging hierarchical three-dimensional bounding boxes, and other steps, thereby improving the precision of the target three-dimensional bounding box corresponding to the obtained grid model, thereby solving the problem of insufficient precision of the traditional overall bounding box in certain applications, especially in scenes that require accurate spatial relationship judgment (such as collision detection or ray tracing scenes). Compared with the traditional overall bounding box, the target three-dimensional bounding box obtained based on the disclosed embodiment can significantly accelerate and optimize ray tracing, and improve computing efficiency by reducing unnecessary calculations.
[0057] Furthermore, in order to facilitate the description of the embodiment of the present disclosure, the following content will gradually describe how to implement the target three-dimensional bounding box generation method proposed in the embodiment of the present disclosure.
[0058] Reference Figure 5 The method for generating a target three-dimensional bounding box proposed in the embodiment of the present disclosure includes the following steps:
[0059] Step 1: Determine multiple layers corresponding to the grid model.
[0060] The number of layers corresponding to the grid model can be determined according to a preset layer accuracy and a height of an overall bounding box corresponding to the grid model.
[0061] In some implementations, the disclosed embodiments may pre-calculate the overall bounding box corresponding to the grid model, and determine multiple layers corresponding to the grid model based on the height and layer accuracy of the overall bounding box.
[0062] For example, if the layer accuracy corresponding to the grid model is 5%, and the height range of the overall bounding box corresponding to the grid model is 0 to 100, that is, [0,100], then in this case, in the multiple layers corresponding to the grid model, the height interval of each layer is 5, that is, the grid model corresponds to 20 layers (that is, the number of layers corresponding to the grid model is 20), among which the height range of the first layer corresponding to the grid model is [0,5), the height range of the second layer is [5,10)... The height range of the 20th layer is [95,100].
[0063] In summary, it can be seen that when the layering accuracy corresponding to the grid model is 5%, and the height range of the overall bounding box corresponding to the grid model is 0 to 100, the grid model corresponds to 20 layers, and the 20 layers are [0,5) layer, [5,10) layer...[95,100] layer.
[0064] Of course, it should be noted that the layering accuracy proposed in the embodiment of the present disclosure is only an example, and the embodiment of the present disclosure does not limit the specific value of the layering accuracy. For example, the layering accuracy can also include 10%. That is, if the layering accuracy corresponding to the grid model is 10%, and the height range of the overall bounding box corresponding to the grid model is 0 to 100, that is, [0,100] as an example, in the multiple layers corresponding to the grid model in the embodiment of the present disclosure, the height interval of each layer is 10. Therefore, the grid model corresponds to 10 layers, that is, the number of layers corresponding to the grid model is 10, that is, the height range of the first layer corresponding to the grid model is [0,10), the height range of the second layer is [10,20).... The height range of the tenth layer is [90,100].
[0065] In summary, when the layering accuracy corresponding to the grid model is 10%, and the height range of the overall bounding box corresponding to the grid model is from 0 to 100, the grid model in the disclosed embodiment corresponds to 10 layers, and the 10 layers are [0,10) layers, [10,20) layers...[90,100) layers.
[0066] Step 2: Determine a second mesh patch corresponding to each layer in a plurality of layers according to the first mesh patch.
[0067] Specifically, for any layer, determining a second mesh surface corresponding to the layer according to the first mesh surface includes:
[0068] When all vertices of the first mesh patch are in the layer, the first mesh patch is determined as the second mesh patch corresponding to the layer; and / or,
[0069] When some vertices of the first mesh face are in the layer, the first mesh face is cut in layers to obtain a second mesh face corresponding to the layer; wherein all vertices of the second mesh face are in the layer.
[0070] Obviously, for any first mesh face, the embodiment of the present disclosure needs to determine whether all vertices of the first mesh face are in one layer.
[0071] For example, if all vertices of any first mesh patch are in a certain layer, then the embodiment of the present disclosure may determine the first mesh patch as the second mesh patch corresponding to the layer.
[0072] Figure 6 FIG. 1 is a schematic diagram of layered cutting of each face of a mesh model according to an embodiment of the present disclosure. Figure 6As shown, taking the grid model corresponding to 20 layers, and the 20 layers corresponding to the grid model are [0,5) layer, [5,10) layer...[95,100] layer as an example, if the Z values of all vertices of the first grid patch A are within the range of [5,10) layer, that is, all vertices of the first grid patch A are within the [5,10) layer, the embodiment of the present disclosure can determine the first grid patch A as the second grid patch corresponding to the [5,10) layer.
[0073] Alternatively, if there is any first mesh face and some of the vertices of the first mesh face are in a certain layer, then the embodiment of the present disclosure can perform layered cutting on the first mesh face to obtain a second mesh face corresponding to the layer; wherein all the vertices of the second mesh face are in the corresponding layer.
[0074] Still Figure 6 As shown, taking the mesh model corresponding to 20 layers, and the 20 layers corresponding to the mesh model are [0,5) layer, [5,10) layer...[95,100] layer as an example, if the Z values of some vertices of the first mesh face B are in the range of [0,5], and the Z values of another part of the vertices are in the range of [5,10), that is, some vertices of the first mesh face B are in the [5,10) layer, and the other part of the vertex values are in the [5,10) layer, the embodiment of the present disclosure can perform layered cutting on the first mesh face B according to the multiple layers corresponding to the mesh model to obtain a second mesh face B1 and a second mesh face B2.
[0075] In some embodiments, if the Z values of all vertices of the second mesh patch B1 are within the range of [0,5), that is, all vertices of the second mesh patch B1 are within the [0,5) layer, the embodiment of the present disclosure can determine that the second mesh patch B1 corresponds to the [5,10) layer; for example, if the Z values of all vertices of the second mesh patch B2 are within the range of [5,10), that is, all vertices of the second mesh patch B2 are within the [5,10) layer, the embodiment of the present disclosure can determine that the second mesh patch B2 corresponds to the [5,10) layer.
[0076] Specifically, if the vertices of the second mesh patch B1 obtained after the layered cutting of the first mesh patch B are (0,0,0), (0,5,5), (5,0,5), that is, the Z values of the vertices of the second mesh patch B1 are all within the range of [0,5), that is, all the vertices of the second mesh patch B1 are within the [0,5) layer, then the embodiment of the present disclosure can determine that the second mesh patch B1 is a patch in the [0,5) layer; or, if the vertices of the second mesh patch B2 obtained after the layered cutting of the first mesh patch B are (0,5,5), (5,0,5), (0,10,10), (10,0,10), that is, the Z values of the vertices of the second mesh patch B2 are all within the range of [5,10), that is, all the vertices of the second mesh patch B2 are within the [5,10) layer, then the embodiment of the present disclosure can determine that the second mesh patch B2 is a patch in the [5,10) layer.
[0077] Step 3: According to the second mesh patches corresponding to each layer, determine the initial two-dimensional bounding box corresponding to each layer.
[0078] Specifically, for any layer, according to the second mesh surface corresponding to the layer, determining the initial two-dimensional bounding box corresponding to the layer includes:
[0079] Projecting the second mesh patch onto the bottom plane of the layer to obtain a projection result;
[0080] According to the projection result, an initial two-dimensional bounding box corresponding to the layer is determined.
[0081] For example, taking the case where the mesh model corresponds to 20 layers, and the 20 layers corresponding to the mesh model are [0,5) layer, [5,10) layer...[95,100] layer, then if the second mesh patch B1 is a triangular patch, and the Z values of all vertices of the second mesh patch B1 are in the range of [0,5), that is, the second mesh patch B1 is in the [0,5) layer, then the embodiment of the present disclosure can project the second mesh patch B1 onto the bottom plane of the [0,5) layer, that is, the plane where Z=0, to obtain the projection result of the second mesh patch B1 on the plane where Z=0 (that is, a new triangle or a straight line), and calculate the two-dimensional bounding box corresponding to the second mesh patch B1 based on the projection result, that is, an initial two-dimensional bounding box corresponding to the layer.
[0082] Alternatively, still taking the example that the mesh model corresponds to 20 layers, and the 20 layers corresponding to the mesh model are [0,5) layer, [5,10) layer...[95,100] layer, then if the second mesh patch B2 belongs to a trapezoidal patch, and the Z values of all vertices of the second mesh patch B2 are within the range of [5,10), that is, the second mesh patch B2 is all in the [5,10) layer. Then the embodiment of the present disclosure can project the second mesh patch B2 onto the bottom plane of the [5,10) layer, that is, the plane of Z=5, to obtain the projection result of the second mesh patch B2 on the plane of Z=5 (that is, a new trapezoid or a straight line), and calculate the two-dimensional bounding box corresponding to the second mesh patch B2 based on the projection result, that is, an initial two-dimensional bounding box corresponding to the layer.
[0083] Step 4: Perform branch processing on the initial two-dimensional bounding boxes corresponding to each layer to determine the branch results corresponding to each layer.
[0084] In some implementations, for each of the multiple layers, the embodiments of the present disclosure may also perform row-by-row processing on the initial two-dimensional bounding box corresponding to each layer, so as to determine the row-by-row results corresponding to each layer.
[0085] Specifically, in the embodiment of the present disclosure, for any layer, the initial two-dimensional bounding box corresponding to the layer is processed by row division to determine the row division result corresponding to the layer, including:
[0086] Determine the row division accuracy corresponding to the layer, and determine multiple rows corresponding to the layer and two-dimensional bounding box blocks corresponding to each row in the multiple rows according to the row division accuracy; wherein the two-dimensional bounding box blocks corresponding to each row are obtained by cutting the initial two-dimensional bounding box by row;
[0087] For any row in the layer, aggregate the intersecting two-dimensional bounding box blocks in the row to obtain an initial row bounding box corresponding to the row;
[0088] According to the initial row bounding boxes corresponding to each row in the layer, the row branching results corresponding to the layer are determined; wherein the row branching results corresponding to the layer include the initial row bounding boxes corresponding to each row in the layer.
[0089] For example, for any layer, the embodiment of the present disclosure may sequentially execute the following steps to obtain a target two-dimensional bounding box corresponding to the layer:
[0090] 1. Determine the branching accuracy corresponding to the layer, and determine the number of rows corresponding to the layer based on the branching accuracy.
[0091] For example, if the line branching accuracy corresponding to the layer is 5%, and the length range of the layer is 0 to 100, that is, [0,100], then in the disclosed embodiment, the layer corresponds to 20 rows, wherein the length range of the first row corresponding to the layer is [0,5), the length range of the second row is [5,10)... the length range of the 20th row is [95,100], that is, the layer corresponds to 20 rows, and the 20 rows are [0,5) rows, [5,10) rows...[95,100] rows.
[0092] Of course, it should be noted that the branching accuracy proposed in the embodiment of the present disclosure is only an example, and the embodiment of the present disclosure does not limit the specific value of the branching accuracy. For example, the branching accuracy can also include 10%. That is, if the branching accuracy corresponding to the layer is 10%, and the length range of the layer is 0 to 100, that is, [0,100] as an example, then in the embodiment of the present disclosure, the layer corresponds to 10 rows, wherein the length range of the first row corresponding to the layer is [0,10), the length range of the second row is [10,20).... the length range of the tenth row is [90,100], that is, the layer corresponds to 10 rows, and the 10 rows are [0,10) rows, [10,20) rows...[90,100] rows.
[0093] 2. According to the row division accuracy and multiple rows corresponding to the layer, all the initial two-dimensional bounding boxes corresponding to the layer are cut to obtain two-dimensional bounding box blocks corresponding to each row in the multiple rows of the layer.
[0094] like Fig. 7A As shown, if the layer contains an initial two-dimensional bounding box M and an initial two-dimensional bounding box N, then the embodiment of the present disclosure can cut the initial two-dimensional bounding box M and the initial two-dimensional bounding box N respectively according to the multiple rows corresponding to the layer and the row division accuracy to obtain the two-dimensional bounding box block corresponding to the initial two-dimensional bounding box M and the two-dimensional bounding box block corresponding to the initial two-dimensional bounding box N.
[0095] For example, Figure 7B As shown, taking the row division accuracy of 5% and the length range of the layer as 0 to 100, that is, the layer corresponds to 20 rows, and the 20 rows are [0,5) rows, [5,10) rows...[95,100) rows as an example, if the initial two-dimensional bounding box M is divided into rows and cut to obtain a two-dimensional bounding box block M1 and a two-dimensional bounding box block M2, then when the two-dimensional bounding box block M1 is completely in the [5,10) row, the embodiment of the present disclosure can determine the two-dimensional bounding box block M1 as the two-dimensional bounding box block corresponding to the [5,10) row; or, when the two-dimensional bounding box block M2 is completely in the [0,5) row, the embodiment of the present disclosure can determine the two-dimensional bounding box block M2 as the bounding box block of the [0,5) row.
[0096] 3. For any row in the layer, aggregate the intersecting two-dimensional bounding box blocks in the row to obtain the initial row bounding box corresponding to the row;
[0097] like Figure 7B As shown, taking the layer corresponding to 20 rows, and the 20 rows as [0,5) rows, [5,10) rows...[95,100) rows as an example, if the initial two-dimensional bounding box M is cut into rows to obtain two-dimensional bounding box blocks M1 and two-dimensional bounding box blocks M2, and the initial two-dimensional bounding box N is cut into rows to obtain two-dimensional bounding box blocks N1 and two-dimensional bounding box blocks N2, then when the two-dimensional bounding box block M1 and the two-dimensional bounding box block N1 intersect, and the two-dimensional bounding box block M1 and the two-dimensional bounding box block N1 are both completely in the [5,10) row, the embodiment of the present disclosure can merge the two-dimensional bounding box block M1 and the two-dimensional bounding box block N1 to obtain an initial row bounding box corresponding to the [5,10) row.
[0098] 4. Determine the row branching result corresponding to the layer according to the initial row bounding boxes corresponding to each row in the layer; wherein the row branching result includes the initial row bounding boxes corresponding to each row in the layer.
[0099] like Figure 7B As shown, taking the layer corresponding to 20 rows, and the 20 rows being [0,5) rows, [5,10) rows...[95,100) rows as an example, if the embodiment of the present disclosure obtains an initial row bounding box corresponding to the [5,10) row and an initial row bounding box corresponding to the [10,15) row for a certain layer, then the embodiment of the present disclosure can determine that the row branching result of the layer includes an initial row bounding box corresponding to the [5,10) row and an initial row bounding box corresponding to the [10,15) row.
[0100] Step 5: According to the first aggregation requirement, aggregate the branch results corresponding to each layer respectively to determine the target two-dimensional bounding box corresponding to each layer.
[0101] Specifically, for any layer, according to the first aggregation requirement, the row results corresponding to the layer are aggregated to determine the target two-dimensional bounding box corresponding to the layer, including:
[0102] Determine in sequence whether the adjacent to-be-processed row bounding boxes in the layer meet the first aggregation requirement; if the adjacent to-be-processed row bounding boxes meet the first aggregation requirement, aggregate the adjacent to-be-processed row bounding boxes to obtain an aggregated row bounding box, until all the adjacent to-be-processed row bounding boxes do not meet the first aggregation requirement; wherein the to-be-processed row bounding boxes include the initial row bounding box and / or the aggregated row bounding box;
[0103] According to the bounding box of the row to be processed, a target two-dimensional bounding box corresponding to the layer is determined.
[0104] For example, for any layer, when there is an initial row bounding box l1 in the first row corresponding to the layer and an initial row bounding box l2 in the second row, if the initial row bounding box l1 and the initial row bounding box l2 meet the first aggregation requirement, then the embodiment of the present disclosure can aggregate the initial row bounding box l1 and the initial row bounding box l2 to obtain an aggregated row bounding box l1. 2+3 Or, if the aggregate row bounding box l 2+3 The first aggregation requirement is satisfied with an initial row bounding box l3 in the adjacent third row. Then the embodiment of the present disclosure may also aggregate the initial row bounding box l3 and the aggregated row bounding box l 2+3 .
[0105] It should be noted that, for any layer, the embodiment of the present disclosure can determine the target two-dimensional bounding box corresponding to the layer based on the to-be-processed row bounding box corresponding to the layer, that is, the embodiment of the present disclosure can determine the aggregated bounding box and / or the initial row bounding box corresponding to the layer as the target two-dimensional bounding box corresponding to the layer.
[0106] For example, if there is any layer in the grid model, and after the to-be-processed row bounding boxes corresponding to the layer are aggregated according to the first aggregation requirement, that is, after the initial row bounding boxes and / or the aggregated row bounding boxes corresponding to the layer are processed according to the first aggregation requirement, that is, the remaining to-be-processed row bounding boxes corresponding to the layer (that is, the initial row bounding boxes and / or the aggregated row bounding boxes) do not meet the first aggregation requirement, the embodiment of the present disclosure can determine the remaining to-be-processed bounding boxes corresponding to the layer (that is, multiple aggregated row bounding boxes and / or multiple initial row bounding boxes) as the target two-dimensional bounding boxes corresponding to the layer.
[0107] For example, if there is any layer in the grid model proposed in the embodiment of the present disclosure, and after the to-be-processed row bounding box corresponding to the layer is aggregated according to the first aggregation requirement, there are only (i.e., remaining) aggregated row bounding box Q and initial row bounding box R in the layer, if the aggregated row bounding box Q and the initial row bounding box R do not meet the first aggregation requirement, then the embodiment of the present disclosure can determine the aggregated row bounding box Q and the initial row bounding box R as the target two-dimensional bounding box corresponding to the layer.
[0108] Further, in the embodiment of the present disclosure, the first aggregation requirement includes:
[0109] Adjacent bounding boxes of to-be-processed rows overlap; and,
[0110] The length difference between adjacent bounding boxes of the to-be-processed rows is less than or equal to a first threshold.
[0111] That is, in the case where there is an initial line bounding box l1 in the first line corresponding to the layer and an initial line bounding box l2 in the second line, if the initial line bounding box l1 overlaps with the initial line bounding box l2, and the difference between the lengths of the initial line bounding box l1 and the initial line bounding box l2 is less than or equal to the first threshold, then the embodiment of the present disclosure may aggregate the initial line bounding box l1 and the initial line bounding box l2 to obtain an aggregated bounding box l 2+3 Alternatively, if the initial line bounding box l1 and the initial line bounding box l2 do not meet the first aggregation requirement (i.e., the initial line bounding box l1 and the initial line bounding box l2 do not overlap; and / or, the length difference between the initial line bounding box l1 and the initial line bounding box l2 is greater than the first threshold), the initial line bounding box l1 and the initial line bounding box l2 are not aggregated.
[0112] In the embodiment of the present disclosure, the first threshold may include forty percent of the initial line bounding box and / or aggregated line bounding box with a longer length among the adjacent to-be-processed line bounding boxes.
[0113] Of course, it should be noted that the embodiments of the present disclosure are not limited to the specific value of the first threshold. The above is only an example. For example, the first threshold proposed in the embodiments of the present disclosure may also include fifty percent of the longer initial row bounding box and / or aggregate row bounding box in the adjacent row bounding boxes to be processed.
[0114] The above content of the disclosed embodiment briefly introduces how to determine the target two-dimensional bounding box corresponding to each layer.
[0115] Of course, after determining the target two-dimensional bounding box corresponding to each layer, the embodiment of the present disclosure also needs to determine the initial three-dimensional bounding box corresponding to each layer according to the target two-dimensional bounding box corresponding to each layer. That is, for any layer, the embodiment of the present disclosure can also generate the initial three-dimensional bounding box corresponding to the layer according to the target two-dimensional bounding box corresponding to the layer. That is, if the mesh model of the embodiment of the present disclosure is as follows Fig. 8A In the embodiment of the present disclosure, it is also necessary to determine the initial three-dimensional bounding box corresponding to the office chair mesh model according to the two-dimensional bounding boxes corresponding to each of the multiple layers corresponding to the office chair mesh model, wherein the initial three-dimensional bounding box corresponding to the office chair mesh model is as follows: Figure 8B shown.
[0116] Step 6: Based on the second aggregation requirement and the initial three-dimensional bounding boxes corresponding to each layer, determine the target three-dimensional bounding box corresponding to the grid model.
[0117] Specifically, based on the second aggregation requirement and the initial three-dimensional bounding boxes corresponding to each layer, determining the target three-dimensional bounding box corresponding to the grid model includes:
[0118] Determine in sequence whether the intersecting three-dimensional bounding boxes to be processed meet the second aggregation requirement; if the intersecting three-dimensional bounding boxes to be processed meet the second aggregation requirement, aggregate the intersecting initial three-dimensional bounding boxes to obtain an aggregated three-dimensional bounding box, until all the intersecting three-dimensional bounding boxes to be processed do not meet the second aggregation requirement; wherein the bounding boxes to be processed include the initial three-dimensional bounding box and / or the aggregated three-dimensional bounding box;
[0119] According to the three-dimensional bounding box to be processed, a target three-dimensional bounding box is determined.
[0120] In some implementations, the disclosed embodiments may determine whether the intersecting three-dimensional bounding boxes to be processed meet the second aggregation requirement layer by layer from bottom to top according to the height of each layer in the multiple layers corresponding to the grid model.
[0121] For example, for the grid model proposed in the embodiments of the present disclosure, if there are intersecting initial three-dimensional bounding boxes in the first layer (i.e., the [0,5) layer) and the second layer (i.e., the [5,10) layer) corresponding to the grid model; and there are intersecting initial three-dimensional bounding boxes in the third layer (i.e., the [10,15) layer) and the fourth layer (i.e., the [15,20) layer) corresponding to the grid model, then the embodiments of the present disclosure can first determine whether the intersecting initial three-dimensional bounding boxes in the first layer (i.e., the [0,5) layer) and the second layer (i.e., the [5,10) layer) corresponding to the grid model meet the second aggregation requirement, and then determine whether the intersecting initial three-dimensional bounding boxes in the third layer (i.e., the [10,15) layer) and the fourth layer (i.e., the [15,20) layer) corresponding to the grid model meet the second aggregation requirement.
[0122] In one example, for the grid model proposed in an embodiment of the present disclosure, when there is an initial three-dimensional bounding box P in the first layer corresponding to the grid model, and an initial three-dimensional bounding box Q in the second layer, and the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q intersect, if the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q meet the second aggregation requirement, the embodiment of the present disclosure can aggregate the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q to obtain the aggregated three-dimensional bounding box PQ. Alternatively, for the grid model proposed in the embodiment of the present disclosure, when there is an initial three-dimensional bounding box R in the third layer corresponding to the grid model, and the aggregated three-dimensional bounding box PQ intersects with the initial three-dimensional bounding box R, if the aggregated three-dimensional bounding box PQ and the initial three-dimensional bounding box R meet the first aggregation requirement, the embodiment of the present disclosure can aggregate the aggregated three-dimensional bounding box PQ and the initial three-dimensional bounding box R; alternatively, although there is an initial three-dimensional bounding box P in the first layer corresponding to the grid model and an initial three-dimensional bounding box Q in the second layer, the intersection of the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q does not meet the second aggregation requirement, and the embodiment of the present disclosure does not need to aggregate the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q.
[0123] Of course, it should be noted that the embodiment of the present disclosure is not limited to judging whether the intersecting three-dimensional bounding boxes to be processed meet the second aggregation requirement layer by layer from bottom to top, and the above is only an example. For example, the embodiment of the present disclosure can also judge whether the intersecting three-dimensional bounding boxes to be processed meet the second aggregation requirement layer by layer from top to bottom.
[0124] It should be noted that the embodiments of the present disclosure can determine the target three-dimensional bounding box corresponding to the layer based on the initial three-dimensional bounding boxes corresponding to the grid model (that is, the initial three-dimensional bounding box corresponding to each layer in the multiple layers corresponding to the grid model). That is, the embodiments of the present disclosure can determine the aggregated three-dimensional bounding box and / or the initial three-dimensional bounding box corresponding to the grid model as the target three-dimensional bounding box corresponding to the layer.
[0125] For example, if the mesh model proposed in the embodiment of the present disclosure is aggregated based on the second aggregation requirement (that is, all remaining three-dimensional bounding boxes to be processed corresponding to the mesh model do not meet the second aggregation requirement), the embodiment of the present disclosure can determine the multiple remaining three-dimensional bounding boxes to be processed corresponding to the mesh model (that is, the multiple remaining aggregated three-dimensional bounding boxes and / or the multiple remaining initial three-dimensional bounding boxes corresponding to the mesh model) as the target three-dimensional bounding box corresponding to the mesh model.
[0126] For example, if after the mesh model proposed in the embodiment of the present disclosure is aggregated based on the second aggregation requirement, the three-dimensional bounding box to be processed corresponding to the mesh model proposed in the embodiment of the present disclosure includes the aggregated three-dimensional bounding box U and the initial three-dimensional bounding box V, and the aggregated three-dimensional bounding box U and the initial three-dimensional bounding box V do not meet the second aggregation requirement, then the embodiment of the present disclosure can determine the aggregated three-dimensional bounding box U and the initial three-dimensional bounding box V as the target three-dimensional bounding box corresponding to the mesh model.
[0127] In the disclosed embodiment, the intersecting three-dimensional bounding boxes to be processed are in different layers;
[0128] The second aggregation requirement includes at least one of the following:
[0129] The height of the to-be-processed three-dimensional bounding box in the upper layer is less than the preset height, and the ratio of the first area to the second area is greater than or equal to the second threshold;
[0130] The ratio of the first area to the second area is greater than or equal to a third threshold, and the ratio of the third area to the second area is greater than or equal to a fourth threshold; wherein,
[0131] The first area is the overlapping area of the three-dimensional bounding box to be processed in the upper layer and the three-dimensional bounding box to be processed in the lower layer; the second area is the bottom area of the three-dimensional bounding box to be processed in the upper layer;
[0132] The third area is the bottom area of the aggregated three-dimensional bounding box obtained by aggregating the intersecting three-dimensional bounding boxes to be processed.
[0133] For example, for the grid model proposed in the embodiment of the present disclosure, if there is an initial three-dimensional bounding box P in the first layer corresponding to the grid model, and there is an initial three-dimensional bounding box Q in the second layer, and the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q intersect, then the embodiment of the present disclosure can determine that the first area is the overlapping area of the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q; the second area is the bottom area of the initial three-dimensional bounding box Q; and the third area is the bottom area of the aggregated three-dimensional bounding box PQ obtained by aggregating the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q. Then, if the height of the initial three-dimensional bounding box P is less than the preset height, and the ratio of the first area (i.e., the overlapping area of the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q) to the second area (i.e., the bottom area of the initial three-dimensional bounding box P) is greater than or equal to the second threshold, the embodiment of the present disclosure can aggregate the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q to obtain an aggregated three-dimensional bounding box PQ.
[0134] In one example, the preset height proposed in the embodiment of the present disclosure may include thirty percent of the layer height; the second threshold may include 0.8.
[0135] Of course, it should be noted that the embodiments of the present disclosure do not limit the specific values of the preset height and the second threshold. The above are only examples. For example, the preset height proposed in the embodiments of the present disclosure may also include fifty percent of the layer height, and the second threshold may also include 0.85, etc.
[0136] Alternatively, for the grid model proposed in the embodiment of the present disclosure, if there is an initial three-dimensional bounding box P in the first layer corresponding to the grid model, and an initial three-dimensional bounding box Q in the second layer, that is, the first area is the overlapping area of the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q, the second area is the bottom area of the initial three-dimensional bounding box Q, and the third area is the bottom area of the aggregated three-dimensional bounding box PQ obtained by aggregating the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q as an example, then when the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q intersect, and the third area (that is, the bottom area of the aggregated three-dimensional bounding box PQ) and the second area (that is, the bottom area of the initial three-dimensional bounding box P) are greater than or equal to the fourth threshold, the embodiment of the present disclosure can aggregate the initial three-dimensional bounding box P and the initial three-dimensional bounding box Q to obtain the aggregated three-dimensional bounding box PQ.
[0137] In one example, the third threshold proposed in the embodiment of the present disclosure may include 0.4; the fourth threshold may include 0.4.
[0138] Of course, it should be noted that the embodiment of the present disclosure does not limit the specific values of the third threshold and the fourth threshold. The above is only an example. For example, the third threshold proposed in the embodiment of the present disclosure may also include 0.6, and the fourth threshold may also include 0.5, etc.
[0139] Afterwards, the embodiment of the present disclosure may determine a target three-dimensional bounding box based on the aggregated three-dimensional bounding box and the initial three-dimensional bounding box.
[0140] In some implementations, if the grid model proposed in the embodiments of the present disclosure is Fig. 8A As shown, the target three-dimensional bounding box obtained based on the embodiment of the present disclosure can be as follows Figure 8C As shown, the target three-dimensional bounding box may include the minimum three-dimensional bounding box corresponding to the grid model.
[0141] The embodiment of the present application effectively solves the problem of insufficient precision of the traditional overall bounding box by generating a set of three-dimensional bounding boxes that closely fit the grid model. While improving the accuracy of application scenarios such as collision detection, the embodiment of the present application can also improve the computing efficiency by optimizing the number of three-dimensional bounding boxes, so that the number of generated target three-dimensional bounding boxes is within an acceptable range, reducing the required computing resources.
[0142] The disclosed embodiment also provides a device for generating a target three-dimensional bounding box. Fig. 9is a schematic structural diagram of a device 900 for generating a target three-dimensional bounding box according to an embodiment of the present disclosure, comprising:
[0143] A first determination module 910 is used to determine a plurality of layers corresponding to a mesh model; the mesh model includes a plurality of first mesh patches;
[0144] A second determination module 920 is used to determine, based on the first mesh patch, a second mesh patch corresponding to each layer in the plurality of layers; wherein the second mesh patch includes the first mesh patch and / or a mesh patch obtained by layered cutting of the first mesh patch;
[0145] A third determination module 930 determines the initial two-dimensional bounding box corresponding to each layer according to the second mesh surface corresponding to each layer;
[0146] The fourth determination module 940 is used to perform branch processing on the initial two-dimensional bounding boxes corresponding to each layer to determine the branch results corresponding to each layer; according to the first aggregation requirement, perform aggregation processing on the branch results corresponding to each layer to determine the target two-dimensional bounding boxes corresponding to each layer; and determine the initial three-dimensional bounding boxes corresponding to each layer according to the target two-dimensional bounding boxes corresponding to each layer;
[0147] The fifth determination module 950 is used to determine a target three-dimensional bounding box corresponding to the mesh model based on the second aggregation requirement and the initial three-dimensional bounding boxes corresponding to each layer.
[0148] In some implementations, the second determining module 920 is configured to:
[0149] When all vertices of the first mesh patch are in the layer, the first mesh patch is determined as the second mesh patch corresponding to the layer; and / or,
[0150] When some vertices of the first mesh face are in the layer, the first mesh face is cut in layers to obtain a second mesh face corresponding to the layer; wherein all vertices of the second mesh face are in the layer.
[0151] In some implementations, the third determination module 930 is configured to:
[0152] Projecting the second mesh patch onto the bottom plane of the layer to obtain a projection result;
[0153] According to the projection result, an initial two-dimensional bounding box corresponding to the layer is determined.
[0154] In some implementations, the fourth determining module 940 is configured to:
[0155] Determine the row division accuracy corresponding to the layer, and determine multiple rows corresponding to the layer and two-dimensional bounding box blocks corresponding to each row in the multiple rows according to the row division accuracy; wherein the two-dimensional bounding box blocks corresponding to each row are obtained by cutting the initial two-dimensional bounding box by row;
[0156] For any row in the layer, aggregate the intersecting two-dimensional bounding box blocks in the row to obtain an initial row bounding box corresponding to the row;
[0157] According to the initial row bounding boxes corresponding to each row in the layer, the row branching results corresponding to the layer are determined; wherein the row branching results corresponding to the layer include the initial row bounding boxes corresponding to each row in the layer.
[0158] In some implementations, the fourth determining module 940 is configured to:
[0159] Determine in sequence whether the adjacent to-be-processed row bounding boxes in the layer meet the first aggregation requirement; if the adjacent to-be-processed row bounding boxes meet the first aggregation requirement, aggregate the adjacent to-be-processed row bounding boxes to obtain an aggregated row bounding box, until all the adjacent to-be-processed row bounding boxes do not meet the first aggregation requirement; wherein the to-be-processed row bounding boxes include the initial row bounding box and / or the aggregated row bounding box;
[0160] According to the bounding box of the row to be processed, a target two-dimensional bounding box corresponding to the layer is determined.
[0161] In some embodiments, the first aggregation requirement includes:
[0162] Adjacent bounding boxes of to-be-processed rows overlap; and,
[0163] The length difference between adjacent to-be-processed row bounding boxes is less than or equal to a first threshold.
[0164] In some implementations, the fifth determining module 950 is configured to:
[0165] Determine in sequence whether the intersecting three-dimensional bounding boxes to be processed meet the second aggregation requirement; if the intersecting three-dimensional bounding boxes to be processed meet the second aggregation requirement, aggregate the intersecting initial three-dimensional bounding boxes to obtain an aggregated three-dimensional bounding box, until all the intersecting three-dimensional bounding boxes to be processed do not meet the second aggregation requirement; wherein the bounding boxes to be processed include the initial three-dimensional bounding box and / or the aggregated three-dimensional bounding box;
[0166] According to the three-dimensional bounding box to be processed, a target three-dimensional bounding box is determined.
[0167] In some implementations, the intersecting three-dimensional bounding boxes to be processed are in different layers;
[0168] The second aggregation requirement includes at least one of the following:
[0169] The height of the to-be-processed three-dimensional bounding box in the upper layer is less than the preset height, and the ratio of the first area to the second area is greater than or equal to the second threshold;
[0170] The ratio of the first area to the second area is greater than or equal to a third threshold, and the ratio of the third area to the second area is greater than or equal to a fourth threshold; wherein,
[0171] The first area is the overlapping area of the three-dimensional bounding box to be processed in the upper layer and the three-dimensional bounding box to be processed in the lower layer; the second area is the bottom area of the three-dimensional bounding box to be processed in the upper layer;
[0172] The third area is the bottom area of the aggregated three-dimensional bounding box obtained by aggregating the intersecting three-dimensional bounding boxes to be processed.
[0173] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0174] In the technical solution disclosed in the present invention, the acquisition, storage and application of user personal test results involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0175] Fig.10 FIG. 1 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. Fig.10 As shown, the electronic device includes: a memory 1010 and a processor 1020, and the memory 1010 stores a computer program that can be run on the processor 1020. The number of memories 1010 and processors 1020 can be one or more. The memory 1010 can store one or more computer programs. When the one or more computer programs are executed by the electronic device, the electronic device executes the method provided by the above method embodiment. The electronic device may also include: a communication interface 1030, which is used to communicate with external devices and perform data exchange transmission.
[0176] If the memory 1010, the processor 1020 and the communication interface 1030 are implemented independently, the memory 1010, the processor 1020 and the communication interface 1030 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0177] Optionally, in a specific implementation, if the memory 1010, the processor 1020 and the communication interface 1030 are integrated on a chip, the memory 1010, the processor 1020 and the communication interface 1030 can communicate with each other through an internal interface.
[0178] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the Advanced RISC Machines (ARM) architecture.
[0179] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).
[0180] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the process or function according to the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (for example: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (for example: infrared, Bluetooth, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by the computer, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc. It is worth noting that the computer-readable storage medium mentioned in the present disclosure may be a non-volatile storage medium, in other words, a non-transient storage medium.
[0181] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0182] In the description of the embodiments of the present disclosure, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0183] In the description of the embodiments of the present disclosure, unless otherwise specified, " / " means or, for example, A / B can mean A or B. "And / or" in this article is only a way to describe 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.
[0184] In the description of the embodiments of the present disclosure, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "plurality" means two or more.
[0185] The above are merely exemplary embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for generating a target three-dimensional bounding box, include: Determine multiple layers corresponding to the grid model; The mesh model includes a plurality of first mesh patches; Determine, according to the first mesh patch, a second mesh patch corresponding to each of the plurality of layers; wherein the second mesh patch includes the first mesh patch and / or a mesh patch obtained by layered cutting of the first mesh patch; Determine the initial two-dimensional bounding boxes corresponding to the respective layers according to the second mesh patches corresponding to the respective layers; Performing branch processing on the initial two-dimensional bounding boxes corresponding to each of the layers respectively to determine the branch results corresponding to each of the layers; performing aggregation processing on the branch results corresponding to each of the layers respectively according to the first aggregation requirement to determine the target two-dimensional bounding boxes corresponding to each of the layers; determining the initial three-dimensional bounding boxes corresponding to each of the layers respectively according to the target two-dimensional bounding boxes corresponding to each of the layers; Based on the second aggregation requirement and the initial three-dimensional bounding boxes corresponding to the respective layers, a target three-dimensional bounding box corresponding to the mesh model is determined.
2. The method according to claim 1, in, For any layer, determining a second mesh surface corresponding to the layer according to the first mesh surface includes: In a case where all vertices of the first mesh patch are in the layer, determining the first mesh patch as a second mesh patch corresponding to the layer; and / or, In the case where some vertices of the first mesh surface are in the layer, the first mesh surface is cut in layers to obtain a second mesh surface corresponding to the layer; wherein all vertices of the second mesh surface are in the layer.
3. The method according to claim 1 or 2, in, For any layer, determining an initial two-dimensional bounding box corresponding to the layer according to the second mesh surface corresponding to the layer includes: Projecting the second mesh surface onto the bottom plane of the layer to obtain a projection result; An initial two-dimensional bounding box corresponding to the layer is determined according to the projection result.
4. The method according to claim 3, in, For any layer, the initial two-dimensional bounding box corresponding to the layer is processed by row division to determine the row division result corresponding to the layer, including: Determine the row division accuracy corresponding to the layer, and determine multiple rows corresponding to the layer and two-dimensional bounding box blocks corresponding to each row in the multiple rows according to the row division accuracy; wherein the two-dimensional bounding box blocks corresponding to each row are obtained by cutting the initial two-dimensional bounding box by row; For any row in the layer, aggregating intersecting two-dimensional bounding box blocks in the row to obtain an initial row bounding box corresponding to the row; According to the initial row bounding boxes corresponding to the rows in the layer, the row branching results corresponding to the layer are determined; wherein the row branching results corresponding to the layer include the initial row bounding boxes corresponding to the rows in the layer.
5. The method according to claim 4, in, For any layer, according to the first aggregation requirement, aggregation processing is performed on the branch results corresponding to the layer to determine the target two-dimensional bounding box corresponding to the layer, including: Determine in sequence whether the adjacent to-be-processed row bounding boxes in the layer meet the first aggregation requirement; if the adjacent to-be-processed row bounding boxes meet the first aggregation requirement, aggregate the adjacent to-be-processed row bounding boxes to obtain an aggregated row bounding box, until all the adjacent to-be-processed row bounding boxes do not meet the first aggregation requirement; wherein the to-be-processed row bounding boxes include the initial row bounding box and / or the aggregated row bounding box; According to the to-be-processed row bounding box, a target two-dimensional bounding box corresponding to the layer is determined.
6. The method according to claim 5, in, The first aggregation requirements include: The adjacent bounding boxes of the to-be-processed rows overlap; and, The length difference between the adjacent to-be-processed row bounding boxes is less than or equal to a first threshold.
7. The method according to claim 5, in, The determining, based on the second aggregation requirement and the initial three-dimensional bounding boxes corresponding to the respective layers, a target three-dimensional bounding box corresponding to the grid model comprises: Determine in sequence whether the intersecting three-dimensional bounding boxes to be processed meet the second aggregation requirement; if the intersecting three-dimensional bounding boxes to be processed meet the second aggregation requirement, aggregate the intersecting initial three-dimensional bounding boxes to obtain an aggregated three-dimensional bounding box, until all the intersecting three-dimensional bounding boxes to be processed do not meet the second aggregation requirement; wherein the bounding boxes to be processed include the initial three-dimensional bounding box and / or the aggregated three-dimensional bounding box; The target three-dimensional bounding box is determined according to the three-dimensional bounding box to be processed.
8. The method according to claim 7, in, The intersecting three-dimensional bounding boxes to be processed are in different layers; The second polymerization requirement includes at least one of the following: The height of the to-be-processed three-dimensional bounding box in the upper layer is less than the preset height, and the ratio of the first area to the second area is greater than or equal to the second threshold; The ratio of the first area to the second area is greater than or equal to a third threshold, and the ratio of the third area to the second area is greater than or equal to a fourth threshold; wherein, The first area is the overlapping area of the three-dimensional bounding box to be processed in the upper layer and the three-dimensional bounding box to be processed in the lower layer; The second area is the bottom area of the three-dimensional bounding box to be processed in the upper layer; The third area is the bottom area of the aggregated three-dimensional bounding box obtained by aggregating the intersecting three-dimensional bounding boxes to be processed.
9. A device for generating a target three-dimensional bounding box, include: A first determination module is used to determine a plurality of layers corresponding to the grid model; The mesh model includes a plurality of first mesh patches; A second determining module is used to determine, based on the first mesh patch, a second mesh patch corresponding to each of the multiple layers; wherein the second mesh patch includes the first mesh patch and / or a mesh patch obtained by layered cutting of the first mesh patch; A third determining module determines, according to the second mesh patches corresponding to the respective layers, the initial two-dimensional bounding boxes corresponding to the respective layers; The fourth determination module is used to perform branch processing on the initial two-dimensional bounding boxes corresponding to each of the layers to determine the branch results corresponding to each of the layers; according to the first aggregation requirement, the branch results corresponding to each of the layers are aggregated to determine the target two-dimensional bounding boxes corresponding to each of the layers; and according to the target two-dimensional bounding boxes corresponding to each of the layers, the initial three-dimensional bounding boxes corresponding to each of the layers are determined; The fifth determination module is used to determine the target three-dimensional bounding box corresponding to the grid model based on the second aggregation requirement and the initial three-dimensional bounding boxes corresponding to each of the layers.
10. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.
12. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.
