Point cloud data display method and device, storage medium and computer equipment
By determining the LOD value of point cloud voxels in the viewport in the point cloud data display and generating tilt loading tasks, the problems of long loading time and high memory usage of super-large point cloud data are solved, and a fast and smooth point cloud data browsing experience is achieved.
Patent Information
- Application Number
- CN202411704544.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-07
AI Technical Summary
When processing ultra-large point cloud data, the loading time is too long and the memory occupancy is high, resulting in poor user experience and low display efficiency.
By determining the requested LOD value and loaded LOD value corresponding to the point cloud voxels in the current viewport, a point cloud tilt loading task is generated, and these tasks are performed by multithreading, and the display is asynchronously updated to reduce unnecessary rendering and memory usage.
It improves the stability and response speed of large-scale point cloud browsing operations, avoids invalid data loading and redundant memory usage, and improves user experience.
Smart Images

Figure CN119577212A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, storage medium and computer equipment for displaying point cloud data. Background Art
[0002] At present, when processing ultra-large point cloud data (specifically, data sets with more than 1 billion points), there are problems such as slow loading, operation jams, and excessive memory usage. Especially when the point cloud data volume is huge or users frequently operate the point cloud, the system often needs to load a large amount of point cloud data at a certain time.
[0003] For example, the current data loading strategy is to complete the loading of the required point cloud data before refreshing the display interface. This method will result in a long loading time when processing extremely large point clouds, which will affect the user experience. In addition, since the system needs to load and maintain a large amount of point cloud data in memory, the resource utilization rate remains high. This high resource utilization not only increases the burden on the system, but also seriously affects the display efficiency. Summary of the invention
[0004] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect that the point cloud data loading strategy in the prior art has a long loading time and a high memory occupancy rate when processing ultra-large point clouds, which seriously affects the display efficiency and reduces the user experience.
[0005] The present application provides a point cloud data display method, the method comprising:
[0006] When displaying point cloud data, determine the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport, wherein the point cloud voxel is obtained by pre-blocking all the point cloud data to be loaded, and each point cloud voxel contains multiple point cloud points, each of which is organized by LOD and randomly and evenly distributed;
[0007] Generate a point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, and add the point cloud block loading task to the request pool;
[0008] The point cloud slice loading task in the request pool is executed through multi-threading, and when the trigger timing is reached, the loaded point cloud slices are merged into the corresponding point cloud voxels in the memory for display and update.
[0009] Optionally, generating a point cloud block loading task according to a requested LOD value and a loaded LOD value corresponding to the point cloud voxel includes:
[0010] Calculate the final LOD value of the point cloud voxel according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel;
[0011] A point cloud block loading task is generated according to the loaded LOD value and the termination LOD value.
[0012] Optionally, calculating the final LOD value of the point cloud voxel according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel includes:
[0013] Determine the preset point count threshold and LOD span threshold;
[0014] Determine the number of point clouds loaded this time according to the requested LOD value corresponding to the point cloud voxel, the loaded LOD value, the point number threshold and the LOD span threshold;
[0015] The final LOD value of the point cloud voxel is calculated according to the loaded LOD value and the number of point clouds loaded this time.
[0016] Optionally, adding the point cloud block loading task to a request pool includes:
[0017] When there are multiple point cloud block loading tasks, determine whether there are point cloud block loading tasks generated by the same point cloud voxel and with the same loaded LOD value among the point cloud block loading tasks;
[0018] If it exists, the point cloud block loading tasks generated by the same point cloud voxel and with the same loaded LOD value will be merged and added to the request pool;
[0019] If it does not exist, each point cloud block loading task is directly added to the request pool in sequence.
[0020] Optionally, executing the point cloud slicing loading task in the request pool through multithreading includes:
[0021] After obtaining the point cloud block loading tasks with the latest request time or the closest to the camera viewpoint from the request pool through multiple sub-threads, the point cloud blocks corresponding to the obtained point cloud block loading tasks are read from the pre-stored point cloud files, and the read point cloud blocks are added to the fusion pool.
[0022] Optionally, when the triggering timing is reached, merging the loaded point cloud slices into corresponding point cloud voxels in the memory for display and updating includes:
[0023] When the number of tasks in the fusion pool exceeds a set number threshold, the point cloud blocks in the fusion pool are merged into corresponding point cloud voxels in the memory for display and update;
[0024] Alternatively, when the refresh time interval of the system exceeds a preset time threshold, the point cloud blocks in the fusion pool are merged into corresponding point cloud voxels in the memory for display and update.
[0025] Optionally, merging the loaded point cloud slices into corresponding point cloud voxels in the memory for display and updating includes:
[0026] When merging the loaded point cloud slice into the corresponding point cloud voxel in the memory, checking whether the loaded LOD value of the point cloud voxel corresponding to the point cloud slice is equal to the starting LOD value of the point cloud slice loading task corresponding to the point cloud slice;
[0027] If they are equal, continue the merge operation;
[0028] If they are not equal, the merge operation is terminated.
[0029] Optionally, the method further comprises:
[0030] Determine the display refresh frame number corresponding to each point cloud block in the memory;
[0031] The absolute value of the difference between the display refresh frame number corresponding to each point cloud slice and the current display frame number is compared with the preset frame number threshold;
[0032] If the absolute value of the difference between the display refresh frame number corresponding to the point cloud block and the current display frame number is greater than the preset frame number threshold, the point cloud block is unloaded from the memory.
[0033] Optionally, the method further comprises:
[0034] Obtaining the memory usage of the memory;
[0035] Comparing the memory usage with a preset memory usage threshold;
[0036] If the memory occupation size is greater than the memory occupation threshold, the point cloud blocks that are not displayed in the memory are unloaded.
[0037] The present application also provides a point cloud data display device, comprising:
[0038] A value determination module, used for determining the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport when displaying the point cloud data, wherein the point cloud voxel is obtained by pre-blocking all the point cloud data to be loaded, and each point cloud voxel contains multiple point cloud points, and each point cloud point is organized according to LOD and randomly and evenly distributed;
[0039] A task generation module, used for generating a point cloud block loading task according to a requested LOD value and a loaded LOD value corresponding to the point cloud voxel, and adding the point cloud block loading task to a request pool;
[0040] The display update module is used to execute the point cloud block loading task in the request pool through multi-threading, and when the trigger timing is reached, merge the loaded point cloud blocks into the corresponding point cloud voxels in the memory for display and update.
[0041] The present application also provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the point cloud data display method as described in any one of the above embodiments.
[0042] The present application also provides a computer device, comprising: one or more processors, and a memory;
[0043] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the point cloud data display method described in any one of the above embodiments are performed.
[0044] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0045] The point cloud data display method, device, storage medium and computer equipment provided by the present application can first determine the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport when displaying the point cloud data, so as to reduce unnecessary rendering and improve display efficiency. The point cloud voxel of the present application is obtained after pre-blocking all the point cloud data to be loaded, and each point cloud voxel contains multiple point cloud points, which is conducive to block management of massive point cloud data according to specific scenarios, and timely determine the point cloud voxel in the current viewport; then, the present application can generate a point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, and add the point cloud block loading task to the request pool, and execute the point cloud block loading task in the request pool through multi-threading, so as to avoid blocking the user's operation on the main program. Finally, when the trigger timing is reached, the present application can merge the loaded point cloud blocks into the corresponding point cloud voxels in the memory for display and update, so as to ensure that the user can quickly and smoothly browse the required content when observing the point cloud data. In general, the asynchronous update display method of this application not only improves the stability and response speed of large-volume point cloud browsing operations, but also avoids invalid data loading and redundant memory usage. Users can still smoothly carry out design work while loading a large amount of point cloud data for browsing, thereby improving the user experience. In addition, the point cloud data display method of this application is not only applicable to desktop software products, but also to cloud products, thereby providing users with a variety of service methods, thereby further improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0047] Figure 1 A schematic diagram of a process flow of a point cloud data display method provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of a point cloud (2814040942 points) displayed by ZWCAD provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of the overall point cloud data display process provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of the overall point cloud data display result provided in the embodiment of the present application;
[0051] Figure 5A schematic diagram of a local point cloud data display process provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of a local point cloud data display result provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of the structure of a point cloud data display device provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0056] In one embodiment, Figure 1 As shown, Figure 1 A schematic diagram of a point cloud data display method provided in an embodiment of the present application; the present application provides a point cloud data display method, which may include:
[0057] S110: When displaying point cloud data, determine the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport.
[0058] In this step, when it is detected that the user opens the point cloud data and displays it, the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport can be determined first, so that the corresponding point cloud block loading task can be generated according to the requested LOD value and the loaded LOD value.
[0059] The point cloud voxels here are obtained by pre-blocking all the point cloud data to be loaded, and each point cloud voxel contains multiple point cloud points, each point cloud point is organized by LOD and randomly and evenly distributed. For example, the present application can construct a scene octree based on three-dimensional space, and store the points in the point cloud in the leaf nodes of the octree, and the leaf nodes of the octree can be called point cloud voxels.
[0060] Moreover, the present application organizes the points by LOD in the block, randomizes the sequence of points, and thus distributes the points randomly. Considering the uneven distribution of the point cloud points, the present application can also count the number of LOD points in each layer. For example, when the point cloud data is opened, the present application can calculate the LOD value of the point cloud voxel in the current view one by one to determine the number of point clouds that need to be loaded for each point cloud voxel. The specific determination process can be determined according to the bounding box range of the point cloud voxel. For example, the present application can be determined according to the pixel width W of the point cloud voxel on the screen in the current viewport. Specifically, it can be: assuming the point cloud size is S, when W takes (0, S], LOD=1, W takes (S, 2*S], LOD takes 2, and so on, the LOD value of each point cloud voxel can be calculated. The process of determining the number of point clouds that need to be loaded according to the LOD value of the point cloud voxel can be calculated by the existing technology, which will not be repeated here.
[0061] It is understandable that the present application manages point cloud data by organizing the point cloud in blocks according to the spatial octree structure, and organizing the point cloud in the block according to the level of detail (LOD). The LOD value of the point cloud voxel organized by the level of detail (LOD) intuitively shows its detail richness, which is closely related to the projection pixel width in the viewport. When observing from a distance, there are many voxels in the viewport but the LOD is low, thereby reducing the rendering burden; at a close distance, there are fewer voxels and higher LOD, thereby presenting more details.
[0062] In addition, since the basis of scene management is viewport information, which determines the visible area of the scene and the fine level of display, this application can reduce unnecessary rendering and improve efficiency through technologies such as invisible area culling and LOD adjustment. Moreover, the dynamic loading mechanism based on viewport information can also load data in real time according to the user's perspective and needs, thereby avoiding unnecessary data loading and waste of resources.
[0063] For example, the present application may first determine the point cloud voxels in the current viewport, where the point cloud voxels may be one or more, depending on the actual situation. After determining the point cloud voxels in the current viewport, the present application may further determine the requested LOD value and loaded LOD value corresponding to one or more point cloud voxels. It is understandable that the requested LOD value here refers to the LOD value to be loaded and displayed calculated by the pixel width of the point cloud voxels on the screen in the current viewport, and the loaded LOD value here refers to the LOD value that has been loaded and displayed in the point cloud voxels in the current viewport.
[0064] When this application determines the requested LOD value and the loaded LOD value corresponding to one or more point cloud voxels in the current viewport, it can generate the corresponding point cloud block loading task, so that the display can be updated asynchronously in a multi-threaded manner, thereby improving the stability and response speed of large-volume point cloud browsing operations, and avoiding invalid data loading and redundant memory usage.
[0065] S120: Generate a point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, and add the point cloud block loading task to the request pool.
[0066] In this step, after determining the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport through S110, the present application can generate a point cloud block loading task based on the requested LOD value and the loaded LOD value corresponding to one or more point cloud voxels, and add the point cloud block loading task to the request pool, so that point cloud data can be dynamically loaded according to demand.
[0067] Among them, this application can generate point cloud block loading tasks corresponding to all point cloud voxels in the current viewport , here Indicates Point cloud segmentation loading tasks, is the total number of point cloud block loading tasks. Then, the present application can add one or more point cloud block loading tasks to the request pool one by one. The request pool can be stored in the form of a task queue for subsequent loading and display.
[0068] S130: executing the point cloud block loading task in the request pool through multi-threading, and when the trigger timing is reached, merging the loaded point cloud blocks into the corresponding point cloud voxels in the memory for display and update.
[0069] In this step, after adding the point cloud block loading task to the request pool through S130, the present application can execute the point cloud block loading task in the request pool through multi-threading, and when the trigger timing is reached, merge the loaded point cloud blocks into the corresponding point cloud voxels in the memory for display and update.
[0070] Among them, when this application executes the point cloud block loading task through multi-threading, it can specifically include three aspects, namely task acquisition, task execution, and task completion. Task acquisition means obtaining tasks from the request pool. When obtaining tasks, the corresponding tasks can be obtained according to strategies such as the request time of each task or the time of adding to the request pool; task execution refers to operations such as reading the required point cloud binary stream from the point cloud file, displaying precompilation, etc.
[0071] It is understandable that when the application executes the point cloud block loading task through multi-threading, the task execution process is carried out in the child thread, thereby avoiding blocking the main thread, so that the main thread can remain idle to respond to user operations, thereby improving the user's operating experience. At the same time, when the request pool is empty, the child thread will be blocked to prevent it from entering an idling state, which can effectively save resources and improve the overall efficiency of the system.
[0072] Furthermore, after the point cloud blocks are loaded, the present application can actively trigger a display refresh, thereby fusing the loaded point cloud blocks to the corresponding point cloud voxels in the memory, thereby achieving instant display and update. Figure 2-Figure 6 As shown, Figure 2 A schematic diagram of a point cloud (2814040942 points) displayed by ZWCAD provided in an embodiment of the present application. Figure 3 A schematic diagram of the overall point cloud data display process provided in the embodiment of the present application, Figure 4 This is a schematic diagram of the overall point cloud data display result provided in the embodiment of the present application. Figure 5 A schematic diagram of a local point cloud data display process provided in an embodiment of the present application, Figure 6 A schematic diagram showing the display results of local point cloud data provided in the embodiment of the present application; Figure 2-Figure 6 It can be seen that through the point cloud data display method of the present application, the required content can be displayed quickly and clearly.
[0073] In the above embodiment, when displaying point cloud data, the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport can be determined first, which can reduce unnecessary rendering and improve display efficiency. The point cloud voxel of the present application is obtained after pre-blocking all the point cloud data to be loaded, and each point cloud voxel contains multiple point cloud points, which is conducive to block management of massive point cloud data according to specific scenarios, and timely determination of the point cloud voxels in the current viewport; then, the present application can generate a point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, and add the point cloud block loading task to the request pool, and execute the point cloud block loading task in the request pool through multi-threading, so as to avoid blocking the user's operation of the main program. Finally, when the trigger timing is reached, the present application can merge the loaded point cloud blocks into the corresponding point cloud voxels in the memory for display and update, thereby ensuring that the user can quickly and smoothly browse the required content when observing the point cloud data. In general, the asynchronous update display method of this application not only improves the stability and response speed of large-volume point cloud browsing operations, but also avoids invalid data loading and redundant memory usage. Users can still smoothly carry out design work while loading a large amount of point cloud data for browsing, thereby improving the user experience. In addition, the point cloud data display method of this application is not only applicable to desktop software products, but also to cloud products, thereby providing users with a variety of service methods, thereby further improving the user experience.
[0074] In one embodiment, generating a point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in S120 may include:
[0075] S121: Calculate the final LOD value of the point cloud voxel according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel.
[0076] S122: Generate a point cloud block loading task according to the loaded LOD value and the termination LOD value.
[0077] In this embodiment, when generating a point cloud block loading task, for each point cloud voxel, the present application can first calculate the terminal LOD value of the point cloud voxel based on the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, and then generate the point cloud block loading task based on the loaded LOD value and the terminal LOD value.
[0078] For example, for a point cloud voxel P, its currently loaded LOD value is s, and the requested LOD value calculated by the current viewport is r. In this case, a point cloud block loading task with LOD values between s and r can be generated. In addition, considering that too many points corresponding to a single point cloud block loading task can easily affect the loading efficiency, this application can also impose certain restrictions on r, and calculate e according to a certain calculation logic, that is, only a point cloud block loading task with LOD values between s and e is generated at a time, and the remaining part from e to r will be processed the next time the display is refreshed.
[0079] It is understandable that in this application, when the display is refreshed once, one point cloud voxel generates at most one point cloud block loading task, and different point cloud voxels can generate multiple point cloud block loading tasks.
[0080] In one embodiment, calculating the final LOD value of the point cloud voxel according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in S121 may include:
[0081] S1211: Determine a preset point count threshold and LOD span threshold.
[0082] S1212: Determine the number of point clouds loaded this time according to the requested LOD value corresponding to the point cloud voxel, the loaded LOD value, the point number threshold and the LOD span threshold.
[0083] S1213: Calculate the final LOD value of the point cloud voxel according to the loaded LOD value and the number of point clouds loaded this time.
[0084] In this embodiment, considering that too many points corresponding to a single point cloud block loading task may easily affect the loading efficiency, when calculating the termination LOD value of the point cloud voxel according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, the present application can first determine the preset point count threshold and LOD span threshold, and then determine the number of point clouds loaded this time according to the requested LOD value, the loaded LOD value, the point count threshold and the LOD span threshold corresponding to the point cloud voxel. In this way, the termination LOD value of the point cloud voxel can be calculated based on the loaded LOD value and the number of point clouds loaded this time.
[0085] Among them, this application can calculate the termination LOD value by the following formula:
[0086]
[0087] In the above formula, To terminate the LOD value, is the loaded LOD value, To request LOD values, is the point threshold, is the LOD span threshold, express arrive The number of points corresponding to the interval, the above formula represents: The value of must meet three conditions: 1) and between; 2) and The span is less than ; 3) arrive The number of points corresponding to the interval is less than .
[0088] In one embodiment, adding the point cloud block loading task to the request pool in S120 may include:
[0089] S123: When there are multiple point cloud block loading tasks, determine whether there are point cloud block loading tasks generated by the same point cloud voxel and with the same loaded LOD value among the point cloud block loading tasks.
[0090] S124: If so, point cloud block loading tasks generated by the same point cloud voxel and with the same loaded LOD value are merged and added to the request pool.
[0091] S125: If it does not exist, directly add each point cloud block loading task to the request pool in sequence.
[0092] In this embodiment, in the process of adding the point cloud block loading task to the request pool, the number of point cloud block loading tasks can be determined first. If there are multiple point cloud block loading tasks, it can be determined first whether there are point cloud block loading tasks generated by the same point cloud voxel and with the same loaded LOD value. If so, the repeated or overlapping tasks are merged to reduce redundancy and improve the overall efficiency of the system; if not, each point cloud block loading task is directly added to the request pool in sequence. When there is only one point cloud block loading task, the point cloud block loading task can also be directly added to the request pool and wait for the triggering opportunity.
[0093] In one embodiment, executing the point cloud block loading task in the request pool through multithreading in S130 may include:
[0094] After obtaining the point cloud block loading tasks with the latest request time or the closest to the camera viewpoint from the request pool through multiple sub-threads, the point cloud blocks corresponding to the obtained point cloud block loading tasks are read from the pre-stored point cloud files, and the read point cloud blocks are added to the fusion pool.
[0095] In this embodiment, when executing the point cloud block loading task in the request through multiple threads, multiple sub-threads can be used to obtain the point cloud block loading task with the most recent request time or the closest to the camera viewpoint from the request pool respectively, and then read the point cloud block corresponding to the obtained point cloud block loading task from the pre-stored point cloud file. In this way, the point cloud in the center of the screen can be loaded first, thereby presenting an effect of gradually spreading encryption from the center to the outside.
[0096] In addition, when the present application executes the point cloud slicing and loading task through multi-threading, the completed task can be added to the fusion pool, which is stored in the form of a task queue, so that it is convenient to obtain the task and perform related settings on it.
[0097] In one embodiment, when the triggering timing is reached in S130, merging the loaded point cloud slices into corresponding point cloud voxels in the memory for display and updating may include:
[0098] S131: When the number of tasks in the fusion pool exceeds a set number threshold, the point cloud blocks in the fusion pool are merged into corresponding point cloud voxels in the memory for display and update.
[0099] S132: Alternatively, when the refresh time interval of the system exceeds a preset time threshold, the point cloud blocks in the fusion pool are merged into corresponding point cloud voxels in the memory for display and update.
[0100] In this embodiment, after the point cloud block data is loaded, the system can actively trigger a display refresh to merge the loaded point cloud blocks into the point cloud voxels in the memory to achieve real-time display and update.
[0101] For example, when the number of tasks in the fusion pool exceeds the set number threshold, the system will automatically trigger a display refresh. In addition, in order to avoid the point cloud not being refreshed for a long time, the system can also set a preset time threshold. If it is not refreshed within the specified time, it will actively trigger a display refresh. After the display refresh is triggered by this method, the main thread can call the display refresh, and the point cloud slices are taken out of the fusion pool and merged into the corresponding point cloud voxels for subsequent display.
[0102] In one embodiment, merging the loaded point cloud slices into corresponding point cloud voxels in the memory for display and updating in S130 may include:
[0103] S310: When merging the loaded point cloud slices into the corresponding point cloud voxels in the memory, check whether the loaded LOD value of the point cloud voxels corresponding to the point cloud slice is equal to the starting LOD value of the point cloud slice loading task corresponding to the point cloud slice.
[0104] S311: If they are equal, continue to perform the merge operation.
[0105] S312: If they are not equal, terminate the merge operation.
[0106] In this embodiment, when the loaded point cloud slices are merged into the corresponding point cloud voxels in the memory for display and updating, validity verification can be performed during the merging process to check whether the LOD (level of detail) value of the loaded voxels is equal to the starting LOD value of the task. For example, the present application can check whether the loaded LOD value of the point cloud voxel corresponding to the point cloud slice is equal to the starting LOD value of the point cloud slice loading task corresponding to the point cloud slice. Only when the two are equal, the merging operation will be performed to ensure the consistency and accuracy of the data.
[0107] In one embodiment, the method may further include:
[0108] S140: Determine the display refresh frame number corresponding to each point cloud block in the memory.
[0109] S141: Compare the absolute value of the difference between the display refresh frame number corresponding to each point cloud slice and the current display frame number with a preset frame number threshold.
[0110] S142: If the absolute value of the difference between the display refresh frame number corresponding to the point cloud block and the current display frame number is greater than the preset frame number threshold, the point cloud block is unloaded from the memory.
[0111] In this embodiment, considering the risk of system memory exhaustion and the problem of browsing freezes caused by excessive memory usage, the present application can unload point cloud slices that have not been displayed for a long time.
[0112] Specifically, the present application can first determine the display refresh frame number corresponding to each point cloud slice in the memory, and then compare the absolute value of the difference between the display refresh frame number corresponding to each point cloud slice and the current display frame number with the preset frame number threshold. If the absolute value of the difference between the display refresh frame number corresponding to one or more point cloud slices and the current display frame number is greater than the preset frame number threshold, one or more point cloud slices are unloaded from the memory. This can not only reduce memory usage but also avoid stuttering.
[0113] It can be understood that the point cloud slice of the present application records the current display refresh frame number, and each display refresh corresponds to a unique frame value, which accumulates with the increase in the number of display refreshes. During the display refresh process, the present application can refresh only the frames in the point cloud slice that need to be displayed according to the viewport information. When the frame number in the point cloud slice has not been refreshed for many times, the point cloud slice is unloaded from the voxel, thereby reducing memory usage.
[0114] In one embodiment, the method may further include:
[0115] S150: Obtain the memory usage size of the memory.
[0116] S151: Compare the memory occupancy size with a preset memory occupancy threshold.
[0117] S152: If the memory usage size is greater than the memory usage threshold, unloading the point cloud blocks that are not displayed in the memory.
[0118] In this embodiment, considering the risk of system memory exhaustion and the browsing lag caused by excessive memory usage, the present application can also unload point cloud blocks that have not been displayed for a long time after the point cloud memory usage reaches a certain threshold.
[0119] Specifically, the present application can first obtain the memory usage size of the memory, and then compare it with the preset memory usage threshold. If the memory usage size is greater than the memory usage threshold, the point cloud blocks that are not displayed in the memory will be unloaded. This reduces memory usage while ensuring data display refresh efficiency.
[0120] The point cloud data display device provided in the embodiment of the present application is described below. The point cloud data display device described below and the point cloud data display method described above can be referenced to each other.
[0121] In one embodiment, Figure 7 As shown, Figure 7 This is a schematic diagram of the structure of a point cloud data display device provided in an embodiment of the present application; the present application also provides a point cloud data display device, which may include a value determination module 210, a task generation module 220, and a display update module 230, which specifically include the following:
[0122] The numerical determination module 210 is used to determine the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport when displaying the point cloud data, wherein the point cloud voxel is obtained by pre-blocking all the point cloud data to be loaded, and each point cloud voxel contains multiple point cloud points, and each point cloud point is organized by LOD and randomly and evenly distributed.
[0123] The task generation module 220 is used to generate a point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, and add the point cloud block loading task to the request pool.
[0124] The display update module 230 is used to execute the point cloud block loading task in the request pool through multi-threading, and when the triggering time is reached, merge the loaded point cloud blocks into the corresponding point cloud voxels in the memory for display and update.
[0125] In the above embodiment, when displaying point cloud data, the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport can be determined first, which can reduce unnecessary rendering and improve display efficiency. The point cloud voxel of the present application is obtained by pre-blocking all the point cloud data to be loaded, and each point cloud voxel contains multiple point clouds, which is conducive to block management of massive point cloud data according to specific scenarios, and timely determination of the point cloud voxels in the current viewport; then, the present application can generate a point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, and add the point cloud block loading task to the request pool, and execute the point cloud block loading task in the request pool through multi-threading, so as to avoid blocking the user's operation of the main program. Finally, when the trigger timing is reached, the present application can merge the loaded point cloud blocks into the corresponding point cloud voxels in the memory for display and update, thereby ensuring that the user can quickly and smoothly browse the required content when observing the point cloud data. In general, the asynchronous update display method of this application not only improves the stability and response speed of large-volume point cloud browsing operations, but also avoids invalid data loading and redundant memory usage. Users can still smoothly carry out design work while loading a large amount of point cloud data for browsing, thereby improving the user experience. In addition, the point cloud data display method of this application is not only applicable to desktop software products, but also to cloud products, thereby providing users with a variety of service methods, thereby further improving the user experience.
[0126] In one embodiment, the present application also provides a computer-readable storage medium, which stores computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors perform the steps of the point cloud data display method described in any one of the above embodiments.
[0127] In one embodiment, the present application also provides a computer device, including: one or more processors, and a memory.
[0128] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the point cloud data display method described in any one of the above embodiments are performed.
[0129] Indicatively, Figure 8 As shown, Figure 8 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 300 may be provided as a server. Figure 8 The computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301 for storing instructions executable by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to perform the point cloud data display method of any of the above embodiments.
[0130] The computer device 300 may further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.
[0131] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0132] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0133] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0134] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A point cloud data display method, characterized in that: The method comprises: When displaying point cloud data, determine the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport, wherein the point cloud voxel is obtained by pre-blocking all the point cloud data to be loaded, and each point cloud voxel contains multiple point cloud points, each of which is organized by LOD and randomly and evenly distributed; Generate a point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, and add the point cloud block loading task to the request pool; The point cloud slice loading task in the request pool is executed through multi-threading, and when the trigger timing is reached, the loaded point cloud slices are merged into the corresponding point cloud voxels in the memory for display and update.
2. The point cloud data display method according to claim 1, characterized in that: The generating of the point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel includes: Calculate the final LOD value of the point cloud voxel according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel; A point cloud block loading task is generated according to the loaded LOD value and the termination LOD value.
3. The point cloud data display method according to claim 2, characterized in that: The calculating the final LOD value of the point cloud voxel according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel includes: Determine the preset point count threshold and LOD span threshold; Determine the number of point clouds loaded this time according to the requested LOD value corresponding to the point cloud voxel, the loaded LOD value, the point number threshold and the LOD span threshold; The final LOD value of the point cloud voxel is calculated according to the loaded LOD value and the number of point clouds loaded this time.
4. The point cloud data display method according to claim 1, characterized in that: The step of adding the point cloud block loading task to the request pool includes: When there are multiple point cloud block loading tasks, determine whether there are point cloud block loading tasks generated by the same point cloud voxel and with the same loaded LOD value among the point cloud block loading tasks; If it exists, the point cloud block loading tasks generated by the same point cloud voxel and with the same loaded LOD value will be merged and added to the request pool; If it does not exist, each point cloud block loading task is directly added to the request pool in sequence.
5. The point cloud data display method according to claim 1, characterized in that: The executing the point cloud block loading task in the request pool through multithreading includes: After obtaining the point cloud block loading tasks with the latest request time or the closest to the camera viewpoint from the request pool through multiple sub-threads, the point cloud blocks corresponding to the obtained point cloud block loading tasks are read from the pre-stored point cloud files, and the read point cloud blocks are added to the fusion pool.
6. The point cloud data display method according to claim 5, characterized in that: When the triggering time is reached, the loaded point cloud blocks are merged into the corresponding point cloud voxels in the memory for display and update, including: When the number of tasks in the fusion pool exceeds a set number threshold, the point cloud blocks in the fusion pool are merged into corresponding point cloud voxels in the memory for display and update; Alternatively, when the refresh time interval of the system exceeds a preset time threshold, the point cloud blocks in the fusion pool are merged into corresponding point cloud voxels in the memory for display and update.
7. The point cloud data display method according to claim 1, characterized in that: The step of merging the loaded point cloud blocks into corresponding point cloud voxels in the memory for display and updating includes: When merging the loaded point cloud slice into the corresponding point cloud voxel in the memory, checking whether the loaded LOD value of the point cloud voxel corresponding to the point cloud slice is equal to the starting LOD value of the point cloud slice loading task corresponding to the point cloud slice; If they are equal, continue the merge operation; If they are not equal, the merge operation is terminated.
8. The point cloud data display method according to any one of claims 1 to 7, characterized in that: The method further comprises: Determine the display refresh frame number corresponding to each point cloud block in the memory; The absolute value of the difference between the display refresh frame number corresponding to each point cloud slice and the current display frame number is compared with the preset frame number threshold; If the absolute value of the difference between the display refresh frame number corresponding to the point cloud block and the current display frame number is greater than the preset frame number threshold, the point cloud block is unloaded from the memory.
9. The point cloud data display method according to any one of claims 1 to 7, characterized in that: The method further comprises: Obtaining the memory usage of the memory; Comparing the memory usage with a preset memory usage threshold; If the memory occupation size is greater than the memory occupation threshold, the point cloud blocks that are not displayed in the memory are unloaded.
10. A point cloud data display device, characterized in that: include: A value determination module, used for determining the requested LOD value and the loaded LOD value corresponding to the point cloud voxel in the current viewport when displaying the point cloud data, wherein the point cloud voxel is obtained by pre-blocking all the point cloud data to be loaded, and each point cloud voxel contains multiple point cloud points, and each point cloud point is organized according to LOD and randomly and evenly distributed; A task generation module, used for generating a point cloud block loading task according to the requested LOD value and the loaded LOD value corresponding to the point cloud voxel, and adding the point cloud block loading task to the request pool; The display update module is used to execute the point cloud block loading task in the request pool through multi-threading, and when the trigger timing is reached, merge the loaded point cloud blocks into the corresponding point cloud voxels in the memory for display and update.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the point cloud data display method according to any one of claims 1 to 9.
12. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the point cloud data display method according to any one of claims 1 to 9 are performed.