CROSS REFERENCE TO RELATED APPLICATIONS

The present application claims the priority of Chinese patent application No. 201911292540.0, filed on Dec. 16, 2019, the content of which is hereby incorporated herein in its entirety by reference.

TECHNICAL FIELD

The present disclosure relates to the field of display technologies, and in particular, to a method for compressing texture data, a device for compressing texture data, a storage medium, and an electronic apparatus.

BACKGROUND

A true 3D (three-dimensional) volumetric display technique, which may be simply referred to as a volumetric display technique or a volumetric three-dimensional display technique, is a kind of true three-dimensional display technology, and is the latest research direction in computer stereo vision systems. Based on such a display technique, a three-dimensional image with a physical depth of field may be directly observed. An image displayed by the true 3D volumetric display technique has the advantages of being very realistic, full-vision, multi-angle of view, simultaneous multi-person observation, real-time interaction, and the like.

As one of true three-dimensional display technologies, the volumetric three-dimensional display technique may include rotating a two-dimensional display panel around a fixed rotation axis and thus resulting in a three-dimensional display space by the sweeping (or scanning) of the display panel, driving the display panel to display different images when the display panel rotates to different positions (or angles), and achieving the effect of true three-dimensional display by using visual persistence (or persistence of vision) of human eyes.

SUMMARY

Embodiments of the present disclosure provide a method for compressing texture data, a device for compressing texture data, a non-transitory computer readable storage medium, and an electronic apparatus.

A first aspect of the present disclosure provides a method for compressing texture data of a three-dimensional model, including:

acquiring data of a plurality of polygonal surfaces constituting a contour of a target three-dimensional model, data of a texture image of the contour, and data of at least one phase plane of the contour, wherein the phase plane includes a plurality of voxels, the texture image includes a plurality of texture points, and the plurality of texture points have texture data of the plurality of polygonal surfaces;

acquiring the texture data of every texture point in each of a plurality of texture point groups, wherein the plurality of texture point groups are corresponding to the plurality of polygonal surfaces, and every texture point in each of the plurality of texture point groups comprises: first texture points and second texture points;

assigning a weight to every texture point in each of the plurality of texture point groups according to the texture data of the first texture points in the texture point group;

calculating a sum of weights of every texture point in each of the plurality of texture point groups; and

compressing the texture data, according to a target compressed data amount, and the texture data and the sum of weights of the texture point, whose sum of weights is not zero in each of the plurality of texture point groups.

In an embodiment, the plurality of voxels of the phase plane are arranged in a plurality of rows and a plurality of columns;

for each of the plurality of texture point groups, the texture data of the first texture points in the texture point group is acquired by:

acquiring positions of an intersection line of the phase plane and the polygonal surface corresponding to the texture point group;

acquiring a voxel, which has a smallest distance to the intersection line, in each of at least one row of voxels or in each of the at least one column of voxels of the phase plane intersecting the intersection line, and acquiring a projection point of the voxel which has the smallest distance to the intersection line on the intersection line; and

determining the texture point, which has the texture data of the projection point, in the texture image as one of the first texture points in the texture point group.

In an embodiment, the texture point having the texture data of the projection point is determined according to the following formula:

V1⁢AV2⁢A=TV⁢⁢1⁢TaTV⁢⁢2⁢Ta,

where V1and V2are positions of a first end point and a second end point, respectively, of one side, which intersects the phase plane, of the polygonal surface, A is an intersection point of the one side with the phase plane, TV1is a position of the texture point having the texture data of the first end point, TV2is a position of the texture point having the texture data of the second end point, Tais a position of the texture point having the texture data of the intersection point, V1A is a length of a line segment between the first end point V1and the intersection point A, V2A is a length of a line segment between the second end point V2and the intersection point A, TV1Tais a length of a line segment between the position TV1and the position Ta, and TV2Tais a length of a line segment between the position TV2and the position Ta.

In an embodiment, the assigning a weight to each texture point in every of the plurality of texture point groups according to the texture data of the first texture points in the texture point group includes:

acquiring an arrangement direction of the first texture points in the texture point group;

determining an element of a weight matrix corresponding to the first texture points in the texture point group according to the arrangement direction of the first texture points in the texture point group, wherein the weight matrix includes a plurality of non-zero elements, and the plurality of non-zero elements are arranged in the weight matrix along the arrangement direction of the first texture points in the texture point group; and

assigning a weight to each of the first texture points and a weight to each of the second texture points according to the weight matrix, wherein the weight corresponding to each of the first texture points is an element value at a center of a corresponding weight matrix.

In an embodiment, the texture data includes color information; and

the compressing the texture data, according to a target compressed data amount, and the texture data and the sum of weights of the texture point, whose sum of weights is not zero, in each of the plurality of texture point groups includes:

