Data rendering method, apparatus, device, and medium
By removing data that does not fall within the preset viewpoint from the point cloud data and filtering based on the number of screen pixels, the problem of low rendering efficiency of large-scale point cloud data is solved, and rendering efficiency is improved without sacrificing accuracy.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHINING 3D TECH CO LTD
- Filing Date
- 2025-11-18
- Publication Date
- 2026-06-25
AI Technical Summary
Rendering large-scale point cloud data requires a lot of computer resources. Using point cloud compression algorithms will lead to a loss of data accuracy. Existing technologies make it difficult to improve rendering efficiency without sacrificing rendering accuracy.
By deleting data that does not fall within the preset imaging viewpoint from single-frame point cloud data, the number of pixels to be processed is determined based on the expected pixel threshold and the number of screen pixels, and then filtered according to the screen depth value, and rendered using a preset lighting model.
Without sacrificing the rendering accuracy of point cloud data, the amount of rendering data was reduced, rendering efficiency was improved, and secondary filtering and retention of effective data were achieved.
Smart Images

Figure CN2025135757_25062026_PF_FP_ABST
Abstract
Description
A data rendering method, apparatus, device, or medium Cross-references to related applications
[0001] This application claims priority to Chinese Patent Application No. 2024118540559, filed on December 16, 2024, entitled “A Data Rendering Method, Apparatus, Device, Medium and Program Product”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of image processing technology, and in particular to a data rendering method, apparatus, device, and medium. Background Technology
[0003] Point clouds are three-dimensional model representations composed of a large number of discrete points, widely used in computer graphics, computer vision, virtual reality, and 3D reconstruction. With the development of related technologies, the scale and complexity of point cloud data are constantly increasing, placing higher demands on the rendering performance of computer equipment. In other words, large-scale point cloud data requires significant computer resources to render and display images. If point cloud compression algorithms are used to compress large-scale point cloud data, the data precision will be lost due to the limitations of the algorithm's principles, resulting in insufficient rendering accuracy. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a data rendering method, apparatus, device, medium, and program product to improve rendering efficiency without sacrificing the rendering accuracy of point cloud data. The specific solution is as follows.
[0005] In a first aspect, embodiments of this application provide a data rendering method, comprising: acquiring single-frame point cloud data; deleting point cloud data that does not fall within a preset imaging viewpoint from the single-frame point cloud data to obtain point cloud data to be screened; determining the number of pixels to be processed based on an expected pixel threshold and the number of screen pixels; ensuring that the number of pixels to be processed is not greater than the number of screen pixels; filtering each point data in the point cloud data to be screened according to the number of pixels to be processed and the screen depth value corresponding to each pixel to be processed; and rendering the screened target point cloud data.
[0006] Optionally, point cloud data that does not fall within the preset imaging viewpoint is deleted from a single frame of point cloud data to obtain point cloud data to be screened, including: spatially segmenting the single frame of point cloud data to obtain multiple blocks of point cloud data; determining the preset imaging viewpoint based on the viewpoint position; and deleting point cloud data that does not fall within the preset imaging viewpoint from the multiple blocks of point cloud data to obtain point cloud data to be screened.
[0007] Optionally, determining the number of pixels to be processed based on the expected pixel threshold and the number of screen pixels includes: obtaining the user-set expected pixel threshold; determining the expected number of pixels based on the expected pixel threshold; if the expected number of pixels is not greater than the number of screen pixels, then determining the expected number of pixels as the number of pixels to be processed; if the expected number of pixels is greater than the number of screen pixels, then determining the number of screen pixels as the number of pixels to be processed.
[0008] Optionally, determining the desired number of pixels based on the desired pixel threshold includes: if the desired pixel threshold is a scaling factor, then the product of the scaling factor and the number of screen pixels is used as the desired number of pixels; if the desired pixel threshold is an integer, then the integer is used as the desired number of pixels.
[0009] Optionally, based on the number of pixels to be processed and the screen depth value corresponding to each pixel, the data of each point in the point cloud data to be screened is filtered, including: determining the space size of the first buffer, the second buffer, and the third buffer according to the number of pixels to be processed, and creating the first buffer, the second buffer, and the third buffer; traversing each point in the point cloud data to be screened in parallel according to the GPU parallelism; for each point data traversed, calculating the screen coordinates and current depth value corresponding to the current point data in screen space, and determining the current pixel to be processed mapped by the screen coordinates; if the screen depth value corresponding to the current pixel to be processed is read from the third buffer, determining whether the current depth value is less than the screen depth value. The current depth value is used to replace the screen depth value recorded in the third buffer with the current depth value. The sequence number of the current point data is updated in the second buffer, and the current point data is updated in the first buffer. Then, the traversal of other point data in the point cloud data to be screened continues. If the screen depth value corresponding to the current pixel is not read from the third buffer, or if the current depth value is not less than the screen depth value corresponding to the current pixel, no operation is performed on the first, second, and third buffers, and the traversal of other point data in the point cloud data to be screened continues. After the traversal is completed, all point data in the first buffer are used as the target point cloud data obtained by screening.
[0010] Optionally, the selected target point cloud data is rendered, including: performing lighting calculations on the target point cloud data using a preset lighting model, and displaying the rendered image on the screen based on the lighting calculation results.
[0011] Optionally, acquiring single-frame point cloud data includes: acquiring single-frame point cloud data from a 3D video model; correspondingly, after rendering the selected target point cloud data, the process further includes: acquiring the next frame of the single-frame point cloud data from the 3D video model as single-frame point cloud data, and deleting point cloud data that does not fall within the preset imaging viewpoint from the single-frame point cloud data to obtain the point cloud data to be screened and other subsequent steps, until all frames in the 3D video model are rendered.
[0012] Secondly, embodiments of this application provide a data rendering apparatus, comprising: an acquisition module configured to acquire single-frame point cloud data; a deletion module configured to delete point cloud data that does not fall within a preset imaging viewpoint from the single-frame point cloud data to obtain point cloud data to be screened; a determination module configured to determine the number of pixels to be processed based on a desired pixel threshold and the number of screen pixels; wherein the number of pixels to be processed is not greater than the number of screen pixels; a filtering module configured to filter each point data in the point cloud data to be screened according to the number of pixels to be processed and the screen depth value corresponding to each pixel to be processed; and a rendering module configured to render the filtered target point cloud data.
[0013] Optionally, the deletion module is specifically configured to: spatially segment the single-frame point cloud data to obtain multiple point cloud data blocks; determine a preset imaging angle based on the viewpoint position; and delete point cloud data blocks that do not fall within the preset imaging angle to obtain point cloud data to be screened.
[0014] Optionally, the determination module is specifically configured to: obtain the user-defined expected pixel threshold; determine the expected number of pixels based on the expected pixel threshold; if the expected number of pixels is not greater than the number of screen pixels, then determine the expected number of pixels as the number of pixels to be processed; if the expected number of pixels is greater than the number of screen pixels, then determine the number of screen pixels as the number of pixels to be processed.
[0015] Optionally, the determining module is specifically configured as follows: if the desired pixel threshold is a scaling factor, then the product of the scaling factor and the number of screen pixels is used as the desired pixel count; if the desired pixel threshold is an integer, then the integer is used as the desired pixel count.
[0016] Optionally, the filtering module is specifically configured to: determine the size of the first buffer, second buffer, and third buffer according to the number of pixels to be processed, and create the first buffer, second buffer, and third buffer; traverse each point data in the point cloud data to be filtered in parallel according to the GPU parallelism; for each traversed point data, calculate the screen coordinates and current depth value corresponding to the current point data in screen space, and determine the current pixel to be processed mapped by the screen coordinates; if the screen depth value corresponding to the current pixel to be processed is read from the third buffer, determine whether the current depth value is less than the screen depth value; if the current depth value is less than the screen depth value, then... Replace the screen depth value corresponding to the current pixel to be processed recorded in the third buffer with the current depth value, update the sequence number of the current point data to the second buffer, update the current point data to the first buffer, and then continue to traverse other point data in the point cloud data to be screened; if the screen depth value corresponding to the current pixel to be processed is not read from the third buffer, or the current depth value is not less than the screen depth value corresponding to the current pixel to be processed, then no operation is performed on the first buffer, the second buffer, and the third buffer, and the traversal of other point data in the point cloud data to be screened continues; after the traversal is completed, all point data in the first buffer are used as the target point cloud data obtained by screening.
[0017] Optionally, the rendering module is specifically configured to: perform lighting calculations on the target point cloud data using a preset lighting model, and display the rendered image on the screen based on the lighting calculation results.
[0018] Optionally, the acquisition module is specifically configured to: acquire single-frame point cloud data from the 3D video model; correspondingly, the acquisition module is also configured to: acquire the next frame of the single-frame point cloud data from the 3D video model as the single-frame point cloud data, and execute the steps in subsequent modules until all frames in the 3D video model are rendered.
[0019] Thirdly, embodiments of this application provide an electronic device, including: a memory configured to store a computer program; and a processor configured to execute the computer program to implement the aforementioned disclosed data rendering method.
[0020] Fourthly, embodiments of this application provide a non-volatile storage medium configured to store a computer program, wherein the computer program, when executed by a processor, implements the aforementioned disclosed data rendering method.
[0021] Fifthly, embodiments of this application provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the aforementioned disclosed data rendering method.
[0022] As can be seen from the above scheme, the embodiments of this application provide a data rendering method, including: acquiring single-frame point cloud data; deleting point cloud data that does not fall within a preset imaging viewpoint from the single-frame point cloud data to obtain point cloud data to be screened; determining the number of pixels to be processed based on the expected pixel threshold and the number of screen pixels; ensuring that the number of pixels to be processed is not greater than the number of screen pixels; filtering each point data in the point cloud data to be screened according to the number of pixels to be processed and the screen depth value corresponding to each pixel to be processed; and rendering the screened target point cloud data.
[0023] As can be seen, this embodiment of the application, for single-frame point cloud data, first reduces the data volume based on a preset imaging viewpoint, then determines the number of pixels to be processed that is no greater than the number of screen pixels, and filters each point data in the point cloud data to be filtered according to the number of pixels to be processed and the screen depth value corresponding to each pixel, thus achieving a secondary filtering of effective data. Finally, the filtered target point cloud data is rendered. Therefore, by reducing invalid data once and filtering and retaining effective data once, the amount of rendering data is reduced, rendering efficiency is improved, and since both invalid data reduction and effective data filtering effectively retain usable data, the rendering accuracy of the point cloud data is not reduced, thus achieving the goal of improving rendering efficiency without sacrificing the rendering accuracy of the point cloud data.
[0024] Correspondingly, the data rendering apparatus, device, medium, and program product provided in this application also have the above-mentioned technical effects. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0026] Figure 1 is a flowchart of a data rendering method disclosed in an embodiment of this application;
[0027] Figure 2 is a flowchart of another data rendering method disclosed in an embodiment of this application;
[0028] Figure 3 is a schematic diagram of a data rendering device disclosed in an embodiment of this application;
[0029] Figure 4 is a schematic diagram of an electronic device disclosed in an embodiment of this application;
[0030] Figure 5 is a server structure diagram provided in an embodiment of this application;
[0031] Figure 6 is a terminal structure diagram provided in an embodiment of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other instances obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0033] Currently, point clouds are a three-dimensional model representation composed of a large number of discrete points, widely used in computer graphics, computer vision, virtual reality, and 3D reconstruction. With the development of related technologies, the scale and complexity of point cloud data are constantly increasing, placing higher demands on the rendering performance of computer equipment. Specifically, large-scale point cloud data requires significant computer resources to render and display images. If point cloud compression algorithms are used to compress large-scale point cloud data, data precision will be lost due to the limitations of the algorithm's principles, resulting in insufficient rendering accuracy. Therefore, this application provides a data rendering scheme that can improve rendering efficiency without sacrificing the rendering precision of point cloud data.
[0034] Referring to Figure 1, this application discloses a data rendering method, including:
[0035] S101. Obtain single-frame point cloud data.
[0036] In this embodiment, a single frame of point cloud data can be any frame of data in a 3D video model. According to this embodiment, each frame of data in the 3D video model can be rendered and displayed. Therefore, in one implementation, obtaining single frame point cloud data includes: obtaining single frame point cloud data from a 3D video model; correspondingly, after rendering the selected target point cloud data, it further includes: obtaining the next frame of the single frame point cloud data from the 3D video model as single frame point cloud data, and performing the deletion of point cloud data that does not fall within the preset imaging viewpoint from the single frame point cloud data to obtain the point cloud data to be screened and subsequent other steps, until all frames in the 3D video model are rendered.
[0037] S102. Delete the point cloud data that does not fall within the preset imaging viewpoint from the single frame point cloud data to obtain the point cloud data to be screened.
[0038] It should be noted that the observation range corresponding to the observation point position can be determined based on the preset imaging viewpoint. A frame of point cloud data may not completely fall within the preset imaging viewpoint, that is, it may not completely fall within the observation range corresponding to the observation point position. Therefore, in one embodiment, the point cloud data that does not fall within the preset imaging viewpoint is deleted from a single frame of point cloud data to obtain the point cloud data to be screened, including: spatially segmenting the single frame of point cloud data to obtain multiple point cloud data blocks; determining the preset imaging viewpoint based on the viewpoint position; and deleting the point cloud data that does not fall within the preset imaging viewpoint from the multiple point cloud data blocks to obtain the point cloud data to be screened.
[0039] S103. Determine the number of pixels to be processed based on the expected pixel threshold and the number of screen pixels.
[0040] In one implementation, determining the number of pixels to be processed based on a desired pixel threshold and the number of screen pixels includes: obtaining a user-defined desired pixel threshold; determining a desired number of pixels based on the desired pixel threshold; if the desired number of pixels is not greater than the number of screen pixels, then determining the desired number of pixels to be processed; if the desired number of pixels is greater than the number of screen pixels, then determining the number of screen pixels to be processed. This ensures that the number of pixels to be processed is not greater than the number of screen pixels, thereby reducing the amount of data that needs to be rendered.
[0041] In one implementation, determining the desired number of pixels based on a desired pixel threshold includes: if the desired pixel threshold is a scaling factor, then the product of the scaling factor and the number of screen pixels is used as the desired number of pixels; if the desired pixel threshold is an integer, then the integer is used as the desired number of pixels. For example: if the desired pixel threshold is one-third, then the number of screen pixels multiplied by 1 / 3 is the desired number of pixels; if the desired pixel threshold is 200,000,000 pixels, then the desired number of pixels is 200,000,000.
[0042] S104. Based on the number of pixels to be processed and the screen depth value corresponding to each pixel, filter the data of each point in the point cloud data to be screened.
[0043] In one implementation, the point data in the point cloud data to be screened is filtered according to the number of pixels to be processed and the screen depth value corresponding to each pixel. This includes: determining the space size of a first buffer, a second buffer, and a third buffer according to the number of pixels to be processed, and creating the first buffer, the second buffer, and the third buffer; traversing each point data in the point cloud data to be screened in parallel according to the GPU parallelism; for each traversed point data, calculating the screen coordinates and current depth value corresponding to the current point data in screen space, and determining the current pixel to be processed mapped by the screen coordinates; if the screen depth value corresponding to the current pixel to be processed is read from the third buffer, determining whether the current depth value is small. If the current depth value is less than the screen depth value, then the current depth value is used to replace the screen depth value corresponding to the current pixel to be processed recorded in the third buffer, and the sequence number of the current point data is updated to the second buffer, and the current point data is updated to the first buffer. Then, the traversal of other point data in the point cloud data to be screened continues. If the screen depth value corresponding to the current pixel to be processed is not read from the third buffer, or the current depth value is not less than the screen depth value corresponding to the current pixel to be processed, then no operation is performed on the first buffer, the second buffer, and the third buffer, and the traversal of other point data in the point cloud data to be screened continues. After the traversal is completed, all point data in the first buffer is used as the target point cloud data obtained by screening.
[0044] As can be seen, the first buffer is used to record the target point cloud data; the second buffer is used to record the sequence number of each point in the target point cloud data; and the third buffer is used to record the screen depth value corresponding to all pixels to be processed. Furthermore, since the number of all pixels to be processed is no greater than the number of screen pixels, the amount of data that the first, second, and third buffers need to record is relatively small, thereby improving the filtering efficiency.
[0045] S105. Render the selected target point cloud data.
[0046] In one implementation, rendering the selected target point cloud data includes: performing lighting calculations on the target point cloud data using a preset lighting model, and displaying the rendered image on the screen based on the lighting calculation results. The preset lighting model can be, for example, Lambertian, Blinn-Phong, or Cook-Torrance.
[0047] As can be seen, this embodiment, for single-frame point cloud data, first reduces the data volume based on a preset imaging viewpoint, then determines the number of pixels to be processed that is no greater than the number of screen pixels, and filters each point data in the point cloud data based on the number of pixels to be processed and the screen depth value corresponding to each pixel, achieving a secondary filtering of effective data. Finally, the filtered target point cloud data is rendered. Thus, by reducing invalid data once and retaining effective data once, the amount of rendering data is reduced, rendering efficiency is improved, and since both invalid data reduction and effective data filtering effectively retain usable data, the rendering accuracy of the point cloud data is not reduced, achieving the goal of improving rendering efficiency without sacrificing the rendering accuracy of the point cloud data.
[0048] Referring to Figure 2, in the application phase, for large-volume point cloud data, its spatial structure information is calculated, and a screen spatial buffer and a pre-culling point cloud model are created. Spatial structure information is added using a spatial segmentation data structure. The spatial segmentation data structure can use a KD-tree (k-dimensional tree) or other data structures. The number of vertices in the pre-culling point cloud model is equal to the number of screen pixels, and its vertex data is set to default values. Further, a pre-culling point cloud data buffer (i.e., the first buffer), a vertex index buffer (i.e., the second buffer), and a screen depth buffer (i.e., the third buffer) are created. The sizes of these three buffers are set based on the number of pixels to be processed. In this embodiment, the sizes of the three buffers are set based on the number of screen pixels.
[0049] In the pre-elimination calculation stage, parallel computing execution units are first created. These parallel computing execution units perform the elimination of point cloud data outside the imaging cone and the elimination of point cloud data with spatial occlusion relationships in a parallel manner.
[0050] Specifically, the removal of point cloud data outside the imaging visual cone involves: determining the spatial structure of the imaging visual cone based on the viewpoint position for all point cloud data, and removing all point cloud data outside the imaging visual cone. In other words, all points in the point cloud data outside the main point cloud data will no longer participate in subsequent steps, reducing the amount of data and achieving performance optimization.
[0051] Specifically, the aforementioned pre-culled point cloud data buffer is used to store the final rendered point cloud data; the vertex index buffer is used to store the index of each pixel on the screen; and the screen depth buffer is used to store the depth value of the pixel corresponding to the point closest to the viewpoint. Before rendering a frame of data, the pre-culled point cloud data buffer is reset to its default value, and values outside the imaging frustum are not displayed; the vertex index buffer is reset to its default value; and the screen depth buffer is reset to its default value, which is determined based on the relationship between the depth value and the viewpoint distance on the currently used graphics interface, generally being an extremely large or small value. Then, all points in the point cloud data within the imaging frustum are traversed, ordered from closest to furthest from the viewpoint.
[0052] For each traversed point, its 3D coordinates are used to perform a spatial matrix operation to obtain its pixel coordinates and depth value in screen space. This depth value is then compared with the corresponding depth value recorded in the screen depth buffer. If the calculated depth value is closer to the viewpoint (i.e., the calculated depth value is less than the corresponding depth value recorded in the screen depth buffer), the traversed point is considered unoccluded, and its index is updated to the corresponding pixel coordinate position in the vertex index buffer. Otherwise, the traversed point is considered occluded, and its index is not recorded in the vertex index buffer; that is, the vertex index buffer is not operated on, and subsequent processing operations for occluded points can be omitted.
[0053] After traversing all points in the point cloud data within the imaging frustum, the vertex position, normal, and color of each point in 3D space are determined based on the point index recorded in the vertex index buffer, and this data is written to the pre-culling point cloud data buffer. The next step is to perform lighting calculations on all data in the pre-culling point cloud data buffer using the lighting model required by the business. Any lighting model can be selected for lighting calculations, such as Lambertian, Blinn-Phong, and Cook-Torrance.
[0054] After a frame of point cloud data is rendered and displayed, the next frame is rendered using the parameters described above, thus enabling continuous rendering and display of 3D images.
[0055] It should be noted that this embodiment is implemented on the GPU, which can further improve rendering efficiency. In this scheme, the number of points to be rendered is not related to the amount of input point cloud data, but to the number of screen pixels. On low-performance or high-resolution display devices, to further improve performance, the size of the created screen depth buffer, vertex index buffer, and pre-culled point cloud data buffer can be set to 1 / 4, 1 / 9, 1 / 16, etc., of the number of screen pixels. This scaling factor is called the screen scaling factor, which further improves performance. Specifically, before comparing the depth of the screen space, the currently processed points are thinned. The thinning ratio is equal to the screen scaling factor, and the standard for thinning is their screen coordinates. For example, if the screen scaling factor is 1 / 4, then when its screen coordinates satisfy the condition that the length and width remainder after taking 2 is equal to 0, its length and width are divided by 2 respectively, and a depth comparison is performed with the corresponding position in the screen depth buffer. If the depth comparison is successful, the point's index is updated to the position corresponding to the vertex index buffer. Accordingly, the pre-culled point cloud data that needs to be updated is the result of multiplying the original data volume by the screen scaling factor, thus improving the speed of updating the buffer. Accordingly, the number of points used for lighting calculations is the original number multiplied by the screen scaling factor, thus improving the speed of lighting calculations.
[0056] As can be seen, this embodiment pre-calculates the visibility of all points in a high-performance manner, eliminates all occluded points by utilizing the occlusion relationship of the point cloud in screen space, skips the rasterization and lighting calculation of occluded points, and further improves rendering performance by utilizing the parallel computing capabilities of the GPU to process the point cloud data, since occluded points generally account for the majority of all point cloud data.
[0057] The following describes a data rendering apparatus provided in an embodiment of this application. The data rendering apparatus described below can be referred to in conjunction with other embodiments described herein.
[0058] Referring to Figure 3, this application discloses a data rendering apparatus, including:
[0059] The acquisition module 301 is configured to acquire single-frame point cloud data;
[0060] The deletion module 302 is configured to delete point cloud data that does not fall within the preset imaging viewpoint from a single frame of point cloud data to obtain point cloud data to be screened.
[0061] The determining module 303 is configured to determine the number of pixels to be processed based on the expected pixel threshold and the number of screen pixels; the number of pixels to be processed is not greater than the number of screen pixels;
[0062] The filtering module 304 is configured to filter the point data in the point cloud data to be filtered based on the number of pixels to be processed and the screen depth value corresponding to each pixel to be processed.
[0063] Rendering module 305 is configured to render the filtered target point cloud data.
[0064] In one implementation, the deletion module is specifically configured as follows:
[0065] Spatial segmentation is performed on a single frame of point cloud data to obtain multiple blocks of point cloud data;
[0066] The preset imaging angle is determined based on the viewpoint position;
[0067] The point cloud data that does not fall within the preset imaging viewpoint is deleted from multiple point cloud data to obtain the point cloud data to be screened.
[0068] In one implementation, the determining module is specifically configured as follows:
[0069] Obtain the user-defined desired pixel threshold;
[0070] Determine the desired number of pixels based on the desired pixel threshold;
[0071] If the desired number of pixels is not greater than the number of pixels on the screen, then the desired number of pixels is determined as the number of pixels to be processed.
[0072] If the desired number of pixels is greater than the number of screen pixels, then the number of screen pixels is determined as the number of pixels to be processed.
[0073] In one implementation, the determining module is specifically configured as follows:
[0074] If the desired pixel threshold is a scaling factor, then the product of the scaling factor and the number of screen pixels is used as the desired number of pixels.
[0075] If the desired pixel threshold is an integer, then the integer will be used as the desired number of pixels.
[0076] In one implementation, the filtering module is specifically configured as follows:
[0077] The size of the first buffer, the second buffer, and the third buffer are determined according to the number of pixels to be processed, and the first buffer, the second buffer, and the third buffer are created.
[0078] The point data in the point cloud data to be screened is traversed in parallel according to the parallelism of the GPU.
[0079] For each point data point traversed, calculate the screen coordinates and current depth value corresponding to the current point data in screen space, and determine the current pixel point to be processed mapped by the screen coordinates.
[0080] If the screen depth value corresponding to the current pixel to be processed is read from the third buffer, it is determined whether the current depth value is less than the screen depth value. If the current depth value is less than the screen depth value, the screen depth value corresponding to the current pixel to be processed recorded in the third buffer is replaced with the current depth value, and the sequence number of the current point data is updated to the second buffer, the current point data is updated to the first buffer, and then the traversal of other point data in the point cloud data to be screened continues.
[0081] If the screen depth value corresponding to the current pixel to be processed is not read from the third buffer, or the current depth value is not less than the screen depth value corresponding to the current pixel to be processed, then no operation is performed on the first buffer, the second buffer, and the third buffer, and the traversal of other point data in the point cloud data to be screened continues.
[0082] After the traversal is complete, all point data in the first buffer are used as the filtered target point cloud data.
[0083] In one implementation, the rendering module is specifically configured as follows:
[0084] The system uses a preset lighting model to perform lighting calculations on the target point cloud data and displays the rendered image on the screen based on the lighting calculation results.
[0085] In one implementation, the acquisition module is specifically configured as follows:
[0086] Obtain single-frame point cloud data from a 3D video model;
[0087] Accordingly, the acquisition module is also configured to: acquire the next frame of the single-frame point cloud data from the 3D video model as the single-frame point cloud data, and execute the steps in other subsequent modules until all frames in the 3D video model are rendered.
[0088] For more detailed information on the working process of each module and unit in this embodiment, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0089] As can be seen, this embodiment provides a data rendering device that reduces the amount of rendering data and improves rendering efficiency by eliminating invalid data once and filtering and retaining valid data once. Furthermore, since both invalid data elimination and valid data filtering can effectively retain usable data, they do not cause a reduction in the rendering accuracy of point cloud data. Thus, the goal of improving rendering efficiency without sacrificing the rendering accuracy of point cloud data is achieved.
[0090] The following describes an electronic device provided by an embodiment of this application. The electronic device described below can be referred to in conjunction with other embodiments described herein.
[0091] Referring to Figure 4, this application discloses an electronic device, including:
[0092] Memory 401 is configured to store computer programs;
[0093] Processor 402 is configured to execute a computer program to implement the methods disclosed in any of the above embodiments.
[0094] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: acquiring single-frame point cloud data; deleting point cloud data that does not fall within the preset imaging viewpoint from the single-frame point cloud data to obtain point cloud data to be screened; determining the number of pixels to be processed based on the expected pixel threshold and the number of screen pixels; ensuring that the number of pixels to be processed is not greater than the number of screen pixels; filtering each point data in the point cloud data to be screened according to the number of pixels to be processed and the screen depth value corresponding to each pixel to be processed; and rendering the screened target point cloud data.
[0095] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: spatially segmenting a single frame of point cloud data to obtain multiple blocks of point cloud data; determining a preset imaging angle based on the viewpoint position; deleting point cloud data that does not fall within the preset imaging angle from the multiple blocks of point cloud data to obtain point cloud data to be screened.
[0096] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: obtain the user-set expected pixel threshold; determine the expected number of pixels based on the expected pixel threshold; if the expected number of pixels is not greater than the number of screen pixels, then determine the expected number of pixels as the number of pixels to be processed; if the expected number of pixels is greater than the number of screen pixels, then determine the number of screen pixels as the number of pixels to be processed.
[0097] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: if the desired pixel threshold is a scaling factor, then the product of the scaling factor and the number of screen pixels is used as the desired pixel number; if the desired pixel threshold is an integer, then the integer is used as the desired pixel number.
[0098] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: determine the space size of the first buffer, the second buffer, and the third buffer according to the number of pixels to be processed, and create the first buffer, the second buffer, and the third buffer; traverse each point data in the point cloud data to be screened in parallel according to the GPU parallelism; for each point data traversed, calculate the screen coordinate point and the current depth value corresponding to the current point data in screen space, and determine the current pixel to be processed mapped by the screen coordinate point; if the screen depth value corresponding to the current pixel to be processed is read from the third buffer, determine whether the current depth value is less than the screen depth value; if the current depth value is less than the screen depth value, determine whether the current depth value is less than the screen depth value. If the depth value is less than the screen depth value, the screen depth value corresponding to the current pixel to be processed recorded in the third buffer is replaced with the current depth value, the sequence number of the current point data is updated in the second buffer, the current point data is updated in the first buffer, and then the traversal of other point data in the point cloud data to be screened continues. If the screen depth value corresponding to the current pixel to be processed is not read from the third buffer, or the current depth value is not less than the screen depth value corresponding to the current pixel to be processed, then no operation is performed on the first buffer, the second buffer, and the third buffer, and the traversal of other point data in the point cloud data to be screened continues. After the traversal is completed, all point data in the first buffer is used as the target point cloud data obtained by screening.
[0099] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: perform lighting calculations on the target point cloud data using a preset lighting model, and display the rendered image on the screen based on the lighting calculation results.
[0100] In this embodiment, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: obtaining single-frame point cloud data from the three-dimensional video model; correspondingly, after rendering the selected target point cloud data, it further includes: obtaining the next frame of the single-frame point cloud data from the three-dimensional video model as the single-frame point cloud data, and deleting point cloud data that does not fall into the preset imaging viewpoint from the single-frame point cloud data to obtain the point cloud data to be screened and other subsequent steps, until all frames in the three-dimensional video model are rendered.
[0101] Furthermore, this application also provides an electronic device. This electronic device can be either a server as shown in FIG. 5 or a terminal as shown in FIG. 6. FIG. 5 and FIG. 6 are both structural diagrams of an electronic device according to an exemplary embodiment, and the content in the figures should not be considered as any limitation on the scope of use of this application.
[0102] Figure 5 is a schematic diagram of a server provided in an embodiment of this application. The server may specifically include: at least one processor, at least one memory, a power supply, a communication interface, an input / output interface, and a communication bus. The memory is configured to store a computer program, which is loaded and executed by the processor to implement the relevant steps in the data rendering process disclosed in any of the foregoing embodiments.
[0103] In this embodiment, the power supply is configured to provide operating voltage to each hardware device on the server; the communication interface can create a data transmission channel between the server and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface is configured to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0104] In addition, the memory, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system, computer programs and data, etc., and the storage method can be temporary storage or permanent storage.
[0105] The operating system is configured to manage and control the various hardware devices and computer programs on the server, enabling the processor to perform operations and processes on the data in the memory. It can be Windows Server, Netware, Unix, Linux, etc. The computer programs, in addition to those capable of performing the data rendering method disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data may include application update information and application developer information.
[0106] Figure 6 is a schematic diagram of the structure of a terminal provided in an embodiment of this application. The terminal may include, but is not limited to, a smartphone, tablet computer, laptop computer, or desktop computer.
[0107] Typically, the terminal in this embodiment includes a processor and a memory.
[0108] The processor may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor can be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor may also include a main processor and coprocessors. The main processor, also known as a CPU (Central Processing Unit), is configured to process data in the wake-up state; the coprocessor is a low-power processor configured to process data in the standby state. In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is configured to render and draw the content required to be displayed on the screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor configured to handle computational operations related to machine learning.
[0109] The memory may include one or more computer non-volatile storage media, which may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory is configured to store at least the following computer program, which, after being loaded and executed by the processor, is capable of implementing the relevant steps in the data rendering method executed on the terminal side as disclosed in any of the foregoing embodiments. Furthermore, the resources stored in the memory may also include operating systems and data, and the storage method may be temporary or permanent storage. The operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, application update information.
[0110] In some embodiments, the terminal may further include a display screen, an input / output interface, a communication interface, a sensor, a power supply, and a communication bus.
[0111] Those skilled in the art will understand that the structure shown in Figure 6 does not constitute a limitation on the terminal and may include more or fewer components than shown.
[0112] The following describes a non-volatile storage medium provided in an embodiment of this application. The non-volatile storage medium described below can be referred to in conjunction with other embodiments described herein.
[0113] A non-volatile storage medium is configured to store a computer program, wherein the computer program, when executed by a processor, implements the data rendering method disclosed in the foregoing embodiments. The non-volatile storage medium is a computer-readable non-volatile storage medium, which, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored thereon include an operating system, computer programs, and data, and the storage method can be temporary storage or permanent storage.
[0114] The following describes a computer program product provided by an embodiment of this application. The computer program product described below can be referred to in conjunction with other embodiments described herein.
[0115] A computer program product includes a computer program / instructions that, when executed by a processor, implement the steps of the aforementioned disclosed data rendering method.
[0116] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0117] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of non-volatile storage medium known in the art.
[0118] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application. Industrial applicability
[0119] This application targets single-frame point cloud data. First, it reduces the data volume based on a preset imaging viewpoint. Then, it determines the number of pixels to be processed, which is no greater than the number of screen pixels. Based on the number of pixels to be processed and the corresponding screen depth value, it filters each point in the point cloud data, achieving a secondary filtering of effective data. Finally, it renders the filtered target point cloud data. Thus, through one invalid data reduction and one effective data filtering, the amount of rendering data is reduced, and rendering efficiency is improved. Furthermore, since both invalid data reduction and effective data filtering effectively retain usable data, the rendering accuracy of the point cloud data is not reduced, achieving the goal of improving rendering efficiency without sacrificing rendering accuracy.
Claims
1. A data rendering method, comprising: Acquire single-frame point cloud data; Delete the point cloud data that does not fall within the preset imaging viewpoint from the single frame point cloud data to obtain the point cloud data to be screened; The number of pixels to be processed is determined based on the expected pixel threshold and the number of screen pixels; The number of pixels to be processed is no greater than the number of pixels on the screen; Based on the number of pixels to be processed and the screen depth value corresponding to each pixel, the data of each point in the point cloud data to be screened is filtered. Render the selected target point cloud data.
2. The method according to claim 1, wherein, Point cloud data that does not fall within the preset imaging viewpoint is deleted from the single-frame point cloud data to obtain the point cloud data to be screened, including: The single-frame point cloud data is spatially segmented to obtain multiple blocks of point cloud data; The preset imaging angle is determined based on the viewpoint position; The point cloud data that does not fall within the preset imaging viewpoint is deleted from the multiple point cloud data to obtain the point cloud data to be screened.
3. The method according to claim 1 or 2, wherein, The number of pixels to be processed is determined based on the expected pixel threshold and the number of screen pixels, including: Obtain the user-defined desired pixel threshold; The desired number of pixels is determined based on the desired pixel threshold. If the desired number of pixels is not greater than the number of screen pixels, then the desired number of pixels is determined as the number of pixels to be processed; If the desired number of pixels is greater than the number of screen pixels, then the number of screen pixels is determined as the number of pixels to be processed.
4. The method according to claim 3, wherein, Determining the desired number of pixels based on the desired pixel threshold includes: If the desired pixel threshold is a scaling factor, then the product of the scaling factor and the number of screen pixels is taken as the desired pixel number. If the desired pixel threshold is an integer, then the integer is used as the desired number of pixels.
5. The method according to any one of claims 1 to 4, wherein, Based on the number of pixels to be processed and the screen depth value corresponding to each pixel, the point data in the point cloud data to be screened is filtered, including: The size of the first buffer, the second buffer, and the third buffer are determined according to the number of pixels to be processed, and the first buffer, the second buffer, and the third buffer are created. The point data in the point cloud data to be screened is traversed in parallel according to the GPU parallelism. For each point data point traversed, calculate the screen coordinates and current depth value corresponding to the current point data in screen space, and determine the current pixel point to be processed mapped by the screen coordinates. If the screen depth value corresponding to the current pixel to be processed is read from the third buffer, it is determined whether the current depth value is less than the screen depth value. If the current depth value is less than the screen depth value, the screen depth value corresponding to the current pixel to be processed recorded in the third buffer is replaced with the current depth value, and the sequence number of the current point data is updated to the second buffer, and the current point data is updated to the first buffer. Then, the traversal of other point data in the point cloud data to be screened continues. If the screen depth value corresponding to the current pixel to be processed is not read from the third buffer, or the current depth value is not less than the screen depth value corresponding to the current pixel to be processed, then no operation is performed on the first buffer, the second buffer, and the third buffer, and the traversal of other point data in the point cloud data to be screened continues. After the traversal is complete, all point data in the first buffer are used as the filtered target point cloud data.
6. The method according to any one of claims 1 to 5, wherein, Rendering the filtered target point cloud data includes: The target point cloud data is used to perform lighting calculations using a preset lighting model, and the rendered image is displayed on the screen based on the lighting calculation results.
7. The method according to any one of claims 1 to 6, wherein, Acquire single-frame point cloud data, including: The single-frame point cloud data is obtained from the 3D video model; Accordingly, after rendering the filtered target point cloud data, the process also includes: The next frame of the single-frame point cloud data is obtained from the three-dimensional video model and used as the single-frame point cloud data. Point cloud data that does not fall within the preset imaging viewpoint are deleted from the single-frame point cloud data to obtain the point cloud data to be screened and other subsequent steps, until all frames in the three-dimensional video model are rendered.
8. A data rendering apparatus, comprising: The acquisition module is configured to acquire single-frame point cloud data. The deletion module is configured to delete point cloud data that does not fall within the preset imaging viewpoint from the single frame point cloud data to obtain point cloud data to be screened. The determination module is configured to determine the number of pixels to be processed based on the desired pixel threshold and the number of screen pixels. The number of pixels to be processed is no greater than the number of pixels on the screen; The filtering module is configured to filter the point data in the point cloud data to be filtered based on the number of pixels to be processed and the screen depth value corresponding to each pixel to be processed. The rendering module is configured to render the filtered target point cloud data.
9. An electronic device, comprising: Memory, configured to store computer programs; A processor is configured to execute the computer program to implement the method as described in any one of claims 1 to 7.
10. A non-volatile storage medium configured to store a computer program, wherein, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.