Disclosure of Invention
The invention provides a point cloud attribute prediction method, an encoding method, a decoding method and equipment thereof, and aims to solve the problem that in the prior art, the attribute prediction value is affected due to the fact that neighbors found by the point cloud in attribute encoding are not close enough, so that the performance of encoding and decoding of the point cloud attribute is poor.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a point cloud attribute prediction method comprises the following steps:
adding an offset value to the original coordinates of the point cloud to obtain new coordinate values;
determining an offset morton order from the new coordinate values;
and determining the attribute predicted value of the current node according to the offset Morton order.
The method for predicting the attribute of the point cloud, wherein the determining the attribute predicted value of the current node according to the offset morton order comprises the following steps:
searching a first existing node forward according to the Morton offset sequence to serve as a first prediction point;
taking the attribute value of the first predicted point as the attribute predicted value of the current node;
or, according to the Morton offset sequence, searching K1 existing nodes forwards as first predicted points, and finding out the point with the smallest distance from the current node at the K1 first predicted points;
taking the attribute value of the point with the minimum distance as the attribute predicted value of the current node;
or, looking up K1 existing nodes forward according to the Morton offset sequence to serve as first predicted points, and weighting attribute values of the K1 first predicted points to serve as attribute predicted values of the current node.
The method for predicting the attribute of the point cloud, wherein the determining the attribute predicted value of the current node according to the offset morton order comprises the following steps:
searching a first existing node forward according to the Morton offset sequence to serve as a first prediction point;
searching a first existing node forward according to the original Morton order under the original coordinate of the point cloud to serve as a second prediction point;
calculating the distance d1 from the first predicted point to the current node;
calculating the distance d2 from the second predicted point to the current node;
comparing the distance d1 with the distance d2, and selecting a point with a small distance as a third prediction point;
taking the attribute value of the third predicted point as the attribute predicted value of the current node;
searching K1 existing nodes forwards according to the Morton offset sequence to serve as first prediction points; from the points
The original Morton order under the cloud original coordinates searches K2 existing nodes forwards to serve as second predicted points;
calculating the distance from the first predicted point and the second predicted point to the current node, and selecting one or more points with small distance as a third predicted point;
taking the attribute value or the attribute weighted value of the third predicted point as the attribute predicted value of the current node;
or, searching K1 existing nodes forwards according to the Morton offset sequence to serve as first prediction points;
according to the original Morton order under the original coordinate of the point cloud, K2 existing nodes are searched forwards to serve as second predicted points;
calculating a weighted distance d1 from the first predicted point to the current node;
calculating a weighted distance d2 from the second predicted point to the current node;
comparing the distance d1 with the distance d2, and selecting a point with a small distance as a third prediction point;
and taking the attribute weighted value of the third predicted point as the attribute predicted value of the current node.
The method for predicting the point cloud attribute, wherein the step of calculating the distance from the first predicted point to the current node includes:
calculating the Euclidean distance between the current node and the first predicted point as the distance between the current node and the first predicted point;
or, calculating the maximum value of the absolute value of the coordinate difference value between the current node and the first predicted point in the X, Y and Z directions as the distance between the current node and the first predicted point;
or, calculating the sum of the difference values of the coordinates of the current node and the first predicted point in the X, Y and Z directions as the distance between the current node and the first predicted point.
A point cloud attribute prediction device comprises a processor, a memory and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the point cloud attribute prediction method according to the present invention.
A point cloud attribute coding method comprises the following steps:
determining an attribute predicted value of a current node by adopting the point cloud attribute predicting method;
determining a predicted residual value of the current node according to the difference value between the attribute value of the current node and the attribute predicted value of the current node;
and encoding the prediction residual value of the current node to obtain a point cloud code stream.
The point cloud attribute coding device comprises a processor, a memory and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the point cloud attribute encoding method according to the present invention.
A point cloud attribute decoding method comprises the following steps:
decoding the point cloud attribute code stream to obtain an attribute residual value of the current node;
determining an attribute predicted value of a current node by adopting the point cloud attribute predicting method;
and determining the attribute value of the current node according to the sum value of the attribute predicted value and the attribute residual value of the current node.
A point cloud attribute decoding device comprises a processor, a memory and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the point cloud attribute decoding method according to the present invention.
The beneficial effects are that: compared with the prior art, the method and the device have the advantages that the neighbor point closest to the current node in the physical space is found by adopting the Morton offset sequence, so that the attribute predicted value of the current node is determined, and finally, the attribute encoding is carried out according to the attribute predicted value or the attribute value of the current node is determined according to the attribute predicted value of the current node and the point cloud attribute code stream. The point cloud attribute prediction method, the encoding method and the decoding method provided by the invention can improve the utilization of the correlation between the geometric information and the attribute information of the point cloud, thereby improving the compression performance of the point cloud attribute.
Detailed Description
The invention provides a point cloud attribute prediction method, an encoding method, a decoding method and equipment thereof, and aims to make the purposes, the technical scheme and the effects of the invention clearer and more definite. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
It will be understood by those skilled in the art that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs unless defined otherwise. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The invention will be further described by the description of embodiments with reference to the accompanying drawings.
Specifically, the morton order after morton ordering of the points in the point cloud may be expressed specifically as: the position coordinates (Xk, yk, zk) of the kth point are expressed as:
morton code table corresponding to kth pointThe method is shown as follows:
Or represents every three bits ++in octal>
The morton code corresponding to the kth point may be expressed as:
Fig. 1 is a partial schematic view of a three-dimensional point cloud, where numerals represent morton sequences in the three-dimensional point cloud, and points are numbered A, B, C, D for convenience of expression assuming that there are points at positions in the morton sequences of 0, 2, 10, 16. In the attribute coding of the PCEM encoder, the searching mode of the point cloud predicted point according to the Morton order is that the first 1 point of the Morton order is searched as the current predicted point. Assuming that the current node is D (16), according to the lookup manner of the PCEM, the first 1 points C (10) of the morton order are found to be the predicted points of D (16), which has a problem that B (2) is C (10) that is closer to D (16) but the predicted points of D (16) are farther, and predicting D (16) using the attribute value of C (10) affects the point cloud compression performance.
Based on the problems of the above technology, the present invention provides a flowchart of a preferred embodiment of a method for predicting a point cloud attribute, as shown in fig. 2, which includes the steps of:
s1, adding an offset value to an original coordinate of a point cloud to obtain a new coordinate value;
s2, determining an offset Morton order according to the new coordinate values;
s3, determining an attribute predicted value of the current node according to the Morton offset sequence.
Specifically, in this embodiment, the original coordinates (x, y, z) of the point cloud are added with a fixed offset value (j 1, j2, j 3), the morton code corresponding to the point cloud is generated by using the new coordinates (x+j1, y+j2, z+j3), and the offset morton sequence is obtained according to the morton sequence, where the offset value j1, j2, j3 is greater than or equal to 1. According to the embodiment, the neighbor point which is closest to the current node physically is found by adopting the offset Morton order, so that the attribute predicted value of the current node is determined, and finally, the attribute encoding is carried out according to the attribute predicted value of the current node or the attribute value of the current node is determined according to the attribute predicted value of the current node and the point cloud attribute code stream, so that the encoding and decoding performance of the point cloud attribute is improved.
In some specific embodiments, adding offset values (1, 1) to points 0, 2, 10, 16 in the origin cloud yields points 7, 21, 29, 23 in the new point cloud after offset, as shown in fig. 3, i.e., A, B, C, D corresponds to points numbered 0, 2, 10, 16 in the original morton order and points numbered 7, 21, 29, 23 in the new morton order, which is called offset morton order.
In some embodiments, the first existing node is looked up forward according to the offset morton order as the first predicted point; and taking the attribute value of the first predicted point as the attribute predicted value of the current node.
As an example, the first existing point is found forward in the offset morton order as the predicted point, and in the offset morton order as shown in fig. 3, the current node D (23) looks up the first 1 point in the offset morton order as the predicted point, and the found predicted point is B (21), and the predicted point of B (21) is used as the predicted point of the current node D (23).
In some embodiments, searching K1 existing nodes forward according to the Morton offset sequence as first predicted points, and finding a point with the smallest distance from the current node at the K1 first predicted points; and taking the attribute value of the point with the minimum distance as the attribute predicted value of the current node.
By way of example, assuming that K1 is set to 2, in the offset morton order shown in fig. 3, the current node D (23) searches for the first 2 points in the offset morton order as predicted points, the found predicted points are B (21), a (7), the first-order distances of the current nodes D (23) and B (21) are 1, the first-order distances of the current nodes D (23) and a (7) are 2, and the B (21) with the smaller distance is selected as the predicted point of the current node D (23).
In some embodiments, K1 existing nodes are searched forward as first predicted points according to the offset morton order, and attribute values of the K1 first predicted points are weighted to be the attribute predicted value of the current node.
By way of example, assuming that K1 is set to 2, in the offset morton order shown in fig. 3, the current node D (23) looks up the first 2 points in the offset morton order as predicted points, the found predicted points are B (21), a (7), and the average of the attribute values of B (21) and a (7) is used as the predicted value of the current node D (23).
In some embodiments, the first existing node is looked up forward according to the offset morton order as the first predicted point; searching a first existing node forward according to the original Morton order under the original coordinate of the point cloud to serve as a second prediction point; calculating the distance d1 from the first predicted point to the current node; calculating the distance d2 from the second predicted point to the current node; comparing the distance d1 with the distance d2, and selecting a point with a small distance as a third prediction point; and taking the attribute value of the third predicted point as the attribute predicted value of the current node.
By way of example, the first existing node of the current node D (16) is found in the original morton order as shown in fig. 1, the found point is C (10), C (10) is taken as the predicted point 1, and the first order distance is 3. The first existing point of the current node D (23) is searched for in the offset morton sequence shown in fig. 3, the first 1 point in the morton sequence is searched for by the current node D (23) as a predicted point, the found predicted point is B (21), B (21) is used as a predicted point 2, and the first-order distance is 1. And comparing the distances between the predicted point 1 and the predicted point 2 and the current node, selecting the predicted point 2 with smaller distance as the predicted point of the current node D (23), and predicting the attribute of the current node by using the attribute value of the predicted point 2.
In some embodiments, K1 existing nodes are looked up forward according to the offset morton order as the first predicted point; according to the original Morton order under the original coordinate of the point cloud, K2 existing nodes are searched forwards to serve as second predicted points; calculating the distance from the first predicted point and the second predicted point to the current node, and selecting a point with a small distance as a third predicted point; and taking the attribute value of the third predicted point as the attribute predicted value of the current node.
As an example, K1 existing points are found forward in the offset morton order shown in fig. 3, K2 existing points are found forward in the original morton order shown in fig. 1, and a point with the smallest distance from the current point is selected from k1+k2 as the predicted point. In the present example, setting K1 to 2 and K2 to 2, in the original morton sequence, the current point D (16) searches the first 2 points in the original morton sequence as the predicted points, and the found predicted points are C (10) and B (2). In the offset morton sequence, the current point D (23) searches the first 2 points in the offset morton sequence as the predicted points, and the found predicted points are B (21) and A (7). The point set found in the two Morton orders is A, B, C, the first-order distances from the current point D are 2, 1 and 4 respectively, and the B with the smallest distance is selected as the predicted point of the current point D.
In some embodiments, K1 existing nodes are looked up forward according to the offset morton order as the first predicted point; according to the original Morton order under the original coordinate of the point cloud, K2 existing nodes are searched forwards to serve as second predicted points; calculating a weighted distance d1 from the first predicted point to the current node; calculating a weighted distance d2 from the second predicted point to the current node; comparing the distance d1 with the distance d2, and selecting a point with a small distance as a third prediction point; and taking the attribute weighted value of the third predicted point as the attribute predicted value of the current node.
For example, K1 existing points are found forward according to the offset morton sequence shown in fig. 3, K2 existing points are found forward according to the original morton sequence shown in fig. 1, the weighted distances from K1 points to the current point and the weighted distances from K2 points to the current point are calculated respectively, and from the weighted distances, K1 points or K2 points with smaller distances are selected as predicted points, and the attribute weighted values are used as predicted values. In this example, K1 is set to 2, K2 is set to 2, and the distance weighting mode is the average value. In the original Morton order, the current point D (16) searches the first 2 points in the original Morton order as predicted points, the found predicted points are C (10) and B (2), the first-order distance from the current point D (16) is 4 and 1, and the average value of the distances is 2.5. In the offset Morton order, the current point D (23) searches the first 2 points in the offset Morton order as the predicted points, and the found predicted points are that the first-order distances of the B (21) and the A (7) from the current point D (16) are 1 and 2, and the average value of the distances is 1.5. B (21) and A (7) of the offset Morton order with smaller weighted distance are selected as predicted points, and attribute weighted values of B (21) and A (7) are selected as predicted values.
In some embodiments, K1 points of presence are found forward in the offset Morton order, K2 points of presence are found forward in the original Morton order, and KX points closest to K1+K2 points are selected as predicted points and KX attribute weights are used as predicted values. In this example, K1 is set to 2, K2 is set to 2, kx is set to 2, and the distance weighting mode is the average. In the original Morton order, the current point D (23) searches the first 2 points in the original Morton order as the predicted points, and the found predicted points are C (10) and B (2). In the offset morton sequence, the current point D (23) searches the first 2 points in the offset morton sequence as the predicted points, and the found predicted points are B (21) and A (7). The set of points found in the two morton sequences is A, B, C, the first-order distances from the current point D are 2, 1 and 4, respectively, and 2 points A, B with smaller first-order distances are selected as predicted points of the current point D, and attribute weighted values of A, B are selected as predicted values.
In some embodiments, the step of calculating the distance of the first predicted point to the current node comprises: calculating the Euclidean distance between the current node and the first predicted point as the distance between the current node and the first predicted point; or, calculating the maximum value of the absolute value of the coordinate difference value between the current node and the first predicted point in the X, Y and Z directions as the distance between the current node and the first predicted point; or, calculating the sum of the difference values of the coordinates of the current node and the first predicted point in the X, Y and Z directions as the distance between the current node and the first predicted point.
In some embodiments, in the case of a quadtree, in the original morton order as shown in fig. 4, the point cloud has a total of 5 points, respectively morton numbers 8, 14, 19, 24, 25, which are referred to as A, B, C, D, E for ease of expression. In the original morton sequence, the previous morton sequence predicted point found by the current point E (25) is D (24), the first-order distance between the D (24) and the current point E (25) is 4, and the D (24) is the first predicted point. The coordinates of the points in fig. 4 are added with the offset (1, 1) to obtain the points in fig. 5, an offset morton sequence is formed, the corresponding offset morton sequence of the points numbered 25, 27, 26, 30 and 28 in fig. 5 is A, B, C, D, E, the predicted point of the current point E (28) is searched from the offset morton sequence, the predicted point of the previous morton sequence found by the a (25) is B (27) according to the offset morton sequence, and the first-order distance from the current point is 1, B (27) is taken as a second predicted point. According to the principle of finding the nearest predicted point, the predicted point B (27) closest to the current point is selected to be closer than the predicted point D (24) found in the original Morton order, so the point B is selected as the predicted point of the current point E.
In some embodiments, a point cloud attribute prediction device is further provided, where the point cloud attribute prediction device includes a processor, a memory, and a communication bus; the memory has stored thereon a computer readable program executable by the processor; the communication bus realizes connection communication between the processor and the memory; the processor, when executing the computer readable program, implements the steps in the point cloud attribute prediction method according to the present invention.
In some embodiments, there is also provided a point cloud attribute encoding method, as shown in fig. 6, including the steps of:
s10, determining an attribute prediction value of the current node by adopting the point cloud attribute prediction method;
s20, determining a predicted residual value of the current node according to a difference value between the attribute value of the current node and the attribute predicted value of the current node;
s30, coding the prediction residual value of the current node to obtain a point cloud code stream.
The embodiment finds the neighbor point which is physically closest to the current node by adopting the offset Morton order, so as to determine the attribute predicted value of the current node, and finally, carrying out attribute coding according to the attribute predicted value. The point cloud attribute coding method provided by the embodiment can improve the utilization of the correlation of the geometric information and the attribute information of the point cloud, thereby improving the coding and decoding performance of the point cloud attribute.
Based on the above-mentioned point cloud attribute encoding method, the present invention further provides a point cloud attribute encoding apparatus, wherein, as shown in fig. 7, it includes at least one processor (processor) 20; a display screen 21; and a memory (memory) 22, which may also include a communication interface (Communications Interface) 23 and a bus 24. Wherein the processor 20, the display 21, the memory 22 and the communication interface 23 may communicate with each other via a bus 24. The display screen 21 is configured to display a user guidance interface preset in the initial setting mode. The communication interface 23 may transmit information. The processor 20 may invoke logic instructions in the memory 22 to perform the methods of the embodiments described above.
Further, the logic instructions in the memory 22 described above may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand alone product.
The memory 22, as a computer readable storage medium, may be configured to store a software program, a computer executable program, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 performs functional applications and data processing, i.e. implements the methods of the embodiments described above, by running software programs, instructions or modules stored in the memory 22.
The memory 22 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the electronic device, etc. In addition, the memory 22 may include high-speed random access memory, and may also include nonvolatile memory. For example, a plurality of media capable of storing program codes such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or a transitory storage medium may be used.
In addition, the specific processes that the above storage medium and the plurality of instruction processors in the point cloud attribute encoding apparatus load and execute are described in detail in the above method, and are not stated here.
In some embodiments, there is also provided a point cloud attribute decoding method, as shown in fig. 8, including the steps of:
s100, decoding the point cloud attribute code stream to obtain an attribute residual value of the current node;
s200, determining an attribute prediction value of the current node by adopting the point cloud attribute prediction method;
s300, determining the attribute value of the current node according to the sum value of the attribute predicted value and the attribute residual value of the current node.
In this embodiment, the neighbor point physically closest to the current node is found by adopting the offset morton order, so as to determine the attribute predicted value of the current node, and finally, the attribute value of the current node is determined according to the attribute predicted value of the current node and the point cloud attribute code stream. The point cloud attribute decoding method provided by the invention can improve the utilization of the correlation between the geometric information and the attribute information of the point cloud, thereby improving the point cloud attribute decoding performance.
Based on the point cloud attribute decoding method, the invention also provides point cloud attribute decoding equipment, which comprises a processor, a memory and a communication bus; the memory has stored thereon a computer readable program executable by the processor; the communication bus realizes connection communication between the processor and the memory; the processor, when executing the computer readable program, implements the steps in the point cloud attribute decoding method according to the present invention.
In some embodiments, data obtained by comparing a result obtained by using the point cloud attribute encoding method and the decoding method for point cloud compression and a reference result of the test platform PCEM are shown in tables 1 to 4, and the offset is (3, 3), the search range is n=8, and m=8:
table 1 is a table of contrast of rate-distortion data for luminance, chrominance, and reflectivity under limited loss geometry, loss properties
Table 2 is a table of contrast of rate-distortion data for luminance, chrominance, and reflectivity under lossless geometry, lossy properties
Table 3 is a table of contrast of rate-distortion data for luminance, chrominance, and reflectivity under lossless geometry, limited loss properties
Table 4 is a table of contrast of rate-distortion data for luminance, chrominance, and reflectivity under lossless geometry, lossless properties
As can be seen from the data in tables 1-4, compared with the reference results of the test platform PCEM, for the reflectivity properties, under the conditions of limited loss geometry, lossy properties, lossless geometry, lossy properties, the end-to-end rate distortion of the present invention is saved by 8.5%, 5.0% and 5.5%, respectively; for brightness attribute, the size of the code stream is 94.7% of the original size under the conditions of lossless geometry and lossless attribute, and the size of the code stream is 90% of the original size under the conditions of limited geometry and lossy attribute, wherein the end-to-end distortion of the invention respectively saves 4.9%, 3.2% and 6.9% under the conditions of lossless geometry and limited lossy attribute; for the chromaticity attribute, under the conditions of limited loss geometry and limited loss attribute, lossless geometry and limited loss attribute, the end-to-end rate distortion of the invention is saved by 5.2%, 4.0% and 6.9% at the highest respectively.
In summary, the present invention finds the nearest neighbor point in the physical space with the current node by adopting the offset morton order, so as to determine the attribute predicted value of the current node, and finally, perform attribute coding according to the attribute predicted value or determine the attribute value of the current node according to the attribute predicted value of the current node and the point cloud attribute code stream. The point cloud attribute prediction method, the encoding method and the decoding method provided by the invention can improve the utilization of the correlation between the geometric information and the attribute information of the point cloud, thereby improving the compression performance of the point cloud attribute.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.