storing the color information of the texture point, whose sum of weights is not zero, in the texture point group in a memory as a node of a multi-tree, and recording in a storage node the sums of weights and a number of the texture points corresponding to the color information stored in the storage node; and

according to the target compressed data amount, traversing leaf nodes of the storage node, deleting the leaf node that has a minimum product of the sum of weights and the number of the texture points corresponding to the color information stored therein, and storing the color information stored in the leaf node, the sum of weights and the number of the texture points corresponding to the color information, in a parent node of the leaf node.

In an embodiment, the storing the color information of the texture point, whose sum of weights is not zero, in the texture point group in a memory as a node of a multi-tree includes:

acquiring components of a plurality of primary colors included in the color information;

determining an address index value of the color information according to the component of each of the plurality of primary colors; and

according to the address index value, storing the color information in a storage node corresponding to the address index value.

In an embodiment, after deleting the leaf node that has a minimum product of the sum of weights and the number of the texture points corresponding to the color information stored therein, and storing the color information stored in the leaf node, the sum of weights and the number of the texture points corresponding to the color information, in a parent node of the leaf node, the method further includes:

determining any parent node as a new leaf node in when leaf nodes corresponding to the parent node are all deleted.

In an embodiment, the multi-tree is an octree.

In an embodiment, for each of the plurality of texture point groups, the second texture points in the texture point group are the texture points corresponding to vertexes of the polygonal surface corresponding to the texture point group.

A second aspect of the present disclosure provides a device for compressing texture data of a three-dimensional model, including:

a first acquisition unit, configured to acquire data of a plurality of polygonal surfaces constituting a contour of a target three-dimensional model, data of a texture image of the contour, and data of at least one phase plane of the contour, wherein the phase plane includes a plurality of voxels, the texture image includes a plurality of texture points, and the plurality of texture points have texture data of the plurality of polygonal surfaces;

a second acquisition unit, configured to acquire the texture data every texture point in each of a plurality of texture point groups, wherein the plurality of texture point groups are corresponding to the plurality of polygonal surfaces, and every texture point in each of the plurality of texture point groups comprises: first texture points and second texture points;

a weight assigner, configured to assign a weight to every texture point in each of the plurality of texture point groups according to the texture data of the first texture points in the texture point group;

a calculator, configured to calculate a sum of weights of every texture point in each of the plurality of texture point groups; and

a data compressor, configured to compress the texture data, according to a target compressed data amount, and the texture data and the sum of weights of the texture point, whose sum of weights is not zero in each of the plurality of texture point groups.

In an embodiment, the plurality of voxels of the phase plane are arranged in a plurality of rows and a plurality of columns; and

the second acquisition unit is further configured to:

acquire positions of an intersection line of the phase plane and the polygonal surface corresponding to each texture point group;

acquire a voxel, which has a smallest distance to the intersection line, in each of at least one row of voxels or in each of the at least one column of voxels of the phase plane intersecting the intersection line, and acquire a projection point of the voxel which has the smallest distance to the intersection line on the intersection line; and

determine the texture point, which has the texture data of the projection point, in the texture image as one of the first texture points in the texture point group.

In an embodiment, the second acquisition unit is further configured to determine the texture point having the texture data of the projection point, according to the following formula:

V1⁢AV2⁢A=TV⁢⁢1⁢TaTV⁢⁢2⁢Ta,

where V1and V2are positions of a first end point and a second end point, respectively, of one side, which intersects the phase plane, of the polygonal surface, A is an intersection point of the one side with the phase plane, TV1is a position of the texture point having the texture data of the first end point, TV2is a position of the texture point having the texture data of the second end point, Tais a position of the texture point having the texture data of the intersection point, V1A is a length of a line segment between the first end point V1and the intersection point A, V2A is a length of a line segment between the second end point V2and the intersection point A, TV1A Tais a length of a line segment between the position TV1and the position Ta, and TV2Tais a length of a line segment between the position TV2and the position Ta.

In an embodiment, the second acquisition unit is further configured to:

determine the texture points corresponding to vertexes of the polygonal surface corresponding to each of the plurality of texture point groups as the second texture points in the texture point group.

A third aspect of the present disclosure provides a non-transitory computer readable storage medium, having a computer program stored thereon, wherein the computer program, when being executed by a processor, implements the method for compressing texture data of a three-dimensional model according to any one of the embodiments of the first aspect of the present disclosure.

A fourth aspect of the present disclosure provides an electronic apparatus, including:

a processor and a memory;

wherein the memory stores a computer program therein, and the computer program, when being executed by the processor, implements the method for compressing texture data of a three-dimensional model according to any one of the embodiments of the first aspect of the present disclosure.

