A point cloud rendering method and system
By dynamically dividing the rendering layers and establishing a non-linear mapping relationship, the contradiction between visual quality and computational efficiency in point cloud rendering is resolved, and adaptive rendering parameter adjustment is achieved, thereby improving the visual effect and efficiency of point cloud rendering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIV OF SCI & TECH
- Filing Date
- 2026-04-28
- Publication Date
- 2026-05-29
AI Technical Summary
Existing point cloud rendering methods cannot dynamically adjust rendering parameters according to viewpoint distance, resulting in a double loss of visual quality and computational efficiency. In particular, the contradiction between near-sparse and far-dense characteristics under perspective projection is difficult to resolve.
By dynamically dividing the rendering layers based on the real-time distance from the point cloud data to the current observation point, a non-linear smooth continuous function mapping relationship is established between the rendering sampling probability and the rendering point radius and the observation distance. Differentiated rendering operations are performed in conjunction with the GPU shader program, and parameter interpolation is performed by setting transition regions.
It achieves adaptive adjustment of rendering parameters, improves visual quality and computational efficiency, avoids visual distortion and computational redundancy, and ensures real-time interactive rendering of large-scale point cloud data.
Smart Images

Figure CN122115669A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer graphics technology, and in particular to a point cloud rendering method and system. Background Technology
[0002] As a fundamental spatial data structure, 3D point clouds have become a core data carrier in fields such as digital twins, high-precision maps, and LiDAR sensing. Efficiently and faithfully projecting large-scale point cloud data into a 2D view is a core issue in point cloud visualization technology, directly impacting data interpretation efficiency and interactive experience.
[0003] Current mainstream point cloud rendering methods, such as the open-source framework Potree or PCL-based rendering pipelines, generally employ a globally uniform, static rendering strategy, applying a fixed sampling probability and pixel radius to all point clouds within the scene. This strategy fundamentally contradicts the spatial distribution characteristics under perspective projection: a uniformly distributed 3D point cloud in the camera coordinate system will exhibit a non-uniform distribution of "sparser near, denser far" on the 2D imaging plane after perspective transformation. Existing static methods fail to dynamically divide the region based on viewpoint distance and cannot adaptively adjust rendering parameters according to projection characteristics, resulting in a dual loss of visual quality and computational efficiency.
[0004] In terms of visual fidelity, if a small pixel radius is used to preserve distant details, the near-field area will appear hollow and fragmented due to sparse projection, disrupting surface continuity. Conversely, if the pixel radius is increased to fill the near-field, the distant area will experience severe aliasing due to excessive pixel overlap, forming blurred color blocks and obscuring details. Crucially, perspective projection itself is non-linear, and existing linear or piecewise parameter adjustment methods struggle to match the patterns of visual change, easily creating visual discontinuities at parameter switching boundaries.
[0005] In terms of computational efficiency, in order to ensure the continuity of near-field vision, the system is often forced to adopt a conservative strategy of high density and large radius, which causes the GPU to consume a lot of computing power on the shading and depth testing of redundant points in the distant area, contributing very little to the final imaging and forming a significant performance bottleneck when processing large-scale scenes. Summary of the Invention
[0006] Purpose of the invention: The purpose of this invention is to solve the technical problems in the prior art and provide a point cloud rendering method and system.
[0007] Technical solution: This application proposes a point cloud rendering method, including the following steps:
[0008] S1, acquire point cloud data of the detected object;
[0009] S2, based on the real-time distance from the acquired point cloud data to the current observation point, dynamically divides the three-dimensional space into multiple rendering layers;
[0010] S3, based on each rendering layer, establishes a non-linear smooth continuous function mapping relationship between the rendering sampling probability and the rendering point radius and the observation distance, and obtains the rendering parameters of each layer by inputting a preset representative observation distance at each layer.
[0011] S4 applies the corresponding rendering parameters to point clouds at different rendering levels, performing differentiated rendering operations.
[0012] Preferably, the 3D space is dynamically divided into multiple rendering layers based on the real-time distance from the acquired point cloud data to the current observation point, including:
[0013] The nearest distance to the nearest point cloud to the current camera is obtained from the point cloud data. And the furthest distance of the furthest point cloud. ;
[0014] Based on nearest distance and the farthest distance Delineate the boundaries of different rendering levels, including rendering levels through linear uniform distribution or non-linear distribution;
[0015] In this process, rendering layers using a non-linear distribution results in smaller spacing between layers in the foreground and larger spacing between layers in the background.
[0016] Preferably, the method of linear uniform distribution includes:
[0017] Its layer boundary thresholds The calculation formula is as follows:
[0018] ;
[0019] in, Indicates the first The distance threshold for each rendering level is the boundary value that divides different rendering levels; This represents a hierarchical index, with values ranging from 0 to... The integers correspond to different rendering levels; This represents the total number of rendering layers, which is a preset layer count parameter.
[0020] Preferably, a non-linear, smooth, continuous function mapping relationship is established between the rendering point radius and the viewing distance, where the rendering point radius... Calculated using the following exponential decay function:
[0021] ;
[0022] in, This represents the rendering radius of a point at a distance d from the camera in this layer, controlling the display size of the point on the screen; This represents the real-time distance from the point to be calculated to the camera; This represents the minimum rendering radius at the farthest point cloud layer from the camera. This represents the maximum rendering radius of the point cloud layer at the closest distance to the camera; This represents the decay rate constant of the rendering radius, controlling how quickly the radius decreases as distance increases.
[0023] Preferably, a non-linear, smooth, continuous function mapping relationship is established between the rendering sampling probability and the observation distance, where the rendering sampling probability... Calculated using the following exponential decay function:
[0024] ;
[0025] in, This represents the sampling probability of a point at a distance d from the camera in this layer, controlling the probability that this point will be retained for rendering; This represents the real-time distance from the point to be calculated to the camera; This represents the minimum sampling probability at the farthest point cloud from the camera, used to reduce redundant points in the distant view; This represents the maximum sampling probability at the point cloud layer closest to the camera; The decay rate constant represents the sampling probability, controlling the rate at which the probability decreases with increasing distance.
[0026] Preferably, applying corresponding rendering parameters to point clouds at different rendering levels to perform differentiated rendering operations includes implementing the following steps in the GPU's shader program:
[0027] For each point cloud vertex after the rasterization stage, the corresponding rendering sampling probability is obtained according to its hierarchical index i. ;
[0028] Generate pseudo-random numbers and match them with the rendering sampling probability. Comparison: If the random number is greater than the rendering sampling probability... If the random number is less than or equal to the rendering sampling probability, then the vertex is discarded. If so, then retain that vertex;
[0029] For the retained vertices, the rendering sampling probability is determined according to the level to which they belong. In addition, taking into account the effects of perspective projection, the size of points in screen space is calculated, and drawing operations are performed.
[0030] in, These are the rendering parameters for the corresponding layer. The rendering radius of the corresponding layer. This represents the sampling probability for rendering.
[0031] Preferably, it also includes over-processing the boundaries of multiple rendering layers, including:
[0032] At the boundary between every two adjacent levels The surrounding area is defined with a width of The transition region;
[0033] If the distance of point P Entering the transition region, the interpolation weight w is calculated based on the relative position of the point within the transition region;
[0034] By using interpolation weight w to perform linear interpolation on the rendering radius and rendering sampling probability of two adjacent layers, the final rendering parameters of point P are obtained. and ;
[0035] Use final rendering parameters and Perform a rendering operation on this point.
[0036] Preferably, the interpolation weight w is calculated using the following formula:
[0037] ;
[0038] in, This is a numerical constraint function that restricts the calculation results to the interval [0.0, 1.0]. Let P be the real-time distance from the point to be calculated to the camera. The threshold value for the hierarchical boundary between the i-th layer and the (i+1)-th layer. The width of the transition zone. This indicates the starting position of the transition zone, which is the left boundary of the transition zone.
[0039] Preferably, the rendering radius and rendering sampling probability The interpolation calculation formula is:
[0040] ;
[0041] ;
[0042] Where w represents the weight value of the interlayer parameter interpolation. , These are the rendering radii corresponding to the i-th layer and the (i+1)-th layer, respectively. , These are the rendering sampling probabilities corresponding to the i-th layer and the (i+1)-th layer, respectively.
[0043] Secondly, this application proposes a point cloud rendering system, including:
[0044] The acquisition unit is used to acquire point cloud data of the detected object;
[0045] Layered units are used to dynamically divide the three-dimensional space into multiple rendering layers based on the real-time distance from the acquired point cloud data to the current observation point;
[0046] The mapping unit is used to establish a non-linear smooth continuous function mapping relationship between the rendering sampling probability and the rendering point radius and the observation distance for each rendering layer. The rendering parameters of each layer are obtained by inputting a preset representative observation distance at each layer.
[0047] The rendering unit is used to apply the corresponding rendering parameters to point clouds at different rendering levels and perform differentiated rendering operations.
[0048] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory. The memory stores one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the electronic device is able to implement any of the possible design methods described in the first aspect.
[0049] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any of the above embodiments.
[0050] Fifthly, embodiments of the present invention also provide a computer program product that, when run on an electronic device, causes the electronic device to perform any possible design method of any of the above aspects.
[0051] Beneficial effects: By dynamically dividing the rendering layers in real time based on viewpoint distance, the contradiction between the traditional one-size-fits-all rendering strategy and the near-sparse and distant-dense characteristics of perspective projection is fundamentally resolved. The rendering strategy changes from globally static to locally dynamic, ensuring the accuracy of differentiated processing for different depth regions. This layering mechanism provides a structured framework for subsequent nonlinear parameter mapping, enabling the adjustment of rendering parameters to be based on an ordered spatial division closely related to visual perception, which is a prerequisite for realizing the intelligence of the entire method.
[0052] By establishing a monotonically decreasing nonlinear function relationship between rendering parameters (radius, sampling rate) and viewing distance, near-field objects are made large and dense, while distant objects are small and sparse. This ensures the surface continuity and visual fullness of near-field objects, while avoiding detail loss (blurring, aliasing) caused by excessive overlap of distant object pixels, and significantly reduces the computational load of redundant distant points. Using smooth, continuous functions such as exponential decay for mapping ensures that the rendering parameters change gradually rather than abruptly with distance, effectively avoiding visual discontinuities or layering that might occur with piecewise linear adjustments, thus improving the naturalness and consistency of the overall rendered image.
[0053] In the GPU shader, pixels are randomly pre-selected based on hierarchical sampling probabilities. This discards a large number of distant pixels that contribute little to the final image at an early stage, significantly reducing the computational load on subsequent pipelines such as rasterization, pixel shading, and depth testing, thus optimizing the allocation of computing resources. The core adaptive logic (distance comparison, parameter selection, and random sampling) is embedded in the efficient GPU shader program, fully utilizing the parallel computing capabilities of the graphics hardware and ensuring the feasibility of real-time, interactive rendering of large-scale point cloud data.
[0054] By setting transition regions and performing parameter interpolation between discrete rendering layers, visible seams or hard boundaries that may occur due to parameter jumps between different layers are completely eliminated. This results in an extremely smooth and natural transition from foreground to background, achieving a visual effect close to continuous adaptive (point-by-point calculation). This smooth transition mechanism is computationally simple (linear interpolation) and is implemented in the shader with minimal performance cost, yet it effectively guarantees high-end visual output quality, making it extremely cost-effective. Attached Figure Description
[0055] Figure 1 A schematic diagram of the method framework for this invention is provided;
[0056] Figure 2 A schematic diagram of the method flow framework for this invention is provided;
[0057] Figure 3 This invention provides an image showing the effect of rendering using this method compared to the traditional direct rendering method;
[0058] Figure 4 This is a block diagram of a device structure provided in one embodiment of this application;
[0059] Figure 5 This is a block diagram of an electronic device structure provided in one embodiment of this application. Detailed Implementation
[0060] To make the technical solution of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0061] Example 1
[0062] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art. The terms "including" and similar expressions used herein mean that the element or object preceding the term covers the element or object listed after the term and its equivalents, but do not exclude other elements or objects.
[0063] In response to the problems existing in the current technology, such as Figure 1-2 As shown, a point cloud rendering method is proposed, including the following steps:
[0064] S1, Acquire point cloud data of the object being probed; the purpose of this step is to acquire 3D point cloud data related to the object being probed, typically obtained through LiDAR, depth cameras, or other 3D scanning devices. This data provides the geometric information of the object in space and lays the foundation for subsequent point cloud processing and rendering.
[0065] S2, based on the real-time distance from the acquired point cloud data to the current observation point, dynamically divides the three-dimensional space into multiple rendering layers;
[0066] Based on the real-time distance from the acquired point cloud data to the current observation point, the 3D space is dynamically divided into multiple rendering layers, including:
[0067] The nearest distance to the nearest point cloud to the current camera is obtained from the point cloud data. And the furthest distance of the furthest point cloud. This serves as the benchmark for the rendering strategy;
[0068] Based on nearest distance and the farthest distance Delineate the boundaries of different rendering levels, including rendering levels through linear uniform distribution or non-linear distribution;
[0069] In this process, rendering layers using a non-linear distribution results in smaller spacing between layers in the foreground and larger spacing between layers in the background.
[0070] Methods using linear uniform distribution include:
[0071] Its layer boundary thresholds The calculation formula is as follows:
[0072] ;
[0073] in, Indicates the first The distance threshold for each rendering level is the boundary value that divides different rendering levels; This represents a hierarchical index, with values ranging from 0 to... The integers correspond to different rendering levels; This represents the total number of rendering layers, which is a preset layer count parameter.
[0074] At the start of each rendering frame, the system first performs a depth evaluation on all visible point clouds within the current view frustum, and quickly determines the distance of the nearest point cloud to the current camera position by traversing or using a pre-built acceleration structure (such as an octree). Distance to the farthest point cloud This dynamically changing distance range This forms the baseline for the current frame rendering strategy. After obtaining this distance range, the system will logically divide the three-dimensional space into n rendering layers along the line of sight, based on the preset number of layers n.
[0075] By using linear uniform or non-linear distributions for rendering layers, including logarithmic or exponential partitioning, the layers in the foreground become narrower and those in the background become wider. This aligns with the natural characteristics of perspective projection, effectively enhancing the naturalness of the visual experience and preventing the rendering of distant areas from appearing too sparse or unnatural.
[0076] Boundary thresholds for each layer Once determined, the most crucial layering operation is efficiently executed within the existing graphics processing unit's (GPU) vertex shader. For each vertex being processed, the shader program calculates its precise distance d to the camera. P This value is then compared with a threshold array to determine its corresponding rendering level index i. This index information will be used as the basis for subsequent adaptive parameter selection and will be passed to the next stage of the rendering pipeline.
[0077] By dynamically dividing the rendering layers based on the distance between the point cloud data and the current observation point, the rendering strategy can be adjusted according to different distances. The rendering strategies for foreground and background areas are different, thus ensuring that foreground details are fully rendered, while backgrounds are not rendered with excessive detail, which would result in visual waste or computational burden.
[0078] S3, based on each rendering layer, establishes a non-linear smooth continuous function mapping relationship between the rendering sampling probability and the rendering point radius and the observation distance, and obtains the rendering parameters of each layer by inputting a preset representative observation distance at each layer.
[0079] Select a representative distance This representative distance can be simply and effectively taken as the distance range of this layer. The midpoint value. In other implementations, other strategies may be used, such as considering the actual distribution of the point cloud within the layer and calculating a distance-weighted average to obtain a more representative value.
[0080] Establish a non-linear, smooth, continuous function mapping relationship between the rendering point radius and the viewing distance, where the rendering point radius... Calculated using the following exponential decay function:
[0081] ;
[0082] in, This represents the rendering radius of a point at a distance d from the camera in this layer, controlling the display size of the point on the screen; This represents the real-time distance from the point to be calculated to the camera; This represents the minimum rendering radius at the farthest point cloud layer from the camera, ensuring basic display accuracy for distant points. This represents the maximum rendering radius of the point cloud layer at the closest distance to the camera, ensuring the fullness of the display of nearby points; This represents the decay rate constant of the rendering radius, controlling how quickly the radius decreases as distance increases.
[0083] Through this non-linear relationship, near-distance point clouds have a larger rendering radius, thus ensuring that they are rendered more clearly and fully on the screen; while far-distance point clouds have a smaller radius, avoiding visual redundancy.
[0084] Establish a non-linear, smooth, continuous function mapping relationship between rendering sampling probability and observation distance, and define the rendering sampling probability. Calculated using the following exponential decay function:
[0085] ;
[0086] in, This represents the sampling probability of a point at a distance d from the camera in this layer, controlling the probability that this point will be retained for rendering; This represents the real-time distance from the point to be calculated to the camera; This represents the minimum sampling probability at the farthest point cloud from the camera, used to reduce redundant points in the distant view; This represents the maximum sampling probability at the point cloud layer closest to the camera; This represents the decay rate constant of the sampling probability, controlling how quickly the probability decreases with increasing distance. (Rendering sampling probability) The selection of points from point cloud data for rendering directly impacts final image quality and computational efficiency. A similar exponential decay function is used to establish a nonlinear mapping between sampling probability and observation distance.
[0087] in, It is usually set to 1.0, which means that the point cloud in the foreground area is fully rendered, while This defines the minimum point cloud density for the distant view area. Used to control the severity of density decay. This is achieved by using representative distances from each layer. Substituting into the above formula, we can obtain a set of rendering parameters that are tightly coupled with the depth of each layer. These parameters are then loaded into the GPU's constant buffer or texture for efficient access by all vertices, optimizing the rendering process.
[0088] A non-linear mapping relationship is established between rendering parameters and observation distance. This relationship makes the rendering parameters (such as rendering point size and sampling probability) decrease monotonically as the observation distance increases, thereby precisely controlling the trend of parameter changes.
[0089] This step aims to establish a non-linear, smooth, and continuous mapping between each rendering level and the viewing distance, adaptively adjusting rendering parameters (such as the rendering point radius and sampling probability) to ensure both fidelity and efficiency in rendering. Specifically, this step involves two main rendering parameters: the rendering point radius and the rendering sampling probability.
[0090] S4 applies the corresponding rendering parameters to the point cloud at different rendering levels, performing differentiated rendering operations. The core purpose of this step is to improve computational efficiency and optimize visual effects by adopting differentiated rendering operations based on the characteristics of different rendering levels.
[0091] Apply corresponding rendering parameters to point clouds at different rendering levels to perform differentiated rendering operations, including implementing the following steps in the GPU shader program:
[0092] For each point cloud vertex after the rasterization stage, the corresponding rendering sampling probability is obtained according to its hierarchical index i. ;
[0093] The shader program generates pseudo-random numbers and compares them with the rendering sampling probability. Comparison: If the random number is greater than the rendering sampling probability... If the random number is less than or equal to the rendering sampling probability, then the vertex is discarded and will not participate in subsequent expensive operations such as pixel shading, thus effectively reducing the rendering load on the distant area. If so, then retain that vertex;
[0094] For the retained vertices, the rendering sampling probability is determined according to the level to which they belong. In addition, taking into account the effects of perspective projection, the size of a point in screen space (such as gl_PointSize in OpenGL) is calculated, and drawing operations are performed.
[0095] in, These are the rendering parameters for the corresponding layer. The rendering radius of the corresponding layer. This represents the sampling probability for rendering.
[0096] At this point, the points in the foreground will be drawn larger and denser, while the points in the background will be smaller and sparser, thus creating a rendered image with both excellent visual effects and computational efficiency on a macroscopic level.
[0097] To eliminate parameter abrupt changes that may occur at layer boundaries due to discrete layering and avoid perceptible visual seams, this implementation introduces a smooth transition mechanism. Within the transition region, the final rendering parameters of a vertex are calculated by smoothly interpolating the rendering parameters of adjacent layers. The implementation also includes transition processing of the boundaries between multiple rendering layers, including:
[0098] At the boundary between every two adjacent levels The surrounding area is defined with a width of The transition region;
[0099] If the distance of point P Entering the transition region, the interpolation weight w is calculated based on the relative position of the point within the transition region;
[0100] By using interpolation weight w to perform linear interpolation on the rendering radius and rendering sampling probability of two adjacent layers, the final rendering parameters of point P are obtained. and ;
[0101] Use final rendering parameters and Perform a rendering operation on this point.
[0102] The formula for calculating the interpolation weight w is:
[0103] ;
[0104] in, This is a numerical constraint function that restricts the calculation results to the interval [0.0, 1.0] to avoid illegal values from excessive weights and ensure the validity of the weights. Let P be the real-time distance from the point to be calculated to the camera. The threshold value for the hierarchical boundary between the i-th layer and the (i+1)-th layer. The width of the transition zone controls the range of parameters for smooth transition. This indicates the starting position of the transition zone, which is the left boundary of the transition zone.
[0105] The rendering radius and rendering sampling probability The interpolation calculation formula is:
[0106] ;
[0107] ;
[0108] Where w is the weight value of the interlayer parameter interpolation. , These are the rendering radii corresponding to the i-th layer and the (i+1)-th layer, respectively. , These are the rendering sampling probabilities corresponding to the i-th layer and the (i+1)-th layer, respectively.
[0109] These were calculated using smooth interpolation. and The original layer parameters are replaced for density testing and radius setting of the vertex. This process is also completed in real-time and efficiently in the shader, ensuring that the changes in rendering parameters are completely continuous and smooth across the entire field of view depth with minimal performance cost, ultimately presenting a highly uniform and natural visual effect. By adjusting rendering parameters (such as sampling probability) according to the layer to which each point cloud belongs, rendering computation in distant areas can be reduced without affecting important details, thus lowering GPU load and improving rendering efficiency. The introduction of a smooth transition mechanism avoids significant visual seams caused by layer segmentation, ensuring a natural transition between different layers of point cloud rendering and improving visual consistency.
[0110] like Figure 3 The image shown is a rendering result achieved using this method compared to the traditional direct rendering method.
[0111] In other embodiments of the invention, combined with Figure 4 This invention discloses a point cloud rendering system, comprising:
[0112] Acquisition unit 201 is used to acquire point cloud data of the detected object;
[0113] Layered unit 202 is used to dynamically divide the three-dimensional space into multiple rendering layers based on the real-time distance from the acquired point cloud data to the current observation point;
[0114] The mapping unit 203 is used to establish a non-linear smooth continuous function mapping relationship between the rendering sampling probability and the rendering point radius and the observation distance for each rendering layer, and to obtain the rendering parameters of each layer by inputting a preset representative observation distance at each layer.
[0115] The rendering unit 204 is used to apply the corresponding rendering parameters to point clouds at different rendering levels and perform differentiated rendering operations.
[0116] In other embodiments of the present invention, an electronic device 400 is disclosed, such as... Figure 5 As shown, the electronic device may include: one or more processors 401; a memory 402; a display 403; one or more application programs (not shown); and one or more computer programs 404. These devices can be connected via one or more communication buses 405. The one or more computer programs 404 are stored in the memory 402 and configured to be executed by the one or more processors 401. The one or more computer programs 404 include instructions that can be used to perform actions such as... Figure 1 And the various steps in the corresponding embodiments.
[0117] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0118] In the various embodiments of this invention, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0119] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.
[0120] The above description is merely a specific implementation of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of the present invention should be covered within the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention should be determined by the protection scope of the claims.
Claims
1. A point cloud rendering method, characterized in that, Includes the following steps: S1, acquire point cloud data of the detected object; S2, based on the real-time distance from the acquired point cloud data to the current observation point, dynamically divides the three-dimensional space into multiple rendering layers; S3, based on each rendering layer, establishes a non-linear smooth continuous function mapping relationship between the rendering sampling probability and the rendering point radius and the observation distance, and obtains the rendering parameters of each layer by inputting a preset representative observation distance at each layer. S4 applies the corresponding rendering parameters to point clouds at different rendering levels, performing differentiated rendering operations.
2. The point cloud rendering method according to claim 1, characterized in that, Based on the real-time distance from the acquired point cloud data to the current observation point, the 3D space is dynamically divided into multiple rendering layers, including: The nearest distance to the nearest point cloud to the current camera is obtained from the point cloud data. And the furthest distance of the furthest point cloud. ; Based on nearest distance and the farthest distance The boundaries of different rendering levels are defined, including rendering levels through linear uniform distribution or non-linear distribution. In this process, rendering layers using a non-linear distribution results in smaller spacing between layers in the foreground and larger spacing between layers in the background.
3. The point cloud rendering method according to claim 2, characterized in that, Methods using linear uniform distribution include: Its layer boundary thresholds The calculation formula is as follows: ; in, Indicates the first The distance threshold for each rendering level is the boundary value that divides different rendering levels; This represents a hierarchical index, with values ranging from 0 to... The integers correspond to different rendering levels; This represents the total number of rendering layers, which is a preset layer count parameter.
4. The point cloud rendering method according to claim 2, characterized in that, Establish a non-linear, smooth, continuous function mapping relationship between the rendering point radius and the viewing distance, where the rendering point radius... Calculated using the following exponential decay function: ; in, This represents the rendering radius of a point at a distance d from the camera in this layer, controlling the display size of the point on the screen; This represents the real-time distance from the point to be calculated to the camera; This represents the minimum rendering radius at the farthest point cloud layer from the camera. This represents the maximum rendering radius of the point cloud layer at the closest distance to the camera; This represents the decay rate constant of the rendering radius, controlling how quickly the radius decreases as distance increases.
5. The point cloud rendering method according to claim 2, characterized in that, Establish a non-linear, smooth, continuous function mapping relationship between rendering sampling probability and observation distance, and define the rendering sampling probability. Calculated using the following exponential decay function: ; in, This represents the sampling probability of a point at a distance d from the camera in this layer, controlling the probability that this point will be retained for rendering; This represents the real-time distance from the point to be calculated to the camera; This represents the minimum sampling probability at the farthest point cloud from the camera, used to reduce redundant points in the distant view; This represents the maximum sampling probability at the point cloud layer closest to the camera; The decay rate constant represents the sampling probability, controlling the rate at which the probability decreases with increasing distance.
6. The point cloud rendering method according to claim 2, characterized in that, Apply corresponding rendering parameters to point clouds at different rendering levels to perform differentiated rendering operations, including implementing the following steps in the GPU shader program: For each point cloud vertex after the rasterization stage, the corresponding rendering sampling probability is obtained according to its hierarchical index i. ; Generate pseudo-random numbers and match them with the rendering sampling probability. Comparison: If the random number is greater than the rendering sampling probability... If the random number is less than or equal to the rendering sampling probability, then the vertex is discarded. If so, then retain that vertex; For the retained vertices, the rendering sampling probability is determined according to the level to which they belong. In addition, taking into account the effects of perspective projection, the size of points in screen space is calculated, and drawing operations are performed. in, These are the rendering parameters for the corresponding layer. The rendering radius of the corresponding layer. This represents the sampling probability for rendering.
7. The point cloud rendering method according to claim 1, characterized in that, This also includes overprocessing the boundaries of multiple rendering layers, including: At the boundary between every two adjacent levels The surrounding area is defined with a width of The transition region; If the distance of point P Entering the transition region, the interpolation weight w is calculated based on the relative position of the point within the transition region; By using interpolation weight w to perform linear interpolation on the rendering radius and rendering sampling probability of two adjacent layers, the final rendering parameters of point P are obtained. and ; Use final rendering parameters and Perform a rendering operation on this point.
8. The point cloud rendering method according to claim 7, characterized in that, The formula for calculating the interpolation weight w is: ; in, This is a numerical constraint function that restricts the calculation results to the interval [0.0, 1.0]. Let P be the real-time distance from the point to be calculated to the camera. The threshold value for the hierarchical boundary between the i-th layer and the (i+1)-th layer. The width of the transition zone. This indicates the starting position of the transition zone, which is the left boundary of the transition zone.
9. The point cloud rendering method according to claim 7, characterized in that, The rendering radius and rendering sampling probability The interpolation calculation formula is: ; ; Where w represents the weight value of the interlayer parameter interpolation. , These are the rendering radii corresponding to the i-th layer and the (i+1)-th layer, respectively. , These are the rendering sampling probabilities corresponding to the i-th layer and the (i+1)-th layer, respectively.
10. A point cloud rendering system, characterized in that, include: The acquisition unit is used to acquire point cloud data of the detected object; Layered units are used to dynamically divide the three-dimensional space into multiple rendering layers based on the real-time distance from the acquired point cloud data to the current observation point; The mapping unit is used to establish a non-linear smooth continuous function mapping relationship between the rendering sampling probability and the rendering point radius and the observation distance for each rendering layer. The rendering parameters of each layer are obtained by inputting a preset representative observation distance at each layer. The rendering unit is used to apply the corresponding rendering parameters to point clouds at different rendering levels and perform differentiated rendering operations.