Data compression method and device, computer equipment and computer readable storage medium
By plane fitting the point cloud of the depth map and generating depth indication information, the problem of the depth map occupying a large amount of storage space is solved, and more efficient data compression is achieved.
Patent Information
- Application Number
- CN202411569694.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-14
AI Technical Summary
The high resolution of the depth map causes it to occupy a lot of storage space and make it difficult to compress efficiently.
By obtaining the point cloud corresponding to the depth map, performing plane fitting, and generating depth indication information, thereby generating compressed data, instead storing the depth information of each point.
Reduces the storage space occupied by depth maps and improves data compression efficiency.
Smart Images

Figure CN119450075A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data compression method, device, computer equipment and computer-readable storage medium. Background Art
[0002] When rendering, it is necessary to first calculate the world coordinates of the pixel, then calculate the coordinates of the pixel on the depth map based on the world coordinates, and sample the depth map based on the coordinates of the pixel on the depth map to obtain the depth information corresponding to the pixel. The high resolution of the depth map causes the depth map to occupy a large storage space. Summary of the invention
[0003] The embodiments of the present application provide a data compression method, apparatus, computer device, and computer-readable storage medium to compress a depth map, thereby reducing the storage space occupied by the depth map.
[0004] In a first aspect, an embodiment of the present application provides a data compression method, comprising:
[0005] Obtaining a point cloud corresponding to the depth map, where points in the point cloud correspond one-to-one to pixels in the depth map;
[0006] Performing plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, wherein the points in the first point set can be fitted into a plane;
[0007] generating depth indication information corresponding to the first point set according to the first point set and plane information corresponding to the first point set;
[0008] Generate compressed data corresponding to the depth map according to the depth indication information.
[0009] In a second aspect, an embodiment of the present application provides a method for determining depth information, including:
[0010] Acquire compressed data corresponding to the depth map, the compressed data comprising depth indication information corresponding to the at least one point set, the points in the point set corresponding to pixels in the depth map, the point set comprising a first point set, the points in the first point set can be fitted into a plane, and the depth indication information comprises plane information of the plane;
[0011] Obtaining the target coordinates of the pixel to be rendered on the depth map, and determining a set of target points corresponding to the target coordinates;
[0012] Determining depth indication information corresponding to the set of target points from the compressed data;
[0013] Determine depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information.
[0014] In a third aspect, an embodiment of the present application further provides a data compression device, comprising:
[0015] A first acquisition unit is used to acquire a point cloud corresponding to the depth map, where points in the point cloud correspond one-to-one to pixels in the depth map;
[0016] a fitting unit, configured to perform plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, wherein the points in the first point set can be fitted into a plane;
[0017] A first generating unit, configured to generate depth indication information corresponding to the first point set according to the first point set and plane information corresponding to the first point set;
[0018] The second generating unit is configured to generate compressed data corresponding to the depth map according to the depth indication information.
[0019] In a fourth aspect, an embodiment of the present application provides a depth information determination device, including:
[0020] a second acquisition unit, configured to acquire compressed data corresponding to the depth map, the compressed data comprising depth indication information corresponding to the at least one point set, the points in the point set corresponding to pixels in the depth map, the point set comprising a first point set, the points in the first point set being fit to a plane, and the depth indication information comprising plane information of the plane;
[0021] A set determining unit, configured to obtain target coordinates of the pixel to be rendered on the depth map, and determine a set of target points corresponding to the target coordinates;
[0022] A first information determining unit, configured to determine depth indication information corresponding to the target point set from the compressed data;
[0023] The second information determining unit is used to determine the depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information.
[0024] In a fifth aspect, an embodiment of the present application also provides a computer device, comprising a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any one of the data compression methods or depth information determination methods provided in the embodiments of the present application.
[0025] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any one of the data compression methods or depth information determination methods provided in the embodiments of the present application.
[0026] The embodiment of the present application obtains a point cloud corresponding to a depth map, and the points in the point cloud correspond one-to-one to the pixels in the depth map; performs plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, and the points in the first point set can be fitted into a plane; generates depth indication information corresponding to the first point set based on the first point set and the plane information corresponding to the first point set; generates compressed data corresponding to the depth map based on the depth indication information, so that for a first point set in the point cloud that can be fitted into a plane, the depth indication information corresponding to the first point set is generated by the plane information, instead of storing the depth information of each point in the first point set, and the amount of compressed data generated based on the depth indication information is less than the amount of data of the depth map, thereby reducing the occupancy of storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 is a flow chart of a data compression method provided in an embodiment of the present application;
[0029] Figure 2 This is a schematic diagram of set partitioning provided in an embodiment of the present application;
[0030] Figure 3 is a schematic diagram of index information of each point set provided in an embodiment of the present application;
[0031] Figure 4 is a flowchart of a method for determining depth information provided by an embodiment of the present application;
[0032] Figure 5 is a schematic diagram of a data compression device provided in an embodiment of the present application;
[0033] Figure 6 is a schematic diagram of depth information determination provided by an embodiment of the present application;
[0034] Figure 7 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0036] The embodiments of the present application provide an invention name method, apparatus, computer device and computer readable storage medium. The invention name apparatus can be integrated in a computer device, which can be a server or a terminal.
[0037] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.
[0038] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0039] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0040] This embodiment will be described from the perspective of a data compression device. The data compression method device may be integrated into a computer device, which may be a server or a terminal.
[0041] The present application provides a data compression method, such as Figure 1 As shown, the specific process of the data compression method can be as follows:
[0042] 101. Obtain a point cloud corresponding to the depth map, where the points in the point cloud correspond one-to-one to the pixels in the depth map.
[0043] Each pixel in the depth map stores depth information. A point in space is obtained by combining the pixel coordinates of each pixel in the depth map and the depth information stored in the pixel into a three-dimensional coordinate. The point cloud corresponding to the depth map can be obtained according to the three-dimensional coordinates corresponding to each pixel in the depth map. Therefore, the points in the point cloud correspond to the pixels in the depth map one by one. Optionally, the point cloud corresponding to the depth map can be stored in an array in sequence.
[0044] In one embodiment, the depth map may be a shadow map, which may be a depth map drawn from the perspective of a light source. The shadow map is sampled when drawing an object to determine the depth value (i.e., depth information) of the pixel. Specifically, the world position of the pixel may be calculated, and then the position on the shadow map may be calculated using the camera matrix and projection matrix of the light source. The shadow map is sampled at this position to obtain a depth value, which is compared with the depth value of the pixel converted into the light source space. If the depth value of the pixel in the light source control is larger, then the pixel is in the shadow, and the color of the pixel may be appropriately weakened to achieve a shadow effect.
[0045] 102. Perform plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, and the points in the first point set can be fitted into a plane.
[0046] For example, a plane fitting may be performed on the point cloud. If the points in the point cloud can be fitted into a plane, the point cloud is used as the first point set, and the plane information of the fitted plane is used as the plane information corresponding to the first point set.
[0047] Optionally, the points in the point cloud can be fitted into a plane using the least squares method to obtain candidate fitting planes, the distance between each point in the point cloud and the candidate fitting planes can be calculated, and the maximum distance therebetween can be determined. If the maximum distance is greater than a preset threshold, it is determined that the points in the point cloud cannot be fitted into a plane. If the maximum distance is not greater than the preset threshold, it is determined that the points in the point cloud can be fitted into a plane.
[0048] The depth information of any point on the plane can be determined based on the plane information. The plane information may include a plane expression, such as z=Ax+By+C. The coordinates (X0, Y0) may be substituted into the plane expression to obtain the depth information at (X0, Y0). The plane information may also include coefficients of the plane expression, such as A, B, and C. The plane information and the coordinates (X0, Y0) are calculated according to a preset calculation strategy to obtain the depth information at (X0, Y0).
[0049] Optionally, the point cloud can also be divided into multiple point cloud subsets. For example, the point cloud can be evenly divided into N point cloud subsets, where N can be an integer such as 4, 8, or 12. Plane fitting is performed on each point cloud subset. If the point cloud subset can be fitted into a plane, the point cloud subset is used as the first point set to obtain at least one first point cloud subset. The fitting plane corresponding to the point cloud subset is used to determine the plane information of the point cloud subset. The plane fitting process refers to the above-mentioned process of plane fitting for the point cloud, and will not be repeated here.
[0050] In one embodiment, a plane fitting may be performed on the points of the point cloud first. If the points in the point cloud cannot be fitted into a plane, the point cloud may be divided into multiple parts to obtain multiple point cloud subsets. At least one first point set is obtained according to the plane fitting result of each point cloud subset. That is, the step of “performing a plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set” may include:
[0051] Perform plane fitting on the points in the point cloud to obtain the plane fitting result of the point cloud;
[0052] If the plane fitting result indicates that the points in the point cloud can be fitted into a plane, the point cloud is determined as the first point set;
[0053] If the plane fitting result indicates that the points in the point cloud cannot be fitted into a plane, plane fitting is performed on multiple point sets corresponding to the point cloud to obtain at least one first point set;
[0054] For each first point set, plane information of a fitting plane corresponding to the points in the first point set is determined.
[0055] The plane fitting result may indicate that the points in the point cloud can be fitted into a plane. If the plane fitting result indicates that the points in the point cloud can be fitted into a plane, the point cloud is determined as the first point set.
[0056] If the plane fitting result indicates that the points in the point cloud cannot be fitted into a plane, the point cloud can be evenly divided into N point sets, where N can be an integer such as 4, 8, or 12. Plane fitting is performed for each point set to obtain at least one first point set and plane information corresponding to the first point set.
[0057] Optionally, the point cloud may be divided into multiple point sets, and the point sets are further divided according to the plane fitting results of each point set until a preset condition is met. That is, in one embodiment, the step of “performing plane fitting on multiple point sets corresponding to the point cloud to obtain at least one first point set” includes:
[0058] Divide the point cloud to obtain multiple point sets;
[0059] For each point set, if the number of points in the point set meets a preset number condition, the point set is determined as a second point set;
[0060] If the number of points in the point set does not meet the preset number condition, the point set is taken as a point cloud, and the step of performing plane fitting on the points in the point cloud to obtain the plane fitting result of the point cloud is returned until the points in the point set can be fitted into a plane to obtain at least one first point cloud subset.
[0061] For example, the point cloud is divided to obtain multiple point sets. The point cloud can be divided into four parts according to the x-axis and y-axis of the camera coordinates to obtain four point sets, or divided into eight parts according to the pixel coordinates to obtain eight point sets. Other division methods are also possible and are not limited here.
[0062] For a point set currently being processed among multiple point sets, if the number of points in the point set currently being processed meets a preset quantity condition, the point set is determined to be a second point set, and the number of points in the subset (also just a point set) obtained after the second point set is divided does not meet the conditions for being fitted into a plane. For example, the number of points after the second point set is divided is less than or equal to 4, etc. If the second point set is divided into 4 parts, then the number of points in the second point set is not greater than 16.
[0063] If the number of points in the currently processed point set meets the preset number condition, plane fitting is performed on the points in the currently processed point set to obtain the plane fitting result of the currently processed point set. If the plane fitting result indicates that the number of points in the currently processed point set meets the preset number condition, the currently processed point set is divided to obtain multiple subsets corresponding to the currently processed point set (a subset is also a point set). If the number of points in the corresponding subset currently processed meets the preset number threshold, plane fitting is performed on the subset to obtain the plane fitting result of the subset. It is determined whether to divide the subset according to the plane fitting result, and it is continuously iterated until the divided point set can be fitted into a plane, or the preset number condition is not met.
[0064] If the plane fitting result of the point cloud indicates that the points in the point cloud cannot be fitted into a plane, the point cloud is determined as a third point set. That is, in one embodiment, if the plane fitting result of the point cloud indicates that the points in the point cloud cannot be fitted into a plane, the point cloud is also determined as a third point set.
[0065] Specifically, if the points in the point cloud can be fitted into a plane, the point cloud is determined as the first point set, and the point cloud is not divided.
[0066] If the points in the point cloud cannot be fitted into a plane, the point cloud is determined to be a third point set, and the point cloud is divided to obtain multiple point sets. For each point set, if the number of points in the point set does not meet the preset number condition and can be fitted into a plane, the point set is determined to be the first point set and the point set is not further divided; if the number of points in the point set does not meet the preset number condition and cannot be fitted into a plane, the point set is determined to be the third point set and the point set is further divided; if the number of points in the point set does not meet the preset number condition, the point set is determined to be the second point set.
[0067] For example, after dividing the point cloud corresponding to a depth map, the obtained point set can be as follows: Figure 2 As shown, Figure 2 This is only a schematic diagram of the segmentation result. The segmentation results of the point clouds corresponding to different depth maps are different.
[0068] 103. Generate depth indication information corresponding to the first point set according to the first point set and plane information corresponding to the first point set.
[0069] For the first point set, the plane information may be converted into depth indication information corresponding to the first point set, or the depth indication information corresponding to the first point set may be generated according to the set type identifier corresponding to the first point set and the plane information corresponding to the first point set. That is, in one embodiment, the step of “generating depth indication information corresponding to the first point set according to the first point set and the plane information corresponding to the first point set” may include:
[0070] Depth indication information corresponding to the first point set is generated according to the set type identifier corresponding to the first point set and the plane information corresponding to the first point set.
[0071] According to the set type identifier corresponding to the first point set and the plane information corresponding to the first point set, depth indication information corresponding to the first point set is generated. The generated depth indication information may include the set type identifier and the plane information. The set type identifier can indicate whether the point set is the first point set, the second point set or the third point set, and then a corresponding method can be selected to determine the depth information.
[0072] For the second point set, depth indication information corresponding to the second point set may be generated according to the set type identifier corresponding to the second point set and the depth information of the points in the second point set. That is, in one embodiment, after the step of "for each point set, if the number of points in the point set meets the preset number condition, the point set is determined as the second point set", the data compression method provided in the embodiment of the present application further includes:
[0073] For each second point set, determining depth information of a point in the second point set;
[0074] Depth indication information corresponding to the second point set is generated according to the depth information and the set type identifier corresponding to the second point set.
[0075] For example, for each second point set, the depth information of the points in the second point set is determined, the depth information of each point in the second point set and the set type identifier corresponding to the second point set are used to generate depth indication information corresponding to the second point set.
[0076] For the third point set, since the third point set is divided into multiple point sets, depth indication information is generated according to the set type identifier corresponding to the third point set and the index of the point set obtained by dividing the third point set, so that when traversing to the third point set, the next traversed point set can be determined, that is, in one embodiment, after the step of "for each point set, if the number of points in the point set meets the preset number condition, the point set is also determined as the third point set", the data compression method provided in the embodiment of the present application may also include:
[0077] For each third point set, determine index information of a point set obtained by dividing the third point set;
[0078] Depth indication information of the third point set is generated according to the index information and the set type identifier corresponding to the third point set.
[0079] The index information may be used to search the storage space for depth indication information corresponding to the point set obtained by dividing the third point set.
[0080] For each third point set, determine index information of a point set obtained by dividing the third point set; and generate depth indication information of the third point set according to the index information and a set type identifier corresponding to the third point set.
[0081] 104. Generate compressed data corresponding to the depth map according to the depth indication information.
[0082] If the point cloud is a first point set, the depth indication information of the first point set may be used as compressed data of the depth map.
[0083] If the point cloud is not the first point set, compressed data corresponding to the depth map may be generated for depth indication information corresponding to each point set obtained based on the point cloud.
[0084] In one embodiment, the point set and the depth indication information corresponding to the depth map may be stored in a tree structure, that is, in one embodiment, the depth map corresponds to a tree structure, each node of the tree structure corresponds to a point set, wherein the root node of the tree structure corresponds to the point cloud, and the node includes the depth indication information of the corresponding point set;
[0085] Before the step of “generating compressed data corresponding to the depth map according to the depth indication information”, the data compression method provided in the embodiment of the present application may further include:
[0086] The tree structure is traversed to extract the depth indication information corresponding to each point set from the nodes of the tree structure.
[0087] The number of subsets obtained each time the point set is divided can determine the corresponding tree structure. For example, if the point set is divided into 4 subsets each time, the tree structure is a quadtree. If the point set is divided into 2 subsets each time, the tree structure is a binary tree.
[0088] The tree structure generation process can be to set up a message queue for storing nodes of the tree structure, and when there is a node in the message queue, take out the point set corresponding to the node, record the node offset through qindex, and use the offset as the index information of the point set corresponding to the node.
[0089] For the first point set, the depth indication information includes plane information and a set type identifier. The plane information may include three plane coefficients of the plane, each coefficient occupies 1 DWORD, and the set type identifier occupies 1 DWORD, so the depth indication information corresponding to the first point set occupies 4 DWORDs of storage space. Assume that the index information of the node corresponding to the first point set is k, and the index information of the next node of the node is k+4.
[0090] For the second point set, the depth indication information includes the depth information of the points in the point set and the set type identifier. The depth information of each point occupies 1 DWORD, and the set type identifier occupies 1 DWORD. If there are 16 points in the second point set, then the depth indication information corresponding to the second point set occupies 17 DWORDs of storage space. Assuming that the index information of the node corresponding to the second point set is k, the index information of the next node of the node is k+17.
[0091] For the third point set, the depth indication information includes the index information of the point set obtained by dividing the third point set, each index information occupies 1 DWORD, and the set type identifier occupies 1 DWORD. If each third point set is divided into 4 point sets, then the depth indication information corresponding to the third point set occupies 5 DWORD storage space. Assuming that the index information of the node corresponding to the first point set is k, the index information of the next node of the node is k+5. Corresponding to Figure 2 The division result is Figure 2 The index information corresponding to the partial point set shown in can be as follows Figure 3 As shown, Figure 3 The size in it indicates the size of the storage space occupied by the depth indication information corresponding to the point set, and the offset is the index information.
[0092] Specifically, a root node can be generated based on the point cloud, and the root node can be added to the message queue. The point cloud corresponding to the root node is taken out from the message queue, and the point cloud is fitted to obtain the plane fitting result of the point cloud. The collection type of the point cloud is determined and a collection type identifier is generated. If the point cloud is the first point set, the plane information and the collection type identifier are stored in the message queue based on the location of the root node, and the index information corresponding to the root node is 0.
[0093] If the point cloud is the third point set, the point cloud is divided, and corresponding nodes are generated for the point sets obtained by the division. The generated nodes are child nodes of the currently processed nodes and are stored in the message queue. The data offset of the obtained child nodes is determined based on the amount of data of the depth indication information that needs to be stored in the third point set.
[0094] For each node, refer to the processing method for the root node and finally obtain the tree structure corresponding to the depth map.
[0095] After the tree structure is generated, the tree structure is traversed, and the index information of the child node is stored in its parent node to obtain the depth indication information corresponding to the parent node. The depth indication information in each node is written into the buffer. The buffer stores the compressed data corresponding to the depth map, which is used to replace the depth map to determine the depth information of the pixel when rendering to the terminal.
[0096] The terminal may bind the buffer in a shader (such as a pixel shader), read the depth indication information from the buffer, and then determine the depth information corresponding to the pixel according to the depth indication information.
[0097] Optionally, the structure of the node can be as follows, where flag is the set type identifier, the first point set, the second point set and the third point set can be marked by 0, 1 and 2 respectively, data stores the point set corresponding to the node, plane stores the plane information, and depth stores the depth information. The data in the flag and union in the node can be written into a buffer in turn to obtain the compressed data corresponding to the depth map.
[0098] struct node
[0099] {
[0100] int flag;
[0101] pointcloud*data;
[0102] union
[0103] {
[0104] plane*plane;
[0105] depth*depth;
[0106] int children[4];
[0107] }
[0108] int index;
[0109] node*childrenNode[4]
[0110] }
[0111] As can be seen from the above, the embodiment of the present application obtains a point cloud corresponding to a depth map, and the points in the point cloud correspond one-to-one to the pixels in the depth map; performs plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, and the points in the first point set can be fitted into a plane; generates depth indication information corresponding to the first point set based on the first point set and the plane information corresponding to the first point set; generates compressed data corresponding to the depth map based on the depth indication information, so that for the first point set in the point cloud that can be fitted into a plane, the depth indication information corresponding to the first point set is generated by the plane information, instead of storing the depth information of each point in the first point set, and the amount of compressed data generated based on the depth indication information is less than the amount of data of the depth map, thereby reducing the occupancy of storage space.
[0112] This embodiment will be described from the perspective of a depth information determination apparatus. The depth information determination apparatus may be integrated into a computer device, which may be a server or a terminal.
[0113] The present application provides a method for determining depth information, such as Figure 4 As shown, the specific process of the depth information determination method can be as follows:
[0114] 201. Obtain compressed data corresponding to a depth map, the compressed data including depth indication information corresponding to at least one point set, the points in the point set corresponding to pixels in the depth map, the point set including a first point set, the points in the first point set can be fitted into a plane, and the depth indication information includes plane information of the plane.
[0115] The compressed data corresponding to the depth map is data obtained by compressing the depth map. The specific process may refer to the contents of step 101 to step 104 in the above embodiment, and will not be described in detail here.
[0116] Since the compressed data can fit the point cloud part corresponding to the depth map into a plane, and the depth information is indicated by the plane information, the compressed data occupies less storage space than the depth map, reducing the storage pressure of the terminal.
[0117] In one embodiment, the depth map may be a shadow map, which may be a depth map drawn from the perspective of a light source. The shadow map is sampled when drawing an object to determine the depth value (i.e., depth information) of the pixel. Specifically, the world position of the pixel may be calculated, and then the position on the shadow map may be calculated using the camera matrix and projection matrix of the light source. The shadow map is sampled at this position to obtain a depth value, which is compared with the depth value of the pixel converted into the light source space. If the depth value of the pixel in the light source control is larger, then the pixel is in the shadow, and the color of the pixel may be appropriately weakened to achieve a shadow effect.
[0118] 202. Obtain target coordinates of the pixel to be rendered on the depth map, and determine a target point set corresponding to the target coordinates.
[0119] When the terminal draws an object, the world coordinates of the model vertices output by the vertex shader are rasterized to obtain the world coordinates of each pixel point (also called pixel) on the screen, and then the world coordinates are converted to the depth map to obtain the coordinates of the pixel point on the depth map, that is, the target coordinates. The pixel to be rendered is the pixel point that needs to be rendered on the screen.
[0120] As can be seen from the above process of obtaining compressed data of the depth map, if the point cloud corresponding to the depth map can be fitted into a plane, the depth map corresponds to a first point set, and this first point set is the point cloud. The point cloud can be determined as the target point set corresponding to the target coordinates.
[0121] Then, the depth information of the pixel to be rendered can be calculated based on the plane information corresponding to the point cloud and the target coordinates.
[0122] Optionally, the compressed data may include a set type identifier, the set type identifier is used to indicate that the point set is the first point set, the second point set or the third point set, and whether the point set corresponding to the set type identifier is the target point set where the target coordinates are located is determined according to the set type identifier. That is, in one embodiment, the compressed data includes the set type identifier, and the step of “determining the target point set corresponding to the target coordinates” includes:
[0123] Determine a candidate point set from at least one point set according to the target coordinates;
[0124] Extracting a set type identifier of the candidate point set from the depth indication information of the candidate point set;
[0125] If the set type identifier indicates that the candidate point set is the first point set, the candidate point set is determined as the target point set corresponding to the target coordinates.
[0126] For example, the point set corresponding to the point cloud can be determined as a candidate point set, and the set type identifier of the candidate point set can be extracted from the depth indication information corresponding to the candidate point set. If the set type identifier indicates that the candidate point set is the first point set or the second point set, the candidate point set is determined to be the target point set corresponding to the target coordinates.
[0127] If the point cloud is the third point set, the point cloud needs to be divided to obtain multiple point sets corresponding to the point cloud. The point set obtained by the division may be one of the first point set, the second point set and the third point set. It is necessary to further determine the candidate point set in the point set obtained by dividing the point cloud, and determine the point set corresponding to the target coordinates based on the candidate point set. Therefore, if the set type identifier indicates that the candidate point set is the third point set, it means that the candidate point set is divided into multiple point sets because the points therein cannot be fitted into a plane and the number of points is large. The candidate point set is not the target point set, and it is necessary to continue to search for the target point set based on the point set obtained by dividing the candidate point set. That is, in one embodiment, at least one point set also includes the third point set. After the step of "extracting the set type identifier of the candidate point set from the depth indication information of the candidate point set", the depth information determination method provided in the embodiment of the present application may also include:
[0128] If the set type identifier indicates that the candidate point set is a third point set, determining a second candidate point set from a plurality of first candidate point sets obtained by dividing the candidate point set according to the target coordinates;
[0129] The second candidate point set is taken as the candidate point set, and the step of extracting the set type identifier of the candidate point set from the depth indication information of the candidate point set is returned to be executed.
[0130] Since the third point set will be divided into multiple point sets, each point set corresponds to an image area of the depth map, so the point set corresponding to the third point set can be determined according to the target coordinates of the pixel to be rendered on the depth map, the target coordinates can be normalized, the x component and the y component are respectively mapped to between 0-1, and the point set corresponding to the target coordinate is determined according to 0-1. If the third point set is divided into 4 point sets, assuming that the normalized x component is pos.x and the y component is pos.y, then pos.x<0.5, pox.y<0.5, the target coordinates correspond to the first point set; if pos.x>0.5, pox.y<0.5, the target coordinates correspond to the second point set; if pos.x<0.5, pox.y>0.5, the target coordinates correspond to the third point set; if pos.x>0.5, pox.y>0.5, the target coordinates correspond to the fourth point set.
[0131] If the point cloud is a third point set, the target coordinates can be normalized according to the resolution of the depth map. For example, if the resolution of the depth map is 512*512, the x component of the target coordinates is divided by 512 to obtain pos.x, and the y component is divided by 512 to obtain pos.y. After determining a second candidate point set from the first candidate point set, if the second candidate point set is the third point set, the coordinates can be normalized again according to the second candidate point set.
[0132] If the target coordinates correspond to the first point set, the normalization processing can be pos.x = pos.x(-1) / 0.5, pos.y = pos.y(-1) / 0.5; if the target coordinates correspond to the second point set, the normalization processing can be pos.x = [pos.x(-1)-0.5] / 0.5, pos.y = pos.y(-1) / 0.5; if the target coordinates correspond to the third point set, the normalization processing can be pos.x = pos.x(-1) / 0.5, pos.y = [pos.y(-1)-0.5] / 0.5; if the target coordinates correspond to the fourth point set, the normalization processing can be [pos.x(-1)-0.5] / 0.5, pos.y = [pos.y(-1)-0.5] / 0.5; where [pos.x(-1), pos.y(-1)] are the coordinates obtained by the last normalization processing of the target coordinates.
[0133] If the set type identifier indicates that the candidate point set is the second point set, the point set is determined as the target point set, that is, in one embodiment, at least one point set also includes the second point set. After the step of "extracting the set type identifier of the candidate point set from the depth indication information of the candidate point set", the depth information determination method provided in the embodiment of the present application may further include:
[0134] If the set type identifier indicates that the candidate point set is the second point set, the candidate point set is determined as the target point set corresponding to the target coordinates.
[0135] 203. Determine depth indication information corresponding to the target point set from the compressed data.
[0136] After the target point set is determined, depth indication information corresponding to the target point set in the compressed data may be determined.
[0137] If the point cloud is a first point set, the compressed data only includes the depth indication information of the first point set, and the depth indication information in the compressed data can be directly determined as the depth indication information corresponding to the target point set.
[0138] If the point cloud is the third point set and the target point set is not the point set corresponding to the point cloud, it is necessary to determine the depth indication information corresponding to the target point set from the compressed data. Specifically, the depth indication information corresponding to the target point set can be determined based on the index information corresponding to the point set. For example, the depth indication information corresponding to each third point set includes the index information of the point set obtained by dividing it. Therefore, in the step of "determining a second candidate point set from multiple first candidate point sets obtained by dividing the candidate point set", the index information of the second candidate point set can also be determined. Based on the index information, the storage location of the depth indication information of the second candidate point set can be determined.
[0139] The index information may be determined according to the set type of each point set. The depth indication information corresponding to point sets of different set types requires different storage spaces. The index information corresponding to the point set may be determined according to the storage space required for the depth indication information of the point set.
[0140] In one embodiment, compressed data can be stored in a tree structure, each node of the tree structure stores depth indication data of a point set, and the depth indication data can be obtained from the node where the target point set is located. The third point set and the point set obtained by its division are in a parent-child relationship in the tree structure.
[0141] Optionally, the depth map may correspond to a tree structure, and the compressed data may be obtained by storing the depth indication information of each node in the tree structure in a cache in sequence, which is equivalent to the depth indication information of each node in the tree structure being stored linearly in the cache. The index information may be the offset of the depth indication information of each node in the cache, and the depth indication information of the point set may be obtained based on the index information.
[0142] For example, if it is determined that the point set corresponding to the target coordinates is the fourth point set under the third point set currently being processed, the depth indication information of the third point set can include the index information corresponding to the fourth point set, assuming it is 14, then the depth indication information corresponding to the fourth point set can be queried based on 14.
[0143] 204. Determine depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information.
[0144] If the target point set is the first point set, the plane information can be obtained from the depth indication information, and the depth information of the pixel to be rendered can be calculated according to the plane information and the target coordinates. That is, in one embodiment, the step of "determining the depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information" includes:
[0145] If the target point set is the first point set, depth information corresponding to the pixels to be rendered is calculated according to the target coordinates and the plane information.
[0146] If the target point set is the second point set, the depth information of the corresponding points can be obtained from the depth indication information according to the target coordinates as the depth information of the pixel to be rendered. That is, in one embodiment, the step of “determining the depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information” may include:
[0147] If the target point set is the second point set, extracting depth information of points matching the target coordinates from the depth indication information;
[0148] The depth information of the point matching the target coordinates is used as the depth information of the pixel to be rendered.
[0149] As can be seen from the above, the embodiment of the present application obtains compressed data corresponding to the depth map, the compressed data includes depth indication information corresponding to at least one point set, the points in the point set correspond to pixels in the depth map, the point set includes a first point set, the points in the first point set can be fitted into a plane, and the depth indication information includes plane information of the plane; obtains the target coordinates of the pixel to be rendered on the depth map, and determines the target point set corresponding to the target coordinates; determines the depth indication information corresponding to the target point set from the compressed data; and determines the depth information corresponding to the pixel to be rendered based on the target coordinates and the depth indication information. Among them, the first point set in the point cloud corresponding to the depth map that can be fitted into a plane in the compressed data replaces the depth information of each point in the first point set. The embodiment of the present application records the plane information. The amount of compressed data generated based on the plane information is less than the amount of data in the depth map, which reduces the storage space occupied.
[0150] In order to facilitate better implementation of the data compression method provided in the embodiment of the present application, a data compression device is also provided in one embodiment. The meanings of the terms are the same as those in the above data compression method, and the specific implementation details can refer to the description in the method embodiment.
[0151] The data compression device can be integrated into a computer device, such as Figure 5 As shown, the data compression device may include: a first acquisition unit 301, a fitting unit 302, a first generation unit 303 and a second generation unit 304, which are specifically as follows:
[0152] (1) A first acquisition unit 301 is used to acquire a point cloud corresponding to the depth map, where points in the point cloud correspond one-to-one to pixels in the depth map.
[0153] (2) A fitting unit 302, configured to perform plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, wherein the points in the first point set can be fitted into a plane.
[0154] In one embodiment, the fitting unit 302 may also be used to:
[0155] Perform plane fitting on the points in the point cloud to obtain the plane fitting result of the point cloud;
[0156] If the plane fitting result indicates that the points in the point cloud can be fitted into a plane, the point cloud is determined as the first point set;
[0157] If the plane fitting result indicates that the points in the point cloud cannot be fitted into a plane, plane fitting is performed on multiple point sets corresponding to the point cloud to obtain at least one first point set;
[0158] For each first point set, plane information of a fitting plane corresponding to the points in the first point set is determined.
[0159] In one embodiment, the fitting unit 302 may also be used to:
[0160] Divide the point cloud to obtain multiple point sets;
[0161] For each point set, if the number of points in the point set meets a preset number condition, the point set is determined as a second point set;
[0162] If the number of points in the point set does not meet the preset number condition, the point set is taken as a point cloud, and the step of performing plane fitting on the points in the point cloud to obtain the plane fitting result of the point cloud is returned until the points in the point set can be fitted into a plane to obtain at least one first point cloud subset.
[0163] In one embodiment, the fitting unit 302 may also be used to:
[0164] (3) A first generating unit 303, configured to generate depth indication information corresponding to the first point set according to the first point set and plane information corresponding to the first point set.
[0165] In one embodiment, the first generating unit 303 may also be used for:
[0166] Depth indication information corresponding to the first point set is generated according to the set type identifier corresponding to the first point set and the plane information corresponding to the first point set.
[0167] (4) A second generating unit 304, configured to generate compressed data corresponding to the depth map according to the depth indication information.
[0168] In one embodiment, the data compression device may further include:
[0169] An index determination unit, configured to determine, for each third point set, index information of a point set obtained by dividing the third point set;
[0170] The first information generating unit is configured to generate depth indication information of the third point set according to the index information and the set type identifier corresponding to the third point set.
[0171] In one embodiment, the data compression device may further include:
[0172] A third information determining unit, configured to determine, for each second point set, depth information of a point in the second point set;
[0173] The first information generating unit is configured to generate depth indication information corresponding to the second point set according to the depth information and a set type identifier corresponding to the second point set.
[0174] In one embodiment, the depth map corresponds to a tree structure, each node of the tree structure corresponds to a point set, wherein the root node of the tree structure corresponds to the point cloud, and the node includes depth indication information of the corresponding point set;
[0175] The data compression device may further include:
[0176] The traversal unit is used to traverse the tree structure and extract depth indication information corresponding to each point set from the nodes of the tree structure.
[0177] As can be seen from the above, the data compression device of the embodiment of the present application obtains the point cloud corresponding to the depth map through the first acquisition unit 301, and the points in the point cloud correspond one-to-one to the pixels in the depth map; the fitting unit 302 performs plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, and the points in the first point set can be fitted into a plane; the first generation unit 303 generates depth indication information corresponding to the first point set according to the first point set and the plane information corresponding to the first point set; the second generation unit 304 generates compressed data corresponding to the depth map according to the depth indication information, so that for the first point set in the point cloud that can be fitted into a plane, the depth indication information corresponding to the first point set is generated through the plane information, instead of storing the depth information of each point in the first point set, and the data amount of the compressed data generated based on the depth indication information is less than the data amount of the depth map, thereby reducing the occupancy of storage space.
[0178] In order to better implement the depth information determination method provided in the embodiment of the present application, a depth information determination device is also provided in one embodiment. The meanings of the terms are the same as those in the above-mentioned depth information determination method, and the specific implementation details can refer to the description in the method embodiment.
[0179] The depth information determination device may be integrated into a computer device, such as Figure 6 As shown, the depth information determination device may include: a second acquisition unit 401, a set determination unit 402, a first information determination unit 403, and a second information determination unit 404, as follows:
[0180] (1) A second acquisition unit 401 is used to acquire compressed data corresponding to the depth map, the compressed data including depth indication information corresponding to at least one point set, the points in the point set corresponding to pixels in the depth map, the point set including a first point set, the points in the first point set can be fitted into a plane, and the depth indication information includes plane information of the plane.
[0181] (2) A set determination unit 402 is used to obtain the target coordinates of the pixel to be rendered on the depth map and determine a target point set corresponding to the target coordinates.
[0182] In one embodiment, the compressed data includes a set type identifier, and the set determination unit 402 may also be used to:
[0183] Determine a candidate point set from at least one point set according to the target coordinates;
[0184] Extracting a set type identifier of the candidate point set from the depth indication information of the candidate point set;
[0185] If the set type identifier indicates that the candidate point set is the first point set, the candidate point set is determined as the target point set corresponding to the target coordinates.
[0186] (3) A first information determining unit 403, configured to determine depth indication information corresponding to the target point set from the compressed data.
[0187] (4) A second information determining unit 404, configured to determine depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information.
[0188] In one embodiment, the second information determining unit 404 may also be used to:
[0189] If the target point set is the second point set, extracting depth information of points matching the target coordinates from the depth indication information;
[0190] The depth information of the point matching the target coordinates is used as the depth information of the pixel to be rendered.
[0191] In one embodiment, the depth information determining device may further include:
[0192] The first determining unit is configured to determine the candidate point set as a target point set corresponding to the target coordinates if the set type identifier indicates that the candidate point set is a second point set.
[0193] In one embodiment, the at least one point set further includes a third point set, and the means for determining from the depth information may include:
[0194] a second determining unit, configured to determine, if the set type identifier indicates that the candidate point set is a third point set, a second candidate point set from a plurality of first candidate point sets obtained by dividing the candidate point set according to the target coordinates;
[0195] The third determining unit is configured to use the second candidate point set as the candidate point set, and return to the step of extracting the set type identifier of the candidate point set from the depth indication information of the candidate point set until the target point set corresponding to the target coordinates is determined.
[0196] In one embodiment, determining the depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information includes:
[0197] If the target point set is the first point set, depth information corresponding to the pixels to be rendered is calculated according to the target coordinates and the plane information.
[0198] As can be seen from the above, the depth information determination device of the embodiment of the present application obtains the compressed data corresponding to the depth map through the second acquisition unit 401, the compressed data includes depth indication information corresponding to at least one point set, the points in the point set correspond to the pixels in the depth map, the point set includes a first point set, the points in the first point set can be fitted into a plane, and the depth indication information includes plane information of the plane; the set determination unit 402 obtains the target coordinates of the pixel to be rendered on the depth map, and determines the target point set corresponding to the target coordinates; the first information determination unit 403 determines the depth indication information corresponding to the target point set from the compressed data; the second information determination unit 404 determines the depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information. Among them, for the first point set in the point cloud corresponding to the depth map that can be fitted into a plane, the compressed data records the plane information instead of recording the depth information of each point in the first point set. The amount of compressed data generated based on the plane information is less than the amount of data of the depth map, thereby reducing the storage space occupied.
[0199] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal. Figure 7 As shown, Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0200] The processor 501 is the control center of the computer device 500. It uses various interfaces and lines to connect the various parts of the entire computer device 500, executes various functions of the computer device 500 and processes data by running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.
[0201] In the embodiment of the present application, the processor 501 in the computer device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:
[0202] Get the point cloud corresponding to the depth map, where the points in the point cloud correspond one-to-one to the pixels in the depth map;
[0203] Performing plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, wherein the points in the first point set can be fitted into a plane;
[0204] generating depth indication information corresponding to the first point set according to the first point set and the plane information corresponding to the first point set;
[0205] Generate compressed data corresponding to the depth map according to the depth indication information.
[0206] or,
[0207] Obtaining compressed data corresponding to the depth map, the compressed data including depth indication information corresponding to at least one point set, the points in the point set corresponding to pixels in the depth map, the point set including a first point set, the points in the first point set can be fitted into a plane, and the depth indication information includes plane information of the plane;
[0208] Obtain the target coordinates of the pixel to be rendered on the depth map, and determine the target point set corresponding to the target coordinates;
[0209] determining depth indication information corresponding to the set of target points from the compressed data;
[0210] Determine the depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information.
[0211] Among them, the first point set in the point cloud corresponding to the depth map in the compressed data that can be fitted into a plane records plane information instead of recording the depth information of each point in the first point set. The amount of compressed data generated based on the plane information is smaller than the amount of data in the depth map, thereby reducing the storage space occupied.
[0212] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0213] Optional, such as Figure 7 As shown, the computer device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Figure 7 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0214] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of computer equipment, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.
[0215] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.
[0216] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another computer device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between an external headset and the computer device.
[0217] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0218] The power supply 507 is used to supply power to various components of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0219] although Figure 7 Not shown, the computer device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0220] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0221] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0222] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any data compression method or depth information determination method provided in the embodiment of the present application. For example, the computer program can execute the following steps:
[0223] Get the point cloud corresponding to the depth map, where the points in the point cloud correspond one-to-one to the pixels in the depth map;
[0224] Performing plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, wherein the points in the first point set can be fitted into a plane;
[0225] generating depth indication information corresponding to the first point set according to the first point set and the plane information corresponding to the first point set;
[0226] Generate compressed data corresponding to the depth map according to the depth indication information.
[0227] or,
[0228] Obtaining compressed data corresponding to the depth map, the compressed data including depth indication information corresponding to at least one point set, the points in the point set corresponding to pixels in the depth map, the point set including a first point set, the points in the first point set can be fitted into a plane, and the depth indication information includes plane information of the plane;
[0229] Obtain the target coordinates of the pixel to be rendered on the depth map, and determine the target point set corresponding to the target coordinates;
[0230] determining depth indication information corresponding to the set of target points from the compressed data;
[0231] Determine the depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information.
[0232] Among them, the first point set in the point cloud corresponding to the depth map in the compressed data that can be fitted into a plane records plane information instead of recording the depth information of each point in the first point set. The amount of compressed data generated based on the plane information is smaller than the amount of data in the depth map, thereby reducing the storage space occupied.
[0233] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0234] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0235] The above is a detailed introduction to a data compression method, device, computer equipment and computer storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data compression method, characterized in that: include: Obtaining a point cloud corresponding to the depth map, where points in the point cloud correspond one-to-one to pixels in the depth map; Performing plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, wherein the points in the first point set can be fitted into a plane; generating depth indication information corresponding to the first point set according to the first point set and plane information corresponding to the first point set; Generate compressed data corresponding to the depth map according to the depth indication information.
2. The method according to claim 1, characterized in that The performing plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set includes: Performing plane fitting on points in the point cloud to obtain a plane fitting result of the point cloud; If the plane fitting result indicates that the points in the point cloud can be fitted into a plane, determining the point cloud as the first point set; If the plane fitting result indicates that the points in the point cloud cannot be fitted into a plane, performing plane fitting on multiple point sets corresponding to the point cloud to obtain at least one first point set; For each of the first point sets, plane information of a fitting plane corresponding to a point in the first point set is determined.
3. The method according to claim 2, characterized in that The performing plane fitting on the multiple point sets corresponding to the point cloud to obtain at least one first point set includes: Dividing the point cloud to obtain multiple point sets; For each point set, if the number of points in the point set meets a preset number condition, the point set is determined as a second point set; If the number of points in the point set does not meet the preset number condition, the point set is used as the point cloud, and the step of performing plane fitting on the points in the point cloud to obtain the plane fitting result of the point cloud is returned to execute until the points in the point set can be fitted into a plane to obtain at least one first point cloud subset.
4. The method according to claim 3, characterized in that If the plane fitting result indicates that the points in the point cloud cannot be fitted into a plane, the point cloud is further determined as a third point set.
5. The method according to claim 4, characterized in that After determining the point cloud as a third point set, the method further includes: For each of the third point sets, determine index information of a point set obtained by dividing the third point set; Depth indication information of the third point set is generated according to the index information and the set type identifier corresponding to the third point set.
6. The method according to claim 3, characterized in that If the number of points in the point set meets a preset number condition, after determining the point set as a second point set, the method further includes: For each of the second point sets, determining depth information of points in the second point set; Depth indication information corresponding to the second point set is generated according to the depth information and a set type identifier corresponding to the second point set.
7. The method according to claim 6, characterized in that The depth map corresponds to a tree structure, each node of the tree structure corresponds to a point set, wherein a root node of the tree structure corresponds to the point cloud, and the node includes depth indication information of the corresponding point set; Before generating compressed data corresponding to the depth map according to the depth indication information, the method further includes: The tree structure is traversed to extract depth indication information corresponding to each point set from nodes of the tree structure.
8. The method according to any one of claims 1 to 7, characterized in that: The generating, according to the first point set and the plane information corresponding to the first point set, depth indication information corresponding to the first point set includes: Depth indication information corresponding to the first point set is generated according to the set type identifier corresponding to the first point set and the plane information corresponding to the first point set.
9. A method for determining depth information, characterized in that: include: Acquire compressed data corresponding to the depth map, the compressed data comprising depth indication information corresponding to the at least one point set, the points in the point set corresponding to pixels in the depth map, the point set comprising a first point set, the points in the first point set can be fitted into a plane, and the depth indication information comprises plane information of the plane; Obtaining target coordinates of the pixel to be rendered on the depth map, and determining a target point set corresponding to the target coordinates; Determining depth indication information corresponding to the set of target points from the compressed data; Determine depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information.
10. The method according to claim 9, characterized in that The compressed data includes a set type identifier, and the determining of the target point set corresponding to the target coordinates includes: Determining a candidate point set from the at least one point set according to the target coordinates; Extracting a set type identifier of the candidate point set from the depth indication information of the candidate point set; If the set type identifier indicates that the candidate point set is the first point set, the candidate point set is determined as the target point set corresponding to the target coordinates.
11. The method according to claim 10, characterized in that The at least one point set further includes a second point set, and after extracting the set type identifier of the candidate point set from the depth indication information of the candidate point set, the method further includes: If the set type identifier indicates that the candidate point set is the second point set, the candidate point set is determined as the target point set corresponding to the target coordinates.
12. The method according to claim 10, characterized in that The at least one point set further includes a third point set, and after extracting the set type identifier of the candidate point set from the depth indication information of the candidate point set, the method further includes: If the set type identifier indicates that the candidate point set is a third point set, determining a second candidate point set from a plurality of first candidate point sets obtained by dividing the candidate point set according to the target coordinates; The second candidate point set is used as the candidate point set, and the step of extracting the set type identifier of the candidate point set from the depth indication information of the candidate point set is returned to be executed until the target point set corresponding to the target coordinates is determined.
13. The method according to claim 12, characterized in that The determining, according to the target coordinates and the depth indication information, the depth information corresponding to the pixel to be rendered includes: If the target point set is the first point set, depth information corresponding to the pixel to be rendered is calculated according to the target coordinates and the plane information.
14. The method according to claim 12, characterized in that The determining, according to the target coordinates and the depth indication information, the depth information corresponding to the pixel to be rendered includes: If the target point set is the second point set, extracting depth information of points matching the target coordinates from the depth indication information; The depth information of the point matching the target coordinates is used as the depth information of the pixel to be rendered.
15. A data compression device, characterized in that: include: A first acquisition unit is used to acquire a point cloud corresponding to the depth map, where points in the point cloud correspond one-to-one to pixels in the depth map; a fitting unit, configured to perform plane fitting on the point cloud to obtain at least one first point set and plane information corresponding to the first point set, wherein the points in the first point set can be fitted into a plane; A first generating unit, configured to generate depth indication information corresponding to the first point set according to the first point set and plane information corresponding to the first point set; The second generating unit is configured to generate compressed data corresponding to the depth map according to the depth indication information.
16. A depth information determination device, characterized in that: include: a second acquisition unit, configured to acquire compressed data corresponding to the depth map, the compressed data comprising depth indication information corresponding to the at least one point set, the points in the point set corresponding to pixels in the depth map, the point set comprising a first point set, the points in the first point set being fit to a plane, and the depth indication information comprising plane information of the plane; A set determining unit, configured to obtain target coordinates of the pixel to be rendered on the depth map, and determine a set of target points corresponding to the target coordinates; A first information determining unit, configured to determine depth indication information corresponding to the target point set from the compressed data; The second information determining unit is used to determine the depth information corresponding to the pixel to be rendered according to the target coordinates and the depth indication information.
17. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the data compression method described in any one of claims 1 to 8, or the depth information determination method described in any one of claims 9 to 14.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the data compression method described in any one of claims 1 to 8, or the depth information determination method described in any one of claims 9 to 14.