WO2023179710A1 - 编码方法及终端 - Google Patents
编码方法及终端 Download PDFInfo
- Publication number
- WO2023179710A1 WO2023179710A1 PCT/CN2023/083357 CN2023083357W WO2023179710A1 WO 2023179710 A1 WO2023179710 A1 WO 2023179710A1 CN 2023083357 W CN2023083357 W CN 2023083357W WO 2023179710 A1 WO2023179710 A1 WO 2023179710A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- information
- reconstructed
- vertices
- target
- encoding
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 145
- 238000013139 quantization Methods 0.000 claims description 51
- 238000012545 processing Methods 0.000 claims description 26
- 238000010586 diagram Methods 0.000 claims description 24
- 238000011002 quantification Methods 0.000 claims description 5
- 238000004806 packaging method and process Methods 0.000 claims 1
- 230000006870 function Effects 0.000 description 20
- 239000013598 vector Substances 0.000 description 18
- 238000004364 calculation method Methods 0.000 description 11
- 238000004891 communication Methods 0.000 description 10
- 238000004422 calculation algorithm Methods 0.000 description 8
- 230000006835 compression Effects 0.000 description 8
- 238000007906 compression Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 6
- 238000012856 packing Methods 0.000 description 6
- 230000001360 synchronised effect Effects 0.000 description 5
- 238000009499 grossing Methods 0.000 description 4
- 230000002829 reductive effect Effects 0.000 description 4
- 239000011159 matrix material Substances 0.000 description 3
- 230000002441 reversible effect Effects 0.000 description 3
- 239000013589 supplement Substances 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 238000000638 solvent extraction Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000002123 temporal effect Effects 0.000 description 2
- 241000699670 Mus sp. Species 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000005094 computer simulation Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000002059 diagnostic imaging Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000002427 irreversible effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000036961 partial effect Effects 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
- 238000005406 washing Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/04—Texture mapping
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/20—Finite element generation, e.g. wire-frame surface description, tesselation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T9/00—Image coding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T9/00—Image coding
- G06T9/001—Model-based coding, e.g. wire frame
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/136—Incoming video signal characteristics or properties
Definitions
- This application belongs to the field of coding technology, and specifically relates to an coding method and a terminal.
- Three-dimensional mesh can be considered the most popular representation method of three-dimensional models in the past many years, and it plays an important role in many applications. Its expression is simple, so it is widely integrated into the graphics processing units of computers, tablets and smartphones with hardware algorithms, specifically used to render three-dimensional meshes.
- Embodiments of the present application provide an encoding method and a terminal, which can solve the problem of encoding failure when encoding connection information of a three-dimensional grid.
- the first aspect provides an encoding method, which includes:
- the encoding end encodes the first information corresponding to the target three-dimensional grid to obtain the first code stream; the first information is determined based on the geometric information corresponding to the target three-dimensional grid;
- the encoding end obtains reconstructed connection information and reconstructed texture coordinate information based on reconstructed geometric information; the reconstructed geometric information is determined based on reconstructing the geometric information;
- the encoding end determines the second code stream based on the reconstructed geometric information and the reconstructed connection information
- the encoding end determines the third code stream based on attribute information, where the attribute information includes a texture map and the reconstructed texture coordinate information;
- the encoding end generates a target code stream based on the first code stream, the second code stream and the third code stream.
- an encoding device including:
- An encoding module configured to encode the first information corresponding to the target three-dimensional grid and obtain the first code stream; the first information is determined based on the geometric information corresponding to the target three-dimensional grid;
- a processing module configured to obtain reconstructed connection information and reconstructed texture coordinate information based on reconstructed geometric information; the reconstructed geometric information is determined based on reconstruction of the geometric information;
- a first determination module configured to determine a second code stream based on the reconstructed geometric information and the reconstructed connection information
- a second determination module configured to determine the third code stream based on attribute information, where the attribute information includes a texture map and the reconstructed texture coordinate information;
- a generating module configured to generate a target code stream based on the first code stream, the second code stream and the third code stream.
- a terminal in a third aspect, includes a processor and a memory.
- the memory stores programs or instructions that can be run on the processor.
- the program or instructions are executed by the processor, the following implementations are implemented: The steps of the method described in one aspect.
- a readable storage medium is provided. Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
- a chip in a fifth aspect, includes a processor and a communication interface.
- the communication interface is coupled to the processor.
- the processor is used to run programs or instructions to implement the method described in the first aspect. .
- a computer program/program product is provided, the computer program/program product Stored in a storage medium, the computer program/program product is executed by at least one processor to implement the steps of the method as described in the first aspect.
- the first information corresponding to the target three-dimensional grid is encoded to obtain the first code stream; the encoding end obtains the reconstructed connection information and the reconstructed texture coordinate information based on the reconstructed geometric information; the encoding end obtains the reconstructed connection information and reconstructed texture coordinate information based on the reconstructed geometric information and the reconstructed texture coordinate information.
- the connection information determines the second code stream; the encoding end determines the third code stream based on the attribute information; the encoding end generates the target code stream based on the first code stream, the second code stream, and the third code stream.
- the reconstructed connection information and the reconstructed texture coordinate information are obtained based on the reconstructed geometric information, and the corresponding relationship between the geometric information corresponding to the reconstructed vertices and the geometric information corresponding to the original vertices is established, so as to perform subsequent processing of the three-dimensional network.
- the step of encoding the connection information and attribute information of the grid avoid encoding failure.
- Figure 1 is a flow chart of the encoding method provided by the embodiment of the present application.
- Figure 2 is a schematic diagram of adjusting connection relationships provided by an embodiment of the present application.
- Figure 3 is a schematic diagram of the process of merging vertices in mesh simplification
- Figure 4 is a schematic diagram of the fine division process based on grid
- Figure 5 is a schematic diagram of the eight directions of patch arrangement
- Figure 6 is a schematic diagram of the encoding process of high-precision geometric information
- Figure 7 is a schematic diagram of raw patch
- Figure 8 is one of the schematic diagrams of encoding connectivity relationships in the embodiment of the present application.
- Figure 9 is the second schematic diagram of the coding connectivity relationship in the embodiment of the present application.
- Figure 10 is a schematic diagram of attribute information encoding in an embodiment of the present application.
- Figure 11 is a structural diagram of an encoding device provided by an embodiment of the present application.
- Figure 12 is a structural diagram of a communication device provided by an embodiment of the present application.
- Figure 13 is a schematic diagram of the hardware structure of a terminal provided by an embodiment of the present application.
- first, second, etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in sequences other than those illustrated or described herein, and that "first" and “second” are distinguished objects It is usually one type, and the number of objects is not limited.
- the first object can be one or multiple.
- “and/or” in the description and claims indicates at least one of the connected objects, and the character “/" generally indicates that the related objects are in an "or” relationship.
- the encoding device corresponding to the encoding method in the embodiment of the present application can be a terminal.
- the terminal can also be called a terminal device or a user terminal (User Equipment, UE).
- the terminal can be a mobile phone, a tablet computer (Tablet Personal Computer, TPC), a laptop Laptop Computer (LC) is also known as notebook computer, Personal Digital Assistant (Personal Digital Assistant, PDA), Pocket PC, Netbook, Ultra-mobile Personal Computer (UMPC), Mobile Internet Device (Mobile Internet Device, MID), Augmented Reality (AR)/Virtual Reality (VR) equipment, robots, wearable devices (Wearable Device) or vehicle-mounted equipment (Vehicle User Equipment, VUE), pedestrian terminals (Pedestrian User Equipment (PUE), smart home (home equipment with wireless communication functions, such as refrigerators, TVs, washing machines or furniture, etc.), game consoles, personal computers (Personal Computer, PC), teller machines or self-service machines and other terminal-side devices, can Wearable devices include: smart watches, smart bracelet
- Figure 1 is a flow chart of the encoding method provided by this application.
- the encoding method provided in this embodiment includes the following steps:
- the encoding end encodes the first information corresponding to the target three-dimensional grid and obtains the first code stream.
- the above-mentioned target three-dimensional grid can be a three-dimensional grid corresponding to any video frame.
- the first information corresponding to the target three-dimensional grid may be determined based on the geometric information corresponding to the target three-dimensional grid, and then the first information may be encoded to obtain the first code stream.
- the first information may be encoded to obtain the first code stream.
- the encoding end obtains reconstructed connection information and reconstructed texture coordinate information based on the reconstructed geometric information.
- the encoding end can reconstruct the geometric information to obtain the reconstructed geometric information.
- the geometric reconstruction here refers to obtaining the three-dimensional coordinates of the reconstructed vertex through the encoding information.
- reconstructed connection information and reconstructed texture coordinate information are obtained.
- the above reconstructed connection information represents the connection relationship between the reconstructed vertices
- the above reconstructed texture coordinate information represents the texture coordinates corresponding to all reconstructed vertices.
- the encoding end determines the second code stream based on the reconstructed geometry information and the reconstructed connection information.
- the reconstructed connection information is encoded according to the reconstructed geometric information and the reconstructed connection information to obtain the second code stream.
- the encoding end determines the third code stream based on the attribute information.
- the above attribute information includes texture map and reconstructed texture coordinate information.
- the encoding end encodes the texture map and reconstructed texture coordinate information separately to obtain different sub-code streams, and mixes the above sub-code streams to obtain a third code stream.
- the encoding end generates a target code stream based on the first code stream, the second code stream, and the third code stream.
- the first code stream, the second code stream and the third code stream are mixed to generate a target code stream.
- the first information corresponding to the target three-dimensional grid is encoded to obtain the first code stream; the encoding end obtains the reconstructed connection information and the reconstructed texture coordinate information based on the reconstructed geometric information; the encoding end obtains the reconstructed connection information and reconstructed texture coordinate information based on the reconstructed geometric information and the reconstructed texture coordinate information.
- the connection information determines the second code stream; the encoding end determines the third code stream based on the attribute information; the encoding end generates the target code stream based on the first code stream, the second code stream, and the third code stream. code stream.
- the reconstructed connection information and the reconstructed texture coordinate information are obtained based on the reconstructed geometric information, and the corresponding relationship between the geometric information corresponding to the reconstructed vertices and the geometric information corresponding to the original vertices is established, so as to perform subsequent processing of the three-dimensional network.
- the step of encoding the connection information and attribute information of the grid avoid encoding failure.
- the method before encoding the first information corresponding to the target three-dimensional grid and obtaining the first code stream, the method includes:
- the encoding end obtains geometric information corresponding to the target three-dimensional grid
- the encoding end projects the vertices contained in the target three-dimensional mesh into a geometric diagram and a placeholder diagram to obtain the first information.
- the encoding end obtains geometric information corresponding to the target three-dimensional grid.
- the above-mentioned geometric information includes the position coordinates of the vertices included in the target three-dimensional grid.
- the vertices included in the above-mentioned target three-dimensional grid are also called original vertex.
- the above-mentioned vertices are projected on the geometric diagram and placeholder diagram according to the order in which the vertices are arranged in the geometric information, and the first information is obtained.
- the position coordinates of each vertex in the placeholder map correspond to the arrangement order of the vertex in the geometric information.
- obtaining the reconstructed connection information and reconstructed texture coordinate information based on the reconstructed geometric information includes:
- the placeholder map Based on the placeholder map, update the index of the vertex included in the connection information to obtain the reconstructed connection information; the placeholder map is obtained based on decoding the first code stream, and the position coordinates of each vertex in the placeholder map are obtained Corresponding to the arrangement order of the vertices in the reconstructed geometry information, the arrangement order of the vertices in the reconstructed geometry information corresponds to the index of the vertices in the reconstructed connection information;
- the position coordinates of each vertex in the placeholder map correspond to the arrangement order of the vertices in the reconstructed geometry information, so The arrangement order of the vertices in the reconstructed geometry information corresponds to the index of the vertices in the reconstructed attribute information.
- the geometric information is reconstructed to obtain the reconstructed geometry information; the first code stream is decoded to obtain a placeholder map.
- the position of each vertex in the placeholder map is The coordinates correspond to the order in which the vertices are arranged in the geometric information.
- the reconstruction sequence of the vertex is generated, and the vertex's
- the reconstruction order corresponds to the position coordinates of each vertex in the placeholder map
- the position coordinates of each vertex in the placeholder map corresponds to the arrangement order of the vertices in the geometric information. Therefore, the arrangement order of each vertex in the geometric information can be established.
- the corresponding relationship with the reconstruction order of the vertex that is, the corresponding relationship between the original vertex and the reconstructed vertex can be established through the vertex position in the placeholder map.
- the index of the vertex included in the connection information is updated according to the above corresponding relationship, and the index is used to represent the reconstruction order of the vertex, thereby obtaining the reconstructed connection information.
- Update the index of the vertices included in the reconstructed texture coordinate information according to the above corresponding relationship establish the corresponding relationship between the reconstructed vertex and the original vertex texture coordinates, that is, the UV coordinates, and rearrange the reconstructed texture coordinates according to the corresponding relationship between the reconstructed vertex and the original vertex texture coordinates. order, thereby establishing the correspondence between the reconstructed vertices and the reconstructed texture coordinates.
- the original vertices are projected and arranged in the placeholder map according to the order in which they are arranged in the geometric information (original vertex order).
- the position of the vertices in the placeholder map is the same as that of the original vertices.
- vertex orders there is a correspondence between vertex orders.
- the above-mentioned placeholder image is losslessly encoded, and the number and position of the vertices in the placeholder image after lossless encoding remain unchanged.
- the geometric information is reconstructed according to the placeholder map and the geometric map, and the reconstruction order of the vertices is generated.
- the method before encoding the first information corresponding to the target three-dimensional grid, the method includes:
- the three-dimensional grid to be encoded is simplified to obtain the target three-dimensional grid
- the three-dimensional grid to be encoded is determined as the target three-dimensional grid.
- the three-dimensional grid to be encoded is simplified, and the simplified three-dimensional grid is determined as the target three-dimensional grid.
- the three-dimensional grid to be encoded can be directly determined as the target three-dimensional grid.
- the three-dimensional grid to be encoded is simplified to obtain the target three-dimensional grid including:
- the encoding end simplifies the three-dimensional grid to be encoded based on the quantization parameters to obtain Get the target 3D grid.
- quantization parameters mentioned in this application mainly include quantization parameters in the three components of X direction, Y direction and Z direction.
- simplifying the target three-dimensional grid to obtain the target three-dimensional grid includes:
- the position coordinates of at least part of the vertices in the three-dimensional mesh to be encoded are adjusted to multiples of the quantization parameters to obtain the target 3D grid.
- the multiple can be any value that meets the requirements, thereby ensuring that no quantization is required during inverse quantization.
- the additional information can restore the original position of the vertex, which will reduce the amount of data consumed by high-precision geometric information.
- the grid simplification operation is first performed.
- the focus of mesh simplification lies in the simplified operations and the corresponding error measures.
- the mesh simplification operation here can be edge-based simplification. As shown in Figure 3, the number of patches and vertices can be reduced by merging two vertices of an edge.
- the mesh can also be simplified through point-based mesh simplification methods.
- the mesh simplification process it is necessary to define a simplified error measure.
- the sum of the equation coefficients of all adjacent faces of a vertex can be selected as the error measure of the vertex, and the error measure of the corresponding edge is the sum of the error measures of the two vertices on the edge.
- the mesh can be divided into one or more local meshes, and the vertex error of the initial mesh in the slice is first calculated to obtain the error of each edge. Then all the edges in the piece are arranged according to a certain rule according to the error, such as from small to large.
- Each simplification can merge edges according to certain rules, such as selecting the edge with the smallest error for merging.
- the merged vertex position is calculated and the errors of all edges related to the merged vertex are updated, and the order of edge arrangement is updated. Iteratively simplify the mesh's faces to some desired number.
- the specific process includes:
- the vertex error can be defined as the sum of the coefficients of the equations of all adjacent faces of the vertex. For example, each adjacent face defines a plane, which can be expressed by Formula 1:
- D is the distance from any vertex to the plane
- n is the unit normal vector of the plane
- v is the position vector of the vertex
- Q is the vertex error
- A, b, c are the coefficients representing the corresponding symbols in Formula 1.
- Q(v) is the vertex error
- v is the corresponding vertex
- Q 1 (v) is the equation of v's adjacent plane 1
- Q 2 (v) is the equation of v's adjacent plane 2
- a 1 , A 2 , b 1 , b 2 , c 1 , c 2 are their corresponding coefficients.
- the corresponding plane error equation can be added to Formula 4.
- a major step in the process of merging vertices is determining the location of the merged vertices.
- the vertex position can be selected to make the error as small as possible. For example, by taking the partial derivative of formula 3, we can get formula 4:
- the connection relationship between the vertices needs to be updated. For example, during the process of merging vertices, it is possible to determine that the merged vertex corresponds to the two vertices before merging. You only need to replace all the indexes of the two vertices before merging that appear in the face with the index of the merged vertex, and then delete the face with duplicate indexes to achieve the purpose of updating the connection relationship.
- the three-dimensional grid may also carry attribute information, and the attribute information may also need to be simplified.
- attribute information such as texture coordinates, colors, normal vectors, etc.
- the vertex coordinates can be extended to higher dimensions to calculate the vertex error with attribute information.
- the vertex coordinates are (x, y, z) and the texture coordinates are (u, v)
- the expanded vertices are (x, y, z, u, v).
- T (p, q, r).
- e 1 and e 2 are two vectors on the plane where T is located, q is, e 2 is, where " ⁇ " represents the dot product of the vectors, which defines a coordinate axis on the high-dimensional plane, with p as the origin.
- the edge part of an image can attract people's attention more, thus affecting people's evaluation of the quality of the image.
- the same is true for three-dimensional meshes. People tend to notice the boundaries more easily. Therefore, whether boundaries are maintained is also a factor that affects the quality of mesh simplification.
- the boundaries of the mesh are generally the boundaries of geometric shapes and textures. When an edge belongs to only one face, the edge is a geometric boundary. When the same vertex has two or more texture coordinates, the vertex is the boundary of the texture coordinates. None of the above boundaries should be merged during mesh simplification. Therefore, during each simplification, you can first determine whether the vertex on the edge is a boundary point. If it is a boundary point, skip it and proceed directly to the next iteration.
- encoding the first information corresponding to the target three-dimensional grid and obtaining the first code stream includes:
- the encoding end quantifies the geometric information of the target three-dimensional grid to obtain the first information
- the encoding end encodes the first information to obtain a first code stream.
- the above geometric information can be understood as the coordinates of the vertices in the target three-dimensional grid, and these coordinates usually refer to three-dimensional coordinates.
- the above-mentioned first information includes at least one of the following:
- the first precision geometric information can be understood as low-precision geometric information, that is, the low-precision geometric information refers to the quantized geometric information of the target three-dimensional grid, that is, the three-dimensional coordinates of each vertex included in the quantized target three-dimensional grid. coordinate information.
- the second precision geometric information can be understood as high-precision geometric information, and the high-precision geometric information can be regarded as geometric information lost in the quantization process, that is, lost three-dimensional coordinate information.
- the information of supplementary points refers to the information of points that require additional processing generated during the quantification process. That is to say, the supplementary points are points that require additional processing generated during the quantification process. For example, the coordinate positions overlap. Repeated points, etc., can be processed in reverse Return to original position after quantization.
- the supplementary point information includes at least one of the following:
- the low-precision geometric information of the supplementary points can be determined through the index of the vertices.
- the third-precision geometric information can be understood as low-precision geometric information of the supplementary points, that is, the quantized three-dimensional coordinate information of the supplementary points.
- the fourth precision geometric information can be understood as the high-precision geometric information of the supplementary point, that is, the three-dimensional coordinate information of the supplementary point that is lost during the quantization process.
- the hidden points after quantization can be determined through A131 and A133 or A132 and A133.
- the first information can be encoded, and the encoded code stream is determined as the first code stream.
- the quantizing the geometric information of the target three-dimensional grid to obtain the first information includes:
- the encoding end quantizes each vertex in the target three-dimensional grid according to the quantization parameter of each component to obtain first precision geometric information.
- the quantization parameters of each component can be flexibly set according to usage requirements; the quantization parameters mainly include quantization parameters on the three components of X, Y and Z.
- quantizing the geometric information of the target three-dimensional grid to obtain the first information includes:
- the encoding end obtains second precision geometric information based on the first precision geometric information and the quantization parameter of each component.
- the f 1 function in Formula 14 to Formula 16 is a quantization function.
- the input of the quantization function is the coordinate of a certain dimension and the quantization parameter of that dimension, and the output is the quantized coordinate value;
- Formula 17 to Formula 19 The input of the f 2 function in is the original coordinate value, the quantized coordinate value and the quantized parameter of this dimension, and the output is a high-precision coordinate value.
- the f 1 function can be calculated in many ways.
- a more common calculation method is as shown in Formula 20 to Formula 22. It is calculated by dividing the original coordinates of each dimension by the quantized parameter of that dimension. Among them, / is the division operator, and the result of the division operation can be rounded in different ways, such as rounding, rounding down, rounding up, etc.
- the implementation methods corresponding to Formula 20 to Formula 22 are as shown in Formula 23 to Formula 25, where * is the multiplication operator.
- the f 1 function and f 2 function can be implemented using bit operations, such as Formula 26 to Formula 31:
- the quantization parameters QP x , QP y and QP z can be set flexibly.
- the quantization parameters of different components are not necessarily equal. You can use the correlation of the quantization parameters of different components to establish the relationship between QP x , QP y and QP z , and set different quantization parameters for different components; secondly, different spaces
- the quantization parameters of the regions are not necessarily equal.
- the quantization parameters can be adaptively set according to the sparsity of the vertex distribution in the local region.
- the high-precision geometric information contains detailed information of the outline of the three-dimensional mesh.
- the high-precision geometric information (x h , y h , z h ) can be further processed.
- the importance of high-precision geometric information of vertices in different areas is different. For areas where vertices are sparsely distributed, the distortion of high-precision geometric information will not have a major impact on the visual effect of the three-dimensional mesh.
- quantizing the geometric information of the target three-dimensional grid to obtain the first information includes:
- the encoding end determines the information of the supplementary point based on the geometric information of the target three-dimensional grid and the first precision geometric information.
- the points with repeated low-precision geometric information are used as supplementary points and encoded separately.
- the geometric information of supplementary points can also be divided into two parts: low-precision geometric information and high-precision geometric information. According to the application's requirements for compression distortion, you can choose to retain all supplementary points or only a part of them.
- the high-precision geometric information of the supplementary points can also be further quantified, or the high-precision geometric information of only some points can be retained.
- the first information needs to be encoded to obtain the final code stream.
- encoding the first information and obtaining the first code stream includes:
- the encoding end processes the first information and obtains the second information.
- the second information packet include at least one of a placeholder diagram and a geometric diagram;
- the first information includes first precision geometric information
- processing the first information to obtain the second information includes:
- the encoding end divides the first precision geometric information into three-dimensional slices
- the encoding end performs two-dimensional projection on the divided three-dimensional slice to obtain the two-dimensional slice;
- the encoding end packages the two-dimensional slices to obtain two-dimensional image information
- the encoding end obtains a first-precision placeholder map and a first-precision geometric map based on the two-dimensional image information.
- the main step is to divide the low-precision geometric information into patches to obtain multiple three-dimensional patches;
- the specific implementation method of this step is: the encoding end determines each element contained in the first-precision geometric information.
- the projection plane of the vertices; the coding end performs slice division on the vertices contained in the first precision geometric information according to the projection plane; the coding end clusters the vertices contained in the first precision geometric information, and obtains Each piece after division.
- the process of patch division mainly includes: first estimating the normal vector of each vertex, selecting the candidate projection plane with the smallest angle between the plane normal vector and the vertex normal vector as the projection plane of the vertex; then, according to the projection The plane initially divides the vertices, and vertices with the same and connected projection planes are composed into a patch; finally, a fine division algorithm is used to optimize the clustering results to obtain the final three-dimensional patch (3D patch).
- the projection plane of each vertex is initially selected.
- the normal vector of the candidate projection plane is Select the plane whose normal vector direction is closest to the vertex normal vector direction as the projection plane of the vertex.
- the calculation process of plane selection is as shown in Equation 34:
- the fine division process can use a grid-based algorithm to reduce the time complexity of the algorithm.
- the grid-based fine division algorithm flow is shown in Figure 4, which specifically includes:
- Step 401 Divide the (x, y, z) geometric coordinate space into voxels.
- Step 402 Find filled voxels.
- Filled voxels refer to voxels that contain at least one point in the grid.
- Step 403 Calculate the smoothing score of each filled voxel on each projection plane, recorded as voxScoreSmooth.
- the voxel smoothing score of the voxel on a certain projection plane is the number of points gathered to the projection plane through the initial segmentation process.
- Step 404 use KD-Tree partitioning to find neighboring filled voxels, denoted as nnFilledVoxels, that is, the nearest filled voxels of each filled voxel (within the search radius and/or limited to the maximum number of adjacent voxels).
- nnFilledVoxels the nearest filled voxels of each filled voxel (within the search radius and/or limited to the maximum number of adjacent voxels).
- Step 405 use the voxel smoothing score of the nearest neighbor filled voxel in each projection plane to calculate the smoothing score (scoreSmooth) of each filled voxel.
- the calculation process is as shown in Formula 35:
- Step 406 Calculate the normal score using the normal vector of the vertex and the normal vector of the candidate projection plane, recorded as scoreNormal.
- the calculation process is as shown in Formula 36:
- p is the index of the projection plane and i is the index of the vertex.
- Step 407 use scoreSmooth and scoreNormal to calculate the final score of each voxel on each projection plane.
- the calculation process is as shown in Equation 37:
- i is the vertex index
- p is the index of the projection plane
- v is the voxel index where vertex i is located.
- Step 408 Use the scores in step 407 to cluster the vertices to obtain finely divided patches.
- the encoding end performs two-dimensional projection on the divided three-dimensional slice to obtain the two-dimensional slice.
- this process is to project the 3D patch onto a two-dimensional plane to obtain a two-dimensional patch (2D patch).
- the encoding end packages the two-dimensional slices to obtain two-dimensional image information.
- this step implements patch packing.
- the purpose of patch packing is to arrange 2D patches on a two-dimensional image.
- the basic principle of patch packing is to arrange patches on a two-dimensional image without overlapping or The pixel-free parts of the patch are partially overlapped and arranged on the two-dimensional image.
- the patches are arranged more closely and have time domain consistency to improve coding performance.
- the resolution of the 2D image is WxH
- the minimum block size that defines the patch arrangement is T, which specifies the minimum distance between different patches placed on this 2D grid.
- patches are inserted and placed on the 2D grid according to the non-overlapping principle.
- Each patch occupies an area consisting of an integer number of TxT blocks.
- the patches can choose a variety of different arrangement directions. For example, eight different arrangement directions can be adopted, as shown in Figure 5, including 0 degrees, 180 degrees, 90 degrees, 270 degrees, and mirror images of the first four directions.
- a patch arrangement method with temporal consistency is adopted.
- a Group of frame all patches of the first frame are arranged in order from largest to smallest.
- the temporal consistency algorithm is used to adjust the order of patches.
- the patch information can be obtained based on the information in the process of obtaining the two-dimensional image information. After that, the patch information can be encoded and the patch information sub-stream can be obtained;
- the patch information records the information of each step operation in the process of obtaining two-dimensional image.
- the patch information includes: patch division information, patch projection plane information, and patch packing position information.
- the process of obtaining the placeholder map is mainly as follows: using the patch arrangement information obtained by patch packing, setting the position of the vertex in the two-dimensional image to 1 and setting the remaining positions to 0 to obtain the placeholder map.
- the main process is: in the process of obtaining the 2D patch through projection, the distance from each vertex to the projection plane is saved. This distance is called the depth.
- the low-precision geometric map compression part is to compress each 2D patch in the 2D patch.
- the depth value of the vertex is arranged to the position of the vertex in the placeholder map to obtain a low-precision geometric map.
- the first information includes second precision geometric information
- processing the first information to obtain the second information includes:
- the encoding end obtains the arrangement order of the vertices contained in the first precision geometric information
- the encoding end arranges the second-precision geometric information corresponding to the vertices included in the first-precision geometric information in the two-dimensional image to generate a second-precision geometric map.
- the high-precision geometric information is arranged in the original patch (raw patch), and the high-precision geometric information corresponding to the vertices in the low-precision geometric map is arranged in a two-dimensional image to obtain the raw patch, thereby generating a high-precision Accurate geometric drawings. It is mainly divided into three steps, as shown in Figure 6, including:
- Step 601 Obtain the vertex arrangement order, scan the low-precision geometric map line by line from left to right, and use the scanning order of each vertex as the vertex arrangement order in the raw patch.
- Step 602 Generate a raw patch.
- a raw patch is a rectangular patch formed by arranging the three-dimensional coordinates of the vertices row by row as shown in Figure 4. According to the vertex arrangement order obtained in the first step, the high-precision geometric information of the vertices is arranged in order to obtain the high-precision geometric information raw patch.
- Step 603 Place the high-precision geometric information in a two-dimensional image to generate a high-precision geometric map.
- the encoding end will encode the first-precision geometric figure and the second-precision geometric figure to obtain the geometric figure sub-stream.
- the first information includes information on supplementary points
- processing the first information to obtain the second information includes:
- the encoding end arranges the third precision geometric information of the supplementary points into a first original slice
- the encoding end arranges the fourth precision geometric information of the supplementary points into a second original slice in the same order as the first original slice;
- the encoding end compresses the first original slice and the second original slice to obtain a geometric map of the supplementary points.
- the low-precision part and the high-precision part of the geometric information of the supplementary points are encoded separately.
- the low-precision geometric information of the supplementary points is arranged into a supplementary point low-precision raw patch in any order; then, the high-precision geometric information is arranged into a supplementary point high-precision raw patch in the same order as the supplementary point low-precision raw patch; finally , to compress supplementary point low-precision raw patches and high-precision raw patches, a variety of compression methods can be used. Among them, one method is to encode the values in the raw patch by run-length coding, entropy coding, etc.
- the other method is to add the supplementary point low-precision raw patch to the blank area in the low-precision geometric map, and add the supplementary point high-precision
- the raw patch adds the blank areas in the high-precision geometric map to obtain the geometric map of supplementary points.
- determining the second code stream based on the reconstructed geometric information and the reconstructed connection information includes:
- the encoding end determines the vertices to be sorted within a first spatial range based on the spatial angle between adjacent triangular patches represented by the reconstructed geometric information and the reconstructed connection information, and the first spatial range is the reconstructed geometry.
- the spatial range where the target vertex of the triangle to be encoded is represented by the information and the reconstructed connection information, and the vertices to be sorted include the target vertex;
- the encoding end sorts the vertices to be sorted to obtain the sorting information of the target vertices
- the encoding end obtains the encoding information of the triangle to be encoded based on the encoding information corresponding to the sorting information of the target vertex;
- the encoding end updates the edge set according to the first preset rule
- the encoding end re-determines the triangles to be encoded based on the updated edge set until the encoding information of all triangles to be encoded is obtained;
- the encoding end encodes the encoding information of all triangles to be encoded to obtain the second code stream;
- the first preset rule includes: adding two sides of the triangle to be encoded except the first side to the side set, and removing the first side from the side set.
- the reconstructed geometric information here includes the index information of the vertices in the target three-dimensional mesh.
- the above three-dimensional network can be divided into at least one triangular patch, and each triangular patch contains at least one triangle.
- some vertices in the first spatial range can be filtered out, and the remaining vertices can be used as vertices to be sorted.
- the first spatial range includes:
- the center of the first sphere and the second sphere are the same, the radius of the first sphere and the radius of the second sphere are different, and the center of the sphere is the target in the first side of the triangle to be encoded.
- Position, for example, the center of the sphere is the midpoint of the first side of the triangle to be encoded.
- the vertices to be sorted are sorted according to a preset sorting criterion.
- the sorting criterion may be to sort according to the distance between the vertices and the midpoint of the first side of the triangle to be encoded, or the sorting criterion may also be to sort according to the vertices. Sort by the size of the radius of the circumcircle of the triangle formed by the first side.
- the sorting criterion can also be other criteria, which are not specifically limited here.
- the vertices in the first spatial range are further deleted, reducing the number of vertices to be sorted, that is, the bit information used in the sorting information of the target vertices can be reduced.
- the encoding end encodes the sorting information of the target vertex to obtain the coded information; when the target condition is not met, the coding end encodes the sorting information of the target vertex.
- the index is encoded to obtain the above encoding information.
- the target condition is that the number of vertices to be sorted in the first spatial range is less than a preset threshold, and/or the sorting number of the target vertex is less than a preset value. Since the number of vertices to be sorted in the first space range is small or the sorting sequence number of the target vertex is small, the encoding information corresponding to the sorting information will occupy a smaller number of bits.
- the sorting information of the target vertex is encoded, It can effectively reduce the number of encoding bits.
- encoding the index of the target vertex can effectively reduce the number of encoding bits compared to encoding the sorting information.
- the encoding end after obtaining the encoding information of the encoding triangle, the encoding end updates the edge set according to the first preset rule; the encoding end re-determines the triangle to be encoded based on the updated edge set until the triangles in the three-dimensional grid are all Get coded information. Encode the encoding information of all the triangles to be encoded to obtain the second code stream.
- the first preset rule includes: adding two sides of the triangle to be encoded except the first side to the side set, and removing the first side from the side set.
- some vertices are excluded in the first spatial range according to the spatial angle between adjacent triangular patches in the three-dimensional grid, and the vertices to be sorted are determined based on the excluded vertices, that is, the number of vertices to be sorted is reduced. In this way, when encoding the sorting information of the target vertex, the number of bits occupied by the encoding information can be further reduced, thereby effectively improving the encoding efficiency.
- the method before determining the vertices to be sorted in the first spatial range based on the spatial angle between adjacent triangular patches represented by the reconstructed geometric information and the reconstructed connection information, the method includes:
- the encoding end selects the first edge from an edge set, wherein the edge set is a set of at least one edge of the encoded triangle represented by the reconstructed geometry information and the reconstructed connection information;
- the encoding end determines the triangle to be encoded based on the first side and the vertex corresponding to the first side, wherein the target vertex of the triangle to be encoded is the vertex corresponding to the first side divided by the third Vertices other than two vertices connected by an edge.
- determining the vertices to be sorted within the first spatial range based on the spatial angle between adjacent triangular patches represented by the reconstructed geometric information and the reconstructed connection information includes:
- the encoding end determines the vertices to be sorted within the first spatial range based on the spatial angle between the adjacent triangle patches.
- the preset category triangle includes at least one of the following:
- a triangle with two vertices coincident or three vertices collinear means that two vertices in a triangle coincide or three vertices are collinear.
- the method also includes:
- the encoding end obtains the encoding information of the triangle to be encoded based on the encoding information corresponding to the target vertex information of the triangle to be encoded.
- the index of the target vertex of the triangle to be encoded is directly encoded, and the encoding information of the triangle to be encoded is obtained based on the encoding information corresponding to the index of the target vertex.
- binary representation when encoding the index of a vertex, binary representation can be directly used or a coding algorithm such as Huffman can be used for encoding.
- a coding algorithm such as Huffman can be used for encoding.
- the encoding method is not specifically limited here.
- determining the vertices to be sorted within the first spatial range based on the spatial angle between adjacent triangular patches represented by the reconstructed geometric information and the reconstructed connection information includes:
- the encoding end excludes all vertices of the first target triangle from the vertices within the first space range to obtain remaining vertices;
- the encoding end determines the vertices to be sorted within the first spatial range based on the remaining vertices
- the first target triangle is a triangle whose angle with an adjacent encoded triangle is less than an angle threshold, and one side of the first target triangle is the same as the first side of the triangle to be encoded.
- the encoding information of the triangle to be encoded also includes: encoding information of the angle threshold.
- the decoding end can obtain the angle threshold based on the encoding information, and determine the vertices to be sorted in the first spatial range based on the angle threshold. In this way, the encoding end can flexibly Set the angle threshold.
- a fixed angle threshold can also be pre-agreed.
- the encoding end and the decoding end determine the vertices to be sorted in the first spatial range based on the pre-agreed angle threshold.
- the encoding end does not need to encode the angle threshold.
- the method also includes:
- the encoding end encodes the target vertex information of the triangle to be encoded in a second spatial range, and obtains the encoding information of the triangle to be encoded.
- the second spatial range is a range other than the first spatial range.
- the encoding information of the triangle to be encoded also includes encoding information of the first spatial range.
- the first spatial range can be flexibly set in this implementation.
- the encoding end and the decoding end can also predetermine the size of the first spatial range. In this method, the encoding end does not need to encode the first spatial range.
- the input three-dimensional mesh is divided into one or more slices at the encoding end, and an initial triangle is selected in each slice.
- the triangle formed by the edge and the pair of vertices is the triangle to be encoded.
- the edge selected in each iteration can be recorded as ⁇
- its opposite vertex is recorded as v
- the triangle to be encoded adjacent to the edge can be encoded.
- the process of encoding connectivity relationships may specifically include:
- the vertex index of the triangle can be directly encoded, or the triangle can be encoded in other ways.
- the preset condition may be that the triangle to be encoded belongs to several special triangles, such as a degenerate surface (two points coincide or three points are collinear) or the angle between the triangle and the encoded triangle is less than a certain angle, or the preset condition
- the condition is that the number of vertices in the first space range is greater than the preset number, or the preset condition is that the target vertex is outside the second space range, such as within the second space range, or the target vertex is within the preset condition
- the sorting numbers of the vertices in the first space range are greater than or equal to the preset value.
- This preset condition can be flexibly set according to requirements. Add the two sides of the triangle to be encoded except side ⁇ to the edge set, and remove edge ⁇ from the set. Then take out the other side of the triangle to be encoded (the side other than side ⁇ ) from the side set according to certain criteria, and continue to encode the triangle adjacent to this side. For example, the next side ⁇ can be selected in the order of access.
- the spatial range can be determined using the geometric properties of adjacent triangular patches, spatial angles, or other criteria.
- the spatial range can be the part between two concentric spheres with the midpoint of side ⁇ as the center of the sphere and the minimum radius R min and the maximum radius R max combining ⁇ R min , R max ⁇ .
- the code is ⁇ R min , R max ⁇ group.
- the above angle values can also be encoded.
- the sorting criterion can be the distance from the vertex v to the midpoint of the side ⁇ ; or the radius of the circumscribed circle of the triangle formed by the side ⁇ . Encodes the sequence number of vertex v in the sorting.
- This encoding process is iterated for each patch of the three-dimensional mesh until all triangles in each patch are encoded. If the edge set is empty but there are unencoded triangles, an initial triangle is selected from the remaining unencoded triangles and the encoding process is cycled.
- determining the third code stream based on attribute information includes:
- the encoding end performs entropy coding on the target coordinate difference to obtain the first sub-code stream; the target coordinate difference is obtained based on the reconstructed texture coordinate information;
- the encoding end uses a video encoder to encode the texture map to obtain a second sub-stream;
- the encoding end obtains a third code stream based on the first sub-code stream and the second sub-code stream.
- the attribute information includes reconstructed texture coordinate information and texture maps.
- the reconstructed texture coordinate information includes reconstructed texture coordinates corresponding to each vertex, that is, UV coordinates.
- the UV coordinates are used to represent the texture color value of the corresponding vertex.
- the encoded geometric information is reconstructed, and it is determined whether the UV coordinates corresponding to the reconstructed vertices are consistent with the UV coordinates corresponding to the original vertices. If they are inconsistent, the UV coordinates corresponding to the original vertices can be compared with the UV coordinates corresponding to the reconstructed vertices.
- the coordinate difference between the coordinates is determined as the target coordinate difference. For a specific technical solution on how to determine the coordinate difference, please refer to subsequent embodiments.
- UV coordinate sub-stream is also called the first sub-stream.
- the video encoder can be directly used to encode the texture map Encoding is performed to form a texture map sub-stream, and the texture map sub-stream is also called a second sub-stream.
- the above-mentioned video encoder includes but is not limited to a High Efficiency Video Coding (HEVC) encoder and a Versatile Video Coding (VVC) encoder.
- HEVC High Efficiency Video Coding
- VVC Versatile Video Coding
- the first sub-code stream and the second sub-code stream are mixed to form a third code stream.
- a third code stream is formed to achieve effective compression of attribute information, thereby reducing the amount of data.
- the method before performing entropy coding on the target coordinate difference to obtain the first sub-code stream, the method includes:
- the encoding end selects a second edge from an edge set, where the edge set is a set of at least one edge of the encoded triangle represented by the reconstructed texture coordinate information;
- the encoding end determines a prediction triangle based on the second side and the vertex corresponding to the second side;
- the encoding end determines the vertices of the second side, other than the two vertices connected to the second side, among the vertices corresponding to the prediction triangle, as prediction vertices;
- the encoding end determines the coordinate difference between the predicted vertex and the real vertex as the target coordinate difference; the real vertex is the second side divided by the vertex corresponding to the triangle to be encoded. A vertex other than the two vertices connected by the second edge.
- ⁇ 1 represents the above-mentioned second side
- A1 represents the vertex corresponding to the above-mentioned second side.
- the triangle S1 can be determined based on the second side and the vertices corresponding to the second side, and the parallelogram prediction method is used for the triangle S1 to determine the predicted triangle S2. Further, among the vertices corresponding to the predicted triangle on the second side, the vertices other than the two vertices connected to the second side are determined as predicted vertices, that is, point A2 shown in Figure 10 .
- the real vertex is the vertex of the second side except the two vertices connected to the second side among the vertices of the triangle to be encoded.
- the above triangle to be encoded is S3 shown in Figure 10
- the above-mentioned real vertex is point A3 shown in Figure 10
- calculate the coordinate difference between the predicted vertex and the real vertex and determine the above-mentioned coordinate difference as the target coordinate difference.
- the execution subject may be an encoding device.
- the encoding device performing the encoding method is taken as an example to illustrate the encoding device provided by the embodiment of the present application.
- the encoding device 1100 includes:
- the encoding module 1101 is used to encode the first information corresponding to the target three-dimensional grid and obtain the first code stream; the first information is determined based on the geometric information corresponding to the target three-dimensional grid;
- the processing module 1102 is configured to obtain reconstructed connection information and reconstructed texture coordinate information based on reconstructed geometric information; the reconstructed geometric information is determined based on reconstruction of the geometric information;
- the first determination module 1103 is used to determine the second code stream based on the reconstructed geometric information and the reconstructed connection information;
- the second determination module 1104 is configured to determine the third code stream based on attribute information, where the attribute information includes the texture map and the reconstructed texture coordinate information;
- Generating module 1105 configured to generate a target code stream based on the first code stream, the second code stream, and the third code stream.
- the encoding device 1100 further includes:
- An acquisition module configured to acquire geometric information corresponding to the target three-dimensional grid; the geometric information includes the position coordinates of the vertices contained in the target three-dimensional grid;
- a projection module used by the encoding end to project the vertices contained in the target three-dimensional grid into a geometric diagram and a placeholder diagram to obtain the first information
- the position coordinates of each vertex in the placeholder map correspond to the arrangement order of the vertices in the geometric information.
- processing module 1102 is specifically used to:
- the placeholder map Based on the placeholder map, update the index of the vertex included in the connection information to obtain the reconstructed connection information; the placeholder map is obtained based on decoding the first code stream, and the position coordinates of each vertex in the placeholder map are obtained Corresponding to the arrangement order of the vertices in the reconstructed geometry information, the arrangement order of the vertices in the reconstructed geometry information corresponds to the index of the vertices in the reconstructed connection information;
- the position coordinates of each vertex in the placeholder map correspond to the arrangement order of the vertex in the reconstructed geometry information, so
- the arrangement order of the vertices in the reconstructed geometry information corresponds to the index of the vertices in the reconstructed attribute information.
- the encoding device 1100 further includes:
- Simplification module used to encode the 3D mesh to be encoded in lossy encoding mode. Perform simplification processing to obtain the target three-dimensional grid;
- the third determination module is used to determine the three-dimensional grid to be encoded as the target three-dimensional grid when the coding mode is lossless.
- the simplified module is specifically used for:
- the three-dimensional grid to be encoded is simplified to obtain the target three-dimensional grid.
- the simplified module is also specifically used for:
- the position coordinates of at least some of the vertices in the three-dimensional mesh to be encoded are adjusted to multiples of quantization parameters to obtain the target three-dimensional mesh.
- the encoding module 1101 is specifically used for:
- the first precision geometric information is the geometric information after quantization of the target three-dimensional grid
- the second precision geometric information is the geometric information lost during the quantization process of the target three-dimensional grid
- the information of the supplementary point Information about points generated during the quantification process that require additional processing is the geometric information after quantization of the target three-dimensional grid
- the encoding module 1101 is also specifically used for:
- each vertex in the target three-dimensional grid is quantized to obtain first precision geometric information.
- the encoding module 1101 is also specifically used for:
- the second precision geometric information is obtained.
- the encoding module 1101 is also specifically used for:
- Information on supplementary points is determined based on the geometric information of the target three-dimensional grid and the first precision geometric information.
- the encoding module 1101 is also specifically used for:
- the encoding module 1101 is also specifically used for:
- a first-precision placeholder map and a first-precision geometric map are obtained.
- the encoding module 1101 is also specifically used for:
- the slice information is encoded to obtain a slice information sub-stream.
- the encoding module 1101 is also specifically used for:
- Second-precision geometric information corresponding to the vertices contained in the first-precision geometric information is arranged in a two-dimensional image to generate a second-precision geometric map.
- the encoding module 1101 is also specifically used for:
- the first-precision geometric figure and the second-precision geometric figure are encoded to obtain the geometric figure sub-stream.
- the encoding module 1101 is also specifically used for:
- the first original slice and the second original slice are compressed to obtain a geometric map of the supplementary points.
- the first determination module 1103 is specifically used to:
- the vertices to be sorted within a first spatial range are determined, and the first spatial range is the reconstructed geometric information and the Reconstruct the spatial range where the target vertex of the triangle to be encoded represented by the connection information is located, and the vertices to be sorted include the target vertex;
- the first preset rule includes: adding two sides of the triangle to be encoded except the first side to the side set, and removing the first side from the side set.
- the first determination module 1103 is also specifically used to:
- the edge set is a set of at least one edge of the encoded triangle represented by the reconstructed geometric information and the reconstructed connection information;
- the first determination module 1103 is also specifically used to:
- the vertices to be sorted within the first spatial range are determined according to the spatial angle between the adjacent triangle patches.
- the first determination module 1103 is also specifically used to:
- the encoding information of the triangle to be encoded is obtained according to the encoding information corresponding to the target vertex information of the triangle to be encoded.
- the first determination module 1103 is also specifically used to:
- the first target triangle is a triangle whose angle with an adjacent encoded triangle is less than an angle threshold, and one side of the first target triangle is the same as the first side of the triangle to be encoded.
- the first determination module 1103 is also specifically used to:
- the second determination module 1104 is also specifically used to:
- the target coordinate difference is obtained based on the reconstructed texture coordinate information
- a third code stream is obtained.
- the second determination module 1104 is also specifically used to:
- edge set is a set of at least one edge of the encoded triangle represented by the reconstructed texture coordinate information
- the coordinate difference between the predicted vertex and the real vertex is determined as the target coordinate difference; the real vertex is the second side connected to the second side in addition to the vertex corresponding to the triangle to be encoded. Vertices other than the two vertices of .
- the first information corresponding to the target three-dimensional grid is encoded to obtain the first code stream; the encoding end obtains the reconstructed connection information and the reconstructed texture coordinate information based on the reconstructed geometric information; the encoding end obtains the reconstructed connection information and reconstructed texture coordinate information based on the reconstructed geometric information and the reconstructed texture coordinate information.
- the connection information determines the second code stream; the encoding end determines the third code stream based on the attribute information; the encoding end generates the target code stream based on the first code stream, the second code stream, and the third code stream.
- the reconstructed connection information and the reconstructed texture coordinate information are obtained based on the reconstructed geometric information, and the corresponding relationship between the geometric information corresponding to the reconstructed vertices and the geometric information corresponding to the original vertices is established, so as to perform subsequent processing of the three-dimensional network.
- the step of encoding the connection information and attribute information of the grid avoid encoding failure.
- the encoding device in the embodiment of the present application may be an electronic device, such as an electronic device with an operating system, or may be a component in the electronic device, such as an integrated circuit or chip.
- the electronic device may be a terminal or other devices other than the terminal.
- terminals may include but are not limited to the types of terminals 11 listed above, and other devices may be servers, network attached storage (Network Attached Storage, NAS), etc., which are not specifically limited in the embodiment of this application.
- NAS Network Attached Storage
- the encoding device provided by the embodiment of the present application can implement each process implemented by the method embodiment in Figure 1 and achieve the same technical effect. To avoid duplication, the details will not be described here.
- this embodiment of the present application also provides a communication device 1200, including Processor 1201 and memory 1202.
- the memory 1202 stores programs or instructions that can be run on the processor 1201.
- the communication device 1200 is a terminal
- the above encoding method is implemented when the program or instructions are executed by the processor 1201.
- Each step of the embodiment can achieve the same technical effect.
- An embodiment of the present application also provides a terminal, including a processor and a communication interface.
- the processor 1201 is configured to perform the following operations:
- reconstructed connection information and reconstructed texture coordinate information are obtained; the reconstructed geometric information is determined based on reconstructing the geometric information;
- a target code stream is generated based on the first code stream, the second code stream and the third code stream.
- FIG. 13 is a schematic diagram of the hardware structure of a terminal that implements an embodiment of the present application.
- the terminal 1300 includes but is not limited to: a radio frequency unit 1301, a network module 1302, an audio output unit 1303, an input unit 1304, a sensor 1305, a display unit 1306, a user input unit 1307, an interface unit 1308, a memory 1309, a processor 1310 and other components. .
- the terminal 1300 may also include a power supply (such as a battery) that supplies power to various components.
- the power supply may be logically connected to the processor 1310 through a power management system, thereby managing charging, discharging, and power consumption through the power management system. Management and other functions.
- the terminal structure shown in FIG. 13 does not constitute a limitation on the terminal.
- the terminal may include more or fewer components than shown in the figure, or some components may be combined or arranged differently, which will not be described again here.
- the input unit 1304 may include a graphics processor (Graphics Processing Unit, GPU) 13041 and a microphone 13042.
- the graphics processor 13041 is responsible for the image capture device (GPU) in the video capture mode or the image capture mode. Process the image data of still pictures or videos obtained by cameras (such as cameras).
- the display unit 1306 may include a display panel 13061, The display panel 13061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
- the user input unit 1307 includes a touch panel 13071 and at least one of other input devices 13072 . Touch panel 13071, also called touch screen.
- the touch panel 13071 may include two parts: a touch detection device and a touch controller.
- Other input devices 13072 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
- the radio frequency unit 1301 after receiving downlink data from the network side device, the radio frequency unit 1301 can transmit it to the processor 1310 for processing; the radio frequency unit 1301 can send uplink data to the network side device.
- the radio frequency unit 1301 includes, but is not limited to, an antenna, amplifier, transceiver, coupler, low noise amplifier, duplexer, etc.
- Memory 1309 may be used to store software programs or instructions as well as various data.
- the memory 1309 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc.
- memory 1309 may include volatile memory or nonvolatile memory, or memory 1309 may include both volatile and nonvolatile memory.
- non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory.
- Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM).
- RAM Random Access Memory
- SRAM static random access memory
- DRAM dynamic random access memory
- synchronous dynamic random access memory Synchronous DRAM, SDRAM
- Double data rate synchronous dynamic random access memory Double Data Rate SDRAM, DDRSDRAM
- Enhanced SDRAM, ESDRAM synchronous link dynamic random access memory
- Synch link DRAM synchronous link dynamic random access memory
- SLDRAM direct memory bus random access memory
- the processor 1310 may include one or more processing units; optionally, the processor 1310 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc.,
- the modem processor mainly processes wireless communication signals, such as base With processor. It can be understood that the above modem processor may not be integrated into the processor 1310.
- the processor 1310 is used to perform the following operations:
- reconstructed connection information and reconstructed texture coordinate information are obtained; the reconstructed geometric information is determined based on reconstructing the geometric information;
- a target code stream is generated based on the first code stream, the second code stream and the third code stream.
- Embodiments of the present application also provide a readable storage medium, with programs or instructions stored on the readable storage medium.
- the program or instructions are executed by a processor, each process of the above encoding method embodiment is implemented, and the same process can be achieved. To avoid repetition, the technical effects will not be repeated here.
- the processor is the processor in the terminal described in the above embodiment.
- the readable storage medium includes computer readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disk or optical disk, etc.
- An embodiment of the present application further provides a chip.
- the chip includes a processor and a communication interface.
- the communication interface is coupled to the processor.
- the processor is used to run programs or instructions to implement each of the above encoding method embodiments. The process can achieve the same technical effect. To avoid repetition, it will not be described again here.
- chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-chip or system-on-chip, etc.
- Embodiments of the present application further provide a computer program/program product.
- the computer program/program product is stored in a storage medium.
- the computer program/program product is executed by at least one processor to implement the above encoding method embodiment.
- Each process can achieve the same technical effect. To avoid duplication, it will not be described again here.
- the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation.
- the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology.
- the computer software product is stored in a storage medium (such as ROM/RAM, disk , CD), including several instructions to cause a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of this application.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Computer Graphics (AREA)
- Signal Processing (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Processing Or Creating Images (AREA)
Abstract
本申请公开了一种编码方法及终端,属于编码技术领域,本申请实施例的编码方法包括:编码端对目标三维网格对应的第一信息进行编码,获取第一码流;第一信息基于目标三维网格对应的几何信息确定;编码端基于重建几何信息,得到重建连接信息和重建纹理坐标信息;重建几何信息基于对几何信息进行重建确定;编码端基于重建几何信息和重建连接信息,确定第二码流;编码端基于属性信息,确定第三码流,属性信息包括纹理图和重建纹理坐标信息;编码端基于第一码流、第二码流和第三码流,生成目标码流。
Description
相关申请的交叉引用
本申请主张在2022年3月25日在中国提交的中国专利申请No.202210307891.X的优先权,其全部内容通过引用包含于此。
本申请属于编码技术领域,具体涉及一种编码方法及终端。
三维网格(Mesh)可以被认为是过去多年来最流行的三维模型的表示方法,其在许多应用程序中扮演着重要的角色。它的表示简便,因此被大量以硬件算法集成到电脑、平板电脑和智能手机的图形处理单元中,专门用于渲染三维网格。
在所有使用三维网格的应用领域中,如计算模拟、娱乐、医学成像、数字化文物、计算机设计、电子商务等,对网格精度的要求一直在提高,所需要的数据量也快速增长,且当前大量的三维模型都需要通过互联网来访问。以上问题导致了三维网格的处理、可视化、传输和存储都越来越复杂。而三维网格压缩是解决上述问题的一个重要途径。它极大地减少了数据量的大小,有利于三维网格的处理、存储和传输。
在使用有损编码对三维网格进行压缩的过程中,需要对三维网格中原顶点对应的几何信息进行重建,得到重建网格。然而,在有损编码的情况下,可能会损失部分网格信息,导致在后续的对三维网格的连接信息和属性信息进行编码的步骤中,不能正确重建连接关系和纹理坐标,进而导致编码失败。
发明内容
本申请实施例提供一种编码方法及终端,能够解决在对三维网格的连接信息进行编码时,容易导致编码失败的问题。
第一方面,提供了一种编码方法,该方法包括:
编码端对目标三维网格对应的第一信息进行编码,获取第一码流;所述第一信息基于所述目标三维网格对应的几何信息确定;
所述编码端基于重建几何信息,得到重建连接信息和重建纹理坐标信息;所述重建几何信息基于对所述几何信息进行重建确定;
所述编码端基于所述重建几何信息和所述重建连接信息,确定第二码流;
所述编码端基于属性信息,确定第三码流,所述属性信息包括纹理图和所述重建纹理坐标信息;
所述编码端基于所述第一码流、所述第二码流和所述第三码流,生成目标码流。
第二方面,提供了一种编码装置,包括:
编码模块,用于对目标三维网格对应的第一信息进行编码,获取第一码流;所述第一信息基于所述目标三维网格对应的几何信息确定;
处理模块,用于基于重建几何信息,得到重建连接信息和重建纹理坐标信息;所述重建几何信息基于对所述几何信息进行重建确定;
第一确定模块,用于基于所述重建几何信息和所述重建连接信息,确定第二码流;
第二确定模块,用于基于属性信息,确定第三码流,所述属性信息包括纹理图和所述重建纹理坐标信息;
生成模块,用于基于所述第一码流、所述第二码流和所述第三码流,生成目标码流。
第三方面,提供了一种终端,该终端包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。
第四方面,提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。
第五方面,提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。
第六方面,提供了一种计算机程序/程序产品,所述计算机程序/程序产品
被存储在存储介质中,所述计算机程序/程序产品被至少一个处理器执行以实现如第一方面所述的方法的步骤。
本申请实施例中,对目标三维网格对应的第一信息进行编码,获取第一码流;编码端基于重建几何信息,得到重建连接信息和重建纹理坐标信息;编码端基于重建几何信息和重建连接信息,确定第二码流;编码端基于属性信息,确定第三码流;编码端基于第一码流、第二码流和第三码流,生成目标码流。本申请实施例中,通过基于重建几何信息,得到重建连接信息和重建纹理坐标信息,建立重建顶点对应的几何信息与原顶点对应的几何信息之间的对应关系,以此在后续的对三维网格的连接信息和属性信息进行编码的步骤中,避免编码失败。
图1是本申请实施例提供的编码方法的流程图;
图2是本申请实施例提供的调整连接关系的示意图;
图3是网格简化中合并顶点过程的示意图;
图4是基于网格的精细划分过程示意图;
图5是Patch排列的八种方向示意图;
图6是高精度几何信息的编码过程示意图;
图7是raw patch示意图;
图8是本申请实施例中编码连接性关系的示意图之一;
图9是本申请实施例中编码连接性关系的示意图之二;
图10是本申请实施例中属性信息编码的示意图;
图11是本申请实施例提供的编码装置的结构图;
图12是本申请实施例提供的通信设备的结构图;
图13是本申请实施例提供的终端的硬件结构示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实
施例。基于本申请中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”所区别的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”一般表示前后关联对象是一种“或”的关系。
本申请实施例中的编码方法对应的编码装置可以为终端,该终端也可以称作终端设备或者用户终端(User Equipment,UE),终端可以是手机、平板电脑(Tablet Personal Computer,TPC)、膝上型电脑(Laptop Computer,LC)或称为笔记本电脑、个人数字助理(Personal Digital Assistant,PDA)、掌上电脑、上网本、超级移动个人计算机(Ultra-mobile Personal Computer,UMPC)、移动上网装置(Mobile Internet Device,MID)、增强现实(Augmented Reality,AR)/虚拟现实(Virtual Reality,VR)设备、机器人、可穿戴式设备(Wearable Device)或车载设备(Vehicle User Equipment,VUE)、行人终端(Pedestrian User Equipment,PUE)、智能家居(具有无线通信功能的家居设备,如冰箱、电视、洗衣机或者家具等)、游戏机、个人计算机(Personal Computer,PC)、柜员机或者自助机等终端侧设备,可穿戴式设备包括:智能手表、智能手环、智能耳机、智能眼镜、智能首饰(智能手镯、智能手链、智能戒指、智能项链、智能脚镯、智能脚链等)、智能腕带、智能服装等。需要说明的是,在本申请实施例并不限定终端的具体类型。
下面结合附图,通过一些实施例及其应用场景对本申请实施例提供的编码方法进行详细地说明。
请参阅图1,图1是本申请提供的编码方法的流程图。本实施例提供的编码方法包括以下步骤:
S101,编码端对目标三维网格对应的第一信息进行编码,获取第一码流。
上述目标三维网格可以是任意视频帧对应的三维网格。
本步骤中,可以基于目标三维网格对应的几何信息,确定目标三维网格对应的第一信息,进而对上述第一信息进行编码获取第一码流。有关于第一信息的具体定义,以及如何获取第一信息的具体技术方案,请参阅后续实施例。
S102,所述编码端基于重建几何信息,得到重建连接信息和重建纹理坐标信息。
本步骤中,编码端可以对几何信息进行重建,得到重建几何信息,需要说明的是,此处的几何重建指的是通过编码信息获取重建顶点的三维坐标。进一步的,基于该重建几何信息,得到重建连接信息和重建纹理坐标信息,上述重建连接信息表征重建顶点之间的连接关系,上述重建纹理坐标信息表征所有重建顶点对应的纹理坐标。
具体的如何基于重建几何信息,得到重建连接信息和重建纹理坐标信息的技术方案,请参阅后续实施例。
S103,所述编码端基于所述重建几何信息和所述重建连接信息,确定第二码流。
本步骤中,在得到重建几何信息和重建连接信息后,根据重建几何信息和重建连接信息,对上述重建连接信息进行编码,得到第二码流。
S104,所述编码端基于属性信息,确定第三码流。
本步骤中,上述属性信息包括纹理图和重建纹理坐标信息。编码端对纹理图和重建纹理坐标信息分别进行编码,得到不同的子码流,将上述子码流进行混流,得到第三码流。
S105,所述编码端基于所述第一码流、所述第二码流和所述第三码流,生成目标码流。
本步骤中,在得到第一码流、第二码流和第三码流之后,对上述第一码流、第二码流和第三码流进行混流,生成目标码流。
本申请实施例中,对目标三维网格对应的第一信息进行编码,获取第一码流;编码端基于重建几何信息,得到重建连接信息和重建纹理坐标信息;编码端基于重建几何信息和重建连接信息,确定第二码流;编码端基于属性信息,确定第三码流;编码端基于第一码流、第二码流和第三码流,生成目
标码流。本申请实施例中,通过基于重建几何信息,得到重建连接信息和重建纹理坐标信息,建立重建顶点对应的几何信息与原顶点对应的几何信息之间的对应关系,以此在后续的对三维网格的连接信息和属性信息进行编码的步骤中,避免编码失败。
可选地,所述对目标三维网格对应的第一信息进行编码,获取第一码流之前,所述方法包括:
所述编码端获取所述目标三维网格对应的几何信息;
所述编码端将所述目标三维网格所包含的顶点投影在几何图和占位图中,得到所述第一信息。
本实施例中,编码端获取目标三维网格对应的几何信息,应理解,上述几何信息包括该目标三维网格所包含的顶点的位置坐标,上述目标三维网格所包含的顶点又称为原顶点。
将上述顶点按照该顶点在几何信息中的排列顺序,投影在几何图和占位图中,得到第一信息。其中,占位图中每个顶点的位置坐标与该顶点在几何信息中的排列顺序对应。
可选地,所述基于重建几何信息,得到重建连接信息和重建纹理坐标信息包括:
基于占位图,更新连接信息所包括的顶点的索引,得到所述重建连接信息;所述占位图基于对所述第一码流解码得到,所述占位图中每个顶点的位置坐标与所述顶点在所述重建几何信息中的排列顺序对应,所述顶点在所述重建几何信息中的排列顺序与所述顶点在所述重建连接信息中的索引对应;
基于所述占位图,更新所述重建纹理坐标信息所包含的顶点的索引;所述占位图中每个顶点的位置坐标与所述顶点在所述重建几何信息中的排列顺序对应,所述顶点在所述重建几何信息中的排列顺序与所述顶点在所述重建属性信息中的索引对应。
本实施例中,在生成第一码流后,对几何信息进行重建,得到重建几何信息;对第一码流进行解码,得到占位图,如上所述,占位图中每个顶点的位置坐标与顶点在几何信息中的排列顺序对应。
进一步的,在对几何信息进行重建后,产生顶点的重建顺序,该顶点的
重建顺序与占位图中每个顶点的位置坐标对应,又占位图中每个顶点的位置坐标与顶点在几何信息中的排列顺序对应,因此可以建立每个顶点在几何信息中的排列顺序与该顶点的重建顺序之间的对应关系,即通过占位图中的顶点位置可以建立原顶点与重建顶点之间的对应关系。根据上述对应关系更新连接信息所包括的顶点的索引,该索引用于表征该顶点的重建顺序,以此得到重建连接信息。根据上述对应关系更新重建纹理坐标信息所包括的顶点的索引,建立重建顶点与原顶点纹理坐标,即UV坐标的对应关系,根据重建顶点与原顶点纹理坐标的对应关系,重新排列重建纹理坐标的顺序,从而建立重建顶点与重建纹理坐标之间的对应关系。
为便于理解,请参阅图2,如图2所示,将原顶点按照在几何信息中的排列顺序(原顶点顺序)投影和排列在占位图中,此时占位图中顶点位置与原顶点顺序之间存在对应关系。在对第一信息进行编码的过程中,对上述占位图进行无损编码,无损编码后的占位图中顶点的点数和位置不变。进而根据占位图和几何图重建几何信息,产生顶点的重建顺序。此时重建顺序与占位图中顶点位置存在对应关系。因此,通过占位图中的顶点位置可以建立原顶点与重建顶点之间的对应关系。
可选地,所述对目标三维网格对应的第一信息进行编码之前,包括:
在处于有损编码模式的情况下,对待编码的三维网格进行简化处理,得到目标三维网格;
在处于无损编码模式的情况下,将待编码的三维网格,确定为目标三维网格。
本步骤中,若对视频的编码模式为有损编码模式,则待编码的三维网格进行简化处理,将简化处理后的三维网格确定为目标三维网格,通过对三维网格进行简化处理,提高三维网格几何信息的压缩效率,有效减少数据量。
若对视频的编码模式为无损编码模式,则可以直接将待编码的三维网格,确定为目标三维网格。
可选地,所述对待编码的三维网格进行简化处理,得到目标三维网格包括:
所述编码端基于量化参数,对所述待编码的三维网格进行简化处理,获
取目标三维网格。
需要说明的是,本申请中所说的量化参数主要包括X向、Y向和Z向三个分量上的量化参数。
可选地,所述基于量化参数,对所述目标三维网格进行简化处理,获取目标三维网格,包括:
所述编码端在进行所述待编码的三维网格中的顶点合并时,将所述待编码的三维网格中的顶点合并后的至少部分顶点的位置坐标调整为量化参数的倍数,获取目标三维网格。
需要说明的是,通过在设置合并后的顶点的位置坐标时,考虑量化参数,将其设置为量化参数的倍数,该倍数可以为符合需求的任意值,以此能够确保在反量化时不需要额外的信息便可恢复顶点的原始位置,将减少高精度的几何信息所消耗的数据量。
下面对简化处理的具体实现方式说明如下。
对于输入的原始网格,即待编码的三维网格,首先进行网格简化的操作。网格简化的重点在于简化的操作以及对应的误差度量。这里的网格简化操作可以为基于边的简化。如图3所示,可以通过合并一条边的两个顶点来达到减少面片数和顶点数的目的。此外,还可通过基于点等网格简化方式对网格进行简化。
在网格简化的过程中需要定义简化的误差度量。例如,可以选取顶点所有相邻面的方程系数之和作为该顶点的误差度量,相应的边的误差度量即为边上两顶点的误差度量之和。在确定好简化操作的方式以及误差度量后就可以开始对网格进行简化。例如,可以将网格分为一片或多片局部网格,先计算片中初始网格的顶点误差来得到每条边的误差。然后将片内的所有边按误差按照某规则,如按照从小到大的规则进行排列。每次简化可以按照某种规则对边进行合并,如选取误差最小的边进行合并,同时计算合并后的顶点位置并更新所有与合并后顶点相关的边的误差,更新边排列的顺序。通过迭代将网格的面简化到某一预期数量。
具体过程包括:
1、顶点误差的计算
顶点误差可以定义为顶点所有相邻面的方程的系数之和。例如,每个相邻面都定义了一个平面,可以用公式一表示:
公式一:D2=(nTv+d)2=vT(nnT)v+2dnTv+d2;
其中,D为任意顶点到平面的距离,n为平面的单位法向量,v为顶点的位置向量,d为常数。用二次曲面的形式表示为公式二:Q=(A,b,c)=(nnT,dn,d2);
其中,Q为顶点误差,A,b,c为表示公式一中相应符号的系数。
从公式二进而得到公式三:Q(v)=vTAv+2bTv+c;
由顶点误差为该顶点所有相邻面的方程系数之和,则可令公式四:Q1(v)+Q2(v)=(Q1+Q2)(v)=(A1+A2,b1+b2,c1+c2)(v)。其中,Q(v)为顶点误差,v为对应的顶点,Q1(v)为v相邻平面1的方程,Q2(v)为v相邻平面2的方程,A1,A2,b1,b2,c1,c2为各自相对应的系数。当然,若存在多个相邻面则可向公式四中继续添加相应的平面误差方程。
2、合并顶点
合并顶点过程的一个主要步骤为确定合并后顶点的位置。根据误差公式三,可以选择能让误差尽可能小的顶点位置。例对通过对公式三求偏导数,可以得到,公式四:
公式五:
由上式可知,只有在矩阵A可逆的情况下,才能求得使误差最小的点。因此,此处对于合并后的顶点位置可以有多种取法。如果考虑网格简化的质量,在矩阵A可逆的情况下,选取使误差最小的顶点位置;在矩阵A不可逆的情况下,可以选择边上包括两端点的其中一个使误差最小的点。如果考虑网格简化的复杂度,可以直接选取边的中点或者两端点的其中一个作为合并后的顶点的位置。如果考虑网格简化后量化的效率,还需要调整合并后的顶点位置。由于量化后对于高精度信息需要单独编码,因此,将一部分合并后的顶点位置调整为相应量化参数的倍数,确保在反量化时不需要额外的信息便可恢复原始位置,将减少高精度的几何信息所消耗的数据量。
确定了如何选取合并后的顶点位置后,便可以开始合并顶点的过程。例如,可以先计算初始网格中所有的边的误差,将其按误差按照某规格,如从
小到大的顺序进行排列。每次迭代,选取误差满足某规则的边,如误差最小的边。从网格顶点中移除边的两个端点并添加合并后的顶点到网格顶点的集合中。将合并前的两个顶点的所有或部分相邻顶点作为合并后的顶点的相邻顶点,然后更新与该合并顶点相连接的所有点的误差度量,从而得到新产生的边的误差。然后从片的全局来更新边的排列顺序。循环上述过程,直到达到满足有损编码所需要的面数。
3、更新连接关系
在合并顶点之后,由于顶点集中删除了一部分顶点,同时又添加了许多新的顶点,因此需要更新顶点之间的连接关系。例如,在合并顶点过程中可以确定合并后的顶点对应的合并之前的两个顶点。只需要用合并后的顶点的索引替换所有在面中出现的合并之前的两个顶点的索引,然后删除具有重复索引的面,就可以达到更新连接关系的目的。
以上即为网格简化的主要过程。同时,三维网格还可能会携带有属性信息,对属性信息也可能需简化。对于带有属性信息的网格,如纹理坐标,颜色,法向量等,可以将顶点坐标扩展到更高的维度从而计算带有属性信息的顶点误差。以纹理坐标为例,设顶点坐标为(x,y,z),纹理坐标为(u,v),则扩展后的顶点为(x,y,z,u,v)。设扩展后的三角形T=(p,q,r),为了确定高维空间上的误差度量,首先计算两个标准正交向量,即:
公式六:
公式七:
其中,e1,e2为T所在平面上的两个向量,q为,e2为,此处"·"代表向量的点乘,它定义了该高维平面上的一个坐标轴,以p为原点。考虑一个任意点v,另u=p-v,由公式八:‖u‖2=(u·e1)2+…+(μ·en)2;
即公式九:(u·e3)2+…+(u·en)2=‖μ‖2-(μ·e1)2-(u·e2)2。
由于e1,e2为T所在平面上的两个向量,则公式九左边项即为顶点到T所在平面的距离的平方,即公式十:D2=‖μ‖2-(μ·e1)2-(u·e2)2;
对其进行展开并合并后可得到与公式三类似的方程,其中:
公式十一:
公式十二:b=(p·e1)e1+(p·e2)e2-p;
公式十三:c=p·p-(p·e1)2-(p·e2)2。
得到上述误差度量后,则可以进行与之前三维信息一样的后续步骤,从而实现了对于带有属性信息的网格的简化。
通常来说,图像的边缘部分更能吸引人们的注意力,从而影响人们对于该图像的质量评价。三维网格也是如此,人们往往更容易注意到边界部分。因此,是否保持边界也是网格简化中影响质量的一个因素。网格的边界一般为几何形状的边界以及纹理的边界。当一条边只属于一个面时,该边即为一个几何边界。当同一个顶点具有两个或多个纹理坐标时,该顶点即为纹理坐标的边界。在网格简化时,以上边界均不应被合并。因此,在每次简化时可以先判断该边上的顶点是否为边界点,若为边界点则跳过,直接进行下一次迭代。
可选地,所述对目标三维网格对应的第一信息进行编码,获取第一码流包括:
所述编码端对所述目标三维网格的几何信息进行量化,获取第一信息;
所述编码端对所述第一信息进行编码,获取第一码流。
上述几何信息可以理解为是目标三维网格中顶点的坐标,该坐标通常指的是三维坐标。
其中,上述第一信息包括以下至少一项:
A11、第一精度几何信息;
需要说明的是,该第一精度几何信息可以理解为低精度几何信息,即低精度几何信息指的是目标三维网格量化后的几何信息,即量化后的目标三维网格包括的各顶点三维坐标信息。
A12、第二精度几何信息;
需要说明的是,该第二精度几何信息可以理解为高精度几何信息,高精度几何信息可以看作是量化过程中丢失的几何信息,即丢失的三维坐标信息。
A13、补充点的信息;
需要说明的是,补充点的信息是指量化过程中产生的需要额外处理的点的信息,也就是说,所述补充点为量化过程中产生的需要额外处理的点,例如,坐标位置出现重叠的重复点等,通过对重复点进行处理,可以使得在反
量化后恢复到原来的位置。
可选地,该补充点的信息,包括以下至少一项:
A131、补充点对应的第一精度几何信息中顶点的索引;
需要说明的是,通过标识索引,便可知道量化后的网格中,哪些点标识的是量化前的三维网格中的多个点,即量化前的三维网格中的多个点在量化后重合到了一起,通过顶点的索引便可确定补充点的低精度几何信息。
A132、补充点的第三精度几何信息;
需要说明的是,该第三精度几何信息可以理解为补充点的低精度几何信息,即补充点被量化后的三维坐标信息。
A133、补充点的第四精度几何信息;
需要说明的是,该第四精度几何信息可以理解为补充点的高精度几何信息,即补充点在被量化过程中丢失的三维坐标信息。
这里需要说明的是,在具体使用时,通过A131和A133或者通过A132和A133便可确定得到量化后隐藏的点有哪些。
需要说明的是,在得到第一信息后,便可以对这些第一信息进行编码,将编码得到的码流确定为第一码流。
可选地,所述对所述目标三维网格的几何信息进行量化,获取第一信息,包括:
所述编码端根据每一分量的量化参数,对所述目标三维网格中的每一顶点进行量化,获取第一精度几何信息。
需要说明的是,每一分量的量化参数可以根据使用需求灵活设置;量化参数主要包括X向、Y向和Z向三个分量上的量化参数。
通常情况下,对于精度要求不高的量化,在量化后可以只保留低精度几何信息;而对于精度要求较高的量化,在量化时不仅要记录低精度几何信息,也需要记录高精度几何信息,以此在解码时能够实现精准的网格恢复。
在上述情况下,可选地,所述对所述目标三维网格的几何信息进行量化,获取第一信息,包括:
所述编码端根据所述第一精度几何信息以及每一分量的量化参数,获取第二精度几何信息。
例如,假设某顶点的三维坐标为(x,y,z),量化参数为(QPx,QPy,QPz),低精度几何信息(xl,yl,zl)和高精度几何信息(xh,yh,zh)的计算过程如公式十四至公式十九所示:
公式十四:xl=f1(x,QPx);
公式十五:yl=f1(y,QPy);
公式十六:zl=f1(z,QPz);
公式十七:xh=f2(x,xl,QPx);
公式十八:yh=f2(y,yl,QPy);
公式十九:zh=f2(z,zl,QPz);
其中,公式十四至公式十六中的f1函数是量化函数,量化函数的输入为某一维度的坐标和该维度的量化参数,输出为量化后的坐标值;公式十七至公式十九中的f2函数输入为原始坐标值、量化后的坐标值以及该维度的量化参数,输出为高精度的坐标值。
f1函数可以有多种计算方式,比较通用的一种计算方式如公式二十至公式二十二所示,使用每个维度的原始坐标除以该维度的量化参数来计算。其中,/为除法运算符,对除法运算的结果可以采用不同的方式进行舍入,如四舍五入、向下取整、向上取整等。f2函数也存在多种计算方式,与公式二十至公式二十二相对应的实现方式如公式二十三至公式二十五所示,其中,*为乘法运算符。
公式二十:xl=x/QPx;
公式二十一:yl=y/QPy;
公式二十二:zl=z/QPz;
公式二十三:xh=x-xl*QPx;
公式二十四:yh=y-yl*QPy;
公式二十五:zh=z-zl*QPz;
当量化参数为2的整数次幂时,f1函数和f2函数可以使用位运算实现,如公式二十六至公式三十一:
公式二十六:xl=x>>log2QPx;
公式二十七:yl=y>>log2QPy;
公式二十八:zl=z>>log2QPz;
公式二十九:xh=x&(QPx-1);
公式三十:yh=y&(QPy-1);
公式三十一:zh=z&(QPz-1);
值得注意的是,无论f1函数和f2函数采用哪种计算方式,量化参数QPx、QPy和QPz都可以灵活设置。首先,不同分量的量化参数并不一定相等,可以利用不同分量的量化参数的相关性,建立QPx、QPy和QPz之间的关系,为不同分量设置不同的量化参数;其次,不同空间区域的量化参数也不一定相等,可以根据局部区域顶点分布的稀疏程度自适应的设置量化参数。
需要说明的是,高精度几何信息包含的是三维网格的轮廓的细节信息。为了进一步提高压缩效率,可以对高精度几何信息(xh,yh,zh)进一步处理。在三维网格模型中,不同区域的顶点高精度几何信息的重要程度是不同的。对于顶点分布稀疏的区域,高精度几何信息的失真并不会对三维网格的视觉效果产生较大影响。这时为了提高压缩效率,可以选择对高精度几何信息进一步量化,或者只保留部分点的高精度几何信息。
在进行量化的过程中,可能会存在多个点量化完重合到同一个位置。
在上述情况下,可选地,所述对所述目标三维网格的几何信息进行量化,获取第一信息,包括:
所述编码端根据所述目标三维网格的几何信息和所述第一精度几何信息,确定补充点的信息。
也就是说,在得到所有顶点的低精度几何信息后,将低精度几何信息重复的点作为补充点,单独进行编码。补充点的几何信息同样可以分为低精度几何信息和高精度几何信息两部分,根据应用对压缩失真的要求,可以选择保留所有补充点或者只保留其中一部分补充点。对补充点的高精度几何信息,也可以进行进一步量化,或者只保留部分点的高精度几何信息。
需要说明的是,在对目标三维网格的几何信息进行量化得到第一信息之后,需要对第一信息进行编码得到最终的码流。
可选地,所述对所述第一信息进行编码,获取第一码流包括:
所述编码端对所述第一信息进行处理,获取第二信息,所述第二信息包
括占位图和几何图中的至少一项;
对所述第二信息进行编码,获取第一码流。
需要说明的是,因第一信息中包含的信息的种类不同,在对第一信息进行处理时,会分别对不同类的信息进行单独处理,下面分别从不同信息的角度,对获取第一码流的实现过程说明如下。
一、所述第一信息包括第一精度几何信息
可选地,在所述第一信息包括第一精度几何信息的情况下,所述对所述第一信息进行处理,获取第二信息,包括:
所述编码端对所述第一精度几何信息进行三维片划分;
所述编码端将划分的三维片进行二维投影,获取二维片;
所述编码端将所述二维片进行打包,获取二维图像信息;
所述编码端根据所述二维图像信息,获取第一精度的占位图和第一精度的几何图。
需要说明的是,此种情况下,主要是将低精度几何信息进行片(Patch)划分,得到多个三维片;此步骤的具体实现方式为:编码端确定第一精度几何信息中包含的每个顶点的投影平面;编码端根据所述投影平面对所述第一精度几何信息中所包含的顶点进行片划分;编码端对所述第一精度几何信息中所包含的顶点进行聚类,得到划分后的每一片。也就是说,对于Patch划分的过程主要包括:首先估计每个顶点的法向量,选择平面法向量与顶点法向量之间的夹角最小的候选投影平面作为该顶点的投影平面;然后,根据投影平面对顶点进行初始划分,将投影平面相同且连通的顶点组成patch;最后,使用精细划分算法优化聚类结果,得到最终的三维片(3D patch)。
下面对由第一精度几何信息得到三维片的过程的具体实现进行详细说明如下。
首先估计每个点的法向量。切线平面和它对应的法线是根据每个点的最近的邻居顶点m在一个预定义的搜索距离定义的。K-D树用于分离数据,并在点pi附近找到相邻点,该集合的重心用于定义法线。重心c的计算方法如下:
公式三十二:
使用特征分解法估计顶点法向量,计算过程公式三十三所示:
公式三十三:
在初始划分阶段,初步选择每个顶点的投影平面。设顶点法向量的估计值为候选投影平面的法向量为选择法向量方向与顶点法向量方向最接近的平面作为该顶点的投影平面,平面选择的计算过程如公式三十四所示:
公式三十四:
精细划分过程可以采用基于网格的算法来降低算法的时间复杂度,基于网格的精细划分算法流程如图4所示,具体包括:
先设置循环次数(numlter)为0,判断循环次数是否小于最大循环次数(需要说明的是,该最大循环次数可以根据使用需求设置),若小于则执行下述过程:
步骤401,将(x,y,z)几何坐标空间划分为体素。
需要说明的是,此处的几何坐标空间指的是由量化得到的第一精度几何信息所构成的几何坐标空间。例如,对于使用体素大小为8的10位Mesh,每个坐标上的体素数量将是1024/8=128,此坐标空间中的体素总数将是128×128×128。
步骤402,查找填充体素,填充体素是指网格中包含至少有一个点的体素。
步骤403,计算每个填充体素在每个投影平面上的平滑分数,记为voxScoreSmooth,体素在某投影平面的体素平滑分数是通过初始分割过程聚集到该投影平面的点的数量。
步骤404,使用KD-Tree分区查找近邻填充体素,记为nnFilledVoxels,即每个填充体素(在搜索半径内和/或限制到最大数量的相邻体素)的最近的填充体素。
步骤405,使用近邻填充体素在每个投影平面的体素平滑分数,计算每个填充体素的平滑分数(scoreSmooth),计算过程如公式三十五所示:
公式三十五:
其中,p是投影平面的索引,v是近邻填充体素的索引。一个体素中所有
点的scoreSmooth是相同的。
步骤406,使用顶点的法向量与候选投影平面的法向量计算法向分数,记为scoreNormal,计算过程如公式三十六所示:
公式三十六:scoreNormal[i][p]=normal[i]·orientation[p];
其中,p是投影平面的索引,i是顶点的索引。
步骤407,使用scoreSmooth和scoreNormal计算每个体素在各个投影平面上的最终分数,计算过程如公式三十七所示:
公式三十七:
其中,i为顶点索引,p为投影平面的索引,v是顶点i所在的体素索引。
步骤408,使用步骤407中的分数对顶点进行聚类,得到精细划分的patch。
多次迭代上述过程,直到得到较为准确的patch。
进一步的,编码端将划分的三维片进行二维投影,获取二维片。
需要说的是,此过程是将3D patch投影到二维平面得到二维片(2D patch)。
编码端将所述二维片进行打包,获取二维图像信息。
需要说明的是,此步骤实现的是片打包(Patch packing),Patch packing的目的是将2D patch排列在一张二维图像上,Patch packing的基本原则是将patch不重叠的排列在二维图像上或者将patch的无像素部分进行部分重叠的排列在二维图像上,通过优先级排列、时域一致排列等算法,使patch排列的更加紧密,且具有时域一致性,提高编码性能。
假设,二维图像的分辨率为WxH,定义patch排列的最小块大小为T,它指定了放置在这个2D网格上的不同补丁之间的最小距离。
首先,patch按照不重叠的原则插入放置在2D网格上。每个patch占用由整数个TxT块组成的区域。此外,相邻patch之间要求至少有一个TxT块的距离。当没有足够的空间放置下一个patch时,图像的高度将变成原来的2倍,然后继续放置patch。
为了使patch排列的更加紧密,patch可以选择多种不同的排列方向。例如,可以采用八种不同的排列方向,如图5所示,包括0度、180度、90度、270度以及前四种方向的镜像。
为了获得更好的适应视频编码器帧间预测的特性,采用一种具有时域一致性的Patch排列方法。在一个框架组(Group of frame,GOF)中,第一帧的所有patch按照从大到小的顺序依次排列。对于GOF中的其他帧,使用时域一致性算法调整patch的排列顺序。
这里还需要说明的是,在得到二维图像信息后便能根据获取二维图像信息过程中的信息得到patch信息,之后便可以进行片信息的编码,获取片信息子码流;
这里需要说明的是,在进行二维图像信息过程中需要记录patch划分的信息、patch投影平面的信息以及patch packing位置的信息,所以patch信息记录的是获取二维图像过程中各步骤操作的信息,即patch信息包括:patch划分的信息、patch投影平面的信息以及patch packing位置的信息。
需要说明的是,对于获取占位图的过程,主要为:利用patch packing得到的patch排列信息,将二维图像中存在顶点的位置设为1,其余位置设为0,得到占位图。对于获取几何图的过程,主要为:在通过投影得到2D patch的过程中,保存了每个顶点到投影平面的距离,这个距离称为深度,低精度几何图压缩部分就是将2D patch中每个顶点的深度值,排列到该顶点在占位图中的位置上,得到低精度几何图。
二、第一信息包括第二精度几何信息
可选地,在所述第一信息包括第二精度几何信息的情况下,所述对所述第一信息进行处理,获取第二信息,包括:
所述编码端获取第一精度几何信息中所包含的顶点的排列顺序;
所述编码端将第一精度几何信息中所包含的顶点对应的第二精度几何信息排列在二维图像中,生成第二精度的几何图。
需要说明的是,高精度几何信息采用原始片(raw patch)的排列方式,将低精度几何图中的顶点对应的高精度几何信息排列在二维图像中,得到raw patch,以此便生成高精度几何图。主要分为三步,如图6所示,包括:
步骤601,获取顶点排列顺序,逐行从左向右扫描低精度几何图,将每个顶点的扫描顺序作为raw patch中顶点的排列顺序。
步骤602,生成原始片(raw patch)。
需要说明的是,raw patch是将顶点的三维坐标按照如图4所示的方式逐行排列,形成的矩形patch。按照第一步中得到的顶点排列顺序,将顶点的高精度几何信息依次排列,得到高精度几何信息raw patch。
步骤603,将高精度几何信息放置在一张二维图像中,生成高精度几何图。
需要说明的是,在编码得到几何图子码流时,编码端是将对第一精度的几何图和第二精度的几何图进行编码,获取几何图子码流。
三、第一信息包括补充点的信息
可选地,在所述第一信息包括补充点的信息的情况下,所述对所述第一信息进行处理,获取第二信息,包括:
所述编码端将所述补充点的第三精度几何信息排列成第一原始片;
所述编码端按照与所述第一原始片相同的排列顺序,将所述补充点的第四精度几何信息排列成第二原始片;
所述编码端对所述第一原始片和所述第二原始片进行压缩,获取补充点的几何图。
需要说明的是,本申请实施例中对于补充点的几何信息分为的低精度部分和高精度部分分别进行编码。首先,按照任意顺序将补充点的低精度几何信息排列成补充点低精度raw patch;然后,按照与补充点低精度raw patch相同的顺序将高精度几何信息排列成补充点高精度raw patch;最后,对补充点低精度raw patch和高精度raw patch进行压缩,可以采用多种压缩方法。其中,一种方法是对raw patch中的值进行游程编码、熵编码等方式编码,另一种方法是,将补充点低精度raw patch加入低精度几何图中的空白区域,将补充点高精度raw patch加入高精度几何图中的空白区域,得到补充点的几何图。
可选地,所述基于所述重建几何信息和所述重建连接信息,确定第二码流包括:
所述编码端根据所述重建几何信息和所述重建连接信息表征的相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点,所述第一空间范围为所述重建几何信息和所述重建连接信息表征的待编码三角形的目标顶点所在的空间范围,且所述待排序顶点包括所述目标顶点;
所述编码端对所述待排序顶点进行排序,得到所述目标顶点的排序信息;
所述编码端根据所述目标顶点的排序信息对应的编码信息,得到所述待编码三角形的编码信息;
所述编码端按照第一预设规则,更新边集合;
所述编码端根据更新后的边集合,重新确定待编码三角形,直至得到全部待编码三角形的编码信息;
所述编码端对所述全部待编码三角形的编码信息进行编码,得到所述第二码流;
其中,所述第一预设规则包括:将所述待编码三角形除第一边之外的两条边加入至所述边集合中,并在所述边集合中移除所述第一边。
这里重建后的几何信息包括目标三维网格中顶点的索引信息。
本申请实施例中,上述三维网络可划分为至少一个三角面片,每个三角面片中包含至少一个三角形。
基于三维网格中相邻三角面片的空间夹角,可以筛除第一空间范围内的部分顶点,并将剩余的部分顶点作为待排序顶点。
可选地,所述第一空间范围包括:
第一球体和第二球体之间的空间范围;
其中,所述第一球体和第二球体的球心相同,所述第一球体的半径和所述第二球体的半径不同,所述球心为所述待编码三角形的第一边中的目标位置,如球心为待编码三角形的第一边的中点。
本实施例中,按照预设排序准则对待排序顶点进行排序,例如该排序准则可以是按照顶点与待编码三角形的第一边的中点的距离进行排序,或者,该排序准则还可以是根据顶点与第一边形成的三角形外接圆的半径的大小进行排序。当然,该排序准则也可以是其他准则,此处不做具体限定。
这里,通过相邻三角面片的空间夹角,进一步删除第一空间范围内的顶点,减少了待排序顶点的数量,即可以减小目标顶点的排序信息所使用的比特信息,
可选地,所述编码端在满足目标条件的情况下,对目标顶点的排序信息进行编码,得到所述编码信息,在不满足目标条件的情况下,对目标顶点的
索引进行编码,得到上述编码信息。例如,该目标条件为所述第一空间范围内的待排序顶点的数量小于预设阈值,和/或,目标顶点的排序序号小于预设数值。由于在第一空间范围内的待排序顶点的数量较小或目标顶点的排序序号较小时,排序信息所对应的编码信息会占用较小的比特数,此时对目标顶点的排序信息进行编码,能够有效减小编码比特数。而对于待排序顶点的数量较大或目的顶点的排序序号较大的情况,对目标顶点的索引进行编码相比于对排序信息进行编码,能够有效地减小编码比特数。
本实施例中,在获得编码三角形的编码信息之后,编码端按照第一预设规则,更新边集合;编码端根据更新后的边集合,重新确定待编码三角形,直至三维网格中的三角形均得到编码信息。对全部待编码三角形的编码信息进行编码,得到第二码流。
其中,第一预设规则包括:将待编码三角形除第一边之外的两条边加入至边集合中,并在边集合中移除所述第一边。
本申请实施例中,根据三维网格中相邻三角面片的空间夹角,在第一空间范围内排除了部分顶点,并基于排除后的顶点确定待排序顶点,即减少了待排序顶点的数量,这样,在对目标顶点的排序信息进行编码时,能够进一步减少该编码信息所占用的比特数,进而有效提高编码效率。
可选地,所述根据所述重建几何信息和所述重建连接信息表征的相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点之前,所述方法包括:
所述编码端在边集合中选取第一边,其中,所述边集合为所述重建几何信息和所述重建连接信息表征的已编码三角形的至少一条边的集合;
所述编码端根据所述第一边和所述第一边对应的顶点,确定待编码三角形,其中,所述待编码三角形的目标顶点为所述第一边对应的顶点中除与所述第一边连接的两个顶点之外的顶点。
可选地,所述根据所述重建几何信息和所述重建连接信息表征的相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点,包括:
所述编码端在待编码三角形为预设类别三角形之外的三角形的情况下,根据所述相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点。
可选地,所述预设类别三角形包括以下至少一项:
与已编码三角形之间的角度小于预设角度的三角形;
两个顶点重合或三个顶点共线的三角形。具体的,是指一个三角形中的两个顶点重合或三个顶点共线。
可选地,所述方法还包括:
所述编码端在所述待编码三角形为预设类别三角形的情况下,根据所述待编码三角形的目标顶点信息对应的编码信息,得到所述待编码三角形的编码信息。
例如,在上述待编码三角形为上述预设类别三角形的情况下,对待编码三角形的目标顶点的索引直接进行编码,并根据该目标顶点的索引对应的编码信息,得到上述待编码三角形的编码信息。
本申请实施例中,在对顶点的索引进行编码时,可以直接使用二进制表示或使用如哈夫曼等编码算法进行编码,此处对编码方法不做具体限定。
可选地,所述根据所述重建几何信息和所述重建连接信息表征的相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点,包括:
所述编码端在所述第一空间范围内的顶点中排除第一目标三角形的所有顶点,得到剩余顶点;
所述编码端根据所述剩余顶点,确定所述第一空间范围内的待排序顶点;
其中,所述第一目标三角形为与邻接的已编码三角形的夹角小于夹角阈值的三角形,且所述第一目标三角形的一条边与所述待编码三角形的第一边相同。
可选地,所述待编码三角形的编码信息还包括:所述夹角阈值的编码信息。
这里,通过对夹角阈值进行编码,使得解码端根据该编码信息可以获取该夹角阈值,并基于该夹角阈值确定第一空间范围内的待排序顶点,该方式中,编码端可以灵活地设置该夹角阈值。
当然,也可以预先约定固定的夹角阈值,编码端和解码端基于预先约定的夹角阈值,确定第一空间范围内的待排序顶点,编码端无需对该夹角阈值进行编码。
可选地,所述方法还包括:
所述编码端对第二空间范围内的待编码三角形的目标顶点信息进行编码,得到所述待编码三角形的编码信息,所述第二空间范围为除第一空间范围之外的范围。
可选地,所述待编码三角形的编码信息还包括所述第一空间范围的编码信息。
例如,对上述第一球体和第二球体的半径进行编码,该实现方式中可以灵活地设置第一空间范围。
当然,编码端和解码端也可预先预定第一空间范围的大小,则该方式中,编码端无需对该第一空间范围进行编码。
在本申请的一具体实施例中,在编码端将输入三维网格分为一个或多个片,在每个片中选取初始三角形。编码该初始三角形的顶点索引并把该初始三角形的边放入边的集合(即边集合)中。选取边集合中的某个边并确定它的对顶点,该边和对顶点组成的三角形即为待编码三角形。例如,可将每次迭代选取的边记为τ,它的对顶点记为v,编码该边相邻的待编码三角形。如图8和图9所示,编码连接性关系的过程可具体包括:
(1)在满足预设条件的情况下,可以直接编码该三角形的顶点索引,也可以对该三角形进行其他方式的编码。该预设条件可以是待编码三角形属于若干种特殊三角形,如属于退化面(有两点重合或三点共线)或该三角形与已编码三角形的夹角小于某角度时,或者,该预设条件为第一空间范围内的顶点的数量大于预设数量,或者,该预设条件为目标顶点位于第二空间范围之外,如位于第二空间范围内,或者,该预设条件内目标顶点在第一空间范围内的顶点中的排序序号大于预设或等于预设数值,该预设条件可以根据需求灵活地进行设置。将该待编码三角形除去边τ外的两条边加入边集合中,并从集合中移除边τ。然后从边集合中按照一定的准则取出该待编码三角形的另一条边(除边τ之外的边),继续编码该边邻接的三角形,例如可以采用存取的顺序来选择下一条边τ。
(2)在不满足上述预设条件的情况下,确定其对顶点v所处的空间范围(即上述第一空间范围)并编码该空间范围。遍历片内该空间范围内的所有顶点,筛除与边τ形成的与已编码邻接三角形夹角小于某角度的新三角形所
有顶点,并编码该角度值。
该空间范围可以利用相邻三角面片的几何特性、空间夹角或其他准则确定。例如,空间范围可以采用以边τ的中点为球心,以最小半径Rmin和最大半径Rmax组合{Rmin,Rmax}的两个同心球间的部分,编码的是{Rmin,Rmax}组。
可选地,还可对上述角度值进行编码。
(3)遍历空间范围内的所有顶点,并按照一定的排序准则进行排序。例如该排序准测可以是顶点v到边τ的中点的距离;或者是与边τ形成的三角形的外接圆的半径。编码对顶点v在排序中的序号。
(4)将上述新编码三角形除去边τ外的两条边加入边集合中,并从边集合中移除边τ。然后从集合中按照一定的准则取出新编码三角形的另一条边,继续编码该边邻接的三角形。
对三维网格的每一个片迭代该编码过程,直到每个片中的三角形都完成编码。若边集合为空但存在尚未编码三角形,则从剩余未编码三角形中选取初始三角形,循环该编码过程。
可选地,所述根据基于属性信息,确定第三码流包括:
所述编码端对目标坐标差值进行熵编码,得到第一子码流;所述目标坐标差值基于所述重建纹理坐标信息得到;
所述编码端对所述纹理图使用视频编码器进行编码,得到第二子码流;
所述编码端基于所述第一子码流和所述第二子码流,得到第三码流。
应理解,属性信息包括重建纹理坐标信息和纹理图,上述重建纹理坐标信息包括每个顶点对应的重建纹理坐标,即UV坐标,上述UV坐标用于表征对应的顶点的纹理颜色值。
本实施例中,对编码后的几何信息进行重建,判断重建顶点对应的UV坐标是否与原顶点对应的UV坐标是否一致,若不一致,则可以将原顶点对应的UV坐标与重建顶点对应的UV坐标之间的坐标差值,确定为目标坐标差值,具体的如何确定坐标差值的技术方案,请参阅后续实施例。
在确定目标坐标差值之后,对该目标坐标差值进行熵编码,形成UV坐标子码流,上述UV坐标子码流又称为第一子码流。
本实施例中,在获取到纹理图之后,可以直接使用视频编码器对纹理图
进行编码,形成纹理图子码流,上述纹理图子码流又称为第二子码流。其中上述视频编码器包括但不限于高效视频编码(High Efficiency Video Coding,HEVC)编码器和多功能视频编码(Versatile Video Coding,VVC)编码器。
在得到第一子码流和第二子码流之后,对上述第一子码流和第二子码流进行混流,形成第三码流。
本实施例中,通过对目标坐标差值进行熵编码以及对纹理图使用视频编码器进行编码,形成第三码流,实现对属性信息的有效压缩,以此减少数据量。
可选地,所述对目标坐标差值进行熵编码,得到第一子码流之前,所述方法包括:
所述编码端在边集合中选取第二边,所述边集合为所述重建纹理坐标信息表征的已编码三角形的至少一条边的集合;
所述编码端根据所述第二边和所述第二边对应的顶点,确定预测三角形;
所述编码端将所述第二边在所述预测三角形对应的顶点中除与所述第二边连接的两个顶点之外的顶点,确定为预测顶点;
所述编码端将所述预测顶点与真实顶点之间的坐标差值,确定为所述目标坐标差值;所述真实顶点为所述第二边在待编码三角形对应的顶点中除与所述第二边连接的两个顶点之外的顶点。
为便于理解,请参阅图10,在图10示出的场景中,τ1表示上述第二边,A1表示上述第二边对应的顶点。可以基于上述第二边和第二边对应的顶点确定三角形S1,对上述三角形S1使用平行四边形预测法,确定预测三角形S2。进一步的,将第二边在预测三角形对应的顶点中除与第二边连接的两个顶点之外的顶点,确定为预测顶点,即图10示出的A2点。
获取待编码三角形的真实顶点,该真实顶点为第二边在待编码三角形对应的顶点中除与第二边连接的两个顶点之外的顶点,上述待编码三角形即图10中示出的S3,上述真实顶点即图10中示出的A3点,计算预测顶点与真实顶点之间的坐标差值,将上述坐标差值确定为目标坐标差值。
本申请实施例提供的编码方法,执行主体可以为编码装置。本申请实施例中以编码装置执行编码方法为例,说明本申请实施例提供的编码装置。
如图11所示,编码装置1100包括:
编码模块1101,用于对目标三维网格对应的第一信息进行编码,获取第一码流;所述第一信息基于所述目标三维网格对应的几何信息确定;
处理模块1102,用于基于重建几何信息,得到重建连接信息和重建纹理坐标信息;所述重建几何信息基于对所述几何信息进行重建确定;
第一确定模块1103,用于基于所述重建几何信息和所述重建连接信息,确定第二码流;
第二确定模块1104,用于基于属性信息,确定第三码流,所述属性信息包括纹理图和所述重建纹理坐标信息;
生成模块1105,用于基于所述第一码流、所述第二码流和所述第三码流,生成目标码流。
可选地,所述编码装置1100还包括:
获取模块,用于获取所述目标三维网格对应的几何信息;所述几何信息包括所述目标三维网格所包含的顶点的位置坐标;
投影模块,用于所述编码端将所述目标三维网格所包含的顶点投影在几何图和占位图中,得到所述第一信息;
其中,所述占位图中每个顶点的位置坐标与所述顶点在所述几何信息中的排列顺序对应。
可选地,所述处理模块1102,具体用于:
基于占位图,更新连接信息所包括的顶点的索引,得到所述重建连接信息;所述占位图基于对所述第一码流解码得到,所述占位图中每个顶点的位置坐标与所述顶点在所述重建几何信息中的排列顺序对应,所述顶点在所述重建几何信息中的排列顺序与所述顶点在所述重建连接信息中的索引对应;
基于所述占位图,更新所述重建纹理坐标信息所包含的顶点的索引;所述占位图中每个顶点的位置坐标与所述顶点在所述重建几何信息中的排列顺序对应,所述顶点在所述重建几何信息中的排列顺序与所述顶点在所述重建属性信息中的索引对应。
可选地,所述编码装置1100还包括:
简化模块,用于在处于有损编码模式的情况下,对待编码的三维网格进
行简化处理,得到目标三维网格;
第三确定模块,用于在处于无损编码模式的情况下,将待编码的三维网格,确定为目标三维网格。
可选地,所述简化模块,具体用于:
基于量化参数,对所述待编码的三维网格进行简化处理,获取目标三维网格。
可选地,所述简化模块,还具体用于:
在进行所述待编码的三维网格中的顶点合并时,将所述待编码的三维网格中的顶点合并后的至少部分顶点的位置坐标调整为量化参数的倍数,获取目标三维网格。
可选地,所述编码模块1101,具体用于:
对所述目标三维网格的几何信息进行量化,获取第一信息,所述第一信息包括以下至少一项:第一精度几何信息、第二精度几何信息、补充点的信息;
对所述第一信息进行编码,获取第一码流;
其中,所述第一精度几何信息为所述目标三维网格量化后的几何信息,所述第二精度几何信息为所述目标三维网格量化过程中丢失的几何信息,所述补充点的信息为量化过程中产生的需要额外处理的点的信息。
可选地,所述编码模块1101,还具体用于:
根据每一分量的量化参数,对所述目标三维网格中的每一顶点进行量化,获取第一精度几何信息。
可选地,所述编码模块1101,还具体用于:
根据所述第一精度几何信息以及每一分量的量化参数,获取第二精度几何信息。
可选地,所述编码模块1101,还具体用于:
根据所述目标三维网格的几何信息和所述第一精度几何信息,确定补充点的信息。
可选地,所述编码模块1101,还具体用于:
对所述第一信息进行处理,获取第二信息,所述第二信息包括占位图和
几何图中的至少一项;
对所述第二信息进行编码,获取第一码流。
可选地,所述编码模块1101,还具体用于:
对所述第一精度几何信息进行三维片划分;
将划分的三维片进行二维投影,获取二维片;
将所述二维片进行打包,获取二维图像信息;
根据所述二维图像信息,获取第一精度的占位图和第一精度的几何图。
可选地,所述编码模块1101,还具体用于:
根据获取二维图像信息过程中的信息,获取片信息;
对所述片信息进行编码,获取片信息子码流。
可选地,所述编码模块1101,还具体用于:
获取第一精度几何信息中所包含的顶点的排列顺序;
将第一精度几何信息中所包含的顶点对应的第二精度几何信息排列在二维图像中,生成第二精度的几何图。
可选地,所述编码模块1101,还具体用于:
对第一精度的几何图和第二精度的几何图进行编码,获取几何图子码流。
可选地,所述编码模块1101,还具体用于:
将所述补充点的第三精度几何信息排列成第一原始片;
按照与所述第一原始片相同的排列顺序,将所述补充点的第四精度几何信息排列成第二原始片;
对所述第一原始片和所述第二原始片进行压缩,获取补充点的几何图。
可选地,所述第一确定模块1103,具体用于:
根据所述重建几何信息和所述重建连接信息表征的相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点,所述第一空间范围为所述重建几何信息和所述重建连接信息表征的待编码三角形的目标顶点所在的空间范围,且所述待排序顶点包括所述目标顶点;
对所述待排序顶点进行排序,得到所述目标顶点的排序信息;
根据所述目标顶点的排序信息对应的编码信息,得到所述待编码三角形的编码信息;
按照第一预设规则,更新边集合;
根据更新后的边集合,重新确定待编码三角形,直至得到全部待编码三角形的编码信息;
对所述全部待编码三角形的编码信息进行编码,得到所述第二码流;
其中,所述第一预设规则包括:将所述待编码三角形除第一边之外的两条边加入至所述边集合中,并在所述边集合中移除所述第一边。
可选地,所述第一确定模块1103,还具体用于:
在边集合中选取第一边,其中,所述边集合为所述重建几何信息和所述重建连接信息表征的已编码三角形的至少一条边的集合;
根据所述第一边和所述第一边对应的顶点,确定待编码三角形,其中,所述待编码三角形的目标顶点为所述第一边对应的顶点中除与所述第一边连接的两个顶点之外的顶点。
可选地,所述第一确定模块1103,还具体用于:
在待编码三角形为预设类别三角形之外的三角形的情况下,根据所述相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点。
可选地,所述第一确定模块1103,还具体用于:
在所述待编码三角形为预设类别三角形的情况下,根据所述待编码三角形的目标顶点信息对应的编码信息,得到所述待编码三角形的编码信息。
可选地,所述第一确定模块1103,还具体用于:
在所述第一空间范围内的顶点中排除第一目标三角形的所有顶点,得到剩余顶点;
根据所述剩余顶点,确定所述第一空间范围内的待排序顶点;
其中,所述第一目标三角形为与邻接的已编码三角形的夹角小于夹角阈值的三角形,且所述第一目标三角形的一条边与所述待编码三角形的第一边相同。
可选地,所述第一确定模块1103,还具体用于:
对第二空间范围内的待编码三角形的目标顶点信息进行编码,得到所述待编码三角形的编码信息,所述第二空间范围为除第一空间范围之外的范围。
可选地,所述第二确定模块1104,还具体用于:
对目标坐标差值进行熵编码,得到第一子码流;所述目标坐标差值基于所述重建纹理坐标信息得到;
对所述纹理图使用视频编码器进行编码,得到第二子码流;
基于所述第一子码流和所述第二子码流,得到第三码流。
可选地,所述第二确定模块1104,还具体用于:
在边集合中选取第二边,所述边集合为所述重建纹理坐标信息表征的已编码三角形的至少一条边的集合;
根据所述第二边和所述第二边对应的顶点,确定预测三角形;
将所述第二边在所述预测三角形对应的顶点中除与所述第二边连接的两个顶点之外的顶点,确定为预测顶点;
将所述预测顶点与真实顶点之间的坐标差值,确定为所述目标坐标差值;所述真实顶点为所述第二边在待编码三角形对应的顶点中除与所述第二边连接的两个顶点之外的顶点。
本申请实施例中,对目标三维网格对应的第一信息进行编码,获取第一码流;编码端基于重建几何信息,得到重建连接信息和重建纹理坐标信息;编码端基于重建几何信息和重建连接信息,确定第二码流;编码端基于属性信息,确定第三码流;编码端基于第一码流、第二码流和第三码流,生成目标码流。本申请实施例中,通过基于重建几何信息,得到重建连接信息和重建纹理坐标信息,建立重建顶点对应的几何信息与原顶点对应的几何信息之间的对应关系,以此在后续的对三维网格的连接信息和属性信息进行编码的步骤中,避免编码失败。
本申请实施例中的编码装置可以是电子设备,例如具有操作系统的电子设备,也可以是电子设备中的部件、例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,终端可以包括但不限于上述所列举的终端11的类型,其他设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)等,本申请实施例不作具体限定。
本申请实施例提供的编码装置能够实现图1的方法实施例实现的各个过程,并达到相同的技术效果,为避免重复,这里不再赘述。
可选地,如图12所示,本申请实施例还提供一种通信设备1200,包括
处理器1201和存储器1202,存储器1202上存储有可在所述处理器1201上运行的程序或指令,例如,该通信设备1200为终端时,该程序或指令被处理器1201执行时实现上述编码方法实施例的各个步骤,且能达到相同的技术效果。
本申请实施例还提供一种终端,包括处理器和通信接口,处理器1201用于执行以下操作:
对目标三维网格对应的第一信息进行编码,获取第一码流;所述第一信息基于所述目标三维网格对应的几何信息确定;
基于重建几何信息,得到重建连接信息和重建纹理坐标信息;所述重建几何信息基于对所述几何信息进行重建确定;
基于所述重建几何信息和所述重建连接信息,确定第二码流;
基于属性信息,确定第三码流,所述属性信息包括纹理图和所述重建纹理坐标信息;
基于所述第一码流、所述第二码流和所述第三码流,生成目标码流。
该终端实施例与上述终端侧方法实施例对应,上述方法实施例的各个实施过程和实现方式均可适用于该终端实施例中,且能达到相同的技术效果。具体地,图13为实现本申请实施例的一种终端的硬件结构示意图。
该终端1300包括但不限于:射频单元1301、网络模块1302、音频输出单元1303、输入单元1304、传感器1305、显示单元1306、用户输入单元1307、接口单元1308、存储器1309、以及处理器1310等部件。
本领域技术人员可以理解,终端1300还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1310逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图13中示出的终端结构并不构成对终端的限定,终端可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
应理解的是,本申请实施例中,输入单元1304可以包括图形处理器(Graphics Processing Unit,GPU)13041和麦克风13042,图形处理器13041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1306可包括显示面板13061,
可以采用液晶显示器、有机发光二极管等形式来配置显示面板13061。用户输入单元1307包括触控面板13071以及其他输入设备13072中的至少一种。触控面板13071,也称为触摸屏。触控面板13071可包括触摸检测装置和触摸控制器两个部分。其他输入设备13072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。
本申请实施例中,射频单元1301接收来自网络侧设备的下行数据后,可以传输给处理器1310进行处理;射频单元1301可以向网络侧设备发送上行数据。通常,射频单元1301包括但不限于天线、放大器、收发信机、耦合器、低噪声放大器、双工器等。
存储器1309可用于存储软件程序或指令以及各种数据。存储器1309可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器1309可以包括易失性存储器或非易失性存储器,或者,存储器1309可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器1309包括但不限于这些和任意其它适合类型的存储器。
处理器1310可包括一个或多个处理单元;可选地,处理器1310集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基
带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器1310中。
其中,处理器1310用于执行以下操作:
对目标三维网格对应的第一信息进行编码,获取第一码流;所述第一信息基于所述目标三维网格对应的几何信息确定;
基于重建几何信息,得到重建连接信息和重建纹理坐标信息;所述重建几何信息基于对所述几何信息进行重建确定;
基于所述重建几何信息和所述重建连接信息,确定第二码流;
基于属性信息,确定第三码流,所述属性信息包括纹理图和所述重建纹理坐标信息;
基于所述第一码流、所述第二码流和所述第三码流,生成目标码流。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述编码方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,所述处理器为上述实施例中所述的终端中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述编码方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片,系统芯片,芯片系统或片上系统芯片等。
本申请实施例另提供了一种计算机程序/程序产品,所述计算机程序/程序产品被存储在存储介质中,所述计算机程序/程序产品被至少一个处理器执行以实现上述编码方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或
者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。
Claims (27)
- 一种编码方法,包括:编码端对目标三维网格对应的第一信息进行编码,获取第一码流;所述第一信息基于所述目标三维网格对应的几何信息确定;所述编码端基于重建几何信息,得到重建连接信息和重建纹理坐标信息;所述重建几何信息基于对所述几何信息进行重建确定;所述编码端基于所述重建几何信息和所述重建连接信息,确定第二码流;所述编码端基于属性信息,确定第三码流,所述属性信息包括纹理图和所述重建纹理坐标信息;所述编码端基于所述第一码流、所述第二码流和所述第三码流,生成目标码流。
- 根据权利要求1所述的方法,其中,所述对目标三维网格对应的第一信息进行编码,获取第一码流之前,所述方法包括:所述编码端获取所述目标三维网格对应的几何信息;所述几何信息包括所述目标三维网格所包含的顶点的位置坐标;所述编码端将所述目标三维网格所包含的顶点投影在几何图和占位图中,得到所述第一信息;其中,所述占位图中每个顶点的位置坐标与所述顶点在所述几何信息中的排列顺序对应。
- 根据权利要求2所述的方法,其中,所述基于重建几何信息,得到重建连接信息和重建纹理坐标信息包括:基于占位图,更新连接信息所包括的顶点的索引,得到所述重建连接信息;所述占位图基于对所述第一码流解码得到,所述占位图中每个顶点的位置坐标与所述顶点在所述重建几何信息中的排列顺序对应,所述顶点在所述重建几何信息中的排列顺序与所述顶点在所述重建连接信息中的索引对应;基于所述占位图,更新所述重建纹理坐标信息所包含的顶点的索引;所述占位图中每个顶点的位置坐标与所述顶点在所述重建几何信息中的排列顺序对应,所述顶点在所述重建几何信息中的排列顺序与所述顶点在所述重建 属性信息中的索引对应。
- 根据权利要求1所述的方法,其中,所述对目标三维网格对应的第一信息进行编码之前,包括:在处于有损编码模式的情况下,对待编码的三维网格进行简化处理,得到目标三维网格;在处于无损编码模式的情况下,将待编码的三维网格,确定为目标三维网格。
- 根据权利要求4所述的方法,其中,所述对待编码的三维网格进行简化处理,得到目标三维网格包括:所述编码端基于量化参数,对所述待编码的三维网格进行简化处理,获取目标三维网格。
- 根据权利要求5所述的方法,其中,所述基于量化参数,对所述目标三维网格进行简化处理,获取目标三维网格包括:所述编码端在进行所述待编码的三维网格中的顶点合并时,将所述待编码的三维网格中的顶点合并后的至少部分顶点的位置坐标调整为量化参数的倍数,获取目标三维网格。
- 根据权利要求1所述的方法,其中,所述对目标三维网格对应的第一信息进行编码,获取第一码流包括:所述编码端对所述目标三维网格的几何信息进行量化,获取第一信息,所述第一信息包括以下至少一项:第一精度几何信息、第二精度几何信息、补充点的信息;所述编码端对所述第一信息进行编码,获取第一码流;其中,所述第一精度几何信息为所述目标三维网格量化后的几何信息,所述第二精度几何信息为所述目标三维网格量化过程中丢失的几何信息,所述补充点的信息为量化过程中产生的需要额外处理的点的信息。
- 根据权利要求7所述的方法,其中,所述对所述目标三维网格的几何信息进行量化,获取第一信息,包括:所述编码端根据每一分量的量化参数,对所述目标三维网格中的每一顶点进行量化,获取第一精度几何信息。
- 根据权利要求7所述的方法,其中,所述对所述目标三维网格的几何信息进行量化,获取第一信息,包括:所述编码端根据所述第一精度几何信息以及每一分量的量化参数,获取第二精度几何信息。
- 根据权利要求7所述的方法,其中,所述对所述目标三维网格的几何信息进行量化,获取第一信息,包括:所述编码端根据所述目标三维网格的几何信息和所述第一精度几何信息,确定补充点的信息。
- 根据权利要求7所述的方法,其中,所述对所述第一信息进行编码,获取第一码流包括:所述编码端对所述第一信息进行处理,获取第二信息,所述第二信息包括占位图和几何图中的至少一项;对所述第二信息进行编码,获取第一码流。
- 根据权利要求11所述的方法,其中,在所述第一信息包括第一精度几何信息的情况下,所述对所述第一信息进行处理,获取第二信息,包括:所述编码端对所述第一精度几何信息进行三维片划分;所述编码端将划分的三维片进行二维投影,获取二维片;所述编码端将所述二维片进行打包,获取二维图像信息;所述编码端根据所述二维图像信息,获取第一精度的占位图和第一精度的几何图。
- 根据权利要求12所述的方法,其中,所述将所述二维片进行打包,获取二维图像信息之后,所述方法包括:所述编码端根据获取二维图像信息过程中的信息,获取片信息;所述编码端对所述片信息进行编码,获取片信息子码流。
- 根据权利要求11所述的方法,其中,在所述第一信息包括第二精度几何信息的情况下,所述对所述第一信息进行处理,获取第二信息,包括:所述编码端获取第一精度几何信息中所包含的顶点的排列顺序;所述编码端将第一精度几何信息中所包含的顶点对应的第二精度几何信息排列在二维图像中,生成第二精度的几何图。
- 根据权利要求11所述的方法,其中,所述对所述第二信息进行编码,包括:所述编码端对第一精度的几何图和第二精度的几何图进行编码,获取几何图子码流。
- 根据权利要求11所述的方法,其中,在所述第一信息包括补充点的信息的情况下,所述对所述第一信息进行处理,获取第二信息,包括:所述编码端将所述补充点的第三精度几何信息排列成第一原始片;所述编码端按照与所述第一原始片相同的排列顺序,将所述补充点的第四精度几何信息排列成第二原始片;所述编码端对所述第一原始片和所述第二原始片进行压缩,获取补充点的几何图。
- 根据权利要求1所述的方法,其中,所述基于所述重建几何信息和所述重建连接信息,确定第二码流包括:所述编码端根据所述重建几何信息和所述重建连接信息表征的相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点,所述第一空间范围为所述重建几何信息和所述重建连接信息表征的待编码三角形的目标顶点所在的空间范围,且所述待排序顶点包括所述目标顶点;所述编码端对所述待排序顶点进行排序,得到所述目标顶点的排序信息;所述编码端根据所述目标顶点的排序信息对应的编码信息,得到所述待编码三角形的编码信息;所述编码端按照第一预设规则,更新边集合;所述编码端根据更新后的边集合,重新确定待编码三角形,直至得到全部待编码三角形的编码信息;所述编码端对所述全部待编码三角形的编码信息进行编码,得到所述第二码流;其中,所述第一预设规则包括:将所述待编码三角形除第一边之外的两条边加入至所述边集合中,并在所述边集合中移除所述第一边。
- 根据权利要求17所述的方法,其中,所述根据所述重建几何信息和所述重建连接信息表征的相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点之前,所述方法包括:所述编码端在边集合中选取第一边,其中,所述边集合为所述重建几何信息和所述重建连接信息表征的已编码三角形的至少一条边的集合;所述编码端根据所述第一边和所述第一边对应的顶点,确定待编码三角形,其中,所述待编码三角形的目标顶点为所述第一边对应的顶点中除与所述第一边连接的两个顶点之外的顶点。
- 根据权利要求18所述的方法,其中,所述根据所述重建几何信息和所述重建连接信息表征的相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点,包括:所述编码端在待编码三角形为预设类别三角形之外的三角形的情况下,根据所述相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点。
- 根据权利要求18所述的方法,所述方法还包括:所述编码端在所述待编码三角形为预设类别三角形的情况下,根据所述待编码三角形的目标顶点信息对应的编码信息,得到所述待编码三角形的编码信息。
- 根据权利要求17所述的方法,其中,所述根据所述重建几何信息和所述重建连接信息表征的相邻三角面片的空间夹角,确定第一空间范围内的待排序顶点,包括:所述编码端在所述第一空间范围内的顶点中排除第一目标三角形的所有顶点,得到剩余顶点;所述编码端根据所述剩余顶点,确定所述第一空间范围内的待排序顶点;其中,所述第一目标三角形为与邻接的已编码三角形的夹角小于夹角阈值的三角形,且所述第一目标三角形的一条边与所述待编码三角形的第一边相同。
- 根据权利要求17所述的方法,所述方法还包括:所述编码端对第二空间范围内的待编码三角形的目标顶点信息进行编码,得到所述待编码三角形的编码信息,所述第二空间范围为除第一空间范围之外的范围。
- 根据权利要求1所述的方法,其中,所述根据基于属性信息,确定第三码流包括:所述编码端对目标坐标差值进行熵编码,得到第一子码流;所述目标坐 标差值基于所述重建纹理坐标信息得到;所述编码端对所述纹理图使用视频编码器进行编码,得到第二子码流;所述编码端基于所述第一子码流和所述第二子码流,得到第三码流。
- 根据权利要求23所述的方法,其中,所述对目标坐标差值进行熵编码,得到第一子码流之前,所述方法包括:所述编码端在边集合中选取第二边,所述边集合为所述重建纹理坐标信息表征的已编码三角形的至少一条边的集合;所述编码端根据所述第二边和所述第二边对应的顶点,确定预测三角形;所述编码端将所述第二边在所述预测三角形对应的顶点中除与所述第二边连接的两个顶点之外的顶点,确定为预测顶点;所述编码端将所述预测顶点与真实顶点之间的坐标差值,确定为所述目标坐标差值;所述真实顶点为所述第二边在待编码三角形对应的顶点中除与所述第二边连接的两个顶点之外的顶点。
- 一种编码装置,包括:编码模块,用于对目标三维网格对应的第一信息进行编码,获取第一码流;所述第一信息基于所述目标三维网格对应的几何信息确定;处理模块,用于基于重建几何信息,得到重建连接信息和重建纹理坐标信息;所述重建几何信息基于对所述几何信息进行重建确定;第一确定模块,用于基于所述重建几何信息和所述重建连接信息,确定第二码流;第二确定模块,用于基于属性信息,确定第三码流,所述属性信息包括纹理图和所述重建纹理坐标信息;生成模块,用于基于所述第一码流、所述第二码流和所述第三码流,生成目标码流。
- 一种终端,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-24任一项所述的编码方法的步骤。
- 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-24任一项所述的编码方法的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210307891.XA CN116843855A (zh) | 2022-03-25 | 2022-03-25 | 编码方法及终端 |
CN202210307891.X | 2022-03-25 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023179710A1 true WO2023179710A1 (zh) | 2023-09-28 |
Family
ID=88100091
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/083357 WO2023179710A1 (zh) | 2022-03-25 | 2023-03-23 | 编码方法及终端 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116843855A (zh) |
WO (1) | WO2023179710A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118298128A (zh) * | 2024-06-04 | 2024-07-05 | 浙江凌迪数字科技有限公司 | 三维网格处理方法、装置、设备及可读存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160086353A1 (en) * | 2014-09-24 | 2016-03-24 | University of Maribor | Method and apparatus for near-lossless compression and decompression of 3d meshes and point clouds |
US20210090301A1 (en) * | 2019-09-24 | 2021-03-25 | Apple Inc. | Three-Dimensional Mesh Compression Using a Video Encoder |
WO2021136876A1 (en) * | 2020-01-02 | 2021-07-08 | Nokia Technologies Oy | An apparatus, a method and a computer program for volumetric video |
WO2021136878A1 (en) * | 2020-01-02 | 2021-07-08 | Nokia Technologies Oy | A method, an apparatus and a computer program product for volumetric video encoding and decoding |
-
2022
- 2022-03-25 CN CN202210307891.XA patent/CN116843855A/zh active Pending
-
2023
- 2023-03-23 WO PCT/CN2023/083357 patent/WO2023179710A1/zh unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160086353A1 (en) * | 2014-09-24 | 2016-03-24 | University of Maribor | Method and apparatus for near-lossless compression and decompression of 3d meshes and point clouds |
US20210090301A1 (en) * | 2019-09-24 | 2021-03-25 | Apple Inc. | Three-Dimensional Mesh Compression Using a Video Encoder |
WO2021136876A1 (en) * | 2020-01-02 | 2021-07-08 | Nokia Technologies Oy | An apparatus, a method and a computer program for volumetric video |
WO2021136878A1 (en) * | 2020-01-02 | 2021-07-08 | Nokia Technologies Oy | A method, an apparatus and a computer program product for volumetric video encoding and decoding |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118298128A (zh) * | 2024-06-04 | 2024-07-05 | 浙江凌迪数字科技有限公司 | 三维网格处理方法、装置、设备及可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN116843855A (zh) | 2023-10-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110996098B (zh) | 处理点云数据的方法和装置 | |
US10904564B2 (en) | Method and apparatus for video coding | |
Maglo et al. | 3d mesh compression: Survey, comparisons, and emerging trends | |
Schnabel et al. | Octree-based Point-Cloud Compression. | |
Borges et al. | Fractional super-resolution of voxelized point clouds | |
WO2023179710A1 (zh) | 编码方法及终端 | |
CN114782564B (zh) | 一种点云的压缩方法、装置、电子设备及存储介质 | |
Caillaud et al. | Progressive compression of arbitrary textured meshes | |
JP2023541271A (ja) | 高密度メッシュ圧縮 | |
CN115176279A (zh) | 用于点云译码的方法和装置 | |
WO2023179706A1 (zh) | 编码方法、解码方法及终端 | |
WO2023197990A1 (zh) | 编码方法、解码方法及终端 | |
WO2023155778A1 (zh) | 编码方法、装置及设备 | |
Marvie et al. | Coding of dynamic 3D meshes | |
CN116843771A (zh) | 编码方法、解码方法及终端 | |
WO2023193709A1 (zh) | 编码、解码方法、装置及设备 | |
WO2024197680A1 (zh) | 点云编解码方法、装置、设备及存储介质 | |
WO2023179705A1 (zh) | 编码、解码方法、装置及设备 | |
US11710258B1 (en) | Systems and methods for compressing three-dimensional image data | |
WO2024026712A1 (zh) | 点云编解码方法、装置、设备及存储介质 | |
WO2023155794A1 (zh) | 编码、解码方法、装置及设备 | |
US20240037799A1 (en) | Point cloud coding/decoding method and apparatus, device and storage medium | |
Ponchio | Multiresolution structures for interactive visualization of very large 3D datasets | |
WO2023174337A1 (zh) | 编码、解码方法、装置及设备 | |
WO2024178632A1 (zh) | 点云编解码方法、装置、设备及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23773956 Country of ref document: EP Kind code of ref document: A1 |