Contents of the Invention
This application provides a web-based point cloud rendering method, system and storage medium, which can improve the efficiency of point cloud rendering.
To achieve the above objectives, the present application adopts the following technical solutions:
In the first aspect of the embodiment of the present application, there is provided a web-based point cloud rendering method, the method comprising:
Get the target coordinate range and target viewing angle height of the current target scene to be rendered, and obtain the reference coordinate range of the previous rendered scene of the target scene;
According to the target coordinate range and the reference coordinate range, determine the new coordinate range and the duplicate coordinate range, and generate a data invocation request based on the new coordinate range and the target viewing angle height;
Send a data call request to the server, and the data call request is used to request new point cloud data corresponding to the coordinate range and the height of the target viewing angle;
The new point cloud data sent by the receiving server is rendered based on the new point cloud data and the duplicate point cloud data corresponding to the preset repeating coordinate range to generate the target scene.
In one embodiment, the reference point cloud data of the previous rendered scene includes a corresponding plurality of levels of data identifiers, each data identifier for identifying the corresponding coordinate range;
Before obtaining the target coordinate range and target viewing angle height of the target scene to be rendered, the method also includes: obtaining the data identification of the reference point cloud data;
Determine the new coordinate range and duplicate coordinate range according to the target coordinate range and the reference coordinate range, including: according to the target coordinate range and the data identification of the reference point cloud data, determine the new coordinate range and the duplicate coordinate range.
In one embodiment, after receiving the new point cloud data sent by the server, the method further comprises:
The newly added point cloud data is decompressed, and the newly added point cloud data after decompression is deserialized to obtain the intermediate point cloud data.
The intermediate point cloud data is stored in binary format to obtain the target new point cloud data;
The target scene is generated based on the new point cloud data and the duplicate point cloud data corresponding to the preset repeating coordinate range, including: the new point cloud data and duplicate point cloud data based on the target are generated.
In one embodiment, based on the target new point cloud data and duplicate point cloud data, the target scene is generated, comprising:
Obtain the target point cloud data according to the new point cloud data and duplicate point cloud data of the target;
Obtain the intensity information of the target point cloud data, and obtain the corresponding pixel values of the target point cloud data according to the intensity information of the target point cloud data;
Based on the coordinate data and pixel values of the target point cloud data, the target scene is generated.
Embodiments of the present application also provide a web-based point cloud rendering method, the method comprising:
Receive the data call request sent by the terminal device, including the new coordinate range and target viewing angle height;
Call the corresponding new point cloud data according to the new coordinate range and the target viewing angle height;
Send new point cloud data to the end device.
In one embodiment, before receiving a data call request sent by the terminal device, the method further comprises:
Get multiple initial point cloud files, initial point cloud files include different file formats;
The initial point cloud file is parsed to obtain the point cloud data in each initial point cloud file, and each point cloud data is stored in the target database.
In one embodiment, the target database comprises a plurality of levels of data identification, each level i data identification indication of the coordinate range consists of a plurality of (i + 1) level coordinate identification indicated by the coordinate range, i is a positive integer;
Each point cloud data is stored in the target database, including: according to the corresponding coordinate range of each data identification, the obtained point cloud data is stored in the target database.
In one embodiment, the server also stores the number of the last level of data identifiers corresponding to the height of each viewing angle;
According to the new coordinate range and target viewing angle height, the corresponding new point cloud data is called from the target database, including:
Determine the corresponding target data identification according to the target coordinate range, and determine the number of targets identified by the last level of data according to the target perspective height;
The last level of data identification in the target data ID is called the target quantity of point cloud data.
In one embodiment, the method further comprises:
Compress the point cloud data included in the target database and store it in the cache space;
Send new point cloud data to the end device, including: from the cache space, send the new point cloud data to the end device through multithreading.
A third aspect of the present application embodiment, there is provided a web-based point cloud rendering system, the system comprising: terminal equipment and server;
The terminal device is used to perform the web-based point cloud rendering method in the first aspect of the present application embodiment, the server is used to perform the web-based point cloud rendering method in the second aspect of the embodiment of the present application.
In the fourth aspect of the present application embodiment, there is provided a computer-readable storage medium, on which a computer program is stored, the computer program is executed by the processor to implement the Web-based point cloud rendering method in the first aspect of the embodiment of the present application, or the computer program is executed by the processor to implement the Web-based point cloud rendering method in the second aspect of the embodiment of the present application.
The technical solution provided in the present application embodiment brings beneficial effects to at least:
The point cloud rendering method based on the Web end provided in the embodiment of the present application, by obtaining the target coordinate range and target viewing angle height of the current target scene to be rendered, and obtaining the reference coordinate range of the previous rendered scene of the target scene, according to the target coordinate range and reference coordinate range, determining the new coordinate range and the repeating coordinate range, and generating a data call request according to the new coordinate range and the target perspective height, sending a data call request to the server, The data call request is used to request the new point cloud data corresponding to the new coordinate range and the height of the target viewing angle, receive the new point cloud data sent by the server, and generate the target scene based on the new point cloud data and the duplicate point cloud data corresponding to the preset repeating coordinate range. Embodiment of the present application provides a web-based point cloud rendering method, by directly calling the desired point cloud data from the server according to the new coordinate range and target viewing angle height, the server has been pre-parsed and classified storage of point cloud data, which can improve the acquisition efficiency of point cloud data, and thus can improve the rendering efficiency of point cloud.
Specific embodiments
The following will be combined with the drawings in the embodiment of the present application, the technical solution in the embodiment of the present application is clearly and completely described, it is clear that the embodiment described is only a part of the embodiment of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without the premise of creative labor are within the scope of the present application.
Hereinafter, the terms "first", "second" are for descriptive purposes only and cannot be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features limited to "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure embodiment, unless otherwise indicated, "multiple" means two or more.
In addition, the use of "based on" or "based on" implies openness and inclusiveness, because a process, step, calculation, or other action that is "based on" or "based on" one or more conditions or values may in practice be based on additional conditions or values that exceed them.
Point cloud is a common expression of spatial geometry, through the lidar to obtain the spatial coordinates of each sample point on the surface of the object, the result is a collection of points, that is, "point cloud". Includes 3D coordinates, laser reflection intensity, and color information. Point cloud has a wide range of applications in the field of computer vision and automatic driving. In recent years, with the continuous emergence and development of 3D sensors, the cost of obtaining point cloud data has been reduced, and the acquisition of data has become more and more convenient. At present, areas such as autonomous driving have created a demand for efficient storage and rendering of data from point clouds. The production of HIGH-precision maps mainly relies on laser point clouds, which are usually massive amounts of data, for example, the amount of point cloud data at an intersection in a high-precision map may be hundreds of millions. This puts forward higher requirements for the rendering processing of point cloud data.
At present, the web-based point cloud rendering method has the advantages of good compatibility, portability and convenient data management compared with the desktop endpoint cloud rendering method. However, at present, the web-based point cloud rendering method can only read the point cloud data in a predefined data format, and the point cloud data in other formats is converted into a predefined data format, which seriously affects the processing efficiency of the point cloud data, and the point cloud data cannot be edited quickly and real-time.
In order to solve the above problems, the present application embodiment provides a web-based point cloud rendering method, by obtaining the target coordinate range and target viewing angle height of the current target scene to be rendered, and obtaining the reference coordinate range of the previous rendered scene of the target scene, according to the target coordinate range and reference coordinate range, determine the new coordinate range and the repeating coordinate range, and generate a data call request according to the new coordinate range and the target viewing angle height, send a data call request to the server, The data call request is used to request the new point cloud data corresponding to the new coordinate range and the height of the target viewing angle, receive the new point cloud data sent by the server, and generate the target scene based on the new point cloud data and the duplicate point cloud data corresponding to the preset repeating coordinate range. Embodiment of the present application provides a web-based point cloud rendering method, by directly calling the desired point cloud data from the server according to the new coordinate range and target viewing angle height, the server has been pre-parsed and classified storage of point cloud data, which can improve the acquisition efficiency of point cloud data, and thus can improve the rendering efficiency of point cloud.
As shown in FIG. 1, the present application embodiment provides a web-based point cloud rendering method, applied to the terminal device, the method comprising the following steps:
Step 101, obtain the target coordinate range and target viewing angle height of the target scene to be rendered, and obtain the reference coordinate range of the previous rendered scene of the target scene.
Among them, the target perspective height refers to the observation of the target scene under different heights of the perspective, the value of the target perspective height can be used to indicate the distance from the target scene, when the value of the target perspective height is larger, that is, when the target scene is farther away, the observed target scene is smaller; When the value of the height of the target perspective is small, that is, closer to the target scene, the observed target scene is larger.
Understandably, point cloud rendering is usually a continuous rendering process, so the previous rendered scene can be understood as the scene to be rendered by the previous render operation of the current render operation.
Optionally, you can monitor the coordinate range of the scene to be rendered by building the visual vertebra and controller of the three-dimensional spatial system in the Web page, and obtain the target coordinate range and target viewing angle height of the current target scene to be rendered when the coordinate range change is heard.
Step 102, according to the target coordinate range and reference coordinate range, determine the new coordinate range and duplicate coordinate range, and generate a data call request according to the new coordinate range and the target viewing angle height.
It should be noted that when performing continuous rendering operations, there will usually be duplicate rendering scenes, which also includes the coordinate range of repeated rendering, so the new coordinate range and duplicate coordinate range can be determined according to the target coordinate range of the current rendered scene and the reference coordinate range of the previous rendered scene. Then you only need to obtain the point cloud corresponding to the new coordinate range is the data, and there is no need to mobilize the point cloud data corresponding to the repeated coordinate range, which can improve the acquisition efficiency of the point cloud data.
At the same time, while determining the new coordinate range and the duplicate coordinate range according to the target coordinate range of the current rendered scene and the reference coordinate range of the previous rendered scene, the excess coordinate range may also be determined, and the point cloud data corresponding to the excess coordinate range can be deleted for the excess coordinate range. That is to say, when the viewing angle range of the cone changes again, comparing the next time the data needed and the loaded data, the unwanted data is cleared, thus avoiding unnecessary rendering overhead, and the unloaded data is obtained through the thread.
Step 103, send a data call request to the server, the data call request is used to request the new coordinate range and the target viewing angle height corresponding to the new point cloud data.
Wherein, the point cloud data is stored in the target database of the server, the target database includes multiple levels of data identification, each level i data identification indicates the coordinate range by a plurality of (i + 1) level coordinate identification indicated by the coordinate range, i is a positive integer.
Specifically, the target database may be an object-relational database (PostgreSQL).
That is, the target database of the server includes a multi-level index ID, each of which is used to indicate the corresponding coordinate range. For example, the target database includes a three-level index identification, wherein the first level of index identification, the first level of index identification includes a plurality of second-level index identification, the second level of index identification includes a plurality of third-level index identification, point cloud data in accordance with the scope of the third level index identification, stored under the corresponding third-level index identity.
At the same time, the server presets the mapping relationship between the viewing angle height and the number of data identifications of the last level, and the point cloud data of the corresponding number of layers can be pushed from the point cloud data of the last level to the terminal device according to the mapping relationship. In this way, the process of invoking the corresponding new point cloud data according to the new coordinate range and the target perspective height can be: the corresponding target data identification is determined according to the target coordinate range, the target number of the last level of data identification is determined according to the target perspective height, and then the point cloud data in the target number of the target data identification in the last level of the target data identification is determined and pushed to the terminal device, which can improve the data search efficiency.
Step 104, receive the new point cloud data sent by the server, and render the new point cloud data and the duplicate point cloud data corresponding to the preset repeat coordinate range to generate the target scene.
After the terminal device receives the new point cloud data sent by the server, it uses the new point cloud data and the duplicate point cloud data stored in the terminal device to render the target scene.
Optionally, the reference point cloud data of the previous rendered scene includes a corresponding plurality of levels of data identifiers, each data identifier is used to identify the corresponding coordinate range;
Before getting the target coordinate range and target viewing angle height of the target scene to be rendered, you can also obtain the data identification of the reference point cloud data. Therefore, based on the target coordinate extent and the reference coordinate extent, the process of determining the new coordinate range and the duplicate coordinate range can be: based on the target coordinate extent and the data identification of the reference point cloud data, the new coordinate range and the duplicate coordinate range are determined. In this way, only the data identification needs to be compared to determine the new coordinate range and the duplicate coordinate range, which can improve the determination efficiency.
In one embodiment, after receiving the new point cloud data transmitted by the server, the terminal apparatus further comprises: decompressing the new point cloud data, deserializing the new point cloud data after decompression, obtaining the intermediate point cloud data, and then storing the intermediate point cloud data in binary format to obtain the target new point cloud data. Correspondingly, based on the new point cloud data and the duplicate point cloud data corresponding to the preset repeating coordinate range, the process of generating the target scene can be: based on the new point cloud data and duplicate point cloud data of the target, the target scene is generated. This satisfies the data format requirements required by the renderer, and the point cloud data based on this format can be rendered directly, resulting in the target scene.
Specifically, in the rendering process, the target point cloud data can be obtained according to the target new point cloud data and repeated point cloud data, and then by obtaining the intensity information of the target point cloud data, the corresponding pixel values of the target point cloud data are obtained according to the intensity information of the target point cloud data, and finally the target scene is generated according to the coordinate data and pixel values of the target point cloud data. In this way, the corresponding pixel values can be generated according to the intensity information of the point cloud data, which can be used to distinguish the objects obtained by rendering, and there is no need to obtain the pixel values of the actual objects, which can simplify the data acquisition process.
As shown in FIG. 2, the present application embodiment also provides a web-based point cloud rendering method, applied to the server, the method comprising:
Step 201, receiving a data call request sent by the terminal device.
The data call request includes the new coordinate range and target viewing angle height.
Step 202, according to the new coordinate range and target viewing angle height in the corresponding new point cloud data.
Step 203, send the new point cloud data to the terminal device.
Optionally, before receiving the data call request sent by the terminal device further comprises: obtaining a plurality of initial point cloud files, wherein the initial point cloud file includes different file formats, parsing the initial point cloud file, obtaining the point cloud data in each initial point cloud file, and storing each point cloud data in the target database.
It is understandable that the point cloud data file collected by the acquisition device may be a variety of different file formats, so it is necessary to parse the initial point cloud file collected, obtain the point cloud data in each initial point cloud file, and store the point cloud data in the target database for the invocation rendering of the terminal device.
Specifically, the target database includes multiple levels of data identification, each level i data identification indicates the coordinate range by a plurality of (i + 1) level coordinate identification indicated by the coordinate range, i is a positive integer; Therefore, the process of storing each point cloud data in the target database can be: according to the corresponding coordinate range of each data, the obtained point cloud data is stored in the target database.
That is, the target database of the server includes a multi-level index ID, each of which is used to indicate the corresponding coordinate range. For example, the target database includes a three-level index identification, wherein the first level of index identification, the first level of index identification includes a plurality of second-level index identification, the second level of index identification includes a plurality of third-level index identification, point cloud data in accordance with the scope of the third level index identification, stored under the corresponding third-level index identity.
Optionally, the server also stores the number of last level data identifiers corresponding to the height of each viewing angle;
Correspondingly, the corresponding new point cloud data is called from the target database according to the new coordinate range and the target viewing angle height, including: determining the corresponding target data identification according to the target coordinate range, determining the target number of the last level of data identification according to the target perspective height, and calling the target cloud data in the target data identification of the last level of data identification.
In one embodiment, the server will also compress the point cloud data included in the target database and store it in the cache space. Correspondingly, the process of the server sending new point cloud data to the terminal device can be: from the cache space, the new point cloud data is sent to the terminal device through multi-threading. By compressing the point cloud data and storing it in the cache space, and using multithreading to send point cloud data to the terminal device, the transmission efficiency of point cloud data can be improved.
Specifically, the cache space can be a redis database, Redis (Remote Dictionary Server), or remote dictionary service, which is an open source log database written in anSI C language, supported by the network, memory-based and persisted, key-Value database, and provides API in multiple languages.
In order to facilitate the understanding of those skilled in the art, the present application embodiment also provides a fault detection method for differential pressure sensor, specifically, the method comprising:
(1) The server obtains multiple initial point cloud files, and the initial point cloud files include different file formats;
(2) The server parses the initial point cloud file, obtains the point cloud data in each initial point cloud file, and stores each point cloud data in the target database.
(3) The server stores the obtained point cloud data in the target database according to the corresponding coordinate range of each data identification.
(4) The server compresses the point cloud data included in the target database and stores it in the cache space;
(5) The terminal device obtains the data identification of the reference point cloud data;
(6) The terminal device obtains the target coordinate range and target viewing angle height of the current target scene to be rendered, and obtains the reference coordinate range of the previous rendered scene of the target scene;
(7) The terminal device determines the new coordinate range and the duplicate coordinate range according to the target coordinate range and the data identification of the reference point cloud data.
(8) The terminal device generates a data call request according to the new coordinate range and the height of the target viewing angle;
(9) The terminal device sends a data call request to the server, and the data call request is used to request the new point cloud data corresponding to the coordinate range and the height of the target perspective;
(10) The server receives the data call request sent by the terminal device, and the data call request includes the new coordinate range and the target viewing angle height;
(11) The server calls the corresponding new point cloud data according to the new coordinate range and target viewing angle height;
(12) The server sends new point cloud data to the terminal device through multi-threading from the cache space.
(13) Receive the new point cloud data sent by the server,
(14) Decompress the newly added point cloud data, and deserialize the newly added point cloud data after the extraction to obtain the intermediate point cloud data;
(15) Render the new point cloud data and duplicate point cloud data based on the target to generate the target scene.
The point cloud rendering method based on the Web end provided in the embodiment of the present application, by obtaining the target coordinate range and target viewing angle height of the current target scene to be rendered, and obtaining the reference coordinate range of the previous rendered scene of the target scene, according to the target coordinate range and reference coordinate range, determining the new coordinate range and the repeating coordinate range, and generating a data call request according to the new coordinate range and the target perspective height, sending a data call request to the server, The data call request is used to request the new point cloud data corresponding to the new coordinate range and the height of the target viewing angle, receive the new point cloud data sent by the server, and generate the target scene based on the new point cloud data and the duplicate point cloud data corresponding to the preset repeating coordinate range. Embodiment of the present application provides a web-based point cloud rendering method, by directly calling the desired point cloud data from the server according to the new coordinate range and target viewing angle height, the server has been pre-parsed and classified storage of point cloud data, which can improve the acquisition efficiency of point cloud data, and thus can improve the rendering efficiency of point cloud.
Through the image frame test of different sizes of data, the above process is performed for a point cloud data of 10GB, 20GB, 30GB and other sizes, and the smooth rendering effect can be achieved under the 8-core processor and 4G unique machine configuration. Under gigabit broadband, the transmission processing rendering of the point cloud through the websocket communication protocol can reach 100m/s. It can support the loading of point cloud data of hundreds of millions of points at the same time, and the point cloud map data of big data can be loaded through the rendering scheduling strategy. According to the loading of a 20G-sized point cloud image frame data, the frame rate of 60fps can be reached on the web browser side, and for more dense intersections, it can also reach a stable frame rate loading of more than 30fps, and at the same time support drawing, editing and other operations in the rendered image frame data. As shown in FIG. 3, the embodiment of the present application provides a schematic diagram of the actual rendering effect of the web-based point cloud rendering method.
At the same time, the point cloud rendering method provided by the present application embodiment, during the rendering process, all point cloud data is directly stored in the database, and the massive point cloud real-time rendering can be realized based on the web side after storage, while meeting the requirements of other editing extension capabilities based on rendering. Moreover, because the point cloud data is stored in the database, the point cloud data can be edited quickly and in real time, and the point cloud data can be accessed anytime and anywhere, and the data is shared, and the browser of any terminal device that meets the requirements can access the required point cloud data by accessing the server.
As shown in FIG. 4, the present application embodiment further provides a web-based point cloud rendering system, the system comprising: a terminal device 10 and a server 20. Specifically, for the terminal apparatus 10 and server 20 may perform the above method embodiment, its implementation principle and technical effect is similar to the above method embodiment, and will not be repeated here. Its implementation principle and technical effect are similar, and it will not be repeated here.
In another embodiment of the present application, there is also a computer-readable storage medium on which a computer program is stored, the computer program is executed by the processor to implement the steps of a web-based point cloud rendering method such as the embodiment of the present application.
In another embodiment of the present application, there is also a computer program product, the computer program product comprising a computer instruction, when the computer instruction is run in a terminal device or server, such that the terminal device or server performs the method flow shown in the above method embodiment in the web-based point cloud rendering method performs each step.
In the above embodiments, it may be achieved in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it may be implemented in whole or in part in the form of a computer program product. This computer program product includes one or more computer instructions. When loading and executing computer execution instructions on a computer, all or partly generate a process or function in accordance with the embodiments of the present application. The computer may be a general purpose computer, a dedicated computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or from a computer-readable storage medium to another computer-readable storage medium transmission, e.g., computer instructions may be transmitted from a website site, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) to another website site, computer, The server or data center makes the transfer. A computer-readable storage medium may be any available media that the computer can access or a data storage device that contains one or more servers, data centers, and other data storage devices that can be integrated with the media. Available media can be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid state disks (SSDs)) and the like.
The technical features of the above embodiments may be arbitrarily combined, in order to make the description concise, not all possible combinations of each of the technical features in the above embodiments are described, however, as long as the combination of these technical features does not contradictory, it should be considered to be the scope of the present specification.
The above embodiments only express several embodiments of the present application, the description of which is more specific and detailed, but can not therefore be understood as a limitation on the scope of the invention patent. It should be noted that, for those of ordinary skill in the art, without departing from the concept of the present application, a number of deformations and improvements may also be made, which fall within the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be subject to the appended claims.