Point cloud-based model rendering method, device and computer readable storage medium
By adjusting the rendering area of point cloud points to adapt to differences in point cloud density, the problem of excessive holes in point cloud rendering was solved, resulting in better rendering effects.
Patent Information
- Application Number
- CN202410978427.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-07-19
AI Technical Summary
Existing point cloud-based model rendering technologies suffer from numerous holes and poor rendering quality, primarily because the fixed size of point cloud points fails to adapt to density differences at different distances.
By responding to the movement to the current point in the preset 3D model, a point cloud set is obtained, and the initial rendering area of the point cloud points is adjusted according to the point cloud density to form a target set. Finally, the local model is rendered based on the target set. The adjustment process includes determining the block density of the point cloud blocks and the rendering area of the point cloud points.
It reduces holes in the rendering model, improves the rendering effect, and makes the rendering model more in line with the human eye's visual perception, with objects appearing larger when closer and smaller when farther away.
Smart Images

Figure CN118898673B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of model rendering, and particularly to a model rendering method and device based on point cloud and a computer readable storage medium. BACKGROUND
[0002] In model rendering, rendering is usually implemented based on point cloud, for example, rendering is implemented based on a laser radar point cloud, wherein the point cloud collected by the laser radar only has information such as position, color, and normal, and because of the characteristics of the laser, the farther the collected object is, the lower the collection density is when the same collection position is fixed. Therefore, when rendering a large-scale point cloud, the size of the rendered point cloud needs to be set; in the prior art, a fixed size is usually set for the point cloud, and the model rendering in this way usually has the problem of more holes, and the rendering effect is poor. SUMMARY
[0003] To solve the above technical problems, the present disclosure is proposed. Embodiments of the present disclosure provide a model rendering method and device based on point cloud and a computer readable storage medium.
[0004] According to an aspect of an embodiment of the present disclosure, a model rendering method based on point cloud is provided, characterized in that comprising:
[0005] In response to moving to a current point in a preset three-dimensional model, a point cloud set corresponding to the current point is obtained; the point cloud set comprises a plurality of point cloud points;
[0006] According to the point cloud density corresponding to the plurality of point cloud points in the point cloud set, the initial rendering area of at least one point cloud point in the point cloud set is adjusted to obtain a target set;
[0007] Based on the target set, a local model corresponding to the current point in the preset three-dimensional model is rendered to obtain a local rendering model.
[0008] Optionally, the adjusting the initial rendering area of at least one point cloud point in the point cloud set according to the point cloud density corresponding to the plurality of point cloud points in the point cloud set to obtain a target set comprises:
[0009] Determine a point cloud block corresponding to at least one point cloud point in the plurality of point cloud points; each point cloud block comprises at least one point cloud point;
[0010] Determine the point cloud density corresponding to the point cloud point according to the block density corresponding to the point cloud block; the block density represents the sparsity of the point cloud point in the point cloud block;
[0011] Adjust the initial rendering area of at least one point cloud point in the point cloud set according to the point cloud density to obtain a target set.
[0012] Optionally, the determining the point cloud density corresponding to the point cloud block comprises:
[0013] determining the block density corresponding to the point cloud block;
[0014] determining the point cloud density of all point cloud points corresponding to the point cloud block based on the block density.
[0015] Optionally, the determining the block density corresponding to the point cloud block comprises:
[0016] determining a first density corresponding to the point cloud block according to the number of point cloud points included in the point cloud block and the volume of the bounding box corresponding to the point cloud block;
[0017] performing normalization on the first density corresponding to at least one point cloud block included in the preset three-dimensional model to obtain the block density corresponding to at least one point cloud block.
[0018] Optionally, before the adjusting the initial rendering area of at least one point cloud point in the point cloud set according to the point cloud density corresponding to a plurality of point cloud points in the point cloud set to obtain a target set, further comprising:
[0019] performing a first adjustment on the initial rendering area of at least one point cloud point included in the point cloud set to obtain a first set; each point cloud point in the first set corresponds to a first rendering area;
[0020] The adjusting the initial rendering area of at least one point cloud point in the point cloud set according to the point cloud density corresponding to a plurality of point cloud points in the point cloud set to obtain a target set comprises:
[0021] adjusting the first rendering area of at least one point cloud point in the first set according to the point cloud density corresponding to a plurality of point cloud points in the point cloud set to obtain a target set.
[0022] Optionally, the performing a first adjustment on the initial rendering area of at least one point cloud point included in the point cloud set to obtain a first set comprises:
[0023] determining distance information of the point cloud point and the current point position according to the position information corresponding to the point cloud point;
[0024] adjusting the initial rendering area according to the distance information, a preset scaling ratio and a preset rendering area to determine a first rendering area corresponding to the point cloud point;
[0025] determining the first set based on at least one point cloud point corresponding to the first rendering area.
[0026] Optionally, the obtaining the point cloud set corresponding to the current point comprises:
[0027] According to the position information corresponding to the current point, at least one point cloud block corresponding to the current point is determined.
[0028] According to the path of the at least one point cloud block, the point cloud set corresponding to the current point is obtained.
[0029] Optionally, the obtaining the point cloud set corresponding to the current point comprises:
[0030] According to the tile set corresponding to the preset three-dimensional model, the paths of the plurality of point cloud blocks backtracking to the root node point cloud block are determined; the tile set comprises a multi-level tree structure composed of a root node point cloud block and a plurality of child node point cloud blocks.
[0031] According to the path, the point cloud points corresponding to the plurality of point cloud blocks included in at least one path are determined, and the point cloud set corresponding to the current point is determined.
[0032] According to another aspect of the embodiments of the present disclosure, a point cloud-based model rendering device is provided, characterized by comprising:
[0033] A point cloud obtaining module is configured to, in response to moving to a current point in a preset three-dimensional model, obtain a point cloud set corresponding to the current point; the point cloud set comprises a plurality of point cloud points.
[0034] A point cloud adjusting module is configured to, according to the point cloud density corresponding to the plurality of point cloud points in the point cloud set, adjust the initial rendering area of at least one point cloud point in the point cloud set to obtain a target set.
[0035] A model rendering module is configured to, based on the target set, render a local model corresponding to the current point in the preset three-dimensional model to obtain a local rendering model.
[0036] Optionally, the point cloud adjusting module comprises:
[0037] A point cloud block unit is configured to determine a point cloud block corresponding to at least one point cloud point in the plurality of point cloud points; each point cloud block comprises at least one point cloud point.
[0038] A density determining unit is configured to determine the point cloud density corresponding to the point cloud point according to the block density corresponding to the point cloud block; the block density represents the sparsity of the point cloud point in the point cloud block.
[0039] An area adjusting unit is configured to adjust an initial rendering area of at least one point cloud point in the point cloud set according to the point cloud density, to obtain a target set.
[0040] Optionally, the density determining unit is specifically configured to determine a block density corresponding to the point cloud block; and determine the point cloud density of all point cloud points corresponding to the point cloud block based on the block density.
[0041] Optionally, when determining the block density corresponding to the point cloud block, the density determining unit is configured to determine a first density corresponding to the point cloud block according to a number of point cloud points included in the point cloud block and a volume of a bounding box corresponding to the point cloud block; and perform normalization on the first density corresponding to at least one point cloud block included in the preset three-dimensional model, to obtain the block density corresponding to the at least one point cloud block.
[0042] Optionally, the device further comprises:
[0043] An initial adjusting module is configured to perform a first adjustment on an initial rendering area of at least one point cloud point included in the point cloud set, to obtain a first set; each point cloud point in the first set corresponds to a first rendering area;
[0044] The point cloud adjusting module is specifically configured to adjust the first rendering area of at least one point cloud point in the first set according to a point cloud density corresponding to a plurality of point cloud points in the point cloud set, to obtain a target set.
[0045] Optionally, the initial adjusting module is specifically configured to determine distance information between the point cloud point and the current point position according to position information corresponding to the point cloud point; adjust the initial rendering area according to the distance information, a preset scaling ratio and a preset rendering area, to determine a first rendering area corresponding to the point cloud point; and determine the first set based on at least one point cloud point corresponding to the first rendering area.
[0046] Optionally, the point cloud obtaining module comprises:
[0047] A block determining unit is configured to determine at least one point cloud block corresponding to the current point position according to position information corresponding to the current point position.
[0048] A path determining unit is configured to obtain a point cloud set corresponding to the current point position according to a path of the at least one point cloud block.
[0049] Optionally, the path determining unit is specifically configured to determine, according to a tile set corresponding to the preset three-dimensional model, paths of the plurality of point cloud blocks backtracking to a root node point cloud block; the tile set includes a multi-level tree structure formed by a root node point cloud block and a plurality of child node point cloud blocks; and according to the paths, point cloud points corresponding to a plurality of point cloud blocks included in at least one of the paths are determined to determine the point cloud set corresponding to the current point position.
[0050] According to still another aspect of the embodiments of the present disclosure, an electronic device is provided, comprising:
[0051] a memory configured to store a computer program product;
[0052] a processor configured to execute the computer program product stored in the memory, and when the computer program product is executed, implement the point cloud-based model rendering method in any of the above embodiments.
[0053] According to still another aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, implement the point cloud-based model rendering method in any of the above embodiments.
[0054] According to still another aspect of the embodiments of the present disclosure, a computer program product is provided, comprising computer program instructions, and when the computer program instructions are executed by a processor, implement the point cloud-based model rendering method in any of the above embodiments.
[0055] According to the point cloud-based model rendering method, device and computer readable storage medium provided by the above embodiments of the present disclosure, in response to moving to a current point position in a preset three-dimensional model, a point cloud set corresponding to the current point position is obtained; the point cloud set includes a plurality of point cloud points; according to point cloud densities corresponding to the plurality of point cloud points in the point cloud set, an initial rendering area of at least one point cloud point in the point cloud set is adjusted to obtain a target set; and based on the target set, a local model corresponding to the current point position in the preset three-dimensional model is rendered to obtain a local rendering model. In this embodiment, the rendering area of the point cloud point is adjusted according to the point cloud density, and the local model corresponding to the current point position is rendered based on the target set composed of the point cloud points with the adjusted rendering area, so that the obtained local rendering model has less holes and better rendering effect.
[0056] The technical solutions of the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0057] The accompanying drawings, which form a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0058] This disclosure will become clearer with reference to the accompanying drawings and the following detailed description, wherein:
[0059] Figure 1 This is an exemplary diagram illustrating the effect of rendering a model using existing technology.
[0060] Figure 2 This is a schematic flowchart of a point cloud-based model rendering method provided in an exemplary embodiment of this disclosure;
[0061] Figure 3 This is a public announcement Figure 1 A flowchart illustrating step 202 in the illustrated embodiment;
[0062] Figure 4 This is a schematic diagram of the visual structure of a 3D tile in an optional example;
[0063] Figure 5 This is a public announcement Figure 1 A flowchart illustrating step 204 in the illustrated embodiment;
[0064] Figure 6 This is a schematic flowchart of a point cloud-based model rendering method provided in another exemplary embodiment of this disclosure;
[0065] Figure 7 This is a schematic diagram illustrating the rendering effect of a point cloud-based model rendering method provided through an exemplary embodiment of the present disclosure;
[0066] Figure 8 This is a schematic diagram of the structure of a point cloud-based model rendering apparatus provided in an exemplary embodiment of this disclosure;
[0067] Figure 9 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0068] Hereinafter, exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present disclosure, and not all embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described herein.
[0069] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0070] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of this disclosure are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.
[0071] It should also be understood that, in the embodiments of the present disclosure, “multiple” can refer to two or more, and “at least one” can refer to one, two or more.
[0072] It should also be understood that, for any component, data or structure mentioned in the embodiments of the present disclosure, one or more can be generally understood without explicit limitation or in the context of the preceding and following.
[0073] In addition, the term “and / or” in the present disclosure is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. In addition, the character “ / ” in the present disclosure generally represents an “or” relationship between the front and rear associated objects. The data referred to in the present disclosure can include unstructured data such as text, images, and videos, and can also be structured data.
[0074] It should also be understood that the description of the embodiments of the present disclosure focuses on the differences between the embodiments, and the same or similar parts can be referred to each other, and for the sake of brevity, will not be repeated.
[0075] At the same time, it should be understood that, for the convenience of description, the size of each part shown in the drawings is not drawn according to the actual proportional relationship.
[0076] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application or uses.
[0077] Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail, but should be considered part of the specification where appropriate.
[0078] It should be noted that: similar signs and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0079] The embodiments of the present disclosure can be applied to terminal devices, computer systems, servers and other electronic devices, which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with terminal devices, computer systems, servers and other electronic devices include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, mainframe computer systems and distributed cloud computing technology environments including any of the above systems, etc.
[0080] Electronic devices such as terminal devices, computer systems, servers, and the like can be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules can include routines, programs, objects, components, logic, data structures, and the like that perform particular tasks or implement particular abstract data types. Computer systems / server can be practiced in distributed cloud computing environments with other computer systems coupled via communication networks. The program modules can be stored in the local or remote computer system memory devices including memory storage devices.
[0081] SUMMARY
[0082] In the process of implementing the present disclosure, the inventors found that in model rendering, for example, using webgl, it is necessary to set the gl_PointSize attribute, but how to set the size of the point cloud point (i.e., the rendering area) is a problem. The existing solution usually sets the point cloud point to a fixed size uniformly, but since there is no perspective relationship when webgl renders the point, that is, there is no "near large and far small", so the same piece of point cloud will become very sparse if placed in the near place, and relatively dense if placed in the far place. For example, as shown in Figure 1 , it can be seen that the closer to the user point, the sparser the point cloud point, but in fact, the point cloud density in the far place and the near place is almost the same. Based on the above problem, the present disclosure provides a technical solution for dynamically adjusting the size of the point cloud point.
[0083] Exemplary Method
[0084] Figure 2 is a flowchart of a point cloud-based model rendering method provided by an exemplary embodiment of the present disclosure. The present embodiment can be applied on an electronic device, as shown in Figure 2 , including the following steps:
[0085] Step 202, in response to moving to the current point in the preset three-dimensional model, obtaining a point cloud set corresponding to the current point.
[0086] Among them, the point cloud set includes a plurality of point cloud points.
[0087] In this embodiment, the preset three-dimensional model can be a model of any known structure. By switching different point positions, dynamic browsing of the preset three-dimensional model is realized. The current point position can be any position in the preset three-dimensional model. The preset three-dimensional model has a corresponding model point cloud set. The model point cloud set can be collected based on a radar (for example, a laser radar) when the preset three-dimensional model is obtained. Each point cloud point has information such as color, three-dimensional coordinates, and a normal line. In this embodiment, the point cloud set is a set of point cloud points corresponding to the current point position obtained from the model point cloud set corresponding to the preset three-dimensional model.
[0088] In step 204, the initial rendering area of at least one point cloud point in the point cloud set is adjusted according to the point cloud density corresponding to the plurality of point cloud points in the point cloud set, to obtain a target set.
[0089] In an embodiment, the point cloud density is the sparsity of the point cloud point in space. For example, the point cloud density is obtained by dividing the number of point cloud points included in a point cloud bounding box by the volume corresponding to the point cloud bounding box. The point cloud bounding box can be determined by spatially segmenting the preset three-dimensional model. The rendering area of the point cloud point is adjusted by the point cloud density. For example, the rendering area of the sparse point cloud point is made larger, and the rendering area of the dense point cloud point is made smaller, to reduce the gap between the rendered point cloud points.
[0090] In step 206, a local model corresponding to the current point position in the preset three-dimensional model is rendered based on the target set, to obtain a local rendering model.
[0091] In this embodiment, the rendering area of all point cloud points included in the target set is the adjusted rendering area. The local rendering model obtained by rendering the local model based on the target set has reduced rendering holes due to the adjusted rendering area of the point cloud points, and has a better rendering effect.
[0092] The point cloud-based model rendering method provided by the above embodiments of the present disclosure responds to movement to a current point position in a preset three-dimensional model, obtains a point cloud set corresponding to the current point position. The point cloud set includes a plurality of point cloud points. The initial rendering area of at least one point cloud point in the point cloud set is adjusted according to the point cloud density corresponding to the plurality of point cloud points in the point cloud set, to obtain a target set. A local model corresponding to the current point position in the preset three-dimensional model is rendered based on the target set, to obtain a local rendering model. In this embodiment, the rendering area of the point cloud point is adjusted according to the point cloud density, and the target set composed of point cloud points with adjusted rendering area is used to render the local model corresponding to the current point position, so that the local rendering model obtained has reduced holes and has a better rendering effect.
[0093] As Figure 3As shown in the above Figure 2 Based on the embodiments shown, step 202 can include the following steps:
[0094] Step 2021, according to the position information corresponding to the current point, determine at least one point cloud block corresponding to the current point.
[0095] In this embodiment, the point cloud block can be obtained by performing at least one spatial thinning on the point cloud, for example, using a 3D tile (3D Tiles) extraction method to obtain a point cloud block, and each 3D tile is taken as a point cloud block, at this time the point cloud block includes point cloud blocks of different levels. Wherein, 3D Tiles is a data format developed for three-dimensional geographic space data, such as photogrammetry, three-dimensional buildings, BIM / CAD, instance elements, point clouds, etc. for stream processing and rendering. It is based on the transmission of renderable hierarchical data structure and tile format set. Since 3D tiles do not have a clear data visualization rule, the client can define the visualization content according to the needs. For example Figure 4 As shown, pnts is a point cloud standard format of 3D tiles, which can be regarded as a tree structure: each node is a point cloud block, and when displaying, the ADD method (showing the content of the point cloud block of this level and all point cloud blocks of the next level corresponding to the point cloud block) is used, that is, when the user is closer to the scene and needs to load the next level point cloud, the next level point cloud is directly added to the scene, instead of replacing the original point cloud. The process of obtaining 3D tiles can be determined by performing at least one thinning on the 3D space, such as Figure 4 As shown on the left, the lowermost layer is the thinning of the 3D space shown by the large cube, obtaining a plurality of small cubes, which are shown as a plurality of origins on the right (each origin represents a point cloud block corresponding to a small cube); continue to perform thinning on the plurality of small cubes of the lowermost layer to obtain a plurality of cubes of the middle layer; continue to perform thinning on the plurality of cubes of the middle layer to obtain a cube of the uppermost layer. This embodiment only shows the case of thinning 3 times, and in actual scenarios, at least one thinning can be performed, and usually the target space is thinned into one point cloud block.
[0096] According to the corresponding collection point of the point cloud collection, the point cloud corresponding to each point can be determined, and the point cloud block is obtained based on the thinning of the point cloud, combined with Figure 4 It can be seen that there is an association relationship between point cloud blocks of different levels, and the ADD method is used when displaying, so after obtaining the point cloud block directly corresponding to the current point, at least one point cloud block associated with the point cloud block is also obtained.
[0097] Step 2022, according to the path of at least one point cloud block, obtain the point cloud set corresponding to the current point.
[0098] Optionally, the point cloud set corresponding to the current point can be obtained based on the path of each point cloud block.
[0099] Optionally, step 2022 may also include:
[0100] Based on the set of tiles corresponding to the preset 3D model, determine the path from multiple point cloud blocks back to the root node point cloud block.
[0101] In this embodiment, each point cloud block is parsed based on the structure corresponding to the tile to determine its level and the number of point cloud points it contains. The point cloud block is then traced back to the root node point cloud block using the tile set, and the sequence numbers of all point cloud blocks along the traversal path are recorded as the path of that point cloud block. Optionally, this embodiment uses a preset table to record the paths of all point cloud blocks involved in the preset 3D model one by one. The tile set includes a multi-level tree structure consisting of a root node point cloud block and multiple child node point cloud blocks. For example, if the tile set includes 2000 point cloud blocks, the preset table size is 2048 rows * 2048 columns. Each row records the sequence numbers of all point cloud blocks along the path associated with a point cloud block (in this embodiment, a unique identifier is assigned to each point cloud block to distinguish between different point cloud blocks). Optionally, the row index in the table is set to the point cloud block's sequence number.
[0102] Based on the path, determine the point cloud points corresponding to at least one of the multiple point cloud blocks included in the path, and determine the point cloud set corresponding to the current point location.
[0103] In this embodiment, after determining the preset table and the point cloud block, the corresponding path can be determined directly by looking up the table, and the point cloud points corresponding to all point cloud blocks included in at least one path can be obtained to obtain the point cloud set corresponding to the current point position.
[0104] like Figure 5 As shown above, in the above Figure 2 Based on the illustrated embodiment, step 204 may include the following steps:
[0105] Step 2041: Determine the point cloud block corresponding to at least one point cloud point among multiple point cloud points.
[0106] Optionally, a point cloud block corresponding to each point cloud point among multiple point cloud points can be determined.
[0107] As can be seen from the point cloud block thinning process, each point cloud block contains at least one point cloud point. Therefore, multiple point cloud blocks can be obtained based on multiple point cloud points.
[0108] Step 2042: Determine the point cloud density corresponding to the point cloud point based on the block density corresponding to the point cloud block.
[0109] The block density represents the sparsity of the point cloud points in the point cloud block. In this embodiment, the block density can be directly used as the point cloud density, or the block density is enlarged or reduced by a preset multiple to obtain the point cloud density. When the block density is enlarged or reduced, the same multiple is applied to the block density of all point cloud blocks in the point cloud set.
[0110] At step 2043, the initial rendering area of at least one point cloud point in the point cloud set is adjusted according to the point cloud density to obtain a target set.
[0111] In this embodiment, when observing the preset three-dimensional model of the solid from the same point (current point cloud), the size of the point cloud density directly affects the display effect of the rendered model. If the point cloud points with large density and the point cloud points with small density are rendered with the same rendering area, there will be large gaps between the point cloud points with small density, and the point cloud points with large density will overlap, resulting in poor rendering effect. In this embodiment, the rendering area of the point cloud points with small density is enlarged, and the rendering area of the point cloud points with large density is reduced, thereby solving the problem of uneven point cloud collection. The local rendering model rendered based on the target set after the rendering area adjustment has better rendering effect, the gaps in the local rendering model are reduced, and the feeling of near large and far small is consistent with the human eye vision.
[0112] In some optional embodiments, step 2042 can include:
[0113] The block density corresponding to the point cloud block is determined.
[0114] Optionally, the first density corresponding to the point cloud block is determined according to the number of point cloud points included in the point cloud block and the volume of the bounding box corresponding to the point cloud block; and the first density corresponding to at least one point cloud block included in the preset three-dimensional model is normalized to obtain the block density corresponding to the at least one point cloud block. Optionally, the first density corresponding to all point cloud blocks included in the preset three-dimensional model is normalized to obtain the block density corresponding to each point cloud block.
[0115] Optionally, the bounding box can be determined by segmenting and thinning the three-dimensional space when the point cloud block is obtained, for example, Figure 4 Each cube on the left side represents a bounding box; correspondingly, one cube encloses one point cloud block (for example, Figure 4 One cube on the left side in the middle corresponds to one point cloud block on the right side), and the volume of the cube is the volume of the point cloud block.
[0116] For example, the first density is determined based on the following formula (1):
[0117] p = size / Volume formula (1)
[0118] wherein, p represents the first density; size represents the number of point cloud points included in the point cloud block; Volume represents the volume of the point cloud block. In order to normalize the density of all point cloud blocks for subsequent processing, the embodiment performs normalization on the first density corresponding to each point cloud block, so that the size range of the obtained block density is between [0, 1].
[0119] Optionally, since there may be multiple point cloud blocks with different densities (for example, a point cloud block including one level and at least one point cloud block corresponding to the next level of the point cloud block) at the same position (corresponding to the same point position, for example, the current point position), the embodiment can determine multiple point cloud blocks included in the corresponding path based on the point cloud block corresponding to the current point cloud according to the lookup table. After determining the block density corresponding to the multiple point cloud blocks, the average density value pScaler of the block density corresponding to all point cloud blocks of the path is calculated, and at this time, the block density corresponding to all point cloud blocks of the path can be updated based on the following formula (2):
[0120] pointSize' = pointSize * (baseScaler - pScaler) Formula (2)
[0121] wherein, pointSize represents the block density of any one point cloud block in the path (which can be determined based on the above formula (1)); pScaler represents the average density value of all point cloud blocks in the path; pointSize' represents the updated block density value; baseScaler represents a preset empirical value, which can be adjusted according to the actual application scenario, for example, baseScaler = 1.5. When baseScaler = 1.5, according to the density adjustment of the above formula (2), the density of the point cloud block with the maximum density in the path corresponding to one point cloud block will be reduced to half of the original, the density of the point cloud block at the average density remains unchanged, and the density of the point cloud block with the minimum density is enlarged to 1.5 times of the original. The embodiment realizes the density balancing processing of the point cloud block, avoids the density difference of multiple point cloud blocks corresponding to the same point position being too large, and solves the problem of poor rendering effect caused by uneven distribution of point cloud points during rendering.
[0122] Based on the block density, the point cloud density of all point cloud points corresponding to the point cloud block is determined.
[0123] Optionally, the block density is taken as the point cloud density of all point cloud points corresponding to the point cloud block.
[0124] In the embodiment, since the point cloud block is determined by thinning the spatial region, that is, the positions of the point cloud points in the same point cloud block are relatively close in space, the point cloud density of the point cloud points in the same point cloud block is relatively small, and the block density is directly used as the point cloud density in the embodiment. Compared with the case where the point cloud density of each point cloud point is calculated respectively, the calculation amount is reduced, and the rendering efficiency is improved.
[0125] Figure 6 is a flowchart of a point cloud-based model rendering method provided by another exemplary embodiment of the present disclosure. The embodiment can be applied on an electronic device, such as a mobile phone, as shown in the figure. Figure 6 The method comprises the following steps:
[0126] In step 602, in response to moving to a current point in a preset three-dimensional model, a point cloud set corresponding to the current point is obtained.
[0127] The point cloud set comprises a plurality of point cloud points.
[0128] The implementation of the embodiment can be understood with reference to step 202 in the above-described embodiment, which will not be described here.
[0129] In step 604, the initial rendering area of at least one point cloud point included in the point cloud set is adjusted for the first time to obtain a first set.
[0130] Each point cloud point in the first set corresponds to a first rendering area.
[0131] In the embodiment, in order to improve the adjustment efficiency of the rendering area of the point cloud points, the initial rendering area of the point cloud points can be adjusted once, and the rendering area adjustment based on the point cloud density can be performed on the basis of the first set after the adjustment.
[0132] In some optional embodiments, step 604 can comprise determining distance information of the point cloud point from the current point according to the position information of the point cloud point.
[0133] The initial rendering area is adjusted according to the distance information, a preset scaling ratio, and a preset rendering area to determine the first rendering area of the point cloud point.
[0134] The first set is determined based on the at least one point cloud point corresponding to the first rendering area.
[0135] The embodiment realizes the basic correction of the near-large and far-small principle. The initial rendering area is adjusted according to the distance information between the point cloud point and the current point. Optionally, the initial rendering area of the point cloud point close to the current point is reduced, and the initial rendering area of the point cloud point far from the current point is enlarged. For example, the first rendering area of the point cloud point is determined based on the following formula (3):
[0136] pointSize = min(size0 * scaler / length, maxPointSize) Formula (3)
[0137] Wherein, the pointSize represents the first rendering area of the point cloud point; the size0 represents the initial rendering area of the point cloud point, for example, the size0 = 1.0; the length represents the distance between the point cloud point and the current point; the scaler represents the preset scaling ratio, which can be determined according to the user's setting, for example, the user determines the preset scaling ratio as 50; the maxPointSize is a preset empirical value, which can be adjusted according to the user's needs, and the preset empirical value corresponds to the case that the distance between the point cloud point and the current point is close to 0 or equal to 0, at this time, the size0 * scaler / length cannot obtain the output result due to the divisor being 0, and the first rendering area is determined by the preset empirical value.
[0138] In step 606, according to the point cloud density corresponding to the plurality of point cloud points in the point cloud set, the first rendering area of at least one point cloud point in the first set is adjusted to obtain a target set.
[0139] The implementation of the embodiment can be understood with reference to step 204 in the above embodiment, and the difference is only that the point cloud set is replaced by the first set, which will not be repeated here.
[0140] In step 608, based on the target set, the local model corresponding to the current point in the preset three-dimensional model is rendered to obtain a local rendering model.
[0141] The implementation of the embodiment can be understood with reference to step 206 in the above embodiment, which will not be repeated here.
[0142] In the embodiment, the initial rendering area of the point cloud point is adjusted twice to achieve a rendering area that is more suitable for the position of the point cloud point and adapts to the corresponding density. Alternatively, the above Figure 1 The specific rendering scene shown in the above embodiment is taken as an example, and by applying the point cloud-based model rendering method provided in the above embodiment, a local rendering model as shown in Figure 7 can be obtained, as shown in Figure 7 It can be found that in the embodiment, the rendering area of each point cloud point meets the characteristics that the near is large and the far is small, and in the part where the point cloud points are dense (the density is large), such as the right half of Figure 1 and Figure 7 , the rendering area of the point cloud point is reduced, and in the part where the point cloud points are sparse (the density is small), such as the left half of Figure 1 and Figure 7 , the rendering area of the point cloud point is increased.
[0143] Any of the point cloud-based model rendering methods provided in the embodiments of the present disclosure can be executed by any appropriate device with data processing capability, including but not limited to: terminal devices and servers, etc. Alternatively, any of the point cloud-based model rendering methods provided in the embodiments of the present disclosure can be executed by a processor, such as a processor executing any of the point cloud-based model rendering methods provided in the embodiments of the present disclosure by calling corresponding instructions stored in a memory. Details are not described herein.
[0144] Exemplary Device
[0145] Figure 8 FIG. 1 is a structural schematic diagram of a point cloud-based model rendering device provided in an example embodiment of the present disclosure. As shown in FIG. 1, the device provided in the embodiment includes: Figure 8
[0146] A point cloud obtaining module 81 is configured to obtain a point cloud set corresponding to a current point in response to moving to the current point in a preset three-dimensional model. The point cloud set includes a plurality of point cloud points.
[0147] A point cloud adjusting module 82 is configured to adjust an initial rendering area of at least one point cloud point in the point cloud set according to a point cloud density corresponding to the plurality of point cloud points in the point cloud set, to obtain a target set.
[0148] A model rendering module 83 is configured to render a local model corresponding to the current point in the preset three-dimensional model based on the target set, to obtain a local rendering model.
[0149] The point cloud-based model rendering device provided in the above embodiments of the present disclosure is configured to obtain a point cloud set corresponding to a current point in response to moving to the current point in a preset three-dimensional model; the point cloud set includes a plurality of point cloud points; adjust an initial rendering area of at least one point cloud point in the point cloud set according to a point cloud density corresponding to the plurality of point cloud points in the point cloud set, to obtain a target set; and render a local model corresponding to the current point in the preset three-dimensional model based on the target set, to obtain a local rendering model. In the embodiment, the rendering area corresponding to the point cloud points is adjusted according to the point cloud density, and the target set composed of the point cloud points with the adjusted rendering area is used to render the local model corresponding to the current point, so that the obtained local rendering model has less holes and better rendering effect.
[0150] In some optional embodiments, the point cloud adjusting module 82 includes:
[0151] A point cloud block unit is configured to determine a point cloud block corresponding to at least one point cloud point in the plurality of point cloud points; each point cloud block includes at least one point cloud point.
[0152] The density determination unit is configured to determine the point cloud density corresponding to the point cloud points according to the block density corresponding to the point cloud block.
[0153] The area adjustment unit is configured to adjust the initial rendering area of at least one point cloud point in the point cloud set according to the point cloud density, to obtain a target set.
[0154] Optionally, the density determination unit is specifically configured to determine the block density corresponding to the point cloud block, and determine the point cloud density of all point cloud points corresponding to the point cloud block based on the block density.
[0155] Optionally, when determining the block density corresponding to the point cloud block, the density determination unit is configured to determine a first density corresponding to the point cloud block according to the number of point cloud points included in the point cloud block and the volume of the bounding box corresponding to the point cloud block, and perform normalization on the first density corresponding to at least one point cloud block included in the preset three-dimensional model to obtain the block density corresponding to the at least one point cloud block.
[0156] In some optional embodiments, the apparatus provided in the embodiment can further include:
[0157] The initial adjustment module is configured to perform first adjustment on the initial rendering area of at least one point cloud point included in the point cloud set, to obtain a first set, and each point cloud point in the first set corresponds to a first rendering area.
[0158] The point cloud adjustment module 82 is specifically configured to adjust the first rendering area of at least one point cloud point in the first set according to the point cloud density corresponding to the plurality of point cloud points in the point cloud set, to obtain a target set.
[0159] Optionally, the initial adjustment module is specifically configured to determine distance information of the point cloud point from the current point position according to position information corresponding to the point cloud point, and adjust the initial rendering area according to the distance information, a preset scaling ratio and a preset rendering area, to determine the first rendering area corresponding to the point cloud point, and determine the first set based on at least one point cloud point corresponding to the first rendering area.
[0160] In some optional embodiments, the point cloud obtaining module 81 includes:
[0161] The block determination unit is configured to determine at least one point cloud block corresponding to the current point position according to position information corresponding to the current point position.
[0162] The path determination unit is configured to obtain the point cloud set corresponding to the current point position according to the path of the at least one point cloud block.
[0163] Optionally, the path determination unit is specifically used to determine the path from multiple point cloud blocks back to the root node point cloud block based on the tile set corresponding to the preset 3D model; the tile set includes a multi-level tree structure consisting of a root node point cloud block and multiple child node point cloud blocks; based on the path, determine the point cloud points corresponding to the multiple point cloud blocks included in at least one path, and determine the point cloud set corresponding to the current point.
[0164] Exemplary Electronic Device
[0165] Below, for reference Figure 9 This describes an electronic device according to embodiments of the present disclosure. The electronic device may be either or both of a first device and a second device, or a standalone device independent of them, which may communicate with the first device and the second device to receive acquired input signals from them.
[0166] Figure 9 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0167] like Figure 9 As shown, the electronic device includes one or more processors and memory.
[0168] A processor can be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and can control other components in an electronic device to perform desired functions.
[0169] The memory can store one or more computer program products, and the memory can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products can be stored on the computer-readable storage medium, and the processor can run the computer program products to implement the point cloud-based model rendering methods of the various embodiments of this disclosure described above, and / or other desired functions.
[0170] In one example, the electronic device may also include input devices and output devices, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0171] In addition, the input device may also include, for example, a keyboard, a mouse, etc.
[0172] The output device can output various information including the determined distance information, direction information, etc. to the outside. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.
[0173] Of course, in order to simplify, Figure 9 Only some of the components of the electronic device related to the present disclosure are shown in the middle, and components such as buses, input / output interfaces, etc. are omitted. In addition, the electronic device can further include any other appropriate components according to the specific application.
[0174] In addition to the above-mentioned method and device, an embodiment of the present disclosure can also be a computer program product including computer program instructions, which, when executed by a processor, causes the processor to perform the steps of the point cloud-based model rendering method according to various embodiments of the present disclosure described in the above part of the specification.
[0175] The computer program product can be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, C++, etc., and a conventional procedural programming language such as "C" language or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0176] In addition, an embodiment of the present disclosure can also be a computer readable storage medium having stored thereon computer program instructions, which, when executed by a processor, cause the processor to perform the steps of the point cloud-based model rendering method according to various embodiments of the present disclosure described in the above part of the specification.
[0177] The computer readable storage medium can employ any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination of the above.
[0178] The above describes the basic principles of the present disclosure in conjunction with specific embodiments, but it should be noted that the advantages, benefits, effects and the like mentioned in the present disclosure are merely examples and are not limiting, and these advantages, benefits, effects and the like cannot be considered as necessary for each embodiment of the present disclosure. In addition, the above specific details are merely for the purpose of example and understanding, and are not limiting, and the above details do not limit the present disclosure to be necessarily implemented with the above specific details.
[0179] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between each embodiment can be mutually referred to. For system embodiments, since they basically correspond to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0180] The block diagrams of the devices, apparatuses, equipment, systems involved in the present disclosure are merely exemplary examples and are not intended to require or imply the connection, arrangement, configuration shown in the block diagram. As those skilled in the art will recognize, these devices, apparatuses, equipment, systems can be connected, arranged, configured in any manner. Words such as "include", "contain", "have" and the like are open-ended words, which mean "including but not limited to", and can be used interchangeably. The words "or" and "and" used herein mean the word "and / or", and can be used interchangeably unless the context clearly indicates otherwise. The word "such as" used herein means the phrase "such as but not limited to", and can be used interchangeably.
[0181] The methods and devices of the present disclosure can be implemented in many ways. For example, the methods and devices of the present disclosure can be implemented by software, hardware, firmware, or any combination of software, hardware, firmware. The above order of steps for the method is merely for illustration, and the steps of the method of the present disclosure are not limited to the above specifically described order, unless otherwise specifically described. In addition, in some embodiments, the present disclosure can also be implemented as programs recorded in recording media, which include machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers the recording media storing the programs for executing the method according to the present disclosure.
[0182] It should also be noted that in the devices, equipment and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions of the present disclosure.
[0183] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0184] The above description has been presented to enable any person skilled in the art to make or use the disclosure. Furthermore, the purpose of the above description is not intended to limit the embodiments of the present disclosure to the form disclosed herein. Although various example aspects and embodiments have been discussed above, those of ordinary skill in the art will appreciate a variety of modifications, alternatives, permutations, additions, and sub-combinations of the described aspects and embodiments.
Claims
1. A point cloud-based model rendering method, characterized in that, include: In response to moving to the current point in the preset 3D model, the point cloud set corresponding to the current point is obtained; The point cloud set includes multiple point cloud points; Based on the point cloud density corresponding to multiple point cloud points in the point cloud set, the initial rendering area of at least one point cloud point in the point cloud set is adjusted to obtain the target set; Based on the target set, the local model corresponding to the current point in the preset 3D model is rendered to obtain a local rendering model; Before adjusting the initial rendering area of at least one point in the point cloud set based on the point cloud density corresponding to multiple point points in the point cloud set to obtain the target set, the process further includes: Based on the location information corresponding to the point cloud points, determine the distance information between the point cloud points and the current point. Based on the distance information, preset scaling ratio, and preset rendering area, the initial rendering area is adjusted to determine the first rendering area corresponding to the point cloud points; A first set is determined based on at least one point cloud point corresponding to the first rendered area.
2. The method according to claim 1, characterized in that, The step of adjusting the initial rendering area of at least one point in the point cloud set based on the point cloud density corresponding to multiple point points in the point cloud set to obtain a target set includes: Identify a point cloud block corresponding to at least one of the plurality of point cloud points; each point cloud block includes at least one point cloud point; The point cloud density corresponding to the point cloud point is determined based on the block density corresponding to the point cloud block; the block density represents the sparseness of the point cloud points in the point cloud block. The initial rendering area of at least one point in the point cloud set is adjusted according to the point cloud density to obtain the target set.
3. The method according to claim 2, characterized in that, The step of determining the point cloud density corresponding to the point cloud point based on the block density corresponding to the point cloud block includes: Determine the block density corresponding to the point cloud block; Based on the block density, the point cloud density of all point cloud points corresponding to the point cloud block is determined.
4. The method according to claim 3, characterized in that, Determining the block density corresponding to the point cloud block includes: The first density corresponding to the point cloud block is determined based on the number of point cloud points included in the point cloud block and the volume of the bounding box corresponding to the point cloud block. Normalize the first density corresponding to at least one point cloud block included in the preset three-dimensional model to obtain the block density corresponding to at least one point cloud block.
5. The method according to any one of claims 1-4, characterized in that, The step of adjusting the initial rendering area of at least one point in the point cloud set based on the point cloud density corresponding to multiple point points in the point cloud set to obtain a target set includes: Based on the point cloud density corresponding to multiple point cloud points in the point cloud set, the first rendering area of at least one point cloud point in the first set is adjusted to obtain the target set.
6. The method according to any one of claims 1-4, characterized in that, Obtaining the point cloud set corresponding to the current point location includes: Based on the location information corresponding to the current point, at least one point cloud block corresponding to the current point is determined; Based on the path of the at least one point cloud block, the point cloud set corresponding to the current point is obtained.
7. The method according to claim 6, characterized in that, The step of obtaining the point cloud set corresponding to the current point location based on the path of the at least one point cloud block includes: Based on the tile set corresponding to the preset 3D model, determine the path from multiple point cloud blocks back to the root node point cloud block; the tile set includes a multi-level tree structure consisting of a root node point cloud block and multiple child node point cloud blocks. Based on the path, determine at least one point cloud point corresponding to multiple point cloud blocks included in the path, and determine the point cloud set corresponding to the current point.
8. A model rendering device based on point clouds, characterized in that, include: The point cloud acquisition module is used to obtain the point cloud set corresponding to the current point position in response to moving to the current point position in the preset 3D model. The point cloud set includes multiple point cloud points; The point cloud adjustment module is used to adjust the initial rendering area of at least one point in the point cloud set according to the point cloud density corresponding to multiple point points in the point cloud set, so as to obtain the target set. The model rendering module is used to render the local model corresponding to the current point in the preset three-dimensional model based on the target set, so as to obtain a local rendering model; The device further includes: The initial adjustment module is used to determine the distance information between the point cloud point and the current point position based on the position information corresponding to the point cloud point; Based on the distance information, preset scaling ratio, and preset rendering area, the initial rendering area is adjusted to determine the first rendering area corresponding to the point cloud points; based on at least one point cloud point corresponding to the first rendering area, a first set is determined.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the point cloud-based model rendering method described in any one of claims 1-7.
Citation Information
Patent Citations
Point cloud processing method and device, electronic equipment and storage medium
CN111429568A