The present invention generally relates to three dimensional (3D) models. More particularly, it relates to compression and transmission of 3D models in a 3D program.
In practical applications, such as 3D games, virtual chatting, digital museums and CAD, many 3D models consist of a large number of connected components. These multi-connected 3D models usually contain a non-trivial amount of repetitive structures via various transformations, as shown in
In PCT application WO2010149492 filed on Jun. 9, 2010, entitled Efficient Compression Scheme for Large 3D Engineering Models, an efficient compression algorithm for multi-connected 3D models by taking advantage of discovering repetitive structures in the input models is disclosed. It first discovers in a 3D model, sets of components repeating in various positions, orientations and scaling factors, known as repetitive structures. Then the repetitive structures in the 3D model are organized using “pattern-instance” representation as shown in
Typically, the transformation information, including translation, rotation and scaling factors, are compressed independently as shown in
This invention directs to methods and apparatuses for 3D model compression.
The present invention solves the problem of 3D model compression and proposes an algorithm to explore the correlation among the instances and an algorithm for adaptive bit determination to increase the compression ratio of a 3D model.
According to an aspect of the present invention, there is provided a method for encoding components of a 3D model. The method comprises the steps of sorting the components based on a value of a principal parameter; and encoding the sorted components by incrementally encoding the principal parameter.
According to another aspect of the present invention, there is provided a method for decoding components of a 3D model, which comprises the steps of determining a sorting dimension based on a principal parameter that is used for encoding said components; and decoding said components by incrementally decoding the principal parameter.
The above features of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which:
In the present invention, a solution to compressing components of a 3D model is proposed. By introducing prediction techniques among components and adaptive quantization strategy, a higher compression ratio for a 3D model is achieved.
Note that in this embodiment, components to be compressed share common parameters so that the principal parameter can be selected from among these common parameters, and all the components to be compressed can be sorted based on the selected principal parameters. Example parameters of components can be any numeric parameters to be encoded, including means, eigenvectors, or some vertex features of the components, or any of the transformation information of the instance component in the “pattern-instance” representation as described before. A general guideline for selecting the principal parameters is that the principal parameter should reflect how the components are correlated and its value has a large value set. For example, if the instance components are highly correlated in terms of their positions, the translation parameter in the instance transformation should be selected as the principal parameter. Those parameters, such as a flag in the component parameter, which have only a limited number of values, may not be a good choice for the principal parameters. The sorting of the components can be done based on a value of the principal parameter, e.g. the x-value of the means of the components if component mean is selected as the principal parameter; or the translation value along the z-axis of the instance transformation if translation is selected as the principal parameter for the instance components. In this case, the incremental encoding of the principal parameter can be performed by incrementally encoding the value used for sorting (known as sorting dimension as will be discussed later) while independently encoding other values (non-sorting dimensions). Other embodiments of the principal parameter are possible depending on the representation of the components. In general, when the components to be compressed are correlated, e.g. in terms of geometry or position, incrementally encoding the principal parameter would reduce the overall bitrate of the compressed 3D model.
The hybrid component encoder 430 further comprises a bit calculator for adaptively determining the number of encoding bits for each parameter of the components. For example, the number of bits assigned to a parameter with a smaller value range should be smaller than that of a parameter with a larger value range, given the same distortion requirement.
The following presents a preferred detailed embodiment of the 3D model compression according to the present invention, which employs pattern-instance 3D model representation as an example for the embodiment. Other 3D model representations would also apply. For explanation purposes, the transformation information for the “pattern-instance” based 3D model is selected as example parameters for compression. Several major steps of this embodiment are:
1. The encoder sorts the instances in ascending (or descending) order of a certain transformation parameter (orientation, translation or scaling), which is called a principal parameter.
2. The dimension of the principal parameter which covers the smallest range of values is employed as the sorting dimension for the above sorting.
3. The values of the principal parameter along the sorting dimension are incrementally encoded rather than independently encoded.
4. The number of quantization bits for each parameter is determined adaptively based on the maximum and minimum values of each corresponding parameter.
Typically, all dimensions of multi-dimensional data in a 3D model, e.g., the vertex coordinates of 3D models, are compressed with an equal number of quantization bits if fixed-length coding is employed. For example, for a tall 3D model with a size of 100×200×500, if the quantization bit for the geometry (i.e., vertex positions) is 12, the quantization steps for the three axes would be 100/212, 200/212 and 500/212. Suppose the original vertex position is (x, y, z) while the decoded version is (x′, y′, z′), then the possible distortions along the x, y and z axes are:
In most applications, it is unnecessary to represent a 3D model with different precision along different axes. Typically, one same precision requirement applies to all dimensions/axes. Thus, in the above example, 12-bit assignment to the vertex position guarantees a distortion lower than 0.061 for all dimensions/axes. In that case, higher precisions or lower distortion along the x and y axes are not necessary and fewer bits could have been assigned to x and y vertex coordinates. The adaptive quantization strategy as disclosed in the present invention would achieve this goal.
According to one embodiment of the present invention, the encoder determines the number of quantization bits for the parameters based on their value ranges and the precision/distortion requirement. Typically, the precision requirement is reflected in the quality requirement of the reconstructed model. The encoder calculates the maximum acceptable distortion for each parameter based on the quality requirement. For example, the maximum acceptable distortion for the translation parameter is distmax, and the maximum and minimum translation values of all instances along x, y and z axes are (xmax, xmin), (ymax, ymin), and (zmax, zmin), respectively. The number of quantization bits for the x, y and z axes can be determined as:
Compared with the equal bit assignment, the adaptive bit assignment of Eqns. (4)-(6) can improve the compression ratio while meeting the distortion requirement.
General criteria for determining a principal parameter are, but not limited to: 1. the bit consumption of the principal parameter shall be significant in the bitstream; 2. the values of the principal parameter shall be distributed as uniformly as possible. Based on the criteria, in the embodiment wherein the pattern-instance representation is used to represent the components, the translation parameter and the rotation parameter are possible candidates for the principal parameter. If a multi-dimensional parameter such as the translation or the rotation of the transformation information of an instance is chosen as the principal parameter, one of its dimensions can be used as the sorting dimension. In a different embodiment, multiple dimensions can be utilized to determine how the components are sorted. In the embodiment wherein one dimension is employed for sorting, the data along this dimension is compressed incrementally. An ideal situation is that the values are distributed evenly so that the value range of the difference between adjacent values can be small and thus require a small number of bits. In general, this case is more likely to happen if the range of the values is small. Thus, in one implementation, the dimension of the parameter which covers the smallest range of values is chosen as the sorting dimension.
Suppose the translation parameter (x, y, z) is the principal parameter, and the value ranges for the translation parameter along three dimensions are
rangex=xmax-xmin, rangey=ymax-ymin, and rangez=zmax-zmin.
If rangex>rangez>rangey, the instances are placed in an ascending (or descending) order according to the values on the y axis first, then z axis, and then x axis during sorting. That is, the priority of the axes for sorting follows priorityy>priorityz>priorityx. When two or more of the value ranges are equal, e.g. rangex=rangey, the priority of the axes for sorting can be pre-determined and agreed upon between the encoder and the decoder or can be transmitted in the bitstream. For example, it can be determined before encoding that the priority follows priorityx>priorityz>priorityy as a tie-breaker when the value ranges for the axes are equal.
After the instances are sorted along one of the parameters, known as the principal parameter, the values of this particular parameter can be encoded incrementally. Denote the principal parameter as P=[Px, Py, Pz] and the value along p axis is selected as the sorting dimension, and pε{x, y, z}. The encoder encodes the difference value along the p axis, diffi=PPi−PPi-1, instead of the value PPi for the ith instance and i=1, . . . , n assuming there are a total of n instances. To incrementally encode PP1˜PPn, the encoder goes through the following steps:
The following is an example of encoding a component using translation parameter as the principal parameter:
xmax=0.68; xmin=0.11; rangex=0.56;
ymax=0.96; ymin=0.24; rangey=0.72;
zmax=0.67; zmin=0.12; rangez=0.55.
Since z axis has the smallest range of the parameter value, z axis is chosen as the sorting dimension.
After the sorting, the increment data of the translation on z axis is:
diffmax=0.02; diffmin=0; rangediff=0.02,
The distortion requirement requires that the decoding error distmax<10−4. Then the number of quantization bits for each dimension can be determined as:
It can be seen that the bit consumption for encoding the translation parameter of an instance is reduced from 12+12+12=36 without the incremental encoding to 12+12+7=31 by employing the sorting and incremental encoding for the instances according to the present invention. The bit saving is 14% in this example.
The corresponding decoding process of the instance transformation information which has been encoded incrementally as disclosed above is shown in
The decoding process of the principal parameter is summarized as follows:
It is to be understood that the present invention should not be limited only to the 3D model compression. The principles of the present invention apply broadly to scenarios where the order of the components or objects in the data to be encoded does not affect the decoding results. In that case, the objects can be sorted/ordered in favor of compression. If the values in one of the data fields are approximately evenly distributed, the objects can be sorted/ordered by the values in this data field; and then this particular data field can be encoded incrementally to achieve bit savings.
Although preferred embodiments of the present invention have been described in detail herein, it is to be understood that this invention is not limited to these embodiments, and that other modifications and variations may be effected by one skilled in the art without departing from the scope of the invention as defined by the appended claims.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/CN2012/071334 | 2/20/2012 | WO | 00 | 8/13/2014 |