WO2020143063A1 - 三维数据点的编解码方法和装置 - Google Patents

三维数据点的编解码方法和装置 Download PDF

Info

Publication number
WO2020143063A1
WO2020143063A1 PCT/CN2019/071494 CN2019071494W WO2020143063A1 WO 2020143063 A1 WO2020143063 A1 WO 2020143063A1 CN 2019071494 W CN2019071494 W CN 2019071494W WO 2020143063 A1 WO2020143063 A1 WO 2020143063A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
block
type
division
blocks
Prior art date
Application number
PCT/CN2019/071494
Other languages
English (en)
French (fr)
Inventor
李璞
张富
郑萧桢
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN201980005594.6A priority Critical patent/CN111406408B/zh
Priority to PCT/CN2019/071494 priority patent/WO2020143063A1/zh
Publication of WO2020143063A1 publication Critical patent/WO2020143063A1/zh
Priority to US17/371,999 priority patent/US20210335015A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/001Model-based coding, e.g. wire frame
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/40Tree coding, e.g. quadtree, octree
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/184Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being bits, e.g. of the compressed video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display

Definitions

  • Embodiments of the present invention relate to the technical field of image processing, and in particular, to a method and device for encoding and decoding three-dimensional data points.
  • a point cloud is a form of representation of a three-dimensional object or scene. It is composed of a set of discrete three-dimensional data points in the space that randomly distribute the space structure and surface properties of the three-dimensional object or scene. In order to accurately reflect the information in space, the number of discrete three-dimensional data points required is huge. In order to reduce the space occupied by the storage of 3D data points and the bandwidth occupied during transmission, it is necessary to encode and compress the 3D data points.
  • the position coordinates of each 3D data point are quantified according to the difference between the maximum and minimum values of the three-dimensional data point position coordinates on the three axes and the quantization accuracy determined according to the input parameters.
  • the position coordinates of the input three-dimensional data points are converted to integer coordinates greater than or equal to zero.
  • Select the maximum value of the maximum value of the position coordinates in the three directions and determine the side length of the cube when initializing the octree division according to the selected maximum value.
  • the side length is an integer power of 2 and is greater than or equal to and closest to the selected maximum value.
  • Each layer of octree is divided into sub-blocks using the position coordinates of the center point of the current block, and the current block is divided into eight small sub-blocks through the center point. After obtaining the sub-block division, it will determine whether there are 3D data points in each sub-block, and the sub-blocks with 3D data points will be further divided until the sub-block is divided to the minimum, that is, when the sub-block side length is 1, the division is stopped , According to the division result of the cube, encode three-dimensional data points.
  • Embodiments of the present invention provide a method and a device for encoding and decoding three-dimensional data points to improve encoding and decoding efficiency.
  • an embodiment of the present invention provides a three-dimensional data point encoding method, including:
  • the position coordinates of the three-dimensional data point to be encoded determine the maximum value of the side length of the three-dimensional cuboid of the three-dimensional data point to be encoded in three directions;
  • an embodiment of the present invention provides a three-dimensional data point decoding method, including:
  • the position coordinates of the three-dimensional data point to be decoded are obtained.
  • an embodiment of the present invention provides a three-dimensional data point encoding device, including:
  • a processor configured to determine the maximum value of the side lengths in three directions of the cuboid of the three-dimensional data point to be encoded according to the position coordinates of the three-dimensional data point to be encoded;
  • the processor is further configured to divide the cuboid at least once into an octree to obtain multiple sub-blocks of the first type;
  • the processor is further configured to perform at least one quadtree division and/or binary tree division on at least one first-type subblock in the first-type subblocks;
  • the processor is further configured to encode the three-dimensional data points to be encoded according to the division result of the rectangular parallelepiped;
  • the memory is used to store the coded stream obtained by encoding.
  • an embodiment of the present invention provides a three-dimensional data point decoding device, including:
  • the processor is used to decode the code stream of the three-dimensional data points to be decoded
  • the processor is further configured to construct a hexahedron according to the decoded code stream, and divide the hexahedron at least once into an octree to obtain multiple sub-blocks of the first type;
  • the processor is further configured to perform at least one quadtree and/or binary tree division on at least one subblock of the first type among the subblocks of the first type;
  • the processor is further used to obtain the position coordinates of the three-dimensional data points to be decoded according to the positions of the divided sub-blocks;
  • the memory is used to store the position coordinates of the three-dimensional data points to be decoded.
  • an embodiment of the present invention provides an encoder, including: a memory, a processor, and a program stored on the memory and executable on the processor.
  • the processor executes the program, the first On the one hand, the three-dimensional data point coding method.
  • an embodiment of the present invention provides a decoder, including: a memory, a processor, and a program stored on the memory and executable on the processor.
  • a decoder including: a memory, a processor, and a program stored on the memory and executable on the processor.
  • the processor executes the program, the first The three-dimensional data point decoding method described in the second aspect.
  • the method and device for encoding and decoding three-dimensional data points determine the maximum value of the side lengths in three directions of the cuboid of the three-dimensional data point to be encoded according to the position coordinates of the three-dimensional data point to be encoded, At least one octree partition is performed on the cuboid to obtain multiple sub-blocks of the first type, and at least one sub-block of the first type in the sub-blocks of the first type is divided into at least one quadtree and/or binary tree, according to the description The division result of the cuboid encodes the three-dimensional data point to be encoded.
  • the cuboid constructed to divide the distribution of spatial three-dimensional data points has different side lengths in three directions, during the division process, the number of divisions of the side lengths in the three directions to the minimum side length is different.
  • the length reaches the minimum side length, it is divided by quadtree division or binary tree division until the side lengths in the three directions all reach the minimum side length, thereby reducing the number of divisions and improving the coding and decoding efficiency.
  • FIG. 1 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention
  • FIG. 6 is a schematic flowchart of a method for decoding a three-dimensional data point according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of an octree division provided by an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a division process provided by an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a three-dimensional data point encoding device according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a three-dimensional data point decoding device according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a distance measuring device according to an embodiment of the present invention.
  • FIG. 12 is a schematic diagram of an embodiment of a distance measuring device of the present invention using a coaxial optical path
  • FIG. 13 is a schematic diagram of a scanning pattern of the distance measuring device 200.
  • a component when a component is said to be “fixed” to another component, it can be directly on another component or there can be a centered component. When a component is considered to be “connected” to another component, it can be directly connected to another component or there may be a centered component at the same time.
  • the embodiments of the present invention are mainly directed to a scenario where the position coordinates of the three-dimensional data points of some point clouds are different in three directions.
  • the side length in three directions of the cuboid constructed to divide the distribution of spatial three-dimensional data points may be different.
  • the specific side length is determined by the maximum value of the three-dimensional data points in three directions.
  • the number of divisions of the side lengths in the three directions to the minimum side length is different.
  • the quadtree or binary tree division is used to divide until the sides in the three directions
  • the length reaches the minimum side length, thereby reducing the number of divisions and improving the coding and decoding efficiency.
  • the reduction in the number of divisions results in a corresponding reduction in the length of the coded stream, so that the position coordinates of the three-bit data points are more effectively compressed.
  • different bit lengths can also be used for encoding according to the division method.
  • the length of the coded code stream can be further reduced, and the coding efficiency and compression efficiency can be further improved.
  • the minimum side length in each direction refers to the side length of each direction of the sub-block obtained at the end of the division.
  • the minimum side length in each direction can be preset before encoding, and the minimum side length in each direction It can be the same or different.
  • a sub-block obtained by dividing an octree in any one time is called a first-type sub-block
  • a sub-block obtained by dividing a quad-tree in any one time is called a second-type sub-block
  • the sub-block obtained by dividing the binary tree at any time is called the third type of sub-block.
  • FIG. 1 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention. As shown in FIG. 1, the method in this embodiment is as follows:
  • S101 Determine, according to the position coordinates of the three-dimensional data point to be encoded, the maximum value of the side lengths in three directions of the cuboid of the three-dimensional data point to be encoded.
  • Quantify the position coordinates of the three-dimensional data points to be encoded obtain the maximum values of the position coordinates of the three-dimensional data points in three directions according to the position coordinates of the quantized three-dimensional data points; according to the position coordinates of the three-dimensional data points in three
  • the maximum value in the direction determines the maximum value of the side lengths in three directions of the cuboid of the three-dimensional data point to be encoded.
  • the value closest to the maximum value among the values greater than or equal to the integer power of 2 of the maximum value of the position coordinates of the three-dimensional data point is obtained.
  • the method further includes: performing an operation of removing duplicate position coordinates.
  • the cuboid can cover all or most of the three-dimensional data points of the point cloud.
  • the value is encoded, and the minimum value among the maximum values in the three directions is written into the information header.
  • a cuboid or cube used to divide the distribution of spatial three-dimensional data points constructed by the decoding end according to the values in the information header.
  • S102 Perform at least one octree division on the cuboid to obtain multiple sub-blocks of the first type.
  • the cuboid is divided at least once into eight octrees, each divided into eight sub-blocks, each divided into sub-blocks containing the position coordinates of the three-dimensional data points obtained in the previous division, until one direction of the divided sub-blocks is obtained Or the side length in both directions reaches the minimum side length.
  • the octree can be divided according to the coordinates of the center point of the first type of sub-blocks obtained in the previous division.
  • the sub-block obtained by the previous division is divided into eight sub-blocks.
  • the corresponding coordinate ranges of the eight sub-blocks obtained are as follows: the coordinate value range of the first sub-block is x ⁇ xmid , Y ⁇ ymid, z ⁇ zmid, the coordinate range of the second sub-block is x ⁇ xmid, y ⁇ ymid, z>zmid, the coordinate range of the third sub-block is x ⁇ xmid, y>ymid, z ⁇ zmid, the coordinate value range of the fourth sub-block is x ⁇ xmid, y>ymid, z>zmid, the coordinate value range of the fifth sub-block is x>xmid, y ⁇ ymid, z ⁇ zmid, the sixth sub-block
  • the coordinate range of the block is x>xmid, y ⁇ ymid, z>zmid
  • the coordinate range of the seventh sub-block is x>xmid, y>ymid, z ⁇ zmid,
  • S103 Perform at least one quadtree division and/or binary tree division on at least one first type subblock in the first type subblock.
  • the side length of the three directions of the cuboid is different, and the division method is different, including but not limited to the following possible situations:
  • Another possible situation is that: the sides of the cuboid are equal in both directions, and the equal sides are longer than the sides in the other direction. After the octree is divided, only the quadtree is divided. .
  • S104 Encode the three-dimensional data point to be encoded according to the division result of the rectangular parallelepiped.
  • the cuboid is divided at least once by an octree to obtain multiple A sub-block of the first type, at least one sub-block of the first type among the sub-blocks of the first type is divided into at least one quadtree and/or binary tree, and the three-dimensional data to be encoded is divided according to the division result of the rectangular parallelepiped Point to encode.
  • the cuboid constructed to divide the distribution of spatial three-dimensional data points has different side lengths in three directions, during the division process, the number of divisions of the side lengths in the three directions to the minimum side length is different.
  • the length reaches the minimum side length, it is divided by quadtree division or binary tree division until the side lengths in the three directions all reach the minimum side length, thereby reducing the number of divisions and improving the coding and decoding efficiency.
  • FIG. 2 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention.
  • FIG. 2 is based on the embodiment shown in FIG. 1, when the side lengths of the three directions of the rectangular parallelepiped are not equal, To describe a possible implementation manner of S103, the method in this embodiment is as follows:
  • S1031a Perform at least one quadtree division on at least one sub-block of the first type among the sub-blocks of the first type to obtain sub-blocks of the second type, until the side lengths of the two sub-blocks of the second type reach The minimum side length.
  • the first type of target sub-block in the first type of sub-block is determined.
  • the first-type target sub-block may refer to a sub-block in the first-type sub-block whose side length in one direction reaches the minimum side length and contains three-dimensional data points. At least one quadtree division is performed on the target sub-blocks of the first type.
  • the target sub-blocks of the first type are divided into quadtrees at least once, and each sub-block is divided into four sub-blocks of the second type.
  • the sub-blocks are divided until the side length of the divided sub-blocks of the second type in both directions reaches the minimum side length,
  • octree division may be performed according to the coordinates of the center point of the first-type target sub-block obtained from the previous division.
  • the first plane passing through the coordinates of the center point and parallel to the xoy plane and the second plane passing through the coordinates of the center point and parallel to the xoz plane are used to divide the previous time
  • the obtained sub-blocks are divided into four sub-blocks of the second type;
  • the second plane passing through the coordinates of the center point and parallel to the xoz plane and the third plane passing through the coordinates of the center point and parallel to the yoz plane are used.
  • the divided sub-blocks are divided into four sub-blocks of the second type.
  • the coordinates of the center point of the first-type target sub-block are (ymid, zmid);
  • the coordinate value range of the first second-type sub-block is: y ⁇ ymid, z ⁇ zmid
  • the coordinate value range of the second sub-block of the second type is: y ⁇ ymid, z>zmid
  • the coordinate value range of the third sub-block of the second type is: y>ymid, z ⁇ zmid
  • the coordinate value range of the fourth sub-block of the second type is: y>ymid, z>zmid;
  • the coordinates of the center point of the target sub-block of the first type are (xmid, zmid);
  • the coordinate range of the first sub-block of the second type is: x ⁇ xmid, z ⁇ zmid
  • the coordinate value range of the second sub-block of the second type is: x ⁇ xmid, z>zmid
  • the coordinate value range of the third sub-block of the second type is: x>xmid, z ⁇ zmid
  • the coordinate value range of the fourth sub-block of the second type is: x>xmid, z>zmid;
  • the coordinates of the center point of the first-type target sub-block are (xmid, ymid); the coordinate range of the first second-type sub-block is: x ⁇ xmid, y ⁇ ymid, the coordinate value range of the second sub-block of the second type is: x ⁇ xmid, y>zmid: the coordinate value range of the third sub-block of the second type is: x>xmid, y ⁇ ymid, the fourth The coordinate value range of a second type of sub-block is: x>xmid, y>ymid.
  • S1032a Perform at least one binary tree division on at least one sub-block of the second type in the sub-block of the second type to obtain a sub-block of the third type until the side lengths in three directions of the sub-block of the second type reach the minimum side long.
  • the second type target sub-block in the second type sub-block is determined.
  • the second type of target sub-block may refer to a sub-block whose side length in both directions reaches the minimum side length and contains three-dimensional data points. At least one binary tree division is performed on the target sub-blocks of the second type.
  • the second-type target sub-blocks are divided into at least one binary tree, and each sub-block is divided into two sub-blocks of the third type, and each division is performed on the sub-blocks obtained by the previous division and containing the position coordinates of the three-dimensional data points.
  • the side lengths in the three directions of the divided sub-blocks of the third type reach the minimum side length.
  • the first plane passing through the coordinates of the center point and parallel to the xoy plane is used to divide the previously divided sub-block into two sub-blocks;
  • the second plane passing through the coordinates of the center point and parallel to the xoz plane is used to divide the previously divided sub-block into two sub-blocks;
  • the third plane passing through the coordinates of the center point and parallel to the yoz plane is used to divide the sub-block obtained by the previous division into two sub-blocks.
  • the coordinate of the center point of the third type sub-block is (zmid); the coordinate value range of the first third type sub-block is: z ⁇ zmid, The coordinate value range of the second third type sub-block is: z>zmid;
  • the coordinate of the center point of the third type sub-block is (ymid)
  • the coordinate value range of the first third type sub-block is: y ⁇ ymid
  • the coordinate value range of the second third type sub-block is: y>ymid;
  • the coordinate of the center point of the third type sub-block is (xmid)
  • the coordinate value range of the first third type sub-block is: x ⁇ xmid
  • the coordinate value range of the second third type sub-block is: x>xmid.
  • the cuboid is divided at least once by an octree to obtain multiple A sub-block of the first type, performing at least one quadtree division on at least one sub-block of the first type among the sub-blocks of the first type to obtain sub-blocks of the second type, until two sub-blocks of the second type
  • the side length in the direction reaches the minimum side length
  • at least one second-type sub-block in the second-type sub-block is divided into at least one binary tree to obtain a third-type sub-block until three of the third-type sub-blocks
  • the side length in the direction reaches the minimum side length
  • the three-dimensional data points to be coded are coded according to the division result of the cuboid, that is, when the side lengths of the three directions of the cuboid
  • the reduction in the number of divisions results in a corresponding reduction in the length of the coded stream, so that the position coordinates of the three-bit data points are more effectively compressed.
  • different bit lengths can also be used for encoding according to the division method.
  • the length of the coded code stream can be further reduced, and the coding efficiency and compression efficiency can be further improved.
  • FIG. 3 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention.
  • FIG. 3 is based on the embodiment shown in FIG. 1, when the side lengths of the two directions of the rectangular parallelepiped are equal, and the The equal side length is greater than the side length in the other direction.
  • the method in this embodiment is as follows:
  • S103b Perform at least one quadtree division on at least one sub-block of the first type among the sub-blocks of the first type to obtain multiple sub-blocks of the second type until the side lengths in three directions of the sub-blocks of the second type reach The minimum side length.
  • a possible implementation manner determining a first-type target sub-block among the first-type sub-blocks.
  • the first type of target sub-block may refer to a sub-block whose side length in one direction reaches the minimum side length and contains three-dimensional data points. At least one quadtree division is performed on the target sub-blocks of the first type.
  • the first type of target sub-blocks are divided into quadtrees, and each sub-block is divided into four sub-blocks.
  • Each sub-block is divided into the second type of sub-blocks containing the position coordinates of the three-dimensional data points obtained by the previous division until the division is obtained.
  • the side lengths of the three directions of the second type of sub-blocks reach the minimum side length.
  • octree division may be performed according to the coordinates of the center point of the first-type target sub-block obtained from the previous division.
  • the first plane passing through the coordinates of the center point and parallel to the xoy plane and the second plane passing through the coordinates of the center point and parallel to the xoz plane are used to divide the previous time
  • the obtained sub-blocks are divided into four sub-blocks of the second type;
  • the second plane passing through the coordinates of the center point and parallel to the xoz plane and the third plane passing through the coordinates of the center point and parallel to the yoz plane are used.
  • the divided sub-blocks are divided into four sub-blocks of the second type.
  • the coordinates of the center point of the first-type target sub-block are (ymid, zmid);
  • the coordinate value range of the first second-type sub-block is: y ⁇ ymid, z ⁇ zmid
  • the coordinate value range of the second sub-block of the second type is: y ⁇ ymid, z>zmid
  • the coordinate value range of the third sub-block of the second type is: y>ymid, z ⁇ zmid
  • the coordinate value range of the fourth sub-block of the second type is: y>ymid, z>zmid;
  • the coordinates of the center point of the target sub-block of the first type are (xmid, zmid);
  • the coordinate range of the first sub-block of the second type is: x ⁇ xmid, z ⁇ zmid
  • the coordinate value range of the second sub-block of the second type is: x ⁇ xmid, z>zmid
  • the coordinate value range of the third sub-block of the second type is: x>xmid, z ⁇ zmid
  • the coordinate value range of the fourth sub-block of the second type is: x>xmid, z>zmid;
  • the coordinates of the center point of the first-type target sub-block are (xmid, ymid); the coordinate range of the first second-type sub-block is: x ⁇ xmid, y ⁇ ymid, the coordinate value range of the second sub-block of the second type is: x ⁇ xmid, y>zmid: the coordinate value range of the third sub-block of the second type is: x>xmid, y ⁇ ymid, the fourth The coordinate value range of a second type of sub-block is: x>xmid, y>ymid.
  • the cuboid is divided at least once by an octree to obtain multiple A sub-block of the first type, performing at least one quadtree division on at least one sub-block of the first type among the sub-blocks of the first type to obtain a plurality of sub-blocks of the second type, until The side lengths in the three directions reach the minimum side length, and the three-dimensional data points to be coded are coded according to the division result of the cuboid, that is, the side lengths of the two directions for the cuboid are equal, and the equal side length is greater than In the side direction scene in the other direction, the mixed octree and quadtree are used to divide the cuboid that is used to divide the distribution of spatial 3D data points, thereby reducing the number of division
  • the reduction in the number of divisions results in a corresponding reduction in the length of the coded stream, so that the position coordinates of the three-bit data points are more effectively compressed.
  • different bit lengths can also be used for encoding according to the division method.
  • the length of the coded code stream can be further reduced, and the coding efficiency and compression efficiency can be further improved.
  • FIG. 4 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention.
  • FIG. 4 is based on the embodiment shown in FIG. 1, when the side lengths of the two directions of the rectangular parallelepiped are equal, and the The equal side length is smaller than the side length in the other direction; to describe another possible implementation manner of S103, the method in this embodiment is as follows:
  • S103c Perform at least one binary tree division on at least one sub-block of the first type in the sub-blocks of the first type to obtain multiple sub-blocks of the third type, until the side lengths of the three types of sub-blocks in the three directions reach the minimum side long.
  • the first type of target sub-block in the first type of sub-block is determined.
  • the first-type target sub-block may refer to a sub-block whose side length in two directions reaches the minimum side length and contains three-dimensional data points; at least one binary tree division is performed on the first-type target sub-block.
  • the first type of target sub-blocks are divided into two binary trees, and each sub-block is divided into two sub-blocks.
  • Each sub-block is divided into the third type of sub-blocks containing the position coordinates of the three-dimensional data points obtained by the previous division, until the divided The side lengths of the three types of sub-blocks in the three directions all reach the minimum side length.
  • the first plane passing through the coordinates of the center point and parallel to the xoy plane is used to divide the previously divided sub-block into two sub-blocks;
  • the second plane passing through the coordinates of the center point and parallel to the xoz plane is used to divide the previously divided sub-block into two sub-blocks;
  • the third plane passing through the coordinates of the center point and parallel to the yoz plane is used to divide the sub-block obtained by the previous division into two sub-blocks.
  • the coordinate of the center point of the first-type target sub-block is (zmid); the coordinate value range of the first third-type sub-block is: z ⁇ zmid , The coordinate value range of the second third type sub-block is: z>zmid;
  • the coordinate of the center point of the first-type target sub-block is (ymid)
  • the coordinate value range of the first third-type sub-block is: y ⁇ ymid
  • the coordinate value range of the second third type sub-block is: y>ymid;
  • the coordinate of the center point of the target sub-block of the first type is (xmid)
  • the coordinate range of the first sub-block of the third type is: x ⁇ xmid
  • the coordinate value range of the second third type sub-block is: x>xmid.
  • the cuboid is divided at least once by an octree to obtain multiple A first-type sub-block, at least one first-type sub-block in the first-type sub-block is divided into at least one binary tree to obtain multiple third-type sub-blocks, up to three of the third-type sub-blocks
  • the side length in the direction reaches the minimum side length, and the three-dimensional data points to be coded are coded according to the division result of the rectangular parallelepiped, that is, for scenes with different side lengths in three directions, a mixture of octree and binary tree is used.
  • the division method divides the constructed cuboid used to divide the distribution of spatial three-dimensional data points, thereby reducing the number of divisions and improving coding efficiency.
  • the reduction in the number of divisions results in a corresponding reduction in the length of the coded stream, so that the position coordinates of the three-bit data points are more effectively compressed.
  • different bit lengths can also be used for encoding according to the division method.
  • the length of the coded code stream can be further reduced, and the coding efficiency and compression efficiency can be further improved.
  • FIG. 5 is a schematic flowchart of a method for encoding a three-dimensional data point according to an embodiment of the present invention.
  • FIG. 5 is a description of a possible implementation manner of S104 based on any of the embodiments shown in FIGS. 1-4. , As shown in Figure 5:
  • S104' Encode each division in turn according to the division order and the three-dimensional data points contained in the sub-blocks obtained by each division.
  • a possible implementation manner according to the situation that the sub-block obtained by each division contains three-dimensional data points, a code stream corresponding to each division is obtained; according to the division order, the code stream corresponding to each division is sequentially encoded.
  • the code stream corresponding to each division is obtained, including:
  • the bit stream corresponding to each sub-block is obtained, each sub-block corresponds to one bit, the bits of the sub-blocks containing the three-dimensional data points and the sub-blocks not containing the three-dimensional data points Different values; generate a code stream corresponding to each division according to the bit value corresponding to the sub-block.
  • the number of bits of the code stream corresponding to each division can be fixedly represented by 8 bits, or can be determined according to the number of divided subblocks. For example, each time an octree is divided into eight subblocks, each octree is divided The corresponding code stream is identified by 8 bits, and each time the quadtree is divided into four sub-blocks, the code stream corresponding to each quadtree is identified by 4 bits, and each time the binary tree is divided into two sub-blocks, each time The code stream corresponding to the binary tree division is identified by 2 bits.
  • the 8-bit bit value is determined according to the three-dimensional data points contained in the divided eight sub-blocks; if the quad-tree division is performed, the three-dimensional data contained in the divided four sub-blocks In the case of data points, determine the bit value of 4 of the 8 bits, and the bit values of the remaining 4 bits are the same as the bit values of sub-blocks that do not contain 3D data points; if binary tree division is performed, the In the case of the three-dimensional data points included in the two sub-blocks, the bit value of two of the eight bits is determined, and the bit values of the remaining six bits are the same as the bit values of the sub-blocks that do not contain the three-dimensional data points.
  • the code stream corresponding to each division is 8 bits, and the bit value of the 8 bits is determined according to the three-dimensional data points contained in the eight sub-blocks obtained by the division;
  • the bit value of the 4 bits is determined according to the three-dimensional data points contained in the four sub-blocks obtained by the division;
  • the bit value of the 2 bits is determined according to the three-dimensional data points included in the two sub-blocks obtained by the division.
  • the bit value corresponding to the sub-blocks containing three-dimensional data points is 1, and the bit value corresponding to the sub-blocks not containing three-dimensional data points is 0.
  • the bit value corresponding to the sub-block containing three-dimensional data points may be 0, and the bit value corresponding to the sub-block not containing three-dimensional data points is 1, which is not limited in this embodiment of the present invention.
  • the method further includes: when a side length in one direction or two directions in the divided sub-blocks reaches the minimum side length, encoding a first identifier, where the first identifier is used to indicate a change in the division mode, the division The method is octree division, quadtree division or binary tree division. In order for the decoding end to determine the change division method according to the first identifier.
  • the first identifier is 8 bits, and the 8-bit bits
  • the values are consistent with the bit values corresponding to sub-blocks that do not contain 3D data points. For example, if the bit value corresponding to the sub-block containing the point cloud 3D data point is 1, and the bit value corresponding to the sub-block not containing the point cloud 3D data point is 0; then the first identifier is 00000000. For another example, if the bit value corresponding to the sub-block including the point cloud 3D data point is 0, and the bit value corresponding to the sub-block not including the point cloud 3D data point is 1; then the first identifier is 11111111.
  • the first identifier is 4 bits, and the bit values of the 4 bits all correspond to the subblocks that do not contain 3D data points. The bit values are consistent. If the sub-block containing the point cloud 3D data point corresponds to a bit value of 1, and the sub-block not containing the point cloud 3D data point corresponds to a bit value of 0; then the first identifier is 0000; if the point cloud 3D data point is included The bit value corresponding to the sub-block is 0, and the bit value corresponding to the sub-block not including the point cloud 3D data point is 1; then the first identifier is 1111.
  • the first identifier when the side length in one direction reaches the minimum side length first, the first identifier is 00000000, and when the side length in the other direction reaches the minimum side length, the first identifier is 0000.
  • the first identifier is 00000000.
  • the first identifier is 00000000.
  • the first identifier after the first identifier, it further includes:
  • a second identifier is encoded, which is used to indicate the direction of reaching the minimum side length or the direction of not reaching the minimum side length.
  • the second identifier is 3 bits or 2 bits.
  • the direction of quadtree division or binary tree division is determined.
  • the second identifier is three bits, 000, 001, or 010; the 000, 001 And 010 respectively correspond to the side length in one direction, indicating that the side length in the corresponding direction reaches the minimum side length, and when the side length in the other direction reaches the minimum side length, the second identifier is two bits, 00 or 01 ; The 00 and 01 respectively correspond to the length of one of the remaining two directions;
  • the second identifier is represented by three bits, the second The identifier is 000, 001, or 010; the 000, 001, and 010 respectively correspond to the side length in one direction, indicating that the side length in the corresponding direction reaches the minimum side length;
  • the second identifier is indicated by three bits.
  • the two identifiers are 100, 101 or 110; the 100, 101 or 110 respectively correspond to the side length in one direction, indicating that the side length in the corresponding direction has not reached the minimum side length.
  • three bits are used to represent three directions in sequence, for example: x, y, z in sequence.
  • the bit position that reaches the minimum side length is 1, and the minimum side is not reached
  • the long bit position is 0; for example: the x direction reaches the minimum side length first is 100; the y direction reaches the minimum side length first is 010; the z direction reaches the minimum side length first is 001; when both the x and y directions reach the minimum
  • the side length is 110, when the x and z directions both reach the minimum side length, it is 101, and when the y and z directions both reach the minimum side length, it is 011.
  • the bit position that reaches the minimum side length is 0, and the bit position that does not reach the minimum side length is 1; for example: 011 reaches the minimum side length first; y direction reaches the minimum side length 101; z direction
  • the minimum side length is 110 first; the minimum side length is 001 when both x and y directions are reached, the minimum side length is 010 when both x and z directions are reached, and the minimum side length is 100 when both y and z directions are reached .
  • the correspondence between the three bits and the three directions is not limited in this embodiment of the present invention, and any adjustment can be made.
  • it also includes: encoding a third identifier, the third identifier is used to indicate the end of the division, for example: the side in the last direction reaches the minimum side length, then encoding 2 bits 00 indicates the end of the division; another example: the last If the two changes reach the minimum side length at the same time, 4 bits 0000 and 2 bits 10 are encoded, or 4 bits 0000 and 2 bits 11 are encoded.
  • the embodiment of the present invention is not limited as long as the division can be distinguished.
  • the method further includes: encoding the number of three-dimensional data points in the sub-block containing the three-dimensional data points.
  • coding 0 indicates that when the sub-block contains N three-dimensional data points, first coding 1 is followed by coding N-1.
  • FIG. 6 is a schematic flowchart of a method for decoding a three-dimensional data point according to an embodiment of the present invention. As shown in FIG. 6, the method in this embodiment is as follows:
  • the decoding end decodes the code stream of the three-dimensional data points to be decoded.
  • S602 Construct a hexahedron according to the code stream obtained by decoding, and divide the hexahedron at least once into an octree to obtain multiple sub-blocks of the first type.
  • the hexahedron may be a cube or a cuboid.
  • decoding the maximum value of the position coordinates of the three-dimensional data point to be decoded in three directions constructing a cuboid according to the maximum value of the three directions.
  • the cube is constructed according to the maximum value of the maximum value of the three directions.
  • the cube is constructed according to the minimum value of the maximum value of the three directions.
  • the octahedron is divided at least once by the octree to obtain a plurality of sub-blocks of the first type.
  • the division method of the octree please refer to the relevant description at the encoding end, and no more details are provided here.
  • S603 Perform at least one quadtree and/or binary tree division on at least one first-type subblock in the first-type subblock.
  • Said performing at least one quadtree and/or binary tree division on at least one subblock of the first type in said first subblocks includes:
  • At least one sub-block of the first type in the first-type sub-block is divided into at least one quadtree to obtain a sub-block of the second type, until the side lengths of the two sub-blocks of the second type reach the minimum side Long; at least one second-type sub-block in the second-type sub-block is divided into at least one binary tree to obtain a third-type sub-block, until the three-direction side length of the third-type sub-block reaches the minimum side long.
  • the first type of target subblock is determined according to the bit value corresponding to the first type of subblock.
  • the bit value of the first type of target subblock indicates that the subblock contains three-dimensional data points;
  • the target sub-blocks of the first type are divided into quadtrees at least once.
  • a second type of target sub-block is determined according to the bit value corresponding to the second type of sub-block, the bit value of the second type of target sub-block indicates that the sub-block contains three-dimensional data points; for the second type of target sub-block Perform at least one binary tree division.
  • a bit value of 1 indicates that the first-type sub-block contains three-dimensional data points, and then the first-type sub-block with a bit value of 1 is determined If it is a first-type target sub-block, or a bit value of 0 indicates that the first-type sub-block contains three-dimensional data points, then the first-type sub-block with a bit value of 0 is determined to be the first-type target sub-block.
  • the first identifier is used to indicate the change division mode, and the decoding end may determine the change division mode according to the first identifier, and the division modes include octree division, quadtree division, and binary tree division.
  • the first identifier indicates a change from octree division to quadtree division, and quadtree division to binary tree division.
  • the second identifier is used to indicate the direction of reaching the minimum side length or the direction of not reaching the minimum side length
  • the decoding end may determine which side length reaches the minimum side length according to the second identifier, and the quadtree divides the edge Which two directions to divide, and which side length of the two directions reaches the minimum side length, the direction along which the binary tree division is divided, or according to the second identifier to determine which two direction side lengths have not reached the minimum side length , In which two directions the quadtree partition is divided, in which direction the side length does not reach the minimum side length, in which direction the binary tree division is divided.
  • the performing at least one quadtree division and/or binary tree division on at least one first-type subblock among the first-type subblocks to obtain multiple second-type subblocks includes:
  • the first identifier is used to indicate the change division mode
  • the decoding end may determine the change division mode according to the first identifier, and the division mode includes octree division, quadtree division, and binary tree division.
  • the decoding end determines that the octree division is changed to the quadtree division according to the first identifier.
  • the second identifier is used to indicate the direction of reaching the minimum side length or the direction of not reaching the minimum side length, and the decoding end determines which side length reaches the minimum side length according to the second identifier, and the quadtree is divided along Which two directions to divide. Or, according to the second identifier, it is determined which side lengths of the two directions have not reached the minimum side length, and in which two directions the quadtree is divided.
  • At least one first-type sub-block in the first-type sub-block is divided into at least one binary tree To obtain multiple third-type sub-blocks until the side lengths of the third-type sub-blocks in the three directions reach the minimum side length.
  • the first identifier is used to indicate the change division mode
  • the decoding end may determine the change division mode according to the first identifier, and the division mode includes octree division, quadtree division, and binary tree division.
  • the decoding end determines that the octree division is changed to a binary tree division according to the first identifier.
  • the second identifier is used to indicate the direction of reaching the minimum side length or the direction of not reaching the minimum side length.
  • the decoding end determines which side lengths of the two directions reach the minimum side length at the same time according to the second identifier. In which direction to divide, or according to the second identifier to determine which direction's side length does not reach the minimum side length, binary tree division along which direction.
  • the decoding end determines that the division ends according to the third identifier.
  • a possible implementation manner is that quadtree division or binary tree division is determined according to the first identifier and the second identifier; and the division ends according to the third identifier.
  • the first identifier when the first identifier is decoded into eight bits of 00000000, it means that the division mode is converted, and then the three bits of the second identifier are decoded, which are 000, 001, or 010; the 000, 001 And 010 respectively correspond to the side length in one direction, determine the side length in the corresponding direction according to the second identifier to reach the minimum side length, and divide the quadtree.
  • the code when the code is connected to the first identifier After four bits of 0000, it indicates the division mode conversion, and then the two bits of the second identifier are decoded as 00 or 01; the 00 and 01 respectively correspond to the side length of one of the remaining two directions, and the The side length of one of the remaining two directions of the corresponding direction reaches the minimum side length, and binary tree division is performed.
  • the first identifier when the first identifier is decoded into eight bits of 00000000, it means that the division mode is converted, and then the three bits of the second identifier are decoded.
  • the second identifier is 000, 001, or 010; the 000 , 001 and 010 respectively correspond to the side length in one direction, indicating that the side length in the corresponding direction reaches the minimum side length.
  • quadtree division it is determined that the side length in the corresponding direction reaches the minimum side length, and quadtree division is performed.
  • the quadtree division when the third identifier 000010 or 000011 is decoded, the division ends.
  • the first identifier when the first identifier is decoded into eight bits of 00000000, it means that the division method is converted, and then the three bits of the second identifier are decoded.
  • the second identifier is 100, 101 or 110; the 100 , 101 and 110 respectively correspond to the side length in one direction, indicating that the side length in the corresponding direction has not reached the minimum side length. That is, the side lengths in the other two directions simultaneously reach the minimum side length first, and the binary tree is divided.
  • the third identifier 00 when the third identifier 00 is decoded, the division ends.
  • the first identifier when the first identifier is decoded into eight bits of 00000000, it means that the division mode is converted, and then the three bits of the second identifier are decoded.
  • the second identifier is 100, 010, 001, 110 , 101 or 011, according to the value of the direction corresponding to the bit, determine whether the direction reaches the minimum side length, for example: the first bit, the second bit and the third bit, which in turn represent x, y, z, will reach
  • the bit position of the minimum side length is 1, and the bit position of the minimum side length is 0; for example: 100 indicates that the minimum side length is reached first in the x direction; 010 indicates that the minimum side length is reached first in the y direction; 001 indicates that the minimum side is reached first in the z direction Long; 110 means that the x and y directions both reach the minimum side length, 101 means that the x and z directions both reach the minimum side length, and 011 means that the y and z directions both reach
  • the bit position that reaches the minimum side length is 0, and the bit position that does not reach the minimum side length is 1; for example: 011 indicates that the minimum side length is reached first in the x direction; 101 indicates that the minimum side length is reached first in the y direction; 110 indicates the z direction The minimum side length is reached first; 001 indicates that the minimum side length is reached in both the x and y directions, 010 indicates the minimum side length is reached in both the x and z directions, and 100 indicates the minimum side length is reached in both y and z directions.
  • the correspondence between the three bits and the three directions is not limited in this embodiment of the present invention, and any adjustment can be made.
  • the third identifier is used to indicate the end of the division. For example, after the binary tree is decoded and decoded to two bits 00, it indicates that the division is ended. For example, after the quadtree is divided and decoded to 4 bits 0000 and two bits 10, or 4-bit 0000 and 2-bit 11 indicate the end of division.
  • S604 Obtain the position coordinates of the three-dimensional data point to be decoded according to the positions of the divided sub-blocks.
  • the hexahedron constructed to divide the distribution of spatial three-dimensional data points is a cuboid constructed according to the maximum value of the three directions. Inverse quantization of the decoded coordinate values opposite to the encoding end can obtain the actual position coordinate values of all three-dimensional data points.
  • the constructed hexahedron used to divide the distribution of spatial three-dimensional data points is a cube constructed according to the maximum value of the maximum values in the three directions.
  • the position coordinates of the three-dimensional data point to be encoded are obtained according to the position of the divided sub-blocks, the maximum value of the maximum values in the three directions, and the ratio of the lengths of the sides of the sub-blocks that are finally divided.
  • the first position coordinates of the three-dimensional data point to be encoded are obtained according to the positions of the divided sub-blocks; the ratio of the shortest side length of the divided sub-block to the side lengths in the remaining two directions is obtained ; The coordinate values of each coordinate in the remaining two directions are multiplied by the ratio of the directions.
  • inverse quantization of the decoded coordinate values opposite to the encoding end can obtain the actual position coordinate values of all three-dimensional data points.
  • the hexahedron constructed to divide the distribution of spatial three-dimensional data points is a cube constructed according to the minimum value of the maximum value in the three directions.
  • the position coordinates of the three-dimensional data point to be encoded are obtained according to the position of the divided sub-blocks, the minimum value of the maximum value in the three directions, and the ratio of each side length of the divided sub-block .
  • the first position coordinates of the three-dimensional data point to be coded are obtained according to the positions of the divided sub-blocks; the longest side length of the sub-block divided into the last obtained and the side lengths of the remaining two directions are obtained, respectively Ratio; the coordinate values of each coordinate in the remaining two directions are multiplied by the ratio of the directions.
  • inverse quantization of the decoded coordinate values opposite to the encoding end can obtain the actual position coordinate values of all three-dimensional data points.
  • it also includes: decoding the number of three-bit data points in the sub-block containing three-dimensional data points. When decoded to 0, it indicates that the corresponding sub-block contains 1 three-dimensional data point. When decoded to 1, it indicates that the corresponding The sub-block contains more than 1 three-dimensional data point, and then decodes the following bits. If the decoded value is N, it is determined that the number of included three-dimensional data points is N+1.
  • the code stream of the three-dimensional data points to be decoded is decoded by the decoding end, a hexahedron is constructed according to the decoded code stream, and the hexahedron is divided at least once by an octree to obtain multiple sub-blocks of the first type. At least one sub-block of the first type in the sub-blocks is divided into quadtrees and/or binary trees at least once, and the position coordinates of the three-dimensional data points to be decoded are obtained according to the positions of the divided subblocks.
  • Each side length is an integer power of 2 and is greater than or equal to and closest to the maximum value in the corresponding direction selected.
  • the rectangular parallelepiped is divided and encoded by an octree.
  • each layer of the octree is divided into sub-blocks using the coordinates of the center point of the current block, and the current block is divided into eight small sub-blocks through the center point.
  • the coordinates of the center point of the current cuboid block are (xmid, ymid, zmid)
  • the coordinate value range of the eight small sub-blocks in the octree division process is shown below.
  • the coordinate range of the first block is x ⁇ xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the second block is x ⁇ xmid, y ⁇ ymid, z>zmid
  • the coordinate of the third block The value range is x ⁇ xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the fourth block is x ⁇ xmid, y>ymid, z>zmid
  • the coordinate range of the fifth block is x> xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the sixth block is x>xmid, y ⁇ ymid, z>zmid
  • the coordinate range of the seventh block is x>xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the eighth block is x>xmid, y>ymid, z>zmid.
  • the sub-block division of the cuboid is performed layer by layer, and the division of each cuboid block is encoded one by one.
  • each layer is partitioned according to the median method. When the edge of one direction reaches the minimum side length first, then in the subsequent partition process, in this direction That is, no division is made.
  • the coordinate values in the direction are all selected to be less than or equal to the median interval.
  • x ⁇ xmid, y ⁇ ymid, z ⁇ zmid there are only four possibilities for the division process at this time, which are respectively possible, x ⁇ xmid, y ⁇ ymid, z ⁇ zmid, and possibly two, x ⁇ xmid, y ⁇ ymid, z>zmid, possibly three, x ⁇ xmid, y>ymid, z ⁇ zmid, possibly four, x ⁇ xmid, y>ymid, z>zmid, four possible corresponding 8-bit descriptions of octree division
  • the number is xxxx0000, where x needs to determine whether the corresponding bit is 0 or 1 according to whether the first four sub-blocks contain three-dimensional data points.
  • the two directions will not be divided in the next division process, that is, the coordinate values in these two directions are selected to be the half of the interval that is less than or equal to the median.
  • the division process at this time there are only two possibilities for the division process at this time, which are possible one, x ⁇ xmid, y ⁇ ymid, z ⁇ zmid, possible two, x ⁇ xmid, y ⁇ ymid, z>zmid, two possible corresponding 8-bit numbers describing octree partitioning are xx000000, where x needs to be based on whether the three-dimensional data points containing point clouds in the previous two sub-blocks Make sure the corresponding bit is 0 or 1. If the sides in the three directions reach the minimum side length, the tree division structure coding ends.
  • the number of 3D data points that encode the point cloud contained in each smallest sub-block is: when the current leaf node block contains a three-dimensional data point of a point cloud, directly encode a 0 to represent it.
  • the current leaf node block contains more than one point cloud of 3D data points, suppose the current leaf node block contains n point cloud of 3D data points, then a 1 will be encoded first, and then the value (n-1) will be encoded.
  • the binary bit stream encoded in the previous representation of the octree division is sent to the arithmetic encoding engine bit by bit for arithmetic encoding, and then the binary bit stream representing the number of 3D data points containing point clouds in the leaf node block is sent to the arithmetic encoding engine for Arithmetic coding.
  • the position coordinates in the point cloud data can be encoded.
  • the maximum value in the three directions can be written into the header information of the code stream file for use by the decoding end.
  • the cuboid when initializing the octree division according to the maximum value of the position coordinates obtained in the decoding header information in the three directions, according to these three values, the side lengths of the cuboid in the three directions when initializing the octree division are determined, Each side length is an integer power of 2 and is greater than or equal to and closest to the maximum value in the corresponding direction selected.
  • a tree structure at the time of encoding is constructed.
  • Each layer of octree is divided into sub-blocks using the coordinates of the center point of the current block, and the current block is divided into eight small sub-blocks through the center point. If the coordinates of the center point of the current cuboid block are (xmid, ymid, zmid), then the coordinate value range of the eight small sub-blocks in the octree division process is shown below.
  • the coordinate range of the corresponding first block is x ⁇ xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the second block is x ⁇ xmid, y ⁇ ymid, z>zmid
  • the third block The coordinate range of the coordinate is x ⁇ xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the fourth block is x ⁇ xmid, y>ymid, z>zmid
  • the coordinate range of the fifth block is x>xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the sixth block is x>xmid, y ⁇ ymid, z>zmid
  • the coordinate range of the seventh block is x>xmid, y> ymid, z ⁇ zmid
  • the coordinate range of the eighth block is x>xmid, y>ymid, z>zmid.
  • the current leaf node block contains only one point cloud of three-dimensional data points.
  • the current leaf node block contains more than one point cloud 3D data point, and then the value (n-1) will be decoded, indicating that the current leaf node block contains n point cloud 3D data points, in order
  • Decoding the position coordinate code stream can decode all the point cloud position coordinates. According to the above scheme, the decoding of the position coordinate code stream encoded by the encoding scheme can be achieved.
  • Initialize the cuboid to be divided For example, find the maximum values in three directions according to the position coordinates of all the three-dimensional data points of all point clouds, and find the maximum values in three directions respectively, and determine the cuboid shape when initializing the tree division according to the selected three values.
  • the side lengths in the three directions, each side length is an integer power of 2 and is greater than or equal to and closest to the maximum value in the corresponding direction selected.
  • the rectangular parallelepiped is divided and encoded by an octree.
  • each layer of the octree is divided into sub-blocks using the coordinates of the center point of the current block, and the current block is divided into eight small sub-blocks through the center point.
  • the coordinates of the center point of the current cuboid block are (xmid, ymid, zmid)
  • the coordinate value range of the eight small sub-blocks in the octree division process is shown below.
  • the coordinate range of the first block is x ⁇ xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the second block is x ⁇ xmid, y ⁇ ymid, z>zmid
  • the coordinate of the third block The value range is x ⁇ xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the fourth block is x ⁇ xmid, y>ymid, z>zmid
  • the coordinate range of the fifth block is x> xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the sixth block is x>xmid, y ⁇ ymid, z>zmid
  • the coordinate range of the seventh block is x>xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the eighth block is x>xmid, y>ymid, z>zmid.
  • the sixth sub-block contains 3D data points of a point cloud
  • none of the other sub-blocks contain 3D data points of a point cloud
  • the 8-bit coded at this time The binary code stream is 0010 0100.
  • the sub-block division of the cuboid is performed layer by layer, and the division of each cuboid block is encoded one by one.
  • each layer is partitioned according to the median method.
  • the division process has the following four possibilities, which are respectively possible: y ⁇ ymid, z ⁇ zmid, Possible two, y ⁇ ymid, z>zmid, possible three, y>ymid, z ⁇ zmid, possible four, y>ymid, z>zmid, then only 4 bits are needed to describe the current division situation.
  • the fourth block contains 3D data points of a point cloud
  • none of the other sub-blocks contain 3D data points of a point cloud
  • the binary code stream is 1001. If the sides in the two directions first reach the minimum side length, then in the next division process, the remaining one direction will be used for division coding. The coordinates in the direction that has reached the minimum side length will not participate in the next division coding.
  • Time tree division becomes binary tree division. Take the x and y axes as the first example when the minimum side length is reached. At this time, the division center is (zmid).
  • the division process has the following two possibilities, which are possible one, z ⁇ zmid, possible Second, z>zmid, only 2 bits are needed to describe the current division.
  • the encoded 2-bit binary code stream is 10 at this time. If the sides in the three directions reach the minimum side length, the tree division structure coding ends, and the number of three-dimensional data points of the point cloud contained in each minimum sub-block needs to be coded.
  • a possible implementation manner when the current leaf node block contains a three-dimensional data point of a point cloud, a 0 is directly encoded for representation.
  • the current leaf node block contains more than one point cloud of 3D data points
  • a 1 will be encoded first, and then the value (n-1) will be encoded.
  • Arithmetic coding According to the above process, the position coordinates in the point cloud data can be encoded.
  • the maximum values in the three directions are written into the header information of the code stream file for use by the decoding end.
  • Cuboid when initializing octree division According to the maximum value of the position coordinates obtained in the decoding header information in three directions, according to these three values, the side lengths of the three directions of the cuboid when initializing tree division are determined, each The side length is an integer power of 2 and is greater than or equal to and closest to the maximum value in the corresponding direction selected.
  • a tree structure at the time of encoding is constructed.
  • Each layer of octree is divided into sub-blocks using the coordinates of the center point of the current block, and the current block is divided into eight small sub-blocks through the center point. If the coordinates of the center point of the current cuboid block are (xmid, ymid, zmid), then the coordinate value range of the eight small sub-blocks in the octree division process is shown below.
  • the coordinate range of the corresponding first block is x ⁇ xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the second block is x ⁇ xmid, y ⁇ ymid, z>zmid
  • the third block The coordinate range of the coordinate is x ⁇ xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the fourth block is x ⁇ xmid, y>ymid, z>zmid
  • the coordinate range of the fifth block is x>xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the sixth block is x>xmid, y ⁇ ymid, z>zmid
  • the coordinate range of the seventh block is x>xmid, y> ymid, z ⁇ zmid
  • the coordinate range of the eighth block is x>xmid, y>ymid, z>zmid.
  • These eight blocks correspond to 8 bits from high to low in turn, a possible implementation: when the corresponding bit is 1, the corresponding sub-block will continue to be divided, when the corresponding bit is 0, the corresponding sub-block will not be further To divide. When the side length of the divided sub-block in a certain direction reaches the minimum side length, the next decoding is 4 bits each, and each bit corresponds to one of the four blocks in the quadtree division. When the corresponding bit is 1, it will be The corresponding sub-blocks are further divided. When the corresponding bit is 0, the corresponding sub-blocks are not further divided.
  • the next decoding is 2 bits each, and each bit corresponds to one of the two blocks in the binary tree division.
  • the corresponding bit is 1, it will be The corresponding sub-block continues to be divided, and when the corresponding is 0, the corresponding sub-block will not be further divided.
  • the division is stopped. Decode the number of 3D data points corresponding to the point cloud contained in the smallest sub-block. A possible implementation manner, when a 0 is decoded, the current leaf node block contains only one point cloud of three-dimensional data points.
  • the position coordinate code stream can decode all the point cloud position coordinates. According to the above solution, decoding of the position coordinate code stream encoded by the encoding solution of Embodiment 2 can be achieved.
  • the side lengths of the three directions of the cuboid, each side length is an integer power of 2 and is greater than or equal to and closest to the maximum value in the corresponding direction selected.
  • the rectangular parallelepiped is divided and encoded by an octree.
  • sub-block division of the cuboid is performed layer by layer, and the division of each cuboid block is encoded one by one.
  • each layer is divided according to the method of taking the median value, and it cannot guarantee that the side lengths in the three directions reach the minimum side length at the same time, and each case will be explained separately.
  • each layer of the octree is divided into sub-blocks using the coordinates of the center point of the current block, and the current block is divided into eight small sub-blocks through the center point . If the coordinates of the center point of the current cuboid block are (xmid, ymid, zmid), then the coordinate value range of the eight small sub-blocks in the octree division process is shown below.
  • the coordinate range of the first block is x ⁇ xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the second block is x ⁇ xmid, y ⁇ ymid, z>zmid
  • the coordinate of the third block The value range is x ⁇ xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the fourth block is x ⁇ xmid, y>ymid, z>zmid
  • the coordinate range of the fifth block is x> xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the sixth block is x>xmid, y ⁇ ymid, z>zmid
  • the coordinate range of the seventh block is x>xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the eighth block is x>xmid, y>ymid, z>zmid.
  • the sixth sub-block contains 3D data points of a point cloud
  • none of the other sub-blocks contain 3D data points of a point cloud
  • the 8-bit coded at this time The binary code stream is 0010 0100.
  • a possible implementation method is to encode 8 bits of 0, namely 0000 and 0000 for identification, and then encode 3 bits to describe which direction in the three directions reaches the minimum side length first, for example: corresponding
  • the relationship of 000 indicates that the side length in the x-axis direction reaches the minimum side length first
  • 001 indicates that the side length in the y-axis direction first reaches the minimum side length
  • 010 indicates that the side length in the z-axis direction first reaches the minimum side length.
  • the quadtree division coding is performed in two directions that have not reached the minimum side length. Take the x-axis reaching the minimum side length as an example for illustration. At this time, the division center is (ymid, zmid).
  • the division process has the following four possibilities, which are respectively possible: y ⁇ ymid, z ⁇ zmid, Possible two, y ⁇ ymid, z>zmid, possible three, y>ymid, z ⁇ zmid, possible four, y>ymid, z>zmid, then only 4 bits are needed to describe the current division situation.
  • the first block contains 3D data points of a point cloud
  • the fourth block contains 3D data points of a point cloud
  • none of the other sub-blocks contain 3D data points of a point cloud
  • the binary code stream is 1001.
  • the z-axis When the z-axis reaches the minimum side length, the z-axis is the remaining two directions y, z is the latter one in the order of x, y, and z Direction, so use 01 to represent.
  • the binary tree division coding is performed in a direction that does not reach the minimum side length.
  • the division center is (ymid).
  • possibility one, y ⁇ ymid, possibility two, and y>ymid there are the following two possibilities for the division process: possibility one, y ⁇ ymid, possibility two, and y>ymid.
  • the encoded 2-bit binary code stream is 10.
  • a possible implementation manner is to encode 4 bits of 0 or 0000 for identification first, and then encode 2 bits of 10 or 2 bits of 11 to mark the partitioning of the cuboid.
  • a possible implementation method first encode 8 bits of 0, that is, 0000 and 0000 to identify, and then encode 3 bits to describe that the remaining side of the three directions does not reach the minimum length Side length.
  • the specific corresponding relationship is 100 indicates that the side length in the x-axis direction has not reached the minimum side length, 101 indicates that the side length in the y-axis direction has not reached the minimum side length, and 110 indicates that the side length in the z-axis direction has not reached the minimum side length.
  • we start to encode binary trees in a direction that does not reach the minimum side length Take the x and y axes as the example when the minimum side length is reached first. The division center at this time is (zmid).
  • the division process has the following two possibilities, which are possible one, z ⁇ zmid, possible Second, z>zmid, only 2 bits are needed to describe the current division.
  • the encoded 2-bit binary code stream is 10 at this time.
  • the binary tree sub-blocks are divided in the order of layer-by-layer coding, and the division of each cuboid block is coded one by one.
  • coding 2-bit 00 indicates that the partition coding of the cuboid is ended.
  • the number of 3D data points of the point cloud contained in each smallest sub-block needs to be coded.
  • a possible implementation manner is that when the current leaf node block contains a three-dimensional data point of a point cloud, a 0 is directly encoded for representation.
  • the current leaf node block contains more than one point cloud of 3D data points, suppose the current leaf node block contains n point cloud of 3D data points, then a 1 will be encoded first, and then the value (n-1) will be encoded.
  • the maximum value of the maximum value in the three directions is written into the header information of the code stream file for use by the decoding end.
  • the side length is an integer power of 2 and is greater than or equal to and closest to the value .
  • decoding is performed according to the octree division, and 8 bits are decoded one by one to construct a tree structure during encoding.
  • Each layer of octree is divided into sub-blocks using the coordinates of the center point of the current block, and the current block is divided into eight small sub-blocks through the center point.
  • the sub-block division is obtained, the sub-block of the three-dimensional data point where the point cloud exists is determined according to the decoded 8 bits. If the bit corresponding to the sub-block is 1, it means that the sub-block has a three-dimensional data point in the point cloud, and will continue to be divided down.
  • bit corresponding to the sub-block is 0, it means that there is no 3D data point of the point cloud in this sub-block, and it will not continue to be divided down. Arithmetic decoding is performed bit by bit. When decoding to 8 bits of 0, that is, 0000 and 0000, there are various situations, which are described below.
  • the side length in the direction reaches the minimum side length first. If it decodes to 001, it means that the side length in the y-axis direction reaches the minimum side length first. If it decodes to 010, it means that the side length in the z-axis direction first reaches the minimum side length. It shows that the next code stream is to encode the quadtree in two directions that have not reached the minimum side length. Take the x-axis reaching the minimum side length as an example for illustration.
  • the division center is (ymid, zmid).
  • the division process has the following four possibilities, which are respectively possible: y ⁇ ymid, z ⁇ zmid, Possible two, y ⁇ ymid, z>zmid, possible three, y>ymid, z ⁇ zmid, possible four, y>ymid, z>zmid, then only 4 bits are needed to describe the current division situation.
  • the sub-blocks of the three-dimensional data points where the point cloud exists are determined according to the decoded 4 bits. If the bit corresponding to the sub-block is 1, it means that the sub-block has a three-dimensional data point in the point cloud, and will continue to be divided down.
  • bit corresponding to the sub-block is 0, it means that there is no 3D data point of the point cloud in this sub-block, and it will not continue to be divided down. Arithmetic decoding is performed bit by bit. When decoding to 4 bits of 0, that is, 0000, there are many cases, which are described below.
  • a possible implementation method when decoding to 4 bits of 0 or 0000, then decoding 2 bits, if decoding to 00, 01 means that one of the remaining two directions has reached the minimum side length, specific
  • 00 which means that the x, y, and z directions are the first in the remaining two directions
  • 01 means that the x, y, and z directions are the latter in the remaining two directions.
  • the following is a specific example, taking the x-axis to reach the minimum side length as an example for illustration. When the z-axis reaches the minimum side length, the z-axis is the remaining two directions y, z is the latter one in the order of x, y, and z Direction, so use 01 to represent.
  • the binary tree division coding is performed in a direction that does not reach the minimum side length.
  • the division center is (ymid).
  • possibility one possibility one
  • y ⁇ ymid possibility two
  • y>ymid there are the following two possibilities for the division process: possibility one, y ⁇ ymid, possibility two, and y>ymid.
  • possibility two possibility two
  • y>ymid only 2 bits are needed to describe the current division happensing.
  • it is changed to decode 2 bits at a time, and the sub-block where point cloud data exists is determined according to the decoded 2 bits. If the bit corresponding to the sub-block is 1, it means that the sub-block has a three-dimensional data point in the point cloud, and will continue to be divided down.
  • bit corresponding to the sub-block is 0, it means that there is no 3D data point of the point cloud in this sub-block, and it will not continue to be divided down. Arithmetic decoding is performed bit by bit. When 2 bits of 0 or 00 are decoded, it indicates that the partition decoding of the cuboid is completed.
  • a possible implementation method when decoding to 0 or 0000 of 4 bits, then decoding 2 bits, if decoding to 11 or 10, it means that the side length of the remaining two directions has also reached the minimum side length, indicating that The partition decoding of the cuboid ends.
  • a possible implementation method when decoding to 8 bits of 0, that is, 0000 and 0000, and then decoding 3 bits, if it decodes to 100, 101, and 110, it means that the latter is converted to binary division, and if decoded to 100, it indicates the x-axis direction
  • the length of the side does not reach the minimum side length. If decoded to 101, the side length in the y-axis direction does not reach the minimum side length. If decoded to 110, the side length in the z-axis direction does not reach the minimum side length.
  • the next code stream is binary tree division coding in the direction that does not reach the minimum side length. Take the x and y axes as the example when the minimum side length is reached first.
  • the division center at this time is (zmid).
  • the division process has the following two possibilities, which are possible one, z ⁇ zmid, possible Second, z>zmid, only 2 bits are needed to describe the current division.
  • the sub-blocks of the three-dimensional data points where the point cloud exists are determined according to the decoded 2 bits. If the bit corresponding to the sub-block is 1, it means that the sub-block has a three-dimensional data point in the point cloud, and will continue to be divided down. If the bit corresponding to the sub-block is 0, it means that there is no 3D data point of the point cloud in this sub-block, and it will not continue to be divided down. Arithmetic decoding is performed bit by bit, and when decoding to 0 or 00 of 2 bits, it indicates that the partition decoding of the cuboid is ended.
  • a possible implementation method when decoding to 8 bits of 0, that is, 0000, 0000, and then decoding 3 bits, if decoding to 111, it means that the minimum side length has been reached in three directions at the same time, indicating that the partition decoding of the cuboid is ended.
  • a possible implementation method when the octree, the quadtree, and the binary tree are mixed, set the side length of the first direction to end the division to a, the side length of the second end to the division direction to b, and the third direction to end the division
  • the side length is c
  • the side length c is the true minimum side length.
  • Gu can multiply the position coordinates of the direction that ends the first division by c/a to achieve scaling of the direction that ends the first division, and multiply the position coordinates of the direction that ends the second division by c/b. Achieve the scaling of the direction that ends the second division.
  • the position coordinates of the octree, quadtree and binary tree can be decoded.
  • Another possible implementation manner when the octree and quadtree are mixed, let the side length of the direction where the division ends first be a, and the side length of the two division directions that end at the same time be d. Gu can multiply the position coordinates of the direction where the division ends first by d/a to achieve the scaling of the direction where the division ends first. According to the above method, the position coordinates of the octree and quadtree can be decoded.
  • Another possible implementation manner when the octree and binary tree are mixed, let the side length of the two directions ending the division first be a, and the side length of the direction ending the division next be e. Gu can multiply the position coordinates of the first two directions by multiplying by e/a to achieve the scaling of the first two directions. According to the above method, the position coordinates of the octree and binary tree can be decoded.
  • the three directions end the division at the same time, which means that the side lengths of the three directions reach the minimum side length at the same time, and no scaling is needed at this time.
  • the position coordinate code stream can decode all the point cloud position coordinates. According to the above solution, decoding of the position coordinate code stream encoded by the encoding solution of Embodiment 3 can be achieved.
  • the side lengths of the three directions of the cuboid, each side length is an integer power of 2 and is greater than or equal to and closest to the maximum value in the corresponding direction selected.
  • the rectangular parallelepiped is coded.
  • sub-block division of the cuboid is performed layer by layer, and the division of each cuboid block is encoded one by one.
  • each layer is divided according to the method of taking the median value, and it cannot guarantee that the side lengths in the three directions reach the minimum side length at the same time, and each case will be explained separately.
  • each layer of the octree is divided into sub-blocks using the coordinates of the center point of the current block, and the current block is divided into eight small sub-blocks through the center point . If the coordinates of the center point of the current cuboid block are (xmid, ymid, zmid), then the coordinate value range of the eight small sub-blocks in the octree division process is shown below.
  • the coordinate range of the first block is x ⁇ xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the second block is x ⁇ xmid, y ⁇ ymid, z>zmid
  • the coordinate of the third block The value range is x ⁇ xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the fourth block is x ⁇ xmid, y>ymid, z>zmid
  • the coordinate range of the fifth block is x> xmid, y ⁇ ymid, z ⁇ zmid
  • the coordinate range of the sixth block is x>xmid, y ⁇ ymid, z>zmid
  • the coordinate range of the seventh block is x>xmid, y>ymid, z ⁇ zmid
  • the coordinate range of the eighth block is x>xmid, y>ymid, z>zmid.
  • the sixth sub-block contains 3D data points of a point cloud
  • none of the other sub-blocks contain 3D data points of a point cloud
  • the 8-bit coded at this time The binary code stream is 0010 0100.
  • a possible implementation method when the side in one direction reaches the minimum side length first, encode 8 bits of 0, that is, 0000 and 0000 for identification, and then encode 3 bits to describe which direction in the three directions reaches the minimum side length first.
  • the relationship of 000 indicates that the side length in the x-axis direction reaches the minimum side length first
  • 001 indicates that the side length in the y-axis direction first reaches the minimum side length
  • 010 indicates that the side length in the z-axis direction first reaches the minimum side length.
  • the quadtree division coding is performed in two directions that have not reached the minimum side length. Take the x-axis reaching the minimum side length as an example for illustration. At this time, the division center is (ymid, zmid).
  • the division process has the following four possibilities, which are respectively possible: y ⁇ ymid, z ⁇ zmid, Possible two, y ⁇ ymid, z>zmid, possible three, y>ymid, z ⁇ zmid, possible four, y>ymid, z>zmid, then only 4 bits are needed to describe the current division situation.
  • the first block contains 3D data points of a point cloud
  • the fourth block contains 3D data points of a point cloud
  • none of the other sub-blocks contain 3D data points of a point cloud
  • the binary code stream is 1001.
  • the z-axis When the z-axis reaches the minimum side length, the z-axis is the remaining two directions y, z is the latter one in the order of x, y, and z Direction, so use 01 to represent.
  • the binary tree division coding is performed in a direction that does not reach the minimum side length.
  • the division center is (ymid).
  • possibility one possibility one
  • y ⁇ ymid possibility two
  • y>ymid there are the following two possibilities for the division process.
  • only 2 bits are needed to describe the current division happensing. For example, when the first block contains three-dimensional data points of a point cloud, and the second block does not contain three-dimensional data points of a point cloud, the encoded 2-bit binary code stream is 10 at this time.
  • a possible implementation method When the remaining two directions reach the minimum side length at the same time, a possible implementation method: combine the directions that have reached the minimum side length before the combination, and all three directions have reached the minimum side length. At this time, the 4-bit 0 or 0000 is coded for identification, and then the 2-bit 10 or 11 logo is coded to encode the rectangular block.
  • a possible implementation method first encode 8 bits of 0, that is, 0000 and 0000 to identify, and then encode 3 bits to describe that the remaining side of the three directions does not reach the minimum length Side length.
  • the specific corresponding relationship is 100 indicates that the side length in the x-axis direction has not reached the minimum side length, 101 indicates that the side length in the y-axis direction has not reached the minimum side length, and 110 indicates that the side length in the z-axis direction has not reached the minimum side length.
  • we start to encode binary trees in a direction that does not reach the minimum side length Take the x and y axes as the example when the minimum side length is reached first. The division center at this time is (zmid).
  • the division process has the following two possibilities, which are possible one, z ⁇ zmid, possible Second, z>zmid, only 2 bits are needed to describe the current division.
  • the encoded 2-bit binary code stream is 10 at this time.
  • the binary tree sub-blocks are divided in the order of layer-by-layer coding, and the division of each cuboid block is coded one by one.
  • coding 2-bit 00 indicates that the partition coding of the cuboid is ended.
  • a possible implementation method first encode the 8-bit 0, that is, 0000, and 0000, and then encode the 3-bit, 111 mark to divide the cuboid.
  • the number of 3D data points of the point cloud contained in each smallest sub-block needs to be coded.
  • a possible implementation manner when the current leaf node block contains a three-dimensional data point of a point cloud, a 0 is directly encoded for representation.
  • the current leaf node block contains more than one point cloud of 3D data points, suppose the current leaf node block contains n point cloud of 3D data points, then a 1 will be encoded first, and then the value (n-1) will be encoded.
  • the minimum value of the maximum value in the three directions is written into the header information of the code stream file for use by the decoding end.
  • Initialize the cube when initializing the tree division according to the minimum value of the maximum value of the position coordinates obtained in the decoding header information in three directions, use this value to initialize the side length of the cube during the tree division, the side length is an integer of 2
  • the power is greater than or equal to and closest to this value.
  • decoding is performed according to the octree division, and 8 bits are decoded one by one to construct a tree structure during encoding.
  • Each layer of octree is divided into sub-blocks using the coordinates of the center point of the current block, and the current block is divided into eight small sub-blocks through the center point.
  • the sub-block division is obtained, the sub-block of the three-dimensional data point where the point cloud exists is determined according to the decoded 8 bits. If the bit corresponding to the sub-block is 1, it means that the sub-block has a three-dimensional data point in the point cloud, and will continue to be divided down.
  • bit corresponding to the sub-block is 0, it means that there is no 3D data point of the point cloud in this sub-block, and it will not continue to be divided down. Arithmetic decoding is performed bit by bit. When decoding to 8 bits of 0, that is, 0000 and 0000, there are various situations, which are described below.
  • the side length in the direction reaches the minimum side length first. If it decodes to 001, it means that the side length in the y-axis direction reaches the minimum side length first. If it decodes to 010, it means that the side length in the z-axis direction first reaches the minimum side length. It shows that the next code stream is to encode the quadtree in two directions that have not reached the minimum side length. Take the x-axis reaching the minimum side length as an example for illustration.
  • the division center is (ymid, zmid).
  • the division process has the following four possibilities, which are respectively possible: y ⁇ ymid, z ⁇ zmid, Possible two, y ⁇ ymid, z>zmid, possible three, y>ymid, z ⁇ zmid, possible four, y>ymid, z>zmid, then only 4 bits are needed to describe the current division situation.
  • the sub-blocks of the three-dimensional data points where the point cloud exists are determined according to the decoded 4 bits. If the bit corresponding to the sub-block is 1, it means that the sub-block has a three-dimensional data point in the point cloud, and will continue to be divided down.
  • bit corresponding to the sub-block is 0, it means that there is no 3D data point of the point cloud in this sub-block, and it will not continue to be divided down. Arithmetic decoding is performed bit by bit. When decoding to 4 bits of 0, that is, 0000, there are many cases, which are described below.
  • a possible implementation method when decoding to 4 bits of 0 or 0000, then decoding 2 bits, if decoding to 00, 01 means that one of the remaining two directions has reached the minimum side length,
  • the specific corresponding relationship is 00, which means that the x, y, and z directions are the first in the remaining two directions, and 01 means that the x, y, and z directions are the latter in the remaining two directions.
  • the following is a specific example, taking the x-axis to reach the minimum side length as an example for illustration. When the z-axis reaches the minimum side length, the z-axis is the remaining two directions y, z is the latter one in the order of x, y, and z Direction, so use 01 to represent.
  • the binary tree division coding is performed in a direction that does not reach the minimum side length.
  • the division center is (ymid).
  • possibility one possibility one, y ⁇ ymid, maybe two, and y>ymid.
  • y ⁇ ymid possibility one
  • y>ymid possibility one
  • only 2 bits are needed to describe the current division happensing.
  • it is changed to decode 2 bits at a time, and the sub-block where point cloud data exists is determined according to the decoded 2 bits. If the bit corresponding to the sub-block is 1, it means that the sub-block has a three-dimensional data point in the point cloud, and will continue to be divided down.
  • bit corresponding to the sub-block is 0, it means that there is no 3D data point of the point cloud in this sub-block, and it will not continue to be divided down. Arithmetic decoding is performed bit by bit. When 2 bits of 0 or 00 are decoded, it indicates that the partition decoding of the cuboid is completed.
  • a possible implementation method when decoding to 8 bits of 0, that is, 0000 and 0000, and then decoding 3 bits, if it decodes to 100, 101, and 110, it means that the latter is converted to binary division, and if decoded to 100, it indicates the x-axis direction
  • the length of the side does not reach the minimum side length. If decoded to 101, the side length in the y-axis direction does not reach the minimum side length. If decoded to 110, the side length in the z-axis direction does not reach the minimum side length.
  • the next code stream is binary tree division coding in the direction that does not reach the minimum side length. Take the x and y axes as the example when the minimum side length is reached first.
  • the division center at this time is (zmid).
  • the division process has the following two possibilities, which are possible one, z ⁇ zmid, possible Second, z>zmid, only 2 bits are needed to describe the current division.
  • the sub-blocks of the three-dimensional data points where the point cloud exists are determined according to the decoded 2 bits. If the bit corresponding to the sub-block is 1, it means that the sub-block has a three-dimensional data point in the point cloud, and will continue to be divided down. If the bit corresponding to the sub-block is 0, it means that there is no 3D data point of the point cloud in this sub-block, and it will not continue to be divided down. Arithmetic decoding is performed bit by bit, and when decoding to 0 or 00 of 2 bits, it indicates that the partition decoding of the cuboid is ended.
  • a possible implementation method when decoding to 8 bits of 0, that is, 0000, 0000, and then decoding 3 bits, if decoding to 111, it means that the minimum side length has been reached in three directions at the same time, indicating that the partition decoding of the cuboid is ended.
  • a possible implementation method when the octree, the quadtree, and the binary tree are mixed, set the side length of the first direction to end the division to a, the side length of the second end to the division direction to b, and the third direction to end the division
  • the side length is c
  • the side length a is the true minimum side length.
  • Gu can multiply the position coordinates of the second ending direction by a/b to achieve the scaling of the second ending direction.
  • the position coordinates of the third ending division direction are all multiplied by a/c to achieve the scaling of the third ending division direction. According to the above method, the position coordinates of the octree, quadtree and binary tree can be decoded.
  • Another possible implementation method when the octree and quadtree are mixed, set the side length of the direction that ends the division first as a, and the side length of the two division directions that end at the same time as d, at this time the side length a is the true minimum side length. Gu can multiply the position coordinates of the two directions at the same time by a/d to achieve the scaling of the two directions at the same time. According to the above method, the position coordinates of the octree and quadtree can be decoded.
  • Another possible implementation method when the octree and binary tree are mixed, set the side length of the first two directions to end the division to a, and then the side length of the direction to end the division to e, then the side length a is the true minimum Side length. Gu can multiply the position coordinates in the direction of the last ending division by a/e to achieve the scaling in the direction of the last ending division. According to the above method, the position coordinates of the octree and binary tree can be decoded.
  • the three directions end the division at the same time, which means that the side lengths of the three directions reach the minimum side length at the same time, and no scaling is needed at this time.
  • the position coordinate code stream can decode all the point cloud position coordinates. According to the above solution, decoding of the position coordinate code stream encoded by the encoding solution of Embodiment 4 can be achieved.
  • FIG. 9 is a schematic structural diagram of a three-dimensional data point encoding apparatus according to an embodiment of the present invention.
  • the apparatus in this embodiment includes: a processor 901 and a memory 902, where,
  • the processor 901 is configured to determine the maximum value of the side lengths in three directions of the cuboid of the three-dimensional data point to be encoded according to the position coordinates of the three-dimensional data point to be encoded;
  • the processor 901 is further configured to divide the cuboid at least once into an octree to obtain multiple sub-blocks of the first type;
  • the processor 901 is further configured to perform at least one quadtree division and/or binary tree division on at least one first-type subblock in the first-type subblocks;
  • the processor 901 is further configured to encode the three-dimensional data point to be encoded according to the division result of the rectangular parallelepiped;
  • the memory 902 is used to store the encoded code stream.
  • the processor 901 is specifically configured to perform at least one quadtree division on at least one sub-block of the first type in the sub-blocks of the first type to obtain sub-blocks of the second type, until two sub-blocks of the second type The side length in each direction reaches the minimum side length; at least one second-type sub-block among the second-type sub-blocks is divided into at least one binary tree to obtain a third-type sub-block, up to three times of the third-type sub-block The side length in each direction reaches the minimum side length.
  • the processor 901 is specifically configured to perform at least one quadtree division on at least one first-type sub-block among the first-type sub-blocks to obtain multiple second-type sub-blocks until the second-type sub-block
  • the side lengths in the three directions reach the minimum side length.
  • the processor 901 is specifically configured to perform at least one binary tree division on at least one sub-block of the first type in the sub-blocks of the first type to obtain multiple sub-blocks of the third type, up to three times of the sub-blocks of the third type
  • the side length in each direction reaches the minimum side length.
  • the processor 901 is specifically configured to determine the first type of target sub-blocks in the first type of sub-blocks, the side length of one direction of the first type of target sub-block reaches the minimum side length and the The first-type target sub-block contains three-dimensional data points; at least one quadtree division is performed on the first-type target sub-block; the second-type target sub-block in the second-type sub-block is determined, the second The side length of the target sub-block in two directions reaches the minimum side length and the second type of target sub-block contains three-dimensional data points; at least one binary tree division is performed on the second type of target sub-block.
  • the processor 901 is specifically configured to determine the first type of target sub-blocks in the first type of sub-blocks, the side length of one direction of the first type of target sub-block reaches the minimum side length and the The first-type target sub-block contains three-dimensional data points; at least one quadtree division is performed on the first-type target sub-block.
  • the processor 901 is specifically configured to determine the first type of target sub-blocks in the first type of sub-blocks.
  • the first-type target sub-block contains three-dimensional data points; at least one binary tree division is performed on the first-type target sub-block.
  • the processor 901 is specifically configured to sequentially encode each division situation according to the division order and the three-dimensional data point situation included in the sub-block obtained by each division.
  • the processor 901 is specifically configured to obtain a code stream corresponding to each division according to the case where the sub-block obtained by each division contains three-dimensional data points; and according to the division order, sequentially encode the code stream corresponding to each division.
  • the processor 901 is specifically configured to obtain a bit stream corresponding to each sub-block according to the situation of the three-dimensional data points contained in the sub-blocks obtained by each division, and each sub-block corresponds to one bit, including the sub of the three-dimensional data points
  • the bit value of a block and a sub-block that does not contain a three-dimensional data point are different; according to the bit value corresponding to the sub-block, a code stream corresponding to each division is generated.
  • the code stream corresponding to each division includes 8 bits
  • the processor 901 is specifically configured to perform at least one of the following operations:
  • the 8-bit bit value is determined according to the three-dimensional data points contained in the eight sub-blocks obtained by the division;
  • bit value of 2 of the 8 bits is determined according to the 3D data points contained in the two sub-blocks obtained by the division, and the bit values of the remaining 6 bits and the children that do not contain the 3D data point The bit value of the block is the same.
  • the processor 901 is specifically configured to perform at least one of the following operations:
  • the code stream corresponding to each division is 8 bits, and the bit value of the 8 bits is determined according to the three-dimensional data points contained in the eight sub-blocks obtained by the division;
  • the bit value of the 4 bits is determined according to the three-dimensional data points contained in the four sub-blocks obtained by the division;
  • the bit value of the 2 bits is determined according to the three-dimensional data points included in the two sub-blocks obtained by the division.
  • bit value corresponding to the sub-block containing the point cloud 3D data point is 0, and the bit value corresponding to the sub-block not containing the point cloud 3D data point is 1;
  • the bit value corresponding to the sub-block containing the point cloud 3D data point is 0, and the bit value corresponding to the sub-block not containing the point cloud 3D data point is 1.
  • the processor 901 is further configured to encode a first identifier when the side length in one direction or two directions in the divided sub-blocks reaches the minimum side length, and the first identifier is used to indicate that the division is changed Way, the division way is octree division, quadtree division or binary tree division.
  • the first identifier is 8 bits, and The 8-bit bit values are all consistent with the bit values corresponding to sub-blocks that do not contain 3D data points;
  • the first identifier is 4 bits, and the bit values of the 4 bits all correspond to the subblocks that do not contain 3D data points. The bit values are consistent.
  • the processor 901 is further used to encode a second identifier, and the second identifier is used to indicate a direction that reaches the minimum side length or a direction that does not reach the minimum side length.
  • the second identifier is 3 bits or 2 bits.
  • the processor 901 is further used to encode a third identifier, and the third identifier is used to indicate the end of the division.
  • the processor 901 is further configured to encode the maximum value of the position coordinates of the three-dimensional data point to be encoded in three directions, and write the maximum value in the three directions into the information header.
  • the processor 901 is further configured to encode the maximum value of the position coordinates of the three-dimensional data point to be encoded among the maximum values of the three directions, and write the maximum value of the maximum values of the three directions into the information In the head.
  • the processor 901 is further configured to encode the minimum value of the position coordinates of the three-dimensional data point to be encoded among the maximum values of the three directions, and write the minimum value among the maximum values of the three directions into the information In the head.
  • the processor 901 is specifically configured to quantize the position coordinates of the three-dimensional data point to be encoded; according to the position coordinates of the quantized three-dimensional data point, obtain the maximum value of the three-dimensional data point position coordinates in three directions; According to the maximum value of the position coordinates of the three-dimensional data point in the three directions, the maximum value of the side length in the three directions of the cuboid of the three-dimensional data point to be encoded is determined.
  • the processor 901 is specifically configured to acquire, in each direction, a value that is greater than or equal to the integer power of 2 of the maximum value of the position coordinates of the three-dimensional data point and is closest to the maximum value.
  • the processor 901 is further configured to encode the number of three-dimensional data points in a sub-block containing three-dimensional data points.
  • the device of this embodiment can be correspondingly used to execute the technical solutions of any of the method embodiments described in FIG. 1 to FIG. 5.
  • the implementation principles and technical effects are similar, and details are not described herein again.
  • the device in this embodiment includes: a processor 1001 and a memory 1002, where the processor 1001 is used to decode a code of a three-dimensional data point to be decoded
  • the processor 1001 is also used to construct a hexahedron based on the decoded code stream, and divide the hexahedron at least once into an octree to obtain multiple sub-blocks of the first type; the processor 1001 is also used to At least one first-type sub-block in the first-type sub-block is divided into at least one quadtree and/or binary tree; the processor 1001 is further configured to obtain three-dimensional data to be decoded according to the position of the divided subblock The position coordinates of the point.
  • the memory 1002 is used to store the position coordinates of the three-dimensional data point to be decoded.
  • hexahedron is a rectangular parallelepiped
  • the processor 1001 is specifically configured to perform at least one quadtree division on at least one sub-block of the first type among the sub-blocks of the first type to obtain sub-blocks of the second type, until two sub-blocks of the second type The side length in each direction reaches the minimum side length; at least one second-type sub-block in the second-type sub-block is divided into at least one binary tree to obtain a third-type sub-block until the third type of the second-type sub-block The side length in each direction reaches the minimum side length.
  • hexahedron is a rectangular parallelepiped
  • the processor 1001 is specifically configured to perform at least one quadtree division on at least one first-type sub-block among the first-type sub-blocks to obtain multiple second-type sub-blocks until the second-type sub-block
  • the side lengths in the three directions reach the minimum side length.
  • hexahedron is a rectangular parallelepiped
  • the processor 1001 is specifically configured to perform at least one binary tree division on at least one first-type sub-block among the first-type sub-blocks to obtain multiple third-type sub-blocks until three of the third-type sub-blocks The side length in each direction reaches the minimum side length.
  • the processor 1001 is specifically configured to determine the first type of target sub-block according to the bit value corresponding to the first type of sub-block, and the bit value of the first type of target sub-block indicates that the sub-block contains three-dimensional data point;
  • the target sub-block of the second type is determined, and the bit value of the target sub-block of the second type indicates that the sub-block contains three-dimensional data points;
  • At least one binary tree division is performed on the target sub-blocks of the second type.
  • the processor 1001 is specifically configured to determine the first type of target sub-block according to the bit value corresponding to the first type of sub-block, and the bit value of the first type of target sub-block indicates that the sub-block contains three-dimensional data point;
  • At least one quadtree division is performed on the target sub-blocks of the first type.
  • the processor 1001 is specifically configured to determine the first type of target sub-block according to the bit value corresponding to the first type of sub-block, and the bit value of the first type of target sub-block indicates that the sub-block contains three-dimensional data point;
  • At least one binary tree division is performed on the target sub-blocks of the first type.
  • the processor 1001 is specifically further configured to decode the first identifier, and the first identifier is used to indicate a change to the division mode, and the division mode is octree division, quadtree division, or binary tree division; Based on the first identifier, a change division method is determined.
  • the processor 1001 is further specifically configured to decode a second identifier, and the second identifier is used to indicate a direction that reaches the minimum side length or a direction that does not reach the minimum side length; according to the second identifier , Determine the direction of reaching the minimum side length or the direction of not reaching the minimum side length.
  • the processor 1001 is further used to decode a third identifier, and the third identifier is used to indicate the end of division.
  • hexahedron is a cube
  • the processor 1001 is specifically configured to determine the quadtree division or the binary tree division according to the first identifier and the second identifier; determine the end of the division according to the third identifier.
  • the processor 1001 is specifically configured to decode the maximum value of the position coordinates of the three-dimensional data point to be decoded in three directions; construct a cuboid according to the maximum value of the three directions.
  • the processor 1001 is specifically configured to decode the maximum value of the maximum position coordinates of the three-dimensional data point to be decoded in three directions; construct a cube according to the maximum value of the maximum value of the three directions; according to the division The obtained sub-block position, the maximum value of the maximum values in the three directions, and the ratio of each side length divided into the sub-block finally obtained, to obtain the position coordinates of the three-dimensional data point to be encoded.
  • the processor 1001 is specifically configured to obtain the first position coordinates of the three-dimensional data point to be encoded according to the positions of the divided sub-blocks; obtain the shortest side lengths of the sub-blocks divided into the last The ratio of the side lengths of the remaining two directions; the coordinate value of each coordinate in the remaining two directions is multiplied by the ratio of the directions.
  • the processor 1001 is specifically configured to decode the minimum value of the maximum value of the position coordinates of the three-dimensional data point to be decoded in three directions; construct a cube according to the minimum value of the maximum value of the three directions; according to the division The obtained position of the sub-block, the minimum value of the maximum value in the three directions, and the ratio of each side length divided into the sub-block to obtain the position coordinates of the three-dimensional data point to be encoded.
  • the processor 1001 is specifically configured to obtain the first position coordinates of the three-dimensional data point to be encoded according to the positions of the divided sub-blocks; obtain the longest side lengths of the divided sub-blocks obtained finally The ratio of the side length to the other two directions; the coordinate value of each coordinate in the other two directions is multiplied by the ratio of the direction.
  • the device of this embodiment can be correspondingly used to execute the technical solution of the method embodiment shown in FIG. 6, and its implementation principles and technical effects are similar, and are not repeated here.
  • An embodiment of the present invention also provides an encoder, including: a memory, a processor, and a program stored on the memory and executable on the processor, and the processor implements the program to implement FIG. 1-FIG. 5 Any one of the three-dimensional data point coding methods.
  • An embodiment of the present invention further provides a decoder, which is characterized by comprising: a memory, a processor, and a program stored on the memory and executable on the processor, which is implemented when the processor executes the program
  • a decoder which is characterized by comprising: a memory, a processor, and a program stored on the memory and executable on the processor, which is implemented when the processor executes the program
  • the above three-dimensional data point may be any three-dimensional data point in the point cloud data acquired by the distance measuring device.
  • the distance measuring device may be an electronic device such as a laser radar or a laser distance measuring device.
  • the distance measuring device is used to sense external environment information, for example, distance information, azimuth information, reflection intensity information, speed information, etc. of the environmental target.
  • One three-dimensional data point may include at least one of the external environment information measured by the distance measuring device.
  • the distance measuring device can detect the distance between the detecting object and the distance measuring device by measuring the time of light propagation between the distance measuring device and the detection object, that is, Time-of-Flight (TOF).
  • TOF Time-of-Flight
  • the distance measuring device may also detect the distance between the detected object and the distance measuring device through other techniques, such as a distance measuring method based on phase shift measurement, or a distance measuring method based on frequency shift measurement. There are no restrictions.
  • the distance measuring device that generates the three-dimensional data points mentioned herein will be described as an example in conjunction with the distance measuring device 100 shown in FIG. 11.
  • the distance measuring device 100 may include a transmitting circuit 110, a receiving circuit 120, a sampling circuit 130 and an arithmetic circuit 140.
  • the transmission circuit 110 may transmit a sequence of light pulses (for example, a sequence of laser pulses).
  • the receiving circuit 120 can receive the optical pulse sequence reflected by the detected object, and photoelectrically convert the optical pulse sequence to obtain an electrical signal, which can be output to the sampling circuit 130 after processing the electrical signal.
  • the sampling circuit 130 may sample the electrical signal to obtain the sampling result.
  • the arithmetic circuit 140 may determine the distance between the distance measuring device 100 and the detected object based on the sampling result of the sampling circuit 130.
  • the distance measuring device 100 may further include a control circuit 150, which can control other circuits, for example, can control the working time of each circuit and/or set parameters for each circuit.
  • a control circuit 150 can control other circuits, for example, can control the working time of each circuit and/or set parameters for each circuit.
  • the distance measuring device shown in FIG. 11 includes a transmitting circuit, a receiving circuit, a sampling circuit, and an arithmetic circuit for emitting a beam of light for detection
  • the embodiments of the present application are not limited thereto, and the transmitting circuit
  • the number of any one of the receiving circuit, the sampling circuit, and the arithmetic circuit may also be at least two, for emitting at least two light beams in the same direction or respectively in different directions; wherein, the at least two light paths may be simultaneously
  • the shot may be shot at different times.
  • the light-emitting chips in the at least two emission circuits are packaged in the same module.
  • each emitting circuit includes a laser emitting chip, and the die in the laser emitting chips in the at least two emitting circuits are packaged together and housed in the same packaging space.
  • the distance measuring device 100 may further include a scanning module 160 for emitting at least one laser pulse sequence emitted from the transmitting circuit by changing the propagation direction.
  • the module including the transmitting circuit 110, the receiving circuit 120, the sampling circuit 130, and the arithmetic circuit 140, or the module including the transmitting circuit 110, the receiving circuit 120, the sampling circuit 130, the arithmetic circuit 140, and the control circuit 150 may be referred to as a measurement
  • the distance measuring module 150 may be independent of other modules, for example, the scanning module 160.
  • a coaxial optical path may be used in the distance measuring device, that is, the light beam emitted by the distance measuring device and the reflected light beam share at least part of the optical path in the distance measuring device.
  • the distance measuring device may also adopt an off-axis optical path, that is, the light beam emitted from the distance measuring device and the reflected light beam are respectively transmitted along different optical paths in the distance measuring device.
  • FIG. 12 shows a schematic diagram of an embodiment of the distance measuring device of the present invention using a coaxial optical path.
  • the distance measuring device 200 includes a distance measuring module 201.
  • the distance measuring module 210 includes a transmitter 203 (which may include the above-mentioned transmitting circuit), a collimating element 204, and a detector 205 (which may include the above-mentioned receiving circuit, sampling circuit, and arithmetic circuit) and Optical path changing element 206.
  • the distance measuring module 210 is used to emit a light beam and receive back light, and convert the back light into an electrical signal.
  • the transmitter 203 may be used to transmit a light pulse sequence.
  • the transmitter 203 may emit a sequence of laser pulses.
  • the laser beam emitted by the transmitter 203 is a narrow-bandwidth beam with a wavelength outside the visible light range.
  • the collimating element 204 is disposed on the exit optical path of the emitter, and is used to collimate the light beam emitted from the emitter 203, and collimate the light beam emitted by the emitter 203 into parallel light to the scanning module.
  • the collimating element is also used to converge at least a part of the return light reflected by the detection object.
  • the collimating element 204 may be a collimating lens or other element capable of collimating the light beam.
  • the optical path changing element 206 is used to combine the transmitting optical path and the receiving optical path in the distance measuring device before the collimating element 104, so that the transmitting optical path and the receiving optical path can share the same collimating element, so that the optical path More compact.
  • the transmitter 103 and the detector 105 may use respective collimating elements, and the optical path changing element 206 is disposed on the optical path behind the collimating element.
  • the light path changing element can use a small-area mirror to convert The transmitting optical path and the receiving optical path are combined.
  • the optical path changing element may also use a mirror with a through hole, where the through hole is used to transmit the light emitted by the emitter 203, and the mirror is used to reflect the return light to the detector 205. In this way, it is possible to reduce the blocking of the return light by the support of the small mirror in the case of using the small mirror.
  • the optical path changing element is offset from the optical axis of the collimating element 204. In some other implementations, the optical path changing element may also be located on the optical axis of the collimating element 204.
  • the distance measuring device 200 further includes a scanning module 202.
  • the scanning module 202 is placed on the exit optical path of the distance measuring module 201, and the scanning module 102 is used to change the transmission direction of the collimated light beam 219 emitted through the collimating element 204 and project it to the external environment, and project the return light to the collimating element 204 .
  • the returned light is converged on the detector 105 via the collimating element 104.
  • the scanning module 202 may include at least one optical element for changing the propagation path of the light beam, wherein the optical element may change the propagation path of the light beam by reflecting, refracting, diffracting, etc. the light beam.
  • the scanning module 202 includes a lens, a mirror, a prism, a galvanometer, a grating, a liquid crystal, an optical phased array (Optical Phased Array), or any combination of the above optical elements.
  • at least part of the optical element is moving, for example, the at least part of the optical element is driven to move by a driving module, and the moving optical element can reflect, refract or diffract the light beam to different directions at different times.
  • multiple optical elements of the scanning module 202 may rotate or vibrate about a common axis 209, and each rotating or vibrating optical element is used to continuously change the direction of propagation of the incident light beam.
  • the multiple optical elements of the scanning module 202 may rotate at different rotation speeds, or vibrate at different speeds.
  • at least part of the optical elements of the scanning module 202 can rotate at substantially the same rotational speed.
  • the multiple optical elements of the scanning module may also rotate around different axes.
  • the multiple optical elements of the scanning module may also rotate in the same direction, or rotate in different directions; or vibrate in the same direction, or vibrate in different directions, which is not limited herein.
  • the scanning module 202 includes a first optical element 214 and a driver 216 connected to the first optical element 214.
  • the driver 216 is used to drive the first optical element 214 to rotate about a rotation axis 209 to change the first optical element 214 The direction of the collimated light beam 219.
  • the first optical element 214 projects the collimated light beam 219 to different directions.
  • the angle between the direction of the collimated light beam 219 changed by the first optical element and the rotation axis 109 changes with the rotation of the first optical element 214.
  • the first optical element 214 includes a pair of opposed non-parallel surfaces through which the collimated light beam 219 passes.
  • the first optical element 214 includes a prism whose thickness varies along at least one radial direction.
  • the first optical element 114 includes a wedge-angle prism that aligns the straight beam 119 for refraction.
  • the scanning module 202 further includes a second optical element 215 that rotates about a rotation axis 209.
  • the rotation speed of the second optical element 215 is different from the rotation speed of the first optical element 214.
  • the second optical element 215 is used to change the direction of the light beam projected by the first optical element 214.
  • the second optical element 115 is connected to another driver 217, and the driver 117 drives the second optical element 215 to rotate.
  • the first optical element 214 and the second optical element 215 may be driven by the same or different drivers, so that the first optical element 214 and the second optical element 215 have different rotation speeds and/or rotations, thereby projecting the collimated light beam 219 to the outside space Different directions can scan a larger spatial range.
  • the controller 218 controls the drivers 216 and 217 to drive the first optical element 214 and the second optical element 215, respectively.
  • the rotation speeds of the first optical element 214 and the second optical element 215 can be determined according to the area and pattern expected to be scanned in practical applications.
  • Drives 216 and 217 may include motors or other drives.
  • the second optical element 115 includes a pair of opposed non-parallel surfaces through which the light beam passes. In one embodiment, the second optical element 115 includes a prism whose thickness varies along at least one radial direction. In one embodiment, the second optical element 115 includes a wedge angle prism.
  • the scanning module 102 further includes a third optical element (not shown) and a driver for driving the third optical element to move.
  • the third optical element includes a pair of opposed non-parallel surfaces through which the light beam passes.
  • the third optical element includes a prism whose thickness varies along at least one radial direction.
  • the third optical element includes a wedge angle prism. At least two of the first, second and third optical elements rotate at different rotational speeds and/or turns.
  • each optical element in the scanning module 202 can project light into different directions, such as directions 211 and 213, so as to scan the space around the distance measuring device 200.
  • FIG. 13 is a schematic diagram of a scanning pattern of the distance measuring device 200. It can be understood that when the speed of the optical element in the scanning module changes, the scanning pattern will also change accordingly.
  • the detection object 201 When the light 211 projected by the scanning module 202 hits the detection object 201, a part of the light is reflected by the detection object 201 to the distance measuring device 200 in a direction opposite to the projected light 211.
  • the returned light 212 reflected by the detection object 201 passes through the scanning module 202 and enters the collimating element 204.
  • the detector 205 is placed on the same side of the collimating element 204 as the emitter 203.
  • the detector 205 is used to convert at least part of the returned light passing through the collimating element 204 into an electrical signal.
  • each optical element is coated with an antireflection coating.
  • the thickness of the antireflection film is equal to or close to the wavelength of the light beam emitted by the emitter 103, which can increase the intensity of the transmitted light beam.
  • a filter layer is plated on the surface of an element on the beam propagation path in the distance measuring device, or a filter is provided on the beam propagation path to transmit at least the wavelength band of the beam emitted by the transmitter, Reflect other bands to reduce the noise caused by ambient light to the receiver.
  • the transmitter 203 may include a laser diode through which laser pulses in the order of nanoseconds are emitted.
  • the laser pulse receiving time may be determined, for example, by detecting the rising edge time and/or the falling edge time of the electrical signal pulse. In this way, the distance measuring device 200 can calculate the TOF using the pulse reception time information and the pulse emission time information, thereby determining the distance between the detection object 201 and the distance measuring device 200.
  • the distance and orientation detected by the distance measuring device 200 can be used for remote sensing, obstacle avoidance, mapping, modeling, navigation, and the like.
  • the distance measuring device of the embodiment of the present invention can be applied to a mobile platform, and the distance measuring device can be installed on the platform body of the mobile platform.
  • a mobile platform with a distance measuring device can measure the external environment, for example, measuring the distance between the mobile platform and obstacles for obstacle avoidance and other purposes, and performing two-dimensional or three-dimensional mapping on the external environment.
  • the mobile platform includes at least one of an unmanned aerial vehicle, a car, a remote control car, a robot, and a camera.
  • the distance measuring device is applied to an unmanned aerial vehicle, the platform body is the fuselage of the unmanned aerial vehicle.
  • the platform body When the distance measuring device is applied to an automobile, the platform body is the body of the automobile.
  • the car may be a self-driving car or a semi-automatic car, and no restriction is made here.
  • the platform body When the distance measuring device is applied to a remote control car, the platform body is the body of the remote control car.
  • the platform body When the distance measuring device is applied to a robot, the platform body is a robot.
  • the distance measuring device is applied to a camera, the platform body is the camera itself.

Abstract

一种三维数据点的编解码方法和装置,通过根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值(S101),对长方体进行至少一次八叉树划分,得到多个第一类子块(S102),对第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分(S103),根据所述长方体的划分结果对所述待编码的三维数据点进行编码(S104)。从而,减小划分次数,提高编解码效率。

Description

三维数据点的编解码方法和装置 技术领域
本发明实施例涉及图像处理技术领域,尤其涉及一种三维数据点的编解码方法和装置。
背景技术
点云是三维物体或场景的一种表现形式,是由空间中一组无规则分布、表达三维物体或场景空间结构和表面属性的离散三维数据点集所构成。为了准确反映空间中的信息,所需离散三维数据点的数目是巨大的。为了减少三维数据点存储所占空间和传输时所占用的带宽,需要对三维数据点进行编码压缩处理。
现有技术中,根据三维数据点的位置坐标在三个轴的最大值、最小值之间的差值,以及根据输入参数确定的量化精度,对每个三维数据点的位置坐标进行量化,将输入的三维数据点的位置坐标转换为大于等于零的整数坐标。选择三个方向上的位置坐标的最大值的最大值,根据选择的最大值确定初始化八叉树划分时的立方体的边长。该边长为2的整数次幂且为大于等于并最接近选择的最大值。在初始化八叉树划分过程的立方体的边长后,进行八叉树划分编码。每层八叉树的划分均利用当前块的中心点的位置坐标进行子块划分,通过中心点将当前块划分为八个小的子块。得到子块划分后,会判断每个子块内是否存在三维数据点,对存在三维数据点的子块会再进一步进行划分,直至子块划分至最小时,即子块边长为1时停止划分,根据所述立方体的划分结果,编码三维数据点。
然而,采用现有技术的编码方法,编码效率不高。
发明内容
本发明实施例提供一种三维数据点的编解码方法和装置,以提高编解码效率。
第一方面,本发明实施例提供一种三维数据点的编码方法,包括:
根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值;
对所述长方体进行至少一次八叉树划分,得到多个第一类子块;
对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分;
根据所述长方体的划分结果对所述待编码的三维数据点进行编码。
第二方面,本发明实施例提供一种三维数据点解码方法,包括:
解码待解码三维数据点的码流;
根据解码得到的码流,构建六面体,并对六面体进行至少一次八叉树的划分,得到多个第一类子块;
对所述第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分;
根据划分得到的子块的位置,得到待解码三维数据点的位置坐标。
第三方面,本发明实施例提供一种三维数据点的编码装置,包括:
处理器,用于根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值;
所述处理器还用于对所述长方体进行至少一次八叉树划分,得到多个第一类子块;
所述处理器还用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分;
所述处理器还用于根据所述长方体的划分结果对所述待编码的三维数据点进行编码;
存储器,用于存储编码得到的码流。
第四方面,本发明实施例提供一种三维数据点解码装置,包括:
处理器,用于解码待解码三维数据点的码流;
所述处理器还用于根据解码得到的码流,构建六面体,并对六面体进行至少一次八叉树的划分,得到多个第一类子块;
所述处理器还用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分;
所述处理器还用于根据划分得到的子块的位置,得到待解码三维数据点 的位置坐标;
存储器,用于存储待解码三维数据点的位置坐标。
第五方面,本发明实施例提供一种编码器,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序,所述处理器执行所述程序时实现第一方面所述的三维数据点编码方法。
第六方面,本发明实施例提供一种解码器,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序,所述处理器执行所述程序时实现第二方面所述的三维数据点解码方法。
本发明实施例提供的三维数据点的编解码方法和装置,通过根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值,对长方体进行至少一次八叉树划分,得到多个第一类子块,对第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分,根据所述长方体的划分结果对所述待编码的三维数据点进行编码。由于构建的用来划分空间三维数据点的分布的长方体的三个方向上的边长不同,从而,在划分过程中,三个方向上的边长到达最小边长的划分次数不同,当有边长到达最小边长时,接着采用四叉树划分或者二叉树划分的方式进行划分,直到三个方向的边长均到达最小边长,从而,减小划分次数,提高编解码效率。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供一种三维数据点的编码方法的流程示意图;
图2为本发明实施例提供一种三维数据点的编码方法的流程示意图;
图3为本发明实施例提供一种三维数据点的编码方法的流程示意图;
图4为本发明实施例提供一种三维数据点的编码方法的流程示意图;
图5为本发明实施例提供一种三维数据点的编码方法的流程示意图;
图6为本发明实施例提供一种三维数据点的解码方法的流程示意图;
图7为本发明实施例提供的一种八叉树划分的示意图;
图8为本发明实施例提供的一种划分过程的示意图;
图9为本发明实施例提供的一种三维数据点的编码装置的结构示意图;
图10为本发明实施例提供的一种三维数据点的解码装置的结构示意图;
图11为本发明实施例提供的测距装置的结构示意图;
图12为本发明的测距装置采用同轴光路的一种实施例的示意图;
图13为测距装置200的一种扫描图案的示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
需要说明的是,当组件被称为“固定于”另一个组件,它可以直接在另一个组件上或者也可以存在居中的组件。当一个组件被认为是“连接”另一个组件,它可以是直接连接到另一个组件或者可能同时存在居中组件。
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。本文所使用的术语“及/或”包括一个或多个相关的所列项目的任意的和所有的组合。
下面结合附图,对本发明的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
本发明实施例主要针对某些点云的三维数据点的位置坐标在三个方向上的取值范围存在差异时的场景。
本发明实施例通过构建的用来划分空间三维数据点的分布的长方体的三个方向上的边长可以不同,具体的边长由三维数据点在三个方向的最大值来确定,从而,在划分过程中,三个方向上的边长到达最小边长的划分次数不同,当有边长到达最小边长时,接着采用四叉树划分或者二叉树划 分的方式进行划分,直到三个方向的边长均到达最小边长,从而,减小划分次数,提高编解码效率。划分次数的减少使得编码码流的长度相应的也会减少,从而,更有有效的压缩三位数据点的位置坐标,在进行编码时,还可以针对划分方式,采用不同的比特长度进行编码,可以进一步地减小编码码流的长度,进一步地提高编码效率和压缩效率。
本发明各实施例中,各方向的最小边长是指划分结束时得到的子块的各方向的边长,各方向的最小边长可以在进行编码前预先设定,各方向的最小边长可以相同,也可以不同。
本发明各实施例中,为了便于描述,将任意一次进行八叉树划分得到的子块称为第一类子块,将任意一次进行四叉树划分得到的子块称为第二类子块,将任意一次进行二叉树划分得到的子块称为第三类子块。
图1为本发明实施例提供一种三维数据点的编码方法的流程示意图,如图1所示,本实施例的方法如下:
S101:根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值。
其中,一种可能的实现方式:
对待编码三维数据点的位置坐标进行量化;根据量化后的三维数据点的位置坐标,获取三维数据点的位置坐标在三个方向上的最大值;根据所述三维数据点的位置坐标在三个方向上的最大值,确定待编码三维数据点的长方体的三个方向的边长的最大值。
可选地,在每个方向上,获取大于等于所述三维数据点的位置坐标的最大值的2的整数次幂的值中最接近所述最大值的值。
可选地,在对位置坐标进行量化之后,还包括:进行去除重复位置坐标的操作。
可选地,该长方体能够覆盖点云的所有三维数据点或者大部分三维数据点。
可选地,对待编码三维数据点的位置坐标在三个方向的最大值进行编码,将所述三个方向的最大值写入信息头中;或者;对待编码三维数据点的位置坐标在三个方向的最大值中的最大值进行编码,将所述三个方向的最大值中的最大值写入信息头中;或者,对待编码三维数据点的位置坐标在三个方向 的最大值中的最小值进行编码,将所述三个方向的最大值中的最小值写入信息头中。以便于解码端根据信息头中的数值构建的用来划分空间三维数据点的分布的长方体或者立方体。
S102:对长方体进行至少一次八叉树划分,得到多个第一类子块。
将长方体进行至少一次八叉树划分,每次划分得到八个子块,每次划分是针对前一次划分得到的包含三维数据点的位置坐标的子块进行划分,直到划分得到的子块的一个方向或者两个方向的边长到达最小边长。
可选地,可以根据前一次划分得到的第一类子块的中心点的坐标进行八叉树划分。
其中,一种可能的八叉树划分方式为:
采用经过所述中心点的坐标且平行xoy平面的第一平面、经过所述中心点的坐标且平行xoz平面的第二平面、经过所述中心点的坐标且平行所述yoz平面的第三平面,将所述前一次划分得到的子块划分为八个子块。
另一种可能的划分方式:
假设前一个第一类子块的中心点的坐标为(xmid,ymid,zmid),划分得到的八个子块对应的坐标范围内分别为:第一个子块的坐标取值范围为x≤xmid,y≤ymid,z≤zmid,第二个子块的坐标取值范围为x≤xmid,y≤ymid,z>zmid,第三个子块的坐标取值范围为x≤xmid,y>ymid,z≤zmid,第四个子块的坐标取值范围为x≤xmid,y>ymid,z>zmid,第五个子块的坐标取值范围为x>xmid,y≤ymid,z≤zmid,第六个子块的坐标取值范围为x>xmid,y≤ymid,z>zmid,第七个子块的坐标取值范围为x>xmid,y>ymid,z≤zmid,第八个子块的坐标取值范围为x>xmid,y>ymid,z>zmid。
S103:对第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分。
长方体三个方向的边长情况不同,进行的划分方式也不相同,包括但不限于如下可能的情况:
一种可能的情况为:长方体的三个方向的边长均不相同,则在八叉树划分结束后,还要进行四叉树划分和二叉树划分。
另一种可能的情况为:长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长,则在八叉树划分结束后,只进行四叉树划分之后 结束。
再一种可能的情况为:长方体的两个方向的边长相等,且所述相等的边长小于另一个方向的边长,则在八叉树划分结束后,只进行二叉树划分之后结束。
S104:根据所述长方体的划分结果对所述待编码的三维数据点进行编码。
本实施例,通过根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值,对长方体进行至少一次八叉树划分,得到多个第一类子块,对第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分,根据所述长方体的划分结果对所述待编码的三维数据点进行编码。由于构建的用来划分空间三维数据点的分布的长方体的三个方向上的边长不同,从而,在划分过程中,三个方向上的边长到达最小边长的划分次数不同,当有边长到达最小边长时,接着采用四叉树划分或者二叉树划分的方式进行划分,直到三个方向的边长均到达最小边长,从而,减小划分次数,提高编解码效率。
图2为本发明实施例提供一种三维数据点的编码方法的流程示意图,图2是在图1所示实施例的基础上,当所述长方体的三个方向的边长均不相等时,S103的一种可能的实现方式的描述,本实施例的方法如下:
S1031a:对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到第二类子块,直到所述第二类子块的两个方向的边长到达最小边长。
一种可能的实现方式:
确定所述第一类子块中的第一类目标子块。可选地,所述第一类目标子块可以指的是所述第一类子块中在一个方向上的边长到达最小边长且包含三维数据点的子块。对所述第一类目标子块进行至少一次四叉树划分。
具体地,将第一类目标子块进行至少一次四叉树划分,每次划分得到四个第二类子块,每次划分是针对前一次划分得到的包含三维数据点的位置坐标的第二类子块进行划分,直到划分得到的第二类子块的两个方向的边长都达到最小边长,
可选地,可以根据前一次划分得到的第一类目标子块的中心点的坐标进行八叉树划分。
一种可能的四叉树划分方式:
若x方向的边长到达最小边长,则采用经过所述中心点的坐标且平行xoy平面的第一平面和经过所述中心点的坐标且平行xoz平面的第二平面将所述前一次划分得到的子块划分为四个第二类子块;
若y方向的边长到达最小边长,采用经过所述中心点的坐标且平行xoy平面的第一平面和经过所述中心点的坐标且平行所述yoz平面的第三平面将所述前一次划分得到的子块划分为四个第二类子块;
若z方向的边长到达最小边长,采用经过所述中心点的坐标且平行xoz平面的第二平面和经过所述中心点的坐标且平行所述yoz平面的第三平面将所述前一次划分得到的子块划分为四个第二类子块。
另一种可能的四叉树划分方式:
若x方向的边长到达最小边长,所述第一类目标子块的中心点的坐标为(ymid,zmid);第一个第二类子块的坐标取值范围为:y≤ymid,z≤zmid,第二个第二类子块的坐标取值范围为:y≤ymid,z>zmid:第三个第二类子块的坐标取值范围为:y>ymid,z≤zmid,第四个第二类子块的坐标取值范围为:y>ymid,z>zmid;
若y方向的边长到达最小边长,所述第一类目标子块的中心点的坐标为(xmid,zmid);第一个第二类子块的坐标取值范围为:x≤xmid,z≤zmid,第二个第二类子块的坐标取值范围为:x≤xmid,z>zmid:第三个第二类子块的坐标取值范围为:x>xmid,z≤zmid,第四个第二类子块的坐标取值范围为:x>xmid,z>zmid;
若z方向的边长到达最小边长,第一类目标子块的中心点的坐标为(xmid,ymid);第一个第二类子块的坐标取值范围为:x≤xmid,y≤ymid,第二个第二类子块的坐标取值范围为:x≤xmid,y>zmid:第三个第二类子块的坐标取值范围为:x>xmid,y≤ymid,第四个第二类子块的坐标取值范围为:x>xmid,y>ymid。
S1032a:对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,得到第三类子块,直到所述第二类子块的三个方向的边长到达最小边长。
一种可能的实现方式:
确定所述第二类子块中的第二类目标子块。可选地,所述第二类目标子块可以指的是在两个方向的边长到达最小边长且包含三维数据点的子块。对所述第二类目标子块进行至少一次二叉树划分。
具体地,将第二类目标子块进行至少一次二叉树划分,每次划分得到两个第三类子块,每次划分是针对前一次划分得到的包含三维数据点的位置坐标的子块进行的划分,直到划分得到的第三类子块的三个方向的边长都达到最小边长。
一种可能的二叉树划分方式:
若x方向和y方向到达最小边长,则采用经过所述中心点的坐标且平行xoy平面的第一平面将所述前一次划分得到的子块划分为两个子块;
若x方向和z方向到达最小边长,则采用经过所述中心点的坐标且平行xoz平面的第二平面将所述前一次划分得到的子块划分为两个子块;
若y方向和z方向到达最小边长,则采用经过所述中心点的坐标且平行yoz平面的第三平面将所述前一次划分得到的子块划分为两个子块。
另一种可能的二叉树划分方式:
若x方向和y方向的边长到达最小边长,所述第三类子块的中心点的坐标为(zmid);第一个第三类子块的坐标取值范围为:z≤zmid,第二个第三类子块的坐标取值范围为:z>zmid;
若x方向和z方向的边长到达最小边长,所述第三类子块的中心点的坐标为(ymid),第一个第三类子块的坐标取值范围为:y≤ymid,第二个第三类子块的坐标取值范围为:y>ymid;
若y方向和z方向的边长到达最小边长,所述第三类子块的中心点的坐标为(xmid),第一个第三类子块的坐标取值范围为:x≤xmid,第二个第三类子块的坐标取值范围为:x>xmid。
本实施例,通过根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值,对长方体进行至少一次八叉树划分,得到多个第一类子块,对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到第二类子块,直到所述第二类子块的两个方向的边长到达最小边长,对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,得到第三类子块,直到所述第三类子块的三个方向 的边长到达最小边长,根据所述长方体的划分结果对所述待编码的三维数据点进行编码,即针对长方体的三个方向的边长均不相等时,采用八叉树、四叉树和二叉树混合的划分方式,对构建的用来划分空间三维数据点的分布的长方体进行划分,从而,减少了划分次数,提高了编码效率。划分次数的减少使得编码码流的长度相应的也会减少,从而,更有有效的压缩三位数据点的位置坐标,在进行编码时,还可以针对划分方式,采用不同的比特长度进行编码,可以进一步地减小编码码流的长度,进一步地提高编码效率和压缩效率。
图3为本发明实施例提供一种三维数据点的编码方法的流程示意图,图3是在图1所示实施例的基础上,当所述长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长,S103的另一种可能的实现方式的描述,本实施例的方法如下:
S103b:对第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到多个第二类子块,直到所述第二类子块的三个方向的边长到达最小边长。
一种可能的实现方式:确定所述第一类子块中的第一类目标子块。可选的,所述第一类目标子块可以指的是在一个方向的边长到达最小边长且包含三维数据点的子块。对所述第一类目标子块进行至少一次四叉树划分。
将第一类目标子块进行四叉树划分,每次划分得到四个子块,每次划分是针对前一次划分得到的包含三维数据点的位置坐标的第二类子块进行划分,直到划分得到的第二类子块的三个方向的边长都达到最小边长。
可选地,可以根据前一次划分得到的第一类目标子块的中心点的坐标进行八叉树划分。
一种可能的四叉树划分方式:
若x方向的边长到达最小边长,则采用经过所述中心点的坐标且平行xoy平面的第一平面和经过所述中心点的坐标且平行xoz平面的第二平面将所述前一次划分得到的子块划分为四个第二类子块;
若y方向的边长到达最小边长,采用经过所述中心点的坐标且平行xoy平面的第一平面和经过所述中心点的坐标且平行所述yoz平面的第三平面将所述前一次划分得到的子块划分为四个第二类子块;
若z方向的边长到达最小边长,采用经过所述中心点的坐标且平行xoz 平面的第二平面和经过所述中心点的坐标且平行所述yoz平面的第三平面将所述前一次划分得到的子块划分为四个第二类子块。
另一种可能的四叉树划分方式:
若x方向的边长到达最小边长,所述第一类目标子块的中心点的坐标为(ymid,zmid);第一个第二类子块的坐标取值范围为:y≤ymid,z≤zmid,第二个第二类子块的坐标取值范围为:y≤ymid,z>zmid:第三个第二类子块的坐标取值范围为:y>ymid,z≤zmid,第四个第二类子块的坐标取值范围为:y>ymid,z>zmid;
若y方向的边长到达最小边长,所述第一类目标子块的中心点的坐标为(xmid,zmid);第一个第二类子块的坐标取值范围为:x≤xmid,z≤zmid,第二个第二类子块的坐标取值范围为:x≤xmid,z>zmid:第三个第二类子块的坐标取值范围为:x>xmid,z≤zmid,第四个第二类子块的坐标取值范围为:x>xmid,z>zmid;
若z方向的边长到达最小边长,第一类目标子块的中心点的坐标为(xmid,ymid);第一个第二类子块的坐标取值范围为:x≤xmid,y≤ymid,第二个第二类子块的坐标取值范围为:x≤xmid,y>zmid:第三个第二类子块的坐标取值范围为:x>xmid,y≤ymid,第四个第二类子块的坐标取值范围为:x>xmid,y>ymid。
本实施例,通过根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值,对长方体进行至少一次八叉树划分,得到多个第一类子块,对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到多个第二类子块,直到所述第二类子块的三个方向的边长到达最小边长,根据所述长方体的划分结果对所述待编码的三维数据点进行编码,即针对长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长的场景,采用八叉树和四叉树混合的划分方式,对构建的用来划分空间三维数据点的分布的长方体进行划分,从而,减少了划分次数,提高了编码效率。划分次数的减少使得编码码流的长度相应的也会减少,从而,更有有效的压缩三位数据点的位置坐标,在进行编码时,还可以针对划分方式,采用不同的比特长度进行编码,可以进一步地减小编码码流的长度,进一步地提高编码效率和压缩效率。
图4为本发明实施例提供一种三维数据点的编码方法的流程示意图,图4是在图1所示实施例的基础上,当所述长方体的两个方向的边长相等,且所述相等的边长小于另一个方向的边长;S103的另一种可能的实现方式的描述,本实施例的方法如下:
S103c:对第一类子块中的至少一个第一类子块进行至少一次二叉树划分,得到多个第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
一种可能的实现方式:
确定所述第一类子块中的第一类目标子块。可选地,所述第一类目标子块可以指的是两个方向的边长到达最小边长且包含三维数据点的子块;对所述第一类目标子块进行至少一次二叉树划分。
将第一类目标子块进行二叉树划分,每次划分得到两个子块,每次划分是针对前一次划分得到的包含三维数据点的位置坐标的第三类子块进行划分,直到划分得到的第三类子块的三个方向的边长都达到最小边长。
一种可能的二叉树划分方式:
若x方向和y方向到达最小边长,则采用经过所述中心点的坐标且平行xoy平面的第一平面将所述前一次划分得到的子块划分为两个子块;
若x方向和z方向到达最小边长,则采用经过所述中心点的坐标且平行xoz平面的第二平面将所述前一次划分得到的子块划分为两个子块;
若y方向和z方向到达最小边长,则采用经过所述中心点的坐标且平行yoz平面的第三平面将所述前一次划分得到的子块划分为两个子块。
另一种可能的二叉树划分方式:
若x方向和y方向的边长到达最小边长,所述第一类目标子块的中心点的坐标为(zmid);第一个第三类子块的坐标取值范围为:z≤zmid,第二个第三类子块的坐标取值范围为:z>zmid;
若x方向和z方向的边长到达最小边长,所述第一类目标子块的中心点的坐标为(ymid),第一个第三类子块的坐标取值范围为:y≤ymid,第二个第三类子块的坐标取值范围为:y>ymid;
若y方向和z方向的边长到达最小边长,所述第一类目标子块的中心点的坐标为(xmid),第一个第三类子块的坐标取值范围为:x≤xmid,第二个第三类子块的坐标取值范围为:x>xmid。
本实施例,通过根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值,对长方体进行至少一次八叉树划分,得到多个第一类子块,对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,得到多个第三类子块,直到所述第三类子块的三个方向的边长到达最小边长,根据所述长方体的划分结果对所述待编码的三维数据点进行编码,即针对三个方向的边长均不相同的场景,采用八叉树和二叉树混合的划分方式,对构建的用来划分空间三维数据点的分布的长方体进行划分,从而,减少了划分次数,提高了编码效率。划分次数的减少使得编码码流的长度相应的也会减少,从而,更有有效的压缩三位数据点的位置坐标,在进行编码时,还可以针对划分方式,采用不同的比特长度进行编码,可以进一步地减小编码码流的长度,进一步地提高编码效率和压缩效率。
图5为本发明实施例提供一种三维数据点的编码方法的流程示意图,图5是在图1-图4任一所示实施例的基础上,对S104的一种可能的实现方式的描述,如图5所示:
S104’:根据划分次序以及每次划分得到的子块中包含的三维数据点情况,依次对每次划分情况进行编码。
一种可能的实现方式:根据每次划分得到的子块包含三维数据点的情况,得到每次划分对应的码流;根据划分次序,依次编码每次划分对应的码流。
其中,所述根据每次划分得到的子块包含的三维数据点的情况,得到每次划分对应的码流,包括:
根据每次划分得到的子块包含的三维数据点的情况,得到每个子块对应的比特流,每个子块对应一个比特,包含三维数据点的子块与未包含三维数据点的子块的比特值不同;根据所述子块对应的比特值,生成所述每次划分对应的码流。获取每次划分得到的子块对应的比特值,根据所有子块对应的比特值生成每次划分对应的码流。
每次划分对应的码流的比特位数可以固定的由8个比特表示,也可以根据划分的子块数确定,例如,每次八叉树划分得到八个子块,则每次八叉树划分对应的码流由8个比特标识,每次四叉树划分得到四个子块,则每次四叉树划分对应的码流由4个比特标识,每次二叉树划分得到两个子块,则每次 二叉树划分对应的码流由2个比特标识。
当每次划分对应的码流固定的由8比特标识:
根据所述子块对应的比特值,生成所述每次划分对应的码流,一种可能的实现方式如下:
若进行八叉树划分,则根据划分得到的八个子块包含的三维数据点情况,确定所述8个比特的比特值;若进行四叉树划分,则根据划分得到的四个子块包含的三维数据点情况,确定所述8个比特中其中4个比特的比特值,其余4个比特的比特值与未包含三维数据点的子块的比特值相同;若进行二叉树划分,则根据划分得到的两个子块包含的三维数据点情况,确定所述8个比特中其中2个比特的比特值,其余6个比特的比特值与未包含三维数据点的子块的比特值相同。
当每次划分对应的码流的比特位数根据划分的子块数确定:
根据所述子块对应的比特值,生成所述每次划分对应的码流,一种可能的实现方式如下:
若进行八叉树划分,每次划分对应的码流为8比特,根据划分得到的八个子块包含的三维数据点情况,确定所述8个比特的比特值;
若进行四叉树划分,每次划分对应的码流为4比特,则根据划分得到的四个子块包含的三维数据点情况,确定所述4个比特的比特值;
若进行二叉树划分,每次划分对应的码流为2比特,则根据划分得到的两个子块包含的三维数据点情况,确定所述2个比特的比特值。
其中,包含三维数据点的子块对应的比特值为1,未包含三维数据点的子块对应的比特值为0。也可以是包含三维数据点的子块对应的比特值为0,未包含三维数据点的子块对应的比特值为1,对此,本发明实施例不做限制。
可选地,还包括:当划分得到的子块中一个方向或者两个方向的边长到达最小边长,编码第一标识符,所述第一标识符用于指示变更划分方式,所述划分方式为八叉树划分、四叉树划分或者二叉树划分。以使解码端根据第一标识符确定变更划分方式。
当进行八叉树划分得到的子块的一个方向的边长到达最小边长或者两个方向的边长同时到达最小边长,所述第一标识符的为8比特,所述8比特的比特值均与未包含三维数据点的子块对应的比特值一致。例如,若包含点云 三维数据点的子块对应的比特值为1,未包含点云三维数据点的子块对应的比特值为0;则第一标识符为00000000。又例如,若包含点云三维数据点的子块对应的比特值为0,未包含点云三维数据点的子块对应的比特值为1;则第一标识符为11111111。
当进行四叉树划分得到子块的两个方向的边长到达最小边长,所述第一标识符为4比特,所述4比特的比特值均与未包含三维数据点的子块对应的比特值一致。若包含点云三维数据点的子块对应的比特值为1,未包含点云三维数据点的子块对应的比特值为0;则第一标识符为0000;若包含点云三维数据点的子块对应的比特值为0,未包含点云三维数据点的子块对应的比特值为1;则第一标识符为1111。
例如:当一个方向的边长先到达最小边长时,所述第一标识符为00000000,当再一个方向的边长到达最小边长时,所述第一标识符为0000。
或者,
当两个方向的边长先同时到达最小边长时,所述第一标识符为00000000。
或者,
当一个方向的边长先到达最小边长时,所述第一标识符为00000000。
可选地,所述第一标识符之后,还包括:
编码第二标识符,所述第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向。可选地,所述第二标识符为3比特或者2比特。以使解码端根据第二标识符确定哪个边长达到了最小边长,哪个边长未到达最小边长,从而,确定四叉树划分或者二叉树划分的方向。
例如:若三个方向的边长依次到达最小边长,当一个方向的边长先到达最小边长时,所述第二标识符为三比特,为000、001或者010;所述000、001和010分别对应一个方向的边长,表示所对应的方向的边长到达最小边长,当再一个方向的边长到达最小边长时,所述第二标识符为两比特,为00或者01;所述00和01分别对应剩余两个方向中的一个方向的边长;
或者,
若一个方向的边长先到达最小边长,剩余两个方向的边长后同时到达最小边长,当一个方向的边长先到达最小边长时,通过三比特表示第二标识符,第二标识符为000、001或者010;所述000、001和010分别对应一个方向 的边长,表示所对应的方向的边长到达最小边长;
或者,
若两个方向的边长先到达最小边长,另一个方向的边长后到达最小边长时,当两个方向的边长先到达最小边长时,通过三比特表示第二标识符,第二标识符为100、101或者110;所述100、101或者110分别对应一个方向的边长,表示所对应的方向的边长未到达最小边长。
或者,用三个比特依次代表三个方向,例如:依次代表x、y、z,当某个方向的边长到达最小边长,则将到达最小边长的比特位置为1,未到达最小边长的比特位置为0;例如:x方向先到达最小边长则为100;y方向先到达最小边长则为010;z方向先到达最小边长则为001;当x、y方向都到达最小边长则为110,当x、z方向都到达最小边长则为101,当y、z方向都到达最小边长则为011。或者,将到达最小边长的比特位置为0,未到达最小边长的比特位置为1;例如:x方向先到达最小边长则为011;y方向先到达最小边长则为101;z方向先到达最小边长则为110;当x、y方向都到达最小边长则为001,当x、z方向都到达最小边长则为010,当y、z方向都到达最小边长则为100。三个比特位与三个方向的对应关系,本发明实施例不作限制,可以做任一调整。
可选地,还包括:编码第三标识符,所述第三标识符用于指示划分结束,例如:最后一个方向的边到达最小边长,则编码2比特00表示划分结束;再例如:最后两条变同时到达最小边长,则编码4比特0000和两比特10,或者,编码4比特0000和两比特11,对此,本发明实施例不做限制,只要能够区分划分结束即可。
可选地,还包括:编码包含三维数据点的子块中的三维数据点的数量。
其中,当子块中包含1个三维数据点,编码0表示,当子块中包含N个三维数据点,先编码1接着编码N-1表示。
图6为本发明实施例提供一种三维数据点的解码方法的流程示意图,如图6所示,本实施例的方法如下:
S601:解码端解码待解码三维数据点的码流。
S602:根据解码得到码流,构建六面体,并对六面体进行至少一次八叉树的划分,得到多个第一类子块。
其中,六面体可以是立方体或者长方体。
可选地,解码待解码到三维数据点的位置坐标在三个方向的最大值;根据所述三个方向的最大值,构建长方体。
可选地,解码待接码到解码三维数据点的位置坐标在三个方向的最大值的最大值;根据所述三个方向的最大值的最大值,构建立方体。
可选地,解码待接码到解码三维数据点的位置坐标在三个方向的最大值的最小值;根据所述三个方向的最大值的最小值,构建立方体。
对六面体进行至少一次八叉树的划分,得到多个第一类子块,具体地,八叉树的划分方式的详细描述参见编码端的相关描述,此处不再赘述。
S603:对第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分。
其中,当六面体为长方体时;
一种可能的实现方式:
当所述长方体的三个方向的边长均不相等时;
所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分,包括:
对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到第二类子块,直到所述第二类子块的两个方向的边长到达最小边长;对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,得到第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
具体地,根据第一类子块对应的比特值,确定第一类目标子块,可选地,所述第一类目标子块的比特值表示所述子块内包含三维数据点;对所述第一类目标子块进行至少一次四叉树划分。根据第二类子块对应的比特值,确定第二类目标子块,所述第二类目标子块的比特值表示所述子块内包含三维数据点;对所述第二类目标子块进行至少一次二叉树划分。
例如:进行八叉树划分得到的最后一层的第一类子块中,比特值为1的表示该第一类子块中包含三维数据点,则确定比特值为1的第一类子块为第一类目标子块,或者,比特值为0的表示该第一类子块中包含三维数据点,则确定比特值为0的第一类子块为第一类目标子块。
可选地,第一标识符用于指示变更划分方式,解码端可以根据第一标识 符确定变更划分方式,划分方式包括八叉树划分、四叉树划分和二叉树划分。在本实现方式中,第一标识符指示从八叉树划分变更为四叉树划分,由四叉树划分变更为二叉树划分。
可选地,第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向,解码端可以根据第二标识符确定哪个方向的边长到达最小边长,四叉树划分沿着哪两个方向进行划分,以及哪两个方向的边长到达最小边长,二叉树划分沿着哪个方向进行划分,或者,根据第二标识符确定哪两个方向的边长未到达最小边长,四叉树划分沿着哪两个方向进行划分,哪个方向的边长未到达最小边长,二叉树划分沿着哪个方向进行划分。
四叉树和二叉树的具体划分方式,参见编码端的相关描述,此处不再赘述。
另一种可能的实现方式:
当所述长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长;
所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分,得到多个第二类子块,包括:
对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到多个第二类子块,直到所述第二类子块的三个方向的边长到达最小边长。
可选地,第一标识符用于指示变更划分方式,解码端可以根据第一标识符确定变更划分方式,划分方式包括八叉树划分、四叉树划分和二叉树划分。本实现方式中,解码端根据第一标识符确定八叉树划分变更为四叉树划分。
可选地,第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向,解码端根据第二标识符确定哪个方向的边长到达最小边长,四叉树划分沿着哪两个方向进行划分。或者,根据第二标识符确定哪两个方向的边长未到达最小边长,四叉树划分沿着哪两个方向进行划分。
四叉树的具体划分方式,参见编码端的相关描述,此处不再赘述。
再一种可能的实现方式:
当所述长方体的两个方向的边长相等,且所述相等的边长小于另一个方向的边长;对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,得到多个第三类子块,直到所述第三类子块的三个方向的边长到达最 小边长。
可选地,第一标识符用于指示变更划分方式,解码端可以根据第一标识符确定变更划分方式,划分方式包括八叉树划分、四叉树划分和二叉树划分。本实现方式中,解码端根据第一标识符确定八叉树划分变更为二叉树划分。
可选地,第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向,解码端根据第二标识符确定哪个两个方向的边长同时到达最小边长,二叉树划分沿着哪个方向进行划分,或者,根据第二标识符确定哪个方向的边长未到达最小边长,二叉树划分沿着哪个方向进行。
可选地,解码端根据第三标识符确定划分结束。
二叉树的具体划分方式,参见编码端的相关描述,此处不再赘述。
可选地,当六面体为立方体时,一种可能的实现方式,根据第一标识符和第二标识符确定进行四叉树划分或者二叉树划分;根据第三标识符确定划分结束。
例如:八叉树划分过程中,当解码到第一标识符八比特00000000之后,表示划分方式转换,再解码所述第二标识符的三比特,为000、001或者010;所述000、001和010分别对应一个方向的边长,根据第二标识符确定所对应的方向的边长到达最小边长,并进行四叉树划分,四叉树划分过程中,当接码到第一标识符四比特0000之后,表示划分方式转换,再解码第二标识符的两比特为00或者01;所述00和01分别对应剩余两个方向中的一个方向的边长,根据第二标识符确定所对应的方向的剩余两个方向中的一个方向的边长到达最小边长,进行二叉树划分。
再例如:
八叉树划分过程中,当解码到第一标识符八比特00000000之后,表示划分方式转换,再解码所述第二标识符的三比特,第二标识符为000、001或者010;所述000、001和010分别对应一个方向的边长,表示所对应的方向的边长到达最小边长。根据第二标识符确定所对应的方向的边长到达最小边长,并进行四叉树划分,四叉树划分过程中,当解码到第三标识符000010或者000011,则划分结束。
或者,
八叉树划分过程中,当解码到第一标识符八比特00000000之后,表示划 分方式转换,再解码所述第二标识符的三比特,第二标识符为100、101或者110;所述100、101和110分别对应一个方向的边长,表示所对应的方向的边长未到达最小边长。即另外两个方向的边长同时先到达最小边长,进行二叉树划分。二叉树划分过程中,当解码到第三标识符00,则划分结束。
或者,八叉树划分过程中,当解码到第一标识符八比特00000000之后,表示划分方式转换,再解码所述第二标识符的三比特,第二标识符为100、010、001、110、101或者011,根据比特位对应的方向的值,确定该方向是否到达最小边长,例如:第一比特位、第二比特位和第三比特位,依次代表x、y、z,将到达最小边长的比特位置为1,未到达最小边长的比特位置为0;例如:100表示x方向先到达最小边长;010表示y方向先到达最小边长;001表示z方向先到达最小边长;110表示x、y方向都到达最小边长,101表示x、z方向都到达最小边长,011表示y、z方向都到达最小边长。或者,将到达最小边长的比特位置为0,未到达最小边长的比特位置为1;例如:011表示x方向先到达最小边长;101表示y方向先到达最小边长;110表示z方向先到达最小边长;001表示x、y方向都到达最小边长,010表示x、z方向都到达最小边长,100表示y、z方向都到达最小边长。三个比特位与三个方向的对应关系,本发明实施例不作限制,可以做任一调整。
所述第三标识符用于指示划分结束,例如:二叉树划分后解码到两比特00,则表示划分结束,再例如:四叉树划分后解码到4比特0000和两比特10,或者,解码到4比特0000和两比特11,则表示划分结束。
S604:根据划分得到的子块的位置,得到待解码三维数据点的位置坐标。
一种可能的实现方式:
当构建的用来划分空间三维数据点的分布的六面体为根据所述三个方向的最大值构建的长方体时。对解码得到的坐标值进行与编码端相反的逆量化既可以得到所有三维数据点的实际位置坐标值。
另一种可能的实现方式:
当构建的用来划分空间三维数据点的分布的六面体为根据所述三个方向的最大值的最大值构建的立方体时。可选地,根据划分得到的子块的位置、所述三个方向的最大值的最大值以及划分到最后得到的子块的各边长的比值,得到待编码三维数据点的位置坐标。
可选地,根据划分得到的子块的位置,得到待编码三维数据点的第一位置坐标;获取所述划分到最后得到的子块的最短的边长分别与其余两个方向的边长比值;每个坐标在所述其余两个方向的坐标值均乘以所述方向的比值。
然后,再对解码得到的坐标值进行与编码端相反的逆量化既可以得到所有三维数据点的实际位置坐标值。
再一种可能的实现方式:
当构建的用来划分空间三维数据点的分布的六面体为根据所述三个方向的最大值的最小值构建的立方体时。可选地,根据所述划分得到的子块的位置、所述三个方向的最大值的最小值以及划分到最后得到的子块的各边长的比值,得到待编码三维数据点的位置坐标。
可选地,根据划分得到的子块的位置,得到待编码三维数据点的第一位置坐标;获取所述划分到最后得到的子块的最长的边长分别与其余两个方向的边长比值;每个坐标在所述其余两个方向的坐标值均乘以所述方向的比值。
然后,再对解码得到的坐标值进行与编码端相反的逆量化既可以得到所有三维数据点的实际位置坐标值。
可选地,还包括:解码包含三维数据点的子块中的三位数据点的数量,当解码到0,表示对应的子块内包含1个三维数据点,当解码到1,表示对应的子块内包含大于1个三维数据点,接着解码后面的比特,若解码出的数值为N,则确定包含的三维数据点数为N+1个。
本实施例,通过解码端解码待解码三维数据点的码流,根据解码得到码流,构建六面体,并对六面体进行至少一次八叉树的划分,得到多个第一类子块,对第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分,根据划分得到的子块的位置,得到待解码三维数据点的位置坐标。由于是进行八叉树与四叉树、二叉树的混合划分,或者,八叉树与四叉树的混合划分,或者,八叉树与二叉树的混合划分,从而,减小划分次数,提高解码码效率。
本发明实施例还提供下面几个实施例,对本发明的技术方案进一步的说明:
一种实施例:
编码端:
对待进行划分的长方体进行初始化。例如,根据所有点云的三维数据点的位置坐标找出三个方向上的最大值,根据这三个方向上的最大值分别确定初始化八叉树划分时的长方体的三个方向的边长,每条边长为2的整数次幂且为大于等于并最接近选出的对应方向上的最大值。
得到初始化的长方体的边长后,对长方体进行八叉树划分编码。
划分的过程中,可选地,每层八叉树的划分均利用当前块的中心点的坐标进行子块划分,通过中心点将当前块划分成八个小的子块。如图7所示,设当前长方体块的中心点的坐标为(xmid,ymid,zmid),则八叉树划分过程中八个小的子块的坐标取值范围如下所示。第一个块的坐标取值范围为x≤xmid,y≤ymid,z≤zmid,第二个块的坐标取值范围为x≤xmid,y≤ymid,z>zmid,第三个块的坐标取值范围为x≤xmid,y>ymid,z≤zmid,第四个块的坐标取值范围为x≤xmid,y>ymid,z>zmid,第五个块的坐标取值范围为x>xmid,y≤ymid,z≤zmid,第六个块的坐标取值范围为x>xmid,y≤ymid,z>zmid,第七个块的坐标取值范围为x>xmid,y>ymid,z≤zmid,第八个块的坐标取值范围为x>xmid,y>ymid,z>zmid。
在八叉树编码过程中,依次判断当前块内包含的所有点云的三维数据点分别属于八个子块中的哪一个,当该块内包含的所有点云的三维数据点属于哪个子块都判定结束后,接着会用8比特来编码当前块对应子块划分的情况。可选地,若当前块内含有三维数据点则对应位会被置为1,否则会被置为0。例如当第三个子块内含有三维数据点,第六子块内含有三维数据点,其他子块内均不含有三维数据点时,此时编码出来的8比特二进制码流为0010 0100。按照图8所示的顺序逐层进行划分。
在编码过程中,逐层进行长方体的子块划分,并逐个编码每个长方体块的划分情况。在编码过程中,由于采用的是长方体划分,每层均按照取中值的方法进行划分,当一个方向的边率先到达最小的边长时,则在接下来的划分过程中,在这个方向上即不进行划分。一种可能的实现方式,该方向上的坐标取值均选择小于等于中值的那半边区间。以x轴先到达最小边长时为例进行说明,这时的划分过程只存在四种可能,分别为可能一,x≤xmid,y≤ymid,z≤zmid,可能二,x≤xmid,y≤ymid,z>zmid,可能三,x≤xmid,y>ymid,z≤zmid,可能四,x≤xmid,y>ymid,z>zmid,四种可能对应的描述八叉树划分的8比 特数为xxxx 0000,其中的x需要根据前面四个子块内含有三维数据点与否来确定对应位为0或为1。若两个方向的边到达最小边长时,则这两个方向在接下来的划分过程中不进行划分,即这两个方向上的坐标取值均选择小于等于中值的那半边区间。以x、y轴两个方向先到达最小边长时为例进行说明,这时的划分过程只存在两种可能,分别为可能一,x≤xmid,y≤ymid,z≤zmid,可能二,x≤xmid,y≤ymid,z>zmid,两种可能对应的描述八叉树划分的8比特数为xx00 0000,其中的x需要根据前面两个子块内含有点云的三维数据点与否来确定对应位为0或为1。若三个方向的边到达最小边长时,则树划分结构编码结束。
编码每个最小的子块内含有的点云的三维数据点的数目。一种可能的实现方式为:当当前叶子节点块内含有一个点云的三维数据点时,直接编码一个0进行表示。当当前叶子节点块内含有不止一个点云的三维数据点时,设当前叶子节点块内含有n个点云的三维数据点,此时会先编码一个1,接着编码数值(n-1)。依次将前面编码表示八叉树划分的二进制比特流逐比特送入算术编码引擎中进行算术编码,接着将表示叶子节点块内含有点云的三维数据点数目的二进制比特流送入算术编码引擎中进行算术编码。根据上述流程即可实现对点云数据中的位置坐标的编码。
可选地,可以将三个方向上的最大值写入到码流文件的头信息中供解码端使用。
解码端:
初始化八叉树划分时的长方体:根据解码头信息中得到的位置坐标在三个方向上的最大值,根据这三个数值分别确定初始化八叉树划分时的长方体的三个方向的边长,每条边长为2的整数次幂且为大于等于并最接近选出的对应方向上的最大值。
可选地,通过逐次解码8比特,来构建出编码时的树形结构。每层八叉树的划分均利用当前块的中心点的坐标进行子块划分,通过中心点将当前块划分成八个小的子块。设当前长方体块的中心点的坐标为(xmid,ymid,zmid),则八叉树划分过程中八个小的子块的坐标取值范围如下所示。对应的第一个块的坐标取值范围为x≤xmid,y≤ymid,z≤zmid,第二个块的坐标取值范围为x≤xmid,y≤ymid,z>zmid,第三个块的坐标取值范围为x≤xmid,y>ymid,z≤zmid, 第四个块的坐标取值范围为x≤xmid,y>ymid,z>zmid,第五个块的坐标取值范围为x>xmid,y≤ymid,z≤zmid,第六个块的坐标取值范围为x>xmid,y≤ymid,z>zmid,第七个块的坐标取值范围为x>xmid,y>ymid,z≤zmid,第八个块的坐标取值范围为x>xmid,y>ymid,z>zmid。这八个块依次对应8比特从高位至低位,一种可能的实现方式,当对应位为1时即会对对应子块继续进行划分,对应位为0时即不会对对应子块再进一步进行划分。当划分的子块某个方向上的边长到达最小边长时,则令其该方向上的中值等于当前块的达到最小边长方向对应的坐标值,其他方向不变继续进行划分。当划分的子块的三个方向上的边长均达到最小边长时,即停止划分。接着解码对应最小子块内含有的点云的三维数据点的数目。一种可能的实现方式,当解码出一个0时,则当前叶子节点块内仅含有一个点云的三维数据点。当解码出一个1时,则当前叶子节点块内含有不止一个点云的三维数据点,接着会解码数值(n-1),表示当前叶子节点块内含有n个点云的三维数据点,顺序解码位置坐标码流即可解码出所有的点云位置坐标。根据上述的方案即可实现对编码方案编码出的位置坐标码流的解码。
另一种实施例:
编码端:
对经过量化之后的三维数据点的位置坐标进行位置坐标编码。
对待进行划分的长方体进行初始化。例如,根据所有点云的三维数据点的位置坐标找出三个方向上的最大值,分别求出三个方向的最大值,根据选定的这三个数值分别确定初始化树划分时的长方体的三个方向的边长,每条边长为2的整数次幂且为大于等于并最接近选出的对应方向上的最大值。
得到初始化的长方体的边长后,对长方体进行八叉树划分编码。
划分的过程中,可选地,每层八叉树的划分均利用当前块的中心点的坐标进行子块划分,通过中心点将当前块划分成八个小的子块。如图7所示,设当前长方体块的中心点的坐标为(xmid,ymid,zmid),则八叉树划分过程中八个小的子块的坐标取值范围如下所示。第一个块的坐标取值范围为x≤xmid,y≤ymid,z≤zmid,第二个块的坐标取值范围为x≤xmid,y≤ymid,z>zmid,第三个块的坐标取值范围为x≤xmid,y>ymid,z≤zmid,第四个块的坐标取值范围为x≤xmid,y>ymid,z>zmid,第五个块的坐标取值范围为x>xmid,y≤ymid, z≤zmid,第六个块的坐标取值范围为x>xmid,y≤ymid,z>zmid,第七个块的坐标取值范围为x>xmid,y>ymid,z≤zmid,第八个块的坐标取值范围为x>xmid,y>ymid,z>zmid。在八叉树编码过程中,依次判断当前块内包含的所有点云的三维数据点分别属于八个子块中的哪一个,当该块内包含的所有点云的三维数据点属于哪个子块都判定结束后,接着会用8比特来编码当前块对应子块划分的情况,一种可能的实现方式:若当前块内含有点云的三维数据点则对应为会被置为1,否则会被置为0。例如当第三个子块内含有点云的三维数据点,第六子块内含有点云的三维数据点,其他子块内均不含有点云的三维数据点时,此时编码出来的8比特二进制码流为0010 0100。按照图8所示的顺序逐层进行划分。在编码过程中,逐层进行长方体的子块划分,并逐个编码每个长方体块的划分情况。在编码过程中,由于采用的是长方体划分,每层均按照取中值的方法进行划分,当一个方向的边先到达最小的边长时,则在接下来的划分过程中,以剩下两个方向进行划分编码,已经达到最小边长方向上的坐标不参与接下来的划分编码,此时树划分变为四叉树划分。以x轴先到达最小边长时为例进行说明,这时的划分中心为(ymid,zmid),这时的划分过程存在以下四种可能,分别为可能一,y≤ymid,z≤zmid,可能二,y≤ymid,z>zmid,可能三,y>ymid,z≤zmid,可能四,y>ymid,z>zmid,这时只需要利用4比特即可描述当前的划分情况。例如当第一个块内含有点云的三维数据点,第四个块内含有点云的三维数据点,其他子块内均不含有点云的三维数据点时,此时编码出来的4比特二进制码流为1001。若两个方向的边先到达最小的边长时,则在接下来的划分过程中,以剩下一个方向进行划分编码,已经达到最小边长方向上的坐标不参与接下来的划分编码,此时树划分变为二叉树划分。以x、y轴两个方向先到达最小边长时为例进行说明,这时的划分中心为(zmid),这时的划分过程存在以下两种可能,分别为可能一,z≤zmid,可能二,z>zmid,这时只需要利用2比特即可描述当前的划分情况。例如当第一个块内含有点云的三维数据点,第二个块内不含有点云的三维数据点,此时编码出来的2比特二进制码流为10。若三个方向的边到达最小的边长时,则树划分结构编码结束,下来需要编码每个最小的子块内含有的点云的三维数据点的数目。一种可能的实现方式:当当前叶子节点块内含有一个点云的三维数据点时,直接编码一个0进行表示。当当前叶子节 点块内含有不止一个点云的三维数据点时,设当前叶子节点块内含有n个点云的三维数据点,此时会先编码一个1,接着编码数值(n-1)。依次将前面编码表示八叉树划分的二进制比特流逐byte送入算术编码引擎中进行算术编码,接着将表示叶子节点块内含有点云的三维数据点数目的二进制比特流送入算术编码引擎中进行算术编码。根据上述流程即可实现对点云数据中的位置坐标的编码。
可选地,将三个方向上的最大值写入到码流文件的头信息中供解码端使用。
解码端:
初始化八叉树划分时的长方体:根据解码头信息中得到的位置坐标在三个方向上的最大值,根据这三个数值分别确定初始化树划分时的长方体的三个方向的边长,每条边长为2的整数次幂且为大于等于并最接近选出的对应方向上的最大值。
可选地,通过逐次解码8比特,来构建出编码时的树形结构。每层八叉树的划分均利用当前块的中心点的坐标进行子块划分,通过中心点将当前块划分成八个小的子块。设当前长方体块的中心点的坐标为(xmid,ymid,zmid),则八叉树划分过程中八个小的子块的坐标取值范围如下所示。对应的第一个块的坐标取值范围为x≤xmid,y≤ymid,z≤zmid,第二个块的坐标取值范围为x≤xmid,y≤ymid,z>zmid,第三个块的坐标取值范围为x≤xmid,y>ymid,z≤zmid,第四个块的坐标取值范围为x≤xmid,y>ymid,z>zmid,第五个块的坐标取值范围为x>xmid,y≤ymid,z≤zmid,第六个块的坐标取值范围为x>xmid,y≤ymid,z>zmid,第七个块的坐标取值范围为x>xmid,y>ymid,z≤zmid,第八个块的坐标取值范围为x>xmid,y>ymid,z>zmid。这八个块依次对应8比特从高位至低位,一种可能的实现方式:当对应位为1时即会对对应子块继续进行划分,对应位为0时即不会对对应子块再进一步进行划分。当划分的子块某个方向上的边长到达最小边长时,接下来每次解码4比特,每1比特对应四叉树划分中四个块中的一个,当对应位为1时即会对对应子块继续进行划分,对应位为0时即不会对对应子块再进一步进行划分。当划分的子块某两个方向上的边长到达最小边长时,接下来每次解码2比特,每1比特对应二叉树划分中两个块中的一个,当对应位为1时即会对对应子块继续进行划分,对 应为0时即不会对对应子块再进一步进行划分。当划分的子块三个方向上的边长均到达最小边长时,即停止划分。解码对应最小子块内含有的点云的三维数据点的数目。一种可能的实现方式,当解码出一个0时,则当前叶子节点块内仅含有一个点云的三维数据点。当解码出一个1时,则当前叶子节点块内含有不止一个点云的三维数据点,接着会解码数值(n-1),表示当前叶子节点块内含有n个点云的三维数据点,顺序解码位置坐标码流即可解码出所有的点云位置坐标。根据上述的方案即可实现对实施例2编码方案编码出的位置坐标码流的解码。
再一种实施例:
编码端:
对经过量化之后的位置坐标进行位置坐标编码。
对待进行划分的长方体进行初始化。例如,根据所有点云的三维数据点的位置坐标找出三个方向上的最大值,分别求出三个方向的最大值,根据选定的这三个数值分别确定初始化八叉树划分时的长方体的三个方向的边长,每条边长为2的整数次幂且为大于等于并最接近选出的对应方向上的最大值。
得到初始化的长方体的边长后,对长方体进行八叉树划分编码。
在编码过程中,可选地,逐层进行长方体的子块划分,并逐个编码每个长方体块的划分情况。在编码过程中,由于采用的是长方体划分,每层均按照取中值的方法进行划分,并不能保证三个方向的边长同时达到最小边长,下来对每种情况分别进行说明。
当三个方向的边长均未达到最小边长时,每层八叉树的划分均利用当前块的中心点的坐标进行子块划分,通过中心点将当前块划分成八个小的子块。设当前长方体块的中心点的坐标为(xmid,ymid,zmid),则八叉树划分过程中八个小的子块的坐标取值范围如下所示。第一个块的坐标取值范围为x≤xmid,y≤ymid,z≤zmid,第二个块的坐标取值范围为x≤xmid,y≤ymid,z>zmid,第三个块的坐标取值范围为x≤xmid,y>ymid,z≤zmid,第四个块的坐标取值范围为x≤xmid,y>ymid,z>zmid,第五个块的坐标取值范围为x>xmid,y≤ymid,z≤zmid,第六个块的坐标取值范围为x>xmid,y≤ymid,z>zmid,第七个块的坐标取值范围为x>xmid,y>ymid,z≤zmid,第八个块的坐标取值范围为x>xmid,y>ymid,z>zmid。在八叉树编码过程中,依次判断当前块内包含的所有点云 的三维数据点分别属于八个子块中的哪一个,当该块内包含的所有点云的三维数据点属于哪个子块都判定结束后,接着会用8比特来编码当前块对应子块划分的情况,一种可能的实现方式:若当前块内含有点云的三维数据点则对应为会被置为1,否则会被置为0。例如当第三个子块内含有点云的三维数据点,第六子块内含有点云的三维数据点,其他子块内均不含有点云的三维数据点时,此时编码出来的8比特二进制码流为0010 0100。按照图8所示的顺序逐层进行划分。在编码过程中,逐层进行长方体的子块划分,并逐个编码每个长方体块的划分情况。
当一个方向的边先到达最小边长时,一种可能的实现方式,先编码8比特的0即0000 0000进行标识,接着编码3比特描述三个方向那个方向先到达最小边长,例如:对应的关系为000表示x轴方向的边长先到达最小边长,001表示y轴方向的边长先到达最小边长,010表示z轴方向的边长先到达最小边长。接下来开始在未到达最小边长的两个方向上进行四叉树划分编码。以x轴先到达最小边长时为例进行说明,这时的划分中心为(ymid,zmid),这时的划分过程存在以下四种可能,分别为可能一,y≤ymid,z≤zmid,可能二,y≤ymid,z>zmid,可能三,y>ymid,z≤zmid,可能四,y>ymid,z>zmid,这时只需要利用4比特即可描述当前的划分情况。例如当第一个块内含有点云的三维数据点,第四个块内含有点云的三维数据点,其他子块内均不含有点云的三维数据点时,此时编码出来的4比特二进制码流为1001。接着,仍然按照逐层编码的顺序进行四叉树子块划分,并逐个编码每个长方体块的划分情况。对接下来的达到最小边长存在两种情况,下面分别进行介绍。
①又一个方向的边达到最小边长时,此时先编码4比特的0即0000进行标识,接着编码2比特描述剩余两个方向那个方向达到最小边长,例如:对应的关系为00表示在剩余的两个方向中按x,y,z顺序靠前的一个方向,01表示在剩余的两个方向中按x,y,z顺序靠后的一个方向。下面具体举例,以x轴先到达最小边长时为例进行说明,当z轴到达最小边长时,z轴为剩余的两个方向y,z中按x,y,z顺序靠后的一个方向,所以利用01进行表示。接下来开始在未达到最小边长的一个方向上进行二叉树划分编码。这时的划分中心为(ymid),这时的划分过程存在以下两种可能,分别为可能一,y≤ymid,可能二,y>ymid,这时只需要利用2比特即可描述当前的划分情况。例如: 当第一个块内含有点云的三维数据点,第二个块内不含有点云的三维数据点,此时编码出来的2比特二进制码流为10。接着,仍然按照逐层编码的顺序进行二叉树子块划分,并逐个编码每个长方体块的划分情况。至剩下一个方向也达到最小边长时,编码2比特的00即表示对长方体的划分编码结束。
②当剩余两个方向的边同时到达最小边长时,这时,组合前面已经到达最小边长的方向,此时三个方向均已经到达最小边长。一种可能的实现方式,此时先编码4比特的0即0000进行标识,接着编码2比特10或者2比特11标识对长方体的划分编码结束。
当两个方向的边先达到最小边长时,一种可能的实现方式:先编码8比特的0即0000 0000进行标识,接着编码3比特描述三个方向中剩余那个方向的边长未达到最小边长。具体对应的关系为100表示x轴方向的边长未达到最小边长,101表示y轴方向的边长未达到最小边长,110表示z轴方向的边长未达到最小边长。接下来开始在未达到最小边长的一个方向进行二叉树划分编码。以x、y轴两个方向先达到最小边长时为例进行说明,这时的划分中心为(zmid),这时的划分过程存在以下两种可能,分别为可能一,z≤zmid,可能二,z>zmid,这时只需要利用2比特即可描述当前的划分情况。例如当第一个块内含有点云的三维数据点,第二个块内不含有点云的三维数据点,此时编码出来的2比特二进制码流为10。接着,按照逐层编码的顺序进行二叉树子块划分,并逐个编码每个长方体块的划分情况。至剩下一个方向也达到最小边长时,编码2比特的00即表示对长方体的划分编码结束。
当三个方向的边同时达到最小边长时,先编码8比特的0即0000 0000进行标识,接着编码3比特的111标识对长方体的划分编码结束。
当树划分结构编码结束后接下里需要编码每个最小的子块内含有的点云的三维数据点的数目。一种可能的实现方式,当当前叶子节点块内含有一个点云的三维数据点时,直接编码一个0进行表示。当当前叶子节点块内含有不止一个点云的三维数据点时,设当前叶子节点块内含有n个点云的三维数据点,此时会先编码一个1,接着编码数值(n-1)。依次将前面编码表示八叉树划分的二进制比特流逐byte送入算术编码引擎中进行算术编码,接着将表示叶子节点块内含有点云的三维数据点数目的二进制比特流送入算术编码引擎中进行算术编码。根据上述流程即可实现对点云数据中的位置坐标的编 码。
可选地,将三个方向上的最大值的最大值写入到码流文件的头信息中供解码端使用。
解码端:
初始化八叉树划分时的立方体:
根据解码头信息中得到的位置坐标在三个方向上的最大值的最大值,利用这个值初始化树划分时的立方体的边长,边长为2的整数次幂且大于等于并最接近该数值。
可选地,一开始按照八叉树划分进行解码,逐次解码8比特,构建出编码时的树形结构。每层八叉树的划分均利用当前块的中心点的坐标进行子块划分,通过中心点将当前块划分为八个小的子块。得到子块划分后,根据解码出的8比特确定存在点云的三维数据点的子块。若子块对应的比特为1则说明该子块存在点云的三维数据点,会继续向下进行划分。若子块对应的比特为0则说明该子块不存在点云的三维数据点,不会继续向下进行划分。逐8比特进行算术解码,当解码到8比特的0即0000 0000时存在多种情况,下面分别进行说明。
一种可能的实现方式:在解码到8比特的0即0000 0000时,接着解码3比特,若解码到000,001,010时即说明后面转为了四叉划分,若解码到000则说明x轴方向的边长先到达了最小边长,若解码到001则说明y轴方向的边长先到达最小边长,若解码到010则说明z轴方向的边长先到达最小边长。说明接下来的码流是在未到达最小边长的两个方向上进行四叉树划分编码。以x轴先到达最小边长时为例进行说明,这时的划分中心为(ymid,zmid),这时的划分过程存在以下四种可能,分别为可能一,y≤ymid,z≤zmid,可能二,y≤ymid,z>zmid,可能三,y>ymid,z≤zmid,可能四,y>ymid,z>zmid,这时只需要利用4比特即可描述当前的划分情况。这时改为每次解码4比特,根据解码出的4比特确定存在点云的三维数据点的子块。若子块对应的比特为1则说明该子块存在点云的三维数据点,会继续向下进行划分。若子块对应的比特为0则说明该子块不存在点云的三维数据点,不会继续向下进行划分。逐4比特进行算术解码,当解码到4比特的0即0000时存在多种情况,下面分别进行说明。
一种可能的实现方式:当解码到4比特的0即0000时,接着解码2比特,若解码到00,01时即表示在前面剩余的两个方向中有一个方向达到了最小边长,具体对应的关系为00表示在剩余的两个方向中按x,y,z顺序靠前的一个方向,01表示在剩余的两个方向中按x,y,z顺序靠后的一个方向。下面具体举例,以x轴先到达最小边长时为例进行说明,当z轴到达最小边长时,z轴为剩余的两个方向y,z中按x,y,z顺序靠后的一个方向,所以利用01进行表示。接下来开始在未达到最小边长的一个方向上进行二叉树划分编码。这时的划分中心为(ymid),这时的划分过程存在以下两种可能,分别为可能一,y≤ymid,可能二,y>ymid,这时只需要利用2比特即可描述当前的划分情况。这时按照改为每次解码2比特,根据解码出的2比特确定存在点云数据的子块。若子块对应的比特为1则说明该子块存在点云的三维数据点,会继续向下进行划分。若子块对应的比特为0则说明该子块不存在点云的三维数据点,不会继续向下进行划分。逐2比特进行算术解码,当解码出2比特的0即00时,表示对长方体的划分解码结束。
一种可能的实现方式:当解码到4比特的0即0000时,接着解码2比特,若解码到11或者10时,表明此时剩余两个方向的边长也达到了最小边长,表示对长方体的划分解码结束。
一种可能的实现方式:在解码到8比特的0即0000 0000时,接着解码3比特,若解码到100,101,110时即说明后面转为了二叉划分,若解码到100表示x轴方向的边长未达到最小边长,若解码到101表示y轴方向的边长未达到最小边长,若解码到110表示z轴方向的边长未达到最小边长。说明接下来的码流是在未到达最小边长的方向上进行二叉树划分编码。以x、y轴两个方向先达到最小边长时为例进行说明,这时的划分中心为(zmid),这时的划分过程存在以下两种可能,分别为可能一,z≤zmid,可能二,z>zmid,这时只需要利用2比特即可描述当前的划分情况。这时改为每次解码2比特,根据解码出的2比特确定存在点云的三维数据点的子块。若子块对应的比特为1则说明该子块存在点云的三维数据点,会继续向下进行划分。若子块对应的比特为0则说明该子块不存在点云的三维数据点,不会继续向下进行划分。逐2比特进行算术解码,当解码到2比特的0即00时,表示对长方体的划分解码结束。
一种可能的实现方式:在解码到8比特的0即0000 0000时,接着解码3比特,若解码到111时即说明三个方向上同时到达了最小边长,表明对长方体的划分解码结束。
在对长方体的划分部分解码结束后,由于采用的是边长不相等的长方体进行划分编码,下面需要进行边长的比例缩放。包括但不限于如下可能的实现方式:
一种可能的实现方式:八叉树四叉树二叉树混合时,设最先结束划分的方向的边长为a,第二个结束划分的方向的边长为b,第三个结束划分的方向的边长为c,此时边长c为真实最小边长。顾对最先结束划分的方向的位置坐标均乘以c/a即可实现对最先结束划分的方向的比例缩放,对第二个结束划分的方向的位置坐标均乘以c/b即可实现对第二个结束划分的方向的比例缩放。按照上述的方法即可对八叉树四叉树二叉树混合时位置坐标解码。
另一种可能的实现方式:八叉树四叉树混合时,设最先结束划分的方向的边长为a,接下来同时结束的两个划分的方向的边长为d。顾对最先结束划分的方向的位置坐标均乘以d/a即可实现对最先结束划分的方向的比例缩放。按照上述的方法即可对八叉树四叉树混合时位置坐标解码。
再一种可能的实现方式:八叉树二叉树混合时,设最先结束划分的两个方向的边长为a,接下来结束划分的方向的边长为e。顾对最先结束划分的两个方向的位置坐标均乘以e/a即可实现对最先结束划分的两个方向的比例缩放。按照上述的方法即可对八叉树二叉树混合时位置坐标解码。
仅八叉树时,这种情况下,三个方向同时结束划分,即说明三个方向的边长同时到达了最小边长,这个时候不需要进行比例缩放。
当解码结束位置坐标后,需要解码每个位置坐标对应的点云点的数目。一种可能的实现方式:当解码出一个0时,则当前叶子节点块内仅含有一个点云的三维数据点。当解码出一个1时,则当前叶子节点块内含有不止一个点云的三维数据点,接着会解码数值(n-1),表示当前叶子节点块内含有n个点云的三维数据点,顺序解码位置坐标码流即可解码出所有的点云位置坐标。根据上述的方案即可实现对实施例3编码方案编码出的位置坐标码流的解码。
又一实施例:
编码端:
对经过量化之后的三维数据点的位置坐标进行位置坐标编码。
对待进行划分的长方体进行初始化。例如,根据所有点云的三维数据点的位置坐标找出三个方向上的最大值,分别求出三个方向的最大值,根据选定的这三个数值分别确定初始化八叉树划分时的长方体的三个方向的边长,每条边长为2的整数次幂且为大于等于并最接近选出的对应方向上的最大值。
得到初始化的长方体的边长后,对长方体长方体划分编码。
在编码过程中,可选地,逐层进行长方体的子块划分,并逐个编码每个长方体块的划分情况。在编码过程中,由于采用的是长方体划分,每层均按照取中值的方法进行划分,并不能保证三个方向的边长同时达到最小边长,下来对每种情况分别进行说明。
当三个方向的边长均未达到最小边长时,每层八叉树的划分均利用当前块的中心点的坐标进行子块划分,通过中心点将当前块划分成八个小的子块。设当前长方体块的中心点的坐标为(xmid,ymid,zmid),则八叉树划分过程中八个小的子块的坐标取值范围如下所示。第一个块的坐标取值范围为x≤xmid,y≤ymid,z≤zmid,第二个块的坐标取值范围为x≤xmid,y≤ymid,z>zmid,第三个块的坐标取值范围为x≤xmid,y>ymid,z≤zmid,第四个块的坐标取值范围为x≤xmid,y>ymid,z>zmid,第五个块的坐标取值范围为x>xmid,y≤ymid,z≤zmid,第六个块的坐标取值范围为x>xmid,y≤ymid,z>zmid,第七个块的坐标取值范围为x>xmid,y>ymid,z≤zmid,第八个块的坐标取值范围为x>xmid,y>ymid,z>zmid。在八叉树编码过程中,依次判断当前块内包含的所有点云的三维数据点分别属于八个子块中的哪一个,当该块内包含的所有点云的三维数据点属于哪个子块都判定结束后,接着会用8比特来编码当前块对应子块划分的情况,一种可能的实现方式:若当前块内含有点云的三维数据点则对应位会被置为1,否则会被置为0。例如当第三个子块内含有点云的三维数据点,第六子块内含有点云的三维数据点,其他子块内均不含有点云的三维数据点时,此时编码出来的8比特二进制码流为0010 0100。按照图10所示的顺序逐层进行划分。在编码过程中,逐层进行长方体的子块划分,并逐个编码每个长方体块的划分情况。
一种可能的实现方式:当一个方向的边先到达最小边长时,先编码8比 特的0即0000 0000进行标识,接着编码3比特描述三个方向那个方向先到达最小边长,具体对应的关系为000表示x轴方向的边长先到达最小边长,001表示y轴方向的边长先到达最小边长,010表示z轴方向的边长先到达最小边长。接下来开始在未到达最小边长的两个方向上进行四叉树划分编码。以x轴先到达最小边长时为例进行说明,这时的划分中心为(ymid,zmid),这时的划分过程存在以下四种可能,分别为可能一,y≤ymid,z≤zmid,可能二,y≤ymid,z>zmid,可能三,y>ymid,z≤zmid,可能四,y>ymid,z>zmid,这时只需要利用4比特即可描述当前的划分情况。例如当第一个块内含有点云的三维数据点,第四个块内含有点云的三维数据点,其他子块内均不含有点云的三维数据点时,此时编码出来的4比特二进制码流为1001。接着,仍然按照逐层编码的顺序进行四叉树子块划分,并逐个编码每个长方体块的划分情况。对接下来的达到最小边长存在两种情况,下面分别进行介绍。
①又一个方向的边达到最小边长时,一种可能的实现方式:此时先编码4比特的0即0000进行标识,接着编码2比特描述剩余两个方向那个方向达到最小边长,具体对应的关系为00表示在剩余的两个方向中按x,y,z顺序靠前的一个方向,01表示在剩余的两个方向中按x,y,z顺序靠后的一个方向。下面具体举例,以x轴先到达最小边长时为例进行说明,当z轴到达最小边长时,z轴为剩余的两个方向y,z中按x,y,z顺序靠后的一个方向,所以利用01进行表示。接下来开始在未达到最小边长的一个方向上进行二叉树划分编码。这时的划分中心为(ymid),这时的划分过程存在以下两种可能,分别为可能一,y≤ymid,可能二,y>ymid,这时只需要利用2比特即可描述当前的划分情况。例如当第一个块内含有点云的三维数据点,第二个块内不含有点云的三维数据点,此时编码出来的2比特二进制码流为10。接着,仍然按照逐层编码的顺序进行二叉树子块划分,并逐个编码每个长方体块的划分情况。至剩下一个方向也达到最小边长时,编码2比特的00即表示对长方体的划分编码结束。
②当剩余两个方向的边同时到达最小边长时,一种可能的实现方式:组合前面已经到达最小边长的方向,此时三个方向均已经到达最小边长。此时先编码4比特的0即0000进行标识,接着编码2比特10或者11标识对长方体的划分编码结束。
当两个方向的边先达到最小边长时,一种可能的实现方式:先编码8比特的0即0000 0000进行标识,接着编码3比特描述三个方向中剩余那个方向的边长未达到最小边长。具体对应的关系为100表示x轴方向的边长未达到最小边长,101表示y轴方向的边长未达到最小边长,110表示z轴方向的边长未达到最小边长。接下来开始在未达到最小边长的一个方向进行二叉树划分编码。以x、y轴两个方向先达到最小边长时为例进行说明,这时的划分中心为(zmid),这时的划分过程存在以下两种可能,分别为可能一,z≤zmid,可能二,z>zmid,这时只需要利用2比特即可描述当前的划分情况。例如当第一个块内含有点云的三维数据点,第二个块内不含有点云的三维数据点,此时编码出来的2比特二进制码流为10。接着,按照逐层编码的顺序进行二叉树子块划分,并逐个编码每个长方体块的划分情况。至剩下一个方向也达到最小边长时,编码2比特的00即表示对长方体的划分编码结束。
当三个方向的边同时达到最小边长时,一种可能的实现方式:先编码8比特的0即0000 0000进行标识,接着编码3比特的111标识对长方体的划分编码结束。
当树划分结构编码结束后接下里需要编码每个最小的子块内含有的点云的三维数据点的数目。一种可能的实现方式:当当前叶子节点块内含有一个点云的三维数据点时,直接编码一个0进行表示。当当前叶子节点块内含有不止一个点云的三维数据点时,设当前叶子节点块内含有n个点云的三维数据点,此时会先编码一个1,接着编码数值(n-1)。依次将前面编码表示八叉树划分的二进制比特流逐byte送入算术编码引擎中进行算术编码,接着将表示叶子节点块内含有点云的三维数据点数目的二进制比特流送入算术编码引擎中进行算术编码。根据上述流程即可实现对点云数据中的位置坐标的编码。
可选地,将三个方向上的最大值的最小值写入到码流文件的头信息中供解码端使用。
解码端:
对初始化树划分时的立方体进行初始化,根据解码头信息中得到的位置坐标在三个方向上的最大值的最小值,利用这个值初始化树划分时的立方体的边长,边长为2的整数次幂且大于等于并最接近该数值。
可选地,一开始按照八叉树划分进行解码,逐次解码8比特,构建出编码时的树形结构。每层八叉树的划分均利用当前块的中心点的坐标进行子块划分,通过中心点将当前块划分为八个小的子块。得到子块划分后,根据解码出的8比特确定存在点云的三维数据点的子块。若子块对应的比特为1则说明该子块存在点云的三维数据点,会继续向下进行划分。若子块对应的比特为0则说明该子块不存在点云的三维数据点,不会继续向下进行划分。逐8比特进行算术解码,当解码到8比特的0即0000 0000时存在多种情况,下面分别进行说明。
一种可能的实现方式:在解码到8比特的0即0000 0000时,接着解码3比特,若解码到000,001,010时即说明后面转为了四叉划分,若解码到000则说明x轴方向的边长先到达了最小边长,若解码到001则说明y轴方向的边长先到达最小边长,若解码到010则说明z轴方向的边长先到达最小边长。说明接下来的码流是在未到达最小边长的两个方向上进行四叉树划分编码。以x轴先到达最小边长时为例进行说明,这时的划分中心为(ymid,zmid),这时的划分过程存在以下四种可能,分别为可能一,y≤ymid,z≤zmid,可能二,y≤ymid,z>zmid,可能三,y>ymid,z≤zmid,可能四,y>ymid,z>zmid,这时只需要利用4比特即可描述当前的划分情况。这时改为每次解码4比特,根据解码出的4比特确定存在点云的三维数据点的子块。若子块对应的比特为1则说明该子块存在点云的三维数据点,会继续向下进行划分。若子块对应的比特为0则说明该子块不存在点云的三维数据点,不会继续向下进行划分。逐4比特进行算术解码,当解码到4比特的0即0000时存在多种情况,下面分别进行说明。
①一种可能的实现方式:当解码到4比特的0即0000时,接着解码2比特,若解码到00,01时即表示在前面剩余的两个方向中有一个方向达到了最小边长,具体对应的关系为00表示在剩余的两个方向中按x,y,z顺序靠前的一个方向,01表示在剩余的两个方向中按x,y,z顺序靠后的一个方向。下面具体举例,以x轴先到达最小边长时为例进行说明,当z轴到达最小边长时,z轴为剩余的两个方向y,z中按x,y,z顺序靠后的一个方向,所以利用01进行表示。接下来开始在未达到最小边长的一个方向上进行二叉树划分编码。这时的划分中心为(ymid),这时的划分过程存在以下两种可能, 分别为可能一,y≤ymid,可能二,y>ymid,这时只需要利用2比特即可描述当前的划分情况。这时按照改为每次解码2比特,根据解码出的2比特确定存在点云数据的子块。若子块对应的比特为1则说明该子块存在点云的三维数据点,会继续向下进行划分。若子块对应的比特为0则说明该子块不存在点云的三维数据点,不会继续向下进行划分。逐2比特进行算术解码,当解码出2比特的0即00时,表示对长方体的划分解码结束。
②一种可能的实现方式:当解码到4比特的0即0000时,接着解码2比特,若解码到10或者11时,表明此时剩余两个方向的边长也达到了最小边长,表示对长方体的划分解码结束。
一种可能的实现方式:在解码到8比特的0即0000 0000时,接着解码3比特,若解码到100,101,110时即说明后面转为了二叉划分,若解码到100表示x轴方向的边长未达到最小边长,若解码到101表示y轴方向的边长未达到最小边长,若解码到110表示z轴方向的边长未达到最小边长。说明接下来的码流是在未到达最小边长的方向上进行二叉树划分编码。以x、y轴两个方向先达到最小边长时为例进行说明,这时的划分中心为(zmid),这时的划分过程存在以下两种可能,分别为可能一,z≤zmid,可能二,z>zmid,这时只需要利用2比特即可描述当前的划分情况。这时改为每次解码2比特,根据解码出的2比特确定存在点云的三维数据点的子块。若子块对应的比特为1则说明该子块存在点云的三维数据点,会继续向下进行划分。若子块对应的比特为0则说明该子块不存在点云的三维数据点,不会继续向下进行划分。逐2比特进行算术解码,当解码到2比特的0即00时,表示对长方体的划分解码结束。
一种可能的实现方式:在解码到8比特的0即0000 0000时,接着解码3比特,若解码到111时即说明三个方向上同时到达了最小边长,表明对长方体的划分解码结束。
在对长方体的划分部分解码结束后,由于采用的是边长不相等的长方体进行划分编码,下面需要进行边长的比例缩放。包括但不限于如下几种可能的实现方式:
一种可能的实现方式:八叉树四叉树二叉树混合时,设最先结束划分的方向的边长为a,第二个结束划分的方向的边长为b,第三个结束划分的方向 的边长为c,此时边长a为真实最小边长。顾对第二个结束划分的方向的位置坐标均乘以a/b即可实现对第二个结束划分的方向的比例缩放。对第三个结束划分的方向的位置坐标均乘以a/c即可实现对第三个结束划分的方向的比例缩放。按照上述的方法即可对八叉树四叉树二叉树混合时位置坐标解码。
另一种可能的实现方式:八叉树四叉树混合时,设最先结束划分的方向的边长为a,接下来同时结束的两个划分的方向的边长为d,此时边长a为真实最小边长。顾对后面同时结束划分的两个方向的位置坐标均乘以a/d即可实现对后面同时结束划分的两个方向的比例缩放。按照上述的方法即可对八叉树四叉树混合时位置坐标解码。
再一种可能的实现方式:八叉树二叉树混合时,设最先结束划分的两个方向的边长为a,接下来结束划分的方向的边长为e,此时边长a为真实最小边长。顾对最后结束划分方向上的位置坐标均乘以a/e即可实现对最后结束划分的方向上的比例缩放。按照上述的方法即可对八叉树二叉树混合时位置坐标解码。
仅八叉树时,这种情况下,三个方向同时结束划分,即说明三个方向的边长同时到达了最小边长,这个时候不需要进行比例缩放。
当解码结束位置坐标后,需要解码每个位置坐标对应的点云点的数目。一种可能的实现方式:当解码出一个0时,则当前叶子节点块内仅含有一个点云的三维数据点。当解码出一个1时,则当前叶子节点块内含有不止一个点云的三维数据点,接着会解码数值(n-1),表示当前叶子节点块内含有n个点云的三维数据点,顺序解码位置坐标码流即可解码出所有的点云位置坐标。根据上述的方案即可实现对实施例4编码方案编码出的位置坐标码流的解码。
图9为本发明实施例提供的一种三维数据点的编码装置的结构示意图,本本实施例的装置包括:处理器901和存储器902,其中,
处理器901用于根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值;
所述处理器901还用于对所述长方体进行至少一次八叉树划分,得到多个第一类子块;
所述处理器901还用于对所述第一类子块中的至少一个第一类子块进行 至少一次四叉树划分和/或二叉树划分;
所述处理器901还用于根据所述长方体的划分结果对所述待编码的三维数据点进行编码;
可选地,存储器902用于存储编码得到的码流。
可选地,当所述长方体的三个方向的边长均不相等时;
所述处理器901具体用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到第二类子块,直到所述第二类子块的两个方向的边长到达最小边长;对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,得到第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
可选地,当所述长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长;
所述处理器901具体用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到多个第二类子块,直到所述第二类子块的三个方向的边长到达最小边长。
可选地,当所述长方体的两个方向的边长相等,且所述相等的边长小于另一个方向的边长;
所述处理器901具体用于对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,得到多个第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
可选地,所述处理器901具体用于确定所述第一类子块中的第一类目标子块,所述第一类目标子块的一个方向的边长到达最小边长且所述第一类目标子块中包含三维数据点;对所述第一类目标子块进行至少一次四叉树划分;确定所述第二类子块中的第二类目标子块,所述第二类目标子块的两个方向的边长到达最小边长且所述第二类目标子块中包含三维数据点;对所述第二类目标子块进行至少一次二叉树划分。
可选地,所述处理器901具体用于确定所述第一类子块中的第一类目标子块,所述第一类目标子块的一个方向的边长到达最小边长且所述第一类目标子块中包含三维数据点;对所述第一类目标子块进行至少一次四叉树划分。
可选地,所述处理器901具体用于确定所述第一类子块中的第一类目标 子块,所述第一类目标子块的两个方向的边长到达最小边长且所述第一类目标子块中包含三维数据点;对所述第一类目标子块进行至少一次二叉树划分。
可选地,所述处理器901具体用于根据划分次序以及每次划分得到的子块中包含的三维数据点情况,依次对每次划分情况进行编码。
可选地,所述处理器901具体用于根据每次划分得到的子块包含三维数据点的情况,得到每次划分对应的码流;根据划分次序,依次编码每次划分对应的码流。
可选地,所述处理器901具体用于根据每次划分得到的子块包含的三维数据点的情况,得到每个子块对应的比特流,每个子块对应一个比特,包含三维数据点的子块与未包含三维数据点的子块的比特值不同;根据所述子块对应的比特值,生成所述每次划分对应的码流。获取每次划分得到的子块对应的比特值,根据所有子块对应的比特值生成每次划分对应的码流。
可选地,所述每次划分对应的码流包含8比特;
所述处理器901具体用于执行以下至少一种操作:
若进行八叉树划分,则根据划分得到的八个子块包含的三维数据点情况,确定所述8个比特的比特值;
若进行四叉树划分,则根据划分得到的四个子块包含的三维数据点情况,确定所述8个比特中其中4个比特的比特值,其余4个比特的比特值与未包含三维数据点的子块的比特值相同;
若进行二叉树划分,则根据划分得到的两个子块包含的三维数据点情况,确定所述8个比特中其中2个比特的比特值,其余6个比特的比特值与未包含三维数据点的子块的比特值相同。
可选地,所述处理器901具体用于执行以下至少一种操作:
若进行八叉树划分,每次划分对应的码流为8比特,根据划分得到的八个子块包含的三维数据点情况,确定所述8个比特的比特值;
若进行四叉树划分,每次划分对应的码流为4比特,则根据划分得到的四个子块包含的三维数据点情况,确定所述4个比特的比特值;
若进行二叉树划分,每次划分对应的码流为2比特,则根据划分得到的两个子块包含的三维数据点情况,确定所述2个比特的比特值。
可选地,包含点云三维数据点的子块对应的比特值为0,未包含点云三 维数据点的子块对应的比特值为1;
或者,
包含点云三维数据点的子块对应的比特值为0,未包含点云三维数据点的子块对应的比特值为1。
可选地,所述处理器901还用于当划分得到的子块中一个方向或者两个方向的边长到达最小边长,编码第一标识符,所述第一标识符用于指示变更划分方式,所述划分方式为八叉树划分、四叉树划分或者二叉树划分。
可选地,当进行八叉树划分得到的子块的一个方向的边长到达最小边长或者两个方向的边长同时到达最小边长,所述第一标识符的为8比特,所述8比特的比特值均与未包含三维数据点的子块对应的比特值一致;
和/或,
当进行四叉树划分得到子块的两个方向的边长到达最小边长,所述第一标识符为4比特,所述4比特的比特值均与未包含三维数据点的子块对应的比特值一致。
可选地,所述处理器901还用于编码第二标识符,所述第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向。
可选地,所述第二标识符为3比特或者2比特。
可选地,所述处理器901还用于编码第三标识符,所述第三标识符用于指示划分结束。
可选地,所述处理器901还用于对待编码三维数据点的位置坐标在三个方向的最大值进行编码,将所述三个方向的最大值写入信息头中。
可选地,所述处理器901还用于对待编码三维数据点的位置坐标在三个方向的最大值中的最大值进行编码,将所述三个方向的最大值中的最大值写入信息头中。
可选地,所述处理器901还用于对待编码三维数据点的位置坐标在三个方向的最大值中的最小值进行编码,将所述三个方向的最大值中的最小值写入信息头中。
可选地,所述处理器901具体用于对待编码三维数据点的位置坐标进行量化;根据量化后的三维数据点的位置坐标,获取三维数据点的位置坐标在三个方向上的最大值;根据所述三维数据点的位置坐标在三个方向上的最大 值,确定待编码三维数据点的长方体的三个方向的边长的最大值。
可选地,所述处理器901具体用于在每个方向上,获取大于等于所述三维数据点的位置坐标的最大值的2的整数次幂的值中最接近所述最大值的值。
可选地,所述处理器901还用于编码包含三维数据点的子块中的三维数据点的数量。
可选地,当子块中包含1个三维数据点,编码0,当子块中包含N个三维数据点,编码1和N-1。
本实施例的装置对应地可用于执行图1-图5任一所述方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图10为本发明实施例提供的一种三维数据点的解码装置的结构示意图,本实施例的装置包括:处理器1001和存储器1002,其中,处理器1001用于解码待解码三维数据点的码流;所述处理器1001还用于根据解码得到的码流,构建六面体,并对六面体进行至少一次八叉树的划分,得到多个第一类子块;所述处理器1001还用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分;所述处理器1001还用于根据划分得到的子块的位置,得到待解码三维数据点的位置坐标。
可选地,存储器1002用于存储待解码三维数据点的位置坐标。
可选地,当所述六面体为长方体时;
当所述长方体的三个方向的边长均不相等时;
所述处理器1001具体用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到第二类子块,直到所述第二类子块的两个方向的边长到达最小边长;对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,得到第三类子块,直到所述第二类子块的三个方向的边长到达最小边长。
可选地,当所述六面体为长方体时;
当所述长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长;
所述处理器1001具体用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到多个第二类子块,直到所述第二类子块的三个方向的边长到达最小边长。
可选地,当所述六面体为长方体时;
当所述长方体的两个方向的边长相等,且所述相等的边长小于另一个方向的边长;
所述处理器1001具体用于对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,得到多个第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
可选地,所述处理器1001具体用于根据第一类子块对应的比特值,确定第一类目标子块,所述第一类目标子块的比特值表示所述子块内包含三维数据点;
对所述第一类目标子块进行至少一次四叉树划分;
根据第二类子块对应的比特值,确定第二类目标子块,所述第二类目标子块的比特值表示所述子块内包含三维数据点;
对所述第二类目标子块进行至少一次二叉树划分。
可选地,所述处理器1001具体用于根据第一类子块对应的比特值,确定第一类目标子块,所述第一类目标子块的比特值表示所述子块内包含三维数据点;
对所述第一类目标子块进行至少一次四叉树划分。
可选地,所述处理器1001具体用于根据第一类子块对应的比特值,确定第一类目标子块,所述第一类目标子块的比特值表示所述子块内包含三维数据点;
对所述第一类目标子块进行至少一次二叉树划分。
可选地,所述处理器1001具体还用于解码第一标识符,所述第一标识符用于指示变更划分方式,所述划分方式为八叉树划分、四叉树划分或者二叉树划分;根据所述第一标识符,确定变更划分方式。
可选地,所述处理器1001具体还用于解码第二标识符,所述第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向;根据所述第二标识符,确定到达最小边长的方向或者未到达最小边长的方向。
可选地,所述处理器1001还用于解码第三标识符,所述第三标识符用于指示划分结束。
可选地,当所述六面体为立方体时;
所述处理器1001具体用于根据第一标识符和第二标识符确定进行四叉树划分或者二叉树划分;根据第三标识符确定划分结束。
可选地,所述处理器1001具体用于解码待解码三维数据点的位置坐标在三个方向的最大值;根据所述三个方向的最大值,构建长方体。
可选地,所述处理器1001具体用于解码待解码三维数据点的位置坐标在三个方向的最大值的最大值;根据所述三个方向的最大值的最大值,构建立方体;根据划分得到的子块位置、所述三个方向的最大值的最大值以及划分到最后得到的子块的各边长的比值,得到待编码三维数据点的位置坐标。
可选地,所述处理器1001具体用于根据划分得到的子块的位置,得到待编码三维数据点的第一位置坐标;获取所述划分到最后得到的子块的最短的边长分别与其余两个方向的边长比值;每个坐标在所述其余两个方向的坐标值均乘以所述方向的比值。
可选地,所述处理器1001具体用于解码待解码三维数据点的位置坐标在三个方向的最大值的最小值;根据所述三个方向的最大值的最小值,构建立方体;根据划分得到的子块的位置、所述三个方向的最大值的最小值以及划分到最后得到子块的各边长的比值,得到待编码三维数据点的位置坐标。
可选地,所述处理器1001具体用于根据划分得到的子块的位置,得到待编码三维数据点的第一位置坐标;获取所述划分到最后得到的子块的最长的边长分别与其余两个方向的边长比值;每个坐标在所述其余两个方向的坐标值均乘以所述方向的比值。
本实施例的装置对应地可用于执行图6所述方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
本发明实施例还提供一种编码器,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序,所述处理器执行所述程序时实现图1-图5任一所述的三维数据点编码方法。
本发明实施例还提供一种解码器,其特征在于,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序,所述处理器执行所述程序时实现图6所述的三维数据点解码方法。
一些示例中,上文中的三维数据点可以是测距装置所获取到的点云数据中的任意一个三维数据点。其中,该测距装置可以是激光雷达、激光测距设 备等电子设备。在一种实施方式中,测距装置用于感测外部环境信息,例如,环境目标的距离信息、方位信息、反射强度信息、速度信息等。一个三维数据点可以包括测距装置所测到的外部环境信息中的至少一种。
一种实现方式中,测距装置可以通过测量测距装置和探测物之间光传播的时间,即光飞行时间(Time-of-Flight,TOF),来探测探测物到测距装置的距离。或者,测距装置也可以通过其他技术来探测探测物到测距装置的距离,例如基于相位移动(phase shift)测量的测距方法,或者基于频率移动(frequency shift)测量的测距方法,在此不做限制。
为了便于理解,以下将结合图11所示的测距装置100对产生本文中提到的三维数据点的测距装置举例描述。
如图11所示,测距装置100可以包括发射电路110、接收电路120、采样电路130和运算电路140。
发射电路110可以发射光脉冲序列(例如激光脉冲序列)。接收电路120可以接收经过被探测物反射的光脉冲序列,并对该光脉冲序列进行光电转换,以得到电信号,再对电信号进行处理之后可以输出给采样电路130。采样电路130可以对电信号进行采样,以获取采样结果。运算电路140可以基于采样电路130的采样结果,以确定测距装置100与被探测物之间的距离。
可选地,该测距装置100还可以包括控制电路150,该控制电路150可以实现对其他电路的控制,例如,可以控制各个电路的工作时间和/或对各个电路进行参数设置等。
应理解,虽然图11示出的测距装置中包括一个发射电路、一个接收电路、一个采样电路和一个运算电路,用于出射一路光束进行探测,但是本申请实施例并不限于此,发射电路、接收电路、采样电路、运算电路中的任一种电路的数量也可以是至少两个,用于沿相同方向或分别沿不同方向出射至少两路光束;其中,该至少两束光路可以是同时出射,也可以是分别在不同时刻出射。一个示例中,该至少两个发射电路中的发光芯片封装在同一个模块中。例如,每个发射电路包括一个激光发射芯片,该至少两个发射电路中的激光发射芯片中的die封装到一起,容置在同一个封装空间中。
一些实现方式中,除了图11所示的电路,测距装置100还可以包括扫描模块160,用于将发射电路出射的至少一路激光脉冲序列改变传播方向出射。
其中,可以将包括发射电路110、接收电路120、采样电路130和运算电路140的模块,或者,包括发射电路110、接收电路120、采样电路130、运算电路140和控制电路150的模块称为测距模块,该测距模块150可以独立于其他模块,例如,扫描模块160。
测距装置中可以采用同轴光路,也即测距装置出射的光束和经反射回来的光束在测距装置内共用至少部分光路。例如,发射电路出射的至少一路激光脉冲序列经扫描模块改变传播方向出射后,经探测物反射回来的激光脉冲序列经过扫描模块后入射至接收电路。或者,测距装置也可以采用异轴光路,也即测距装置出射的光束和经反射回来的光束在测距装置内分别沿不同的光路传输。图12示出了本发明的测距装置采用同轴光路的一种实施例的示意图。
测距装置200包括测距模块201,测距模块210包括发射器203(可以包括上述的发射电路)、准直元件204、探测器205(可以包括上述的接收电路、采样电路和运算电路)和光路改变元件206。测距模块210用于发射光束,且接收回光,将回光转换为电信号。其中,发射器203可以用于发射光脉冲序列。在一个实施例中,发射器203可以发射激光脉冲序列。可选的,发射器203发射出的激光束为波长在可见光范围之外的窄带宽光束。准直元件204设置于发射器的出射光路上,用于准直从发射器203发出的光束,将发射器203发出的光束准直为平行光出射至扫描模块。准直元件还用于会聚经探测物反射的回光的至少一部分。该准直元件204可以是准直透镜或者是其他能够准直光束的元件。
在图12所示实施例中,通过光路改变元件206来将测距装置内的发射光路和接收光路在准直元件104之前合并,使得发射光路和接收光路可以共用同一个准直元件,使得光路更加紧凑。在其他的一些实现方式中,也可以是发射器103和探测器105分别使用各自的准直元件,将光路改变元件206设置在准直元件之后的光路上。
在图12所示实施例中,由于发射器103出射的光束的光束孔径较小,测距装置所接收到的回光的光束孔径较大,所以光路改变元件可以采用小面积的反射镜来将发射光路和接收光路合并。在其他的一些实现方式中,光路改变元件也可以采用带通孔的反射镜,其中该通孔用于透射发射器203的出 射光,反射镜用于将回光反射至探测器205。这样可以减小采用小反射镜的情况中小反射镜的支架会对回光的遮挡。
在图12所示实施例中,光路改变元件偏离了准直元件204的光轴。在其他的一些实现方式中,光路改变元件也可以位于准直元件204的光轴上。
测距装置200还包括扫描模块202。扫描模块202放置于测距模块201的出射光路上,扫描模块102用于改变经准直元件204出射的准直光束219的传输方向并投射至外界环境,并将回光投射至准直元件204。回光经准直元件104汇聚到探测器105上。
在一个实施例中,扫描模块202可以包括至少一个光学元件,用于改变光束的传播路径,其中,该光学元件可以通过对光束进行反射、折射、衍射等等方式来改变光束传播路径。例如,扫描模块202包括透镜、反射镜、棱镜、振镜、光栅、液晶、光学相控阵(Optical Phased Array)或上述光学元件的任意组合。一个示例中,至少部分光学元件是运动的,例如通过驱动模块来驱动该至少部分光学元件进行运动,该运动的光学元件可以在不同时刻将光束反射、折射或衍射至不同的方向。在一些实施例中,扫描模块202的多个光学元件可以绕共同的轴209旋转或振动,每个旋转或振动的光学元件用于不断改变入射光束的传播方向。在一个实施例中,扫描模块202的多个光学元件可以以不同的转速旋转,或以不同的速度振动。在另一个实施例中,扫描模块202的至少部分光学元件可以以基本相同的转速旋转。在一些实施例中,扫描模块的多个光学元件也可以是绕不同的轴旋转。在一些实施例中,扫描模块的多个光学元件也可以是以相同的方向旋转,或以不同的方向旋转;或者沿相同的方向振动,或者沿不同的方向振动,在此不作限制。
在一个实施例中,扫描模块202包括第一光学元件214和与第一光学元件214连接的驱动器216,驱动器216用于驱动第一光学元件214绕转动轴209转动,使第一光学元件214改变准直光束219的方向。第一光学元件214将准直光束219投射至不同的方向。在一个实施例中,准直光束219经第一光学元件改变后的方向与转动轴109的夹角随着第一光学元件214的转动而变化。在一个实施例中,第一光学元件214包括相对的非平行的一对表面,准直光束219穿过该对表面。在一个实施例中,第一光学元件214包括厚度 沿至少一个径向变化的棱镜。在一个实施例中,第一光学元件114包括楔角棱镜,对准直光束119进行折射。
在一个实施例中,扫描模块202还包括第二光学元件215,第二光学元件215绕转动轴209转动,第二光学元件215的转动速度与第一光学元件214的转动速度不同。第二光学元件215用于改变第一光学元件214投射的光束的方向。在一个实施例中,第二光学元件115与另一驱动器217连接,驱动器117驱动第二光学元件215转动。第一光学元件214和第二光学元件215可以由相同或不同的驱动器驱动,使第一光学元件214和第二光学元件215的转速和/或转向不同,从而将准直光束219投射至外界空间不同的方向,可以扫描较大的空间范围。在一个实施例中,控制器218控制驱动器216和217,分别驱动第一光学元件214和第二光学元件215。第一光学元件214和第二光学元件215的转速可以根据实际应用中预期扫描的区域和样式确定。驱动器216和217可以包括电机或其他驱动器。
在一个实施例中,第二光学元件115包括相对的非平行的一对表面,光束穿过该对表面。在一个实施例中,第二光学元件115包括厚度沿至少一个径向变化的棱镜。在一个实施例中,第二光学元件115包括楔角棱镜。
一个实施例中,扫描模块102还包括第三光学元件(图未示)和用于驱动第三光学元件运动的驱动器。可选地,该第三光学元件包括相对的非平行的一对表面,光束穿过该对表面。在一个实施例中,第三光学元件包括厚度沿至少一个径向变化的棱镜。在一个实施例中,第三光学元件包括楔角棱镜。第一、第二和第三光学元件中的至少两个光学元件以不同的转速和/或转向转动。
扫描模块202中的各光学元件旋转可以将光投射至不同的方向,例如方向211和213,如此对测距装置200周围的空间进行扫描。如图13所示,图13为测距装置200的一种扫描图案的示意图。可以理解的是,扫描模块内的光学元件的速度变化时,扫描图案也会随之变化。
当扫描模块202投射出的光211打到探测物201时,一部分光被探测物201沿与投射的光211相反的方向反射至测距装置200。探测物201反射的回光212经过扫描模块202后入射至准直元件204。
探测器205与发射器203放置于准直元件204的同一侧,探测器205用于将穿过准直元件204的至少部分回光转换为电信号。
一个实施例中,各光学元件上镀有增透膜。可选的,增透膜的厚度与发射器103发射出的光束的波长相等或接近,能够增加透射光束的强度。
一个实施例中,测距装置中位于光束传播路径上的一个元件表面上镀有滤光层,或者在光束传播路径上设置有滤光器,用于至少透射发射器所出射的光束所在波段,反射其他波段,以减少环境光给接收器带来的噪音。
在一些实施例中,发射器203可以包括激光二极管,通过激光二极管发射纳秒级别的激光脉冲。进一步地,可以确定激光脉冲接收时间,例如,通过探测电信号脉冲的上升沿时间和/或下降沿时间确定激光脉冲接收时间。如此,测距装置200可以利用脉冲接收时间信息和脉冲发出时间信息计算TOF,从而确定探测物201到测距装置200的距离。
测距装置200探测到的距离和方位可以用于遥感、避障、测绘、建模、导航等。在一种实施方式中,本发明实施方式的测距装置可应用于移动平台,测距装置可安装在移动平台的平台本体。具有测距装置的移动平台可对外部环境进行测量,例如,测量移动平台与障碍物的距离用于避障等用途,和对外部环境进行二维或三维的测绘。在某些实施方式中,移动平台包括无人飞行器、汽车、遥控车、机器人、相机中的至少一种。当测距装置应用于无人飞行器时,平台本体为无人飞行器的机身。当测距装置应用于汽车时,平台本体为汽车的车身。该汽车可以是自动驾驶汽车或者半自动驾驶汽车,在此不做限制。当测距装置应用于遥控车时,平台本体为遥控车的车身。当测距装置应用于机器人时,平台本体为机器人。当测距装置应用于相机时,平台本体为相机本身。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (84)

  1. 一种三维数据点的编码方法,其特征在于,包括:
    根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值;
    对所述长方体进行至少一次八叉树划分,得到多个第一类子块;
    对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分;
    根据所述长方体的划分结果对所述待编码的三维数据点进行编码。
  2. 根据权利要求1所述的方法,其特征在于,当所述长方体的三个方向的边长均不相等时;
    所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分,包括:
    对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到第二类子块,直到所述第二类子块的两个方向的边长到达最小边长;
    对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,得到第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
  3. 根据权利要求1所述的方法,其特征在于,当所述长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长;
    所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分,包括:
    对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到多个第二类子块,直到所述第二类子块的三个方向的边长到达最小边长。
  4. 根据权利要求1所述的方法,其特征在于,当所述长方体的两个方向的边长相等,且所述相等的边长小于另一个方向的边长;
    所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分,包括:
    对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,得到多个第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
  5. 根据权利要求2所述的方法,其特征在于,所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,包括:
    确定所述第一类子块中的第一类目标子块,所述第一类目标子块的一个方向的边长到达最小边长且所述第一类目标子块中包含三维数据点;
    对所述第一类目标子块进行至少一次四叉树划分;
    所述对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,包括:
    确定所述第二类子块中的第二类目标子块,所述第二类目标子块的两个方向的边长到达最小边长且所述第二类目标子块中包含三维数据点;
    对所述第二类目标子块进行至少一次二叉树划分。
  6. 根据权利要求3所述的方法,其特征在于,所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,包括:
    确定所述第一类子块中的第一类目标子块,所述第一类目标子块的一个方向的边长到达最小边长且所述第一类目标子块中包含三维数据点;
    对所述第一类目标子块进行至少一次四叉树划分。
  7. 根据权利要求4所述的方法,其特征在于,所述对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,包括:
    确定所述第一类子块中的第一类目标子块,所述第一类目标子块的两个方向的边长到达最小边长且所述第一类目标子块中包含三维数据点;
    对所述第一类目标子块进行至少一次二叉树划分。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述根据所述长方体的划分结果对所述待编码的三维数据点进行编码,包括:
    根据划分次序以及每次划分得到的子块中包含的三维数据点情况,依次对每次划分情况进行编码。
  9. 根据权利要求8所述的方法,其特征在于,所述根据划分次序以及每次划分得到的子块中包含的三维数据点情况,依次对每次划分情况进行编码,包括:
    根据每次划分得到的子块包含三维数据点的情况,得到每次划分对应的码流;
    根据划分次序,依次编码每次划分对应的码流。
  10. 根据要求9所述的方法,其特征在于,所述根据每次划分得到的子块包含的三维数据点的情况,得到每次划分对应的码流,包括:
    根据每次划分得到的子块包含的三维数据点的情况,得到每个子块对应的比特流,每个子块对应一个比特,包含三维数据点的子块与未包含三维数据点的子块的比特值不同;
    根据所述子块对应的比特值,生成所述每次划分对应的码流。
    获取每次划分得到的子块对应的比特值,根据所有子块对应的比特值生成每次划分对应的码流。
  11. 根据权利要求10所述的方法,其特征在于,所述每次划分对应的码流包含8比特;
    所述根据所述子块对应的比特值,生成所述每次划分对应的码流,包括以下至少一种操作:
    若进行八叉树划分,则根据划分得到的八个子块包含的三维数据点情况,确定所述8个比特的比特值;
    若进行四叉树划分,则根据划分得到的四个子块包含的三维数据点情况,确定所述8个比特中其中4个比特的比特值,其余4个比特的比特值与未包含三维数据点的子块的比特值相同;
    若进行二叉树划分,则根据划分得到的两个子块包含的三维数据点情况,确定所述8个比特中其中2个比特的比特值,其余6个比特的比特值与未包含三维数据点的子块的比特值相同。
  12. 根据权利要求10所述的方法,其特征在于,所述根据所述子块对应的比特值,生成所述每次划分对应的码流,包括以下至少一种操作:
    若进行八叉树划分,每次划分对应的码流为8比特,根据划分得到的八个子块包含的三维数据点情况,确定所述8个比特的比特值;
    若进行四叉树划分,每次划分对应的码流为4比特,则根据划分得到的四个子块包含的三维数据点情况,确定所述4个比特的比特值;
    若进行二叉树划分,每次划分对应的码流为2比特,则根据划分得到的两个子块包含的三维数据点情况,确定所述2个比特的比特值。
  13. 根据权利要求11或12所述的方法,其特征在于,包含点云三维数据点的子块对应的比特值为0,未包含点云三维数据点的子块对应的比特值为1;
    或者,
    包含点云三维数据点的子块对应的比特值为0,未包含点云三维数据点的子块对应的比特值为1。
  14. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    当划分得到的子块中一个方向或者两个方向的边长到达最小边长,编码第一标识符,所述第一标识符用于指示变更划分方式,所述划分方式为八叉树划分、四叉树划分或者二叉树划分。
  15. 根据权利要求12所述的方法,其特征在于,当进行八叉树划分得到的子块的一个方向的边长到达最小边长或者两个方向的边长同时到达最小边长,所述第一标识符的为8比特,所述8比特的比特值均与未包含三维数据点的子块对应的比特值一致;
    和/或,
    当进行四叉树划分得到子块的两个方向的边长到达最小边长,所述第一标识符为4比特,所述4比特的比特值均与未包含三维数据点的子块对应的比特值一致。
  16. 根据权利要求14或15所述的方法,其特征在于,所述第一标识符之后,还包括:
    编码第二标识符,所述第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向。
  17. 根据权利要求16所述的方法,其特征在于,所述第二标识符为3比特或者2比特。
  18. 根据权利要求16或17所述的方法,其特征在于,还包括:
    编码第三标识符,所述第三标识符用于指示划分结束。
  19. 根据权利要求1-18任一项所述的方法,其特征在于,还包括:
    对待编码三维数据点的位置坐标在三个方向的最大值进行编码,将所述三个方向的最大值写入信息头中。
  20. 根据权利要求1-18任一项所述的方法,其特征在于,还包括:
    对待编码三维数据点的位置坐标在三个方向的最大值中的最大值进行编码,将所述三个方向的最大值中的最大值写入信息头中。
  21. 根据权利要求1-18任一项所述的方法,其特征在于,还包括:
    对待编码三维数据点的位置坐标在三个方向的最大值中的最小值进行编 码,将所述三个方向的最大值中的最小值写入信息头中。
  22. 根据权利要求1-21任一项所述的方法,其特征在于,根据待编码三维数据点的位置坐标,确定所述待编码三维数据点的长方体的三个方向的边长的最大值,包括:
    对待编码三维数据点的位置坐标进行量化;
    根据量化后的三维数据点的位置坐标,获取三维数据点的位置坐标在三个方向上的最大值;
    根据所述三维数据点的位置坐标在三个方向上的最大值,确定待编码三维数据点的长方体的三个方向的边长的最大值。
  23. 根据权利要求22所述的方法,其特征在于,所述根据所述三维数据点的位置坐标在三个方向上的最大值,确定待编码三维数据点的长方体的三个方向的边长的最大值,包括:
    在每个方向上,获取大于等于所述三维数据点的位置坐标的最大值的2的整数次幂的值中最接近所述最大值的值。
  24. 根据权利要求1-23任一项所述的方法,其特征在于,还包括:
    编码包含三维数据点的子块中的三维数据点的数量。
  25. 根据权利要求14所述的方法,其特征在于,当子块中包含1个三维数据点,编码0,当子块中包含N个三维数据点,编码1和N-1。
  26. 一种三维数据点解码方法,其特征在于,包括:
    解码待解码三维数据点的码流;
    根据解码得到的码流,构建六面体,并对六面体进行至少一次八叉树的划分,得到多个第一类子块;
    对所述第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分;
    根据划分得到的子块的位置,得到待解码三维数据点的位置坐标。
  27. 根据权利要求26所述的方法,其特征在于,当所述六面体为长方体时;
    当所述长方体的三个方向的边长均不相等时;
    所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分,包括:
    对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到第二类子块,直到所述第二类子块的两个方向的边长到达最小边长;
    对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,得到第三类子块,直到所述第二类子块的三个方向的边长到达最小边长。
  28. 根据权利要求26所述的方法,其特征在于,当所述六面体为长方体时;
    当所述长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长;
    所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分,包括:
    对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到多个第二类子块,直到所述第二类子块的三个方向的边长到达最小边长。
  29. 根据权利要求26所述的方法,其特征在于,当所述六面体为长方体时;
    当所述长方体的两个方向的边长相等,且所述相等的边长小于另一个方向的边长;
    所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分,包括:
    对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,得到多个第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
  30. 根据权利要求27所述的方法,其特征在于,所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,包括:
    根据第一类子块对应的比特值,确定第一类目标子块,所述第一类目标子块的比特值表示所述子块内包含三维数据点;
    对所述第一类目标子块进行至少一次四叉树划分;
    所述对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,包括:
    根据第二类子块对应的比特值,确定第二类目标子块,所述第二类目标子块的比特值表示所述子块内包含三维数据点;
    对所述第二类目标子块进行至少一次二叉树划分。
  31. 根据权利要求28所述的方法,其特征在于,所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,包括:
    根据第一类子块对应的比特值,确定第一类目标子块,所述第一类目标子块的比特值表示所述子块内包含三维数据点;
    对所述第一类目标子块进行至少一次四叉树划分。
  32. 根据权利要求29所述的方法,其特征在于,所述对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,包括:
    根据第一类子块对应的比特值,确定第一类目标子块,所述第一类目标子块的比特值表示所述子块内包含三维数据点;
    对所述第一类目标子块进行至少一次二叉树划分。
  33. 根据权利要求26-32任一项所述的方法,其特征在于,还包括:
    解码第一标识符,所述第一标识符用于指示变更划分方式,所述划分方式为八叉树划分、四叉树划分或者二叉树划分;
    根据所述第一标识符,确定变更划分方式。
  34. 根据权利要求33任一项所述的方法,其特征在于,还包括:
    解码第二标识符,所述第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向;
    根据所述第二标识符,确定到达最小边长的方向或者未到达最小边长的方向。
  35. 根据权利要求34所述的方法,其特征在于,还包括:
    解码第三标识符,所述第三标识符用于指示划分结束。
  36. 根据权利要求26所述的方法,其特征在于,当所述六面体为立方体时;
    所述对所述第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分,包括:
    根据第一标识符和第二标识符确定进行四叉树划分或者二叉树划分;
    根据第三标识符确定划分结束。
  37. 根据权利要求26-36任一项所述的方法,其特征在于,所述根据解码得到的码流,构建六面体,包括:
    解码待解码三维数据点的位置坐标在三个方向的最大值;
    根据所述三个方向的最大值,构建长方体。
  38. 根据权利要求26-36任一项所述的方法,其特征在于,所述根据解码得到的码流,构建六面体,包括:
    解码待解码三维数据点的位置坐标在三个方向的最大值的最大值;
    根据所述三个方向的最大值的最大值,构建立方体;
    所述根据划分得到的子块的位置,得到待解码三维数据点的位置坐标,包括:
    根据划分得到的子块位置、所述三个方向的最大值的最大值以及划分到最后得到的子块的各边长的比值,得到待编码三维数据点的位置坐标。
  39. 根据权利要求38所述的方法,其特征在于,所述根据划分得到的子块位置、所述三个方向的最大值的最大值以及划分到最后得到的子块的各边长的比值,得到待编码三维数据点的位置坐标,包括:
    根据划分得到的子块的位置,得到待编码三维数据点的第一位置坐标;
    获取所述划分到最后得到的子块的最短的边长分别与其余两个方向的边长比值;
    每个坐标在所述其余两个方向的坐标值均乘以所述方向的比值。
  40. 根据权利要求26-36任一项所述的方法,其特征在于,
    所述根据解码得到的码流,构建六面体,包括:
    解码待解码三维数据点的位置坐标在三个方向的最大值的最小值;
    根据所述三个方向的最大值的最小值,构建立方体;
    所述根据划分得到的子块的位置,得到待解码三维数据点的位置坐标,包括:
    根据划分得到的子块的位置、所述三个方向的最大值的最小值以及划分到最后得到子块的各边长的比值,得到待编码三维数据点的位置坐标。
  41. 根据权利要求40所述的方法,其特征在于,根据划分得到的子块的位置、所述三个方向的最大值的最小值以及划分到最后得到子块的各边长的比值,得到待编码三维数据点的位置坐标,包括:
    根据划分得到的子块的位置,得到待编码三维数据点的第一位置坐标;
    获取所述划分到最后得到的子块的最长的边长分别与其余两个方向的边长比值;
    每个坐标在所述其余两个方向的坐标值均乘以所述方向的比值。
  42. 一种三维数据点的编码装置,其特征在于,包括:
    处理器,用于根据待编码的三维数据点的位置坐标,确定所述待编码的三维数据点的长方体的三个方向的边长的最大值;
    所述处理器还用于对所述长方体进行至少一次八叉树划分,得到多个第一类子块;
    所述处理器还用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分和/或二叉树划分;
    所述处理器还用于根据所述长方体的划分结果对所述待编码的三维数据点进行编码;
    存储器,用于存储编码得到的码流。
  43. 根据权利要求42所述的装置,其特征在于,当所述长方体的三个方向的边长均不相等时;
    所述处理器具体用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到第二类子块,直到所述第二类子块的两个方向的边长到达最小边长;对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,得到第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
  44. 根据权利要求42所述的装置,其特征在于,当所述长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长;
    所述处理器具体用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到多个第二类子块,直到所述第二类子块的三个方向的边长到达最小边长。
  45. 根据权利要求42所述的装置,其特征在于,当所述长方体的两个方向的边长相等,且所述相等的边长小于另一个方向的边长;
    所述处理器具体用于对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,得到多个第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
  46. 根据权利要求43所述的装置,其特征在于,所述处理器具体用于确定所述第一类子块中的第一类目标子块,所述第一类目标子块的一个方向的 边长到达最小边长且所述第一类目标子块中包含三维数据点;对所述第一类目标子块进行至少一次四叉树划分;确定所述第二类子块中的第二类目标子块,所述第二类目标子块的两个方向的边长到达最小边长且所述第二类目标子块中包含三维数据点;对所述第二类目标子块进行至少一次二叉树划分。
  47. 根据权利要求44所述的装置,其特征在于,所述处理器具体用于确定所述第一类子块中的第一类目标子块,所述第一类目标子块的一个方向的边长到达最小边长且所述第一类目标子块中包含三维数据点;对所述第一类目标子块进行至少一次四叉树划分。
  48. 根据权利要求45所述的装置,其特征在于,所述处理器具体用于确定所述第一类子块中的第一类目标子块,所述第一类目标子块的两个方向的边长到达最小边长且所述第一类目标子块中包含三维数据点;对所述第一类目标子块进行至少一次二叉树划分。
  49. 根据权利要求42-48任一项所述的装置,其特征在于,所述处理器具体用于根据划分次序以及每次划分得到的子块中包含的三维数据点情况,依次对每次划分情况进行编码。
  50. 根据权利要求49所述的装置,其特征在于,所述处理器具体用于根据每次划分得到的子块包含三维数据点的情况,得到每次划分对应的码流;根据划分次序,依次编码每次划分对应的码流。
  51. 根据要求50所述的装置,其特征在于,所述处理器具体用于根据每次划分得到的子块包含的三维数据点的情况,得到每个子块对应的比特流,每个子块对应一个比特,包含三维数据点的子块与未包含三维数据点的子块的比特值不同;根据所述子块对应的比特值,生成所述每次划分对应的码流。获取每次划分得到的子块对应的比特值,根据所有子块对应的比特值生成每次划分对应的码流。
  52. 根据权利要求51所述的装置,其特征在于,所述每次划分对应的码流包含8比特;
    所述处理器具体用于执行以下至少一种操作:
    若进行八叉树划分,则根据划分得到的八个子块包含的三维数据点情况,确定所述8个比特的比特值;
    若进行四叉树划分,则根据划分得到的四个子块包含的三维数据点情况, 确定所述8个比特中其中4个比特的比特值,其余4个比特的比特值与未包含三维数据点的子块的比特值相同;
    若进行二叉树划分,则根据划分得到的两个子块包含的三维数据点情况,确定所述8个比特中其中2个比特的比特值,其余6个比特的比特值与未包含三维数据点的子块的比特值相同。
  53. 根据权利要求51所述的装置,其特征在于,所述处理器具体用于执行以下至少一种操作:
    若进行八叉树划分,每次划分对应的码流为8比特,根据划分得到的八个子块包含的三维数据点情况,确定所述8个比特的比特值;
    若进行四叉树划分,每次划分对应的码流为4比特,则根据划分得到的四个子块包含的三维数据点情况,确定所述4个比特的比特值;
    若进行二叉树划分,每次划分对应的码流为2比特,则根据划分得到的两个子块包含的三维数据点情况,确定所述2个比特的比特值。
  54. 根据权利要求52或53所述的装置,其特征在于,包含点云三维数据点的子块对应的比特值为0,未包含点云三维数据点的子块对应的比特值为1;
    或者,
    包含点云三维数据点的子块对应的比特值为0,未包含点云三维数据点的子块对应的比特值为1。
  55. 根据权利要求53所述的装置,其特征在于,所述处理器还用于当划分得到的子块中一个方向或者两个方向的边长到达最小边长,编码第一标识符,所述第一标识符用于指示变更划分方式,所述划分方式为八叉树划分、四叉树划分或者二叉树划分。
  56. 根据权利要求53所述的装置,其特征在于,当进行八叉树划分得到的子块的一个方向的边长到达最小边长或者两个方向的边长同时到达最小边长,所述第一标识符的为8比特,所述8比特的比特值均与未包含三维数据点的子块对应的比特值一致;
    和/或,
    当进行四叉树划分得到子块的两个方向的边长到达最小边长,所述第一标识符为4比特,所述4比特的比特值均与未包含三维数据点的子块对应的 比特值一致。
  57. 根据权利要求55或56所述的装置,其特征在于,所述处理器还用于编码第二标识符,所述第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向。
  58. 根据权利要求57所述的装置,其特征在于,所述第二标识符为3比特或者2比特。
  59. 根据权利要求57或58所述的装置,其特征在于,所述处理器还用于编码第三标识符,所述第三标识符用于指示划分结束。
  60. 根据权利要求42-59任一项所述的装置,其特征在于,所述处理器还用于对待编码三维数据点的位置坐标在三个方向的最大值进行编码,将所述三个方向的最大值写入信息头中。
  61. 根据权利要求42-59任一项所述的装置,其特征在于,所述处理器还用于对待编码三维数据点的位置坐标在三个方向的最大值中的最大值进行编码,将所述三个方向的最大值中的最大值写入信息头中。
  62. 根据权利要求42-59任一项所述的装置,其特征在于,所述处理器还用于对待编码三维数据点的位置坐标在三个方向的最大值中的最小值进行编码,将所述三个方向的最大值中的最小值写入信息头中。
  63. 根据权利要求42-62任一项所述的装置,其特征在于,所述处理器具体用于对待编码三维数据点的位置坐标进行量化;根据量化后的三维数据点的位置坐标,获取三维数据点的位置坐标在三个方向上的最大值;根据所述三维数据点的位置坐标在三个方向上的最大值,确定待编码三维数据点的长方体的三个方向的边长的最大值。
  64. 根据权利要求63所述的装置,其特征在于,所述处理器具体用于在每个方向上,获取大于等于所述三维数据点的位置坐标的最大值的2的整数次幂的值中最接近所述最大值的值。
  65. 根据权利要求42-64任一项所述的装置,其特征在于,所述处理器还用于编码包含三维数据点的子块中的三维数据点的数量。
  66. 根据权利要求55所述的装置,其特征在于,当子块中包含1个三维数据点,编码0,当子块中包含N个三维数据点,编码1和N-1。
  67. 一种三维数据点解码装置,其特征在于,包括:
    处理器,用于解码待解码三维数据点的码流;
    所述处理器还用于根据解码得到的码流,构建六面体,并对六面体进行至少一次八叉树的划分,得到多个第一类子块;
    所述处理器还用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树和/或二叉树划分;
    所述处理器还用于根据划分得到的子块的位置,得到待解码三维数据点的位置坐标;
    存储器,用于存储待解码三维数据点的位置坐标。
  68. 根据权利要求67所述的装置,其特征在于,当所述六面体为长方体时;
    当所述长方体的三个方向的边长均不相等时;
    所述处理器具体用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到第二类子块,直到所述第二类子块的两个方向的边长到达最小边长;对所述第二类子块中的至少一个第二类子块进行至少一次二叉树划分,得到第三类子块,直到所述第二类子块的三个方向的边长到达最小边长。
  69. 根据权利要求67所述的装置,其特征在于,当所述六面体为长方体时;
    当所述长方体的两个方向的边长相等,且所述相等的边长大于另一个方向的边长;
    所述处理器具体用于对所述第一类子块中的至少一个第一类子块进行至少一次四叉树划分,得到多个第二类子块,直到所述第二类子块的三个方向的边长到达最小边长。
  70. 根据权利要求67所述的装置,其特征在于,当所述六面体为长方体时;
    当所述长方体的两个方向的边长相等,且所述相等的边长小于另一个方向的边长;
    所述处理器具体用于对所述第一类子块中的至少一个第一类子块进行至少一次二叉树划分,得到多个第三类子块,直到所述第三类子块的三个方向的边长到达最小边长。
  71. 根据权利要求68所述的装置,其特征在于,所述处理器具体用于根据第一类子块对应的比特值,确定第一类目标子块,所述第一类目标子块的比特值表示所述子块内包含三维数据点;
    对所述第一类目标子块进行至少一次四叉树划分;
    根据第二类子块对应的比特值,确定第二类目标子块,所述第二类目标子块的比特值表示所述子块内包含三维数据点;
    对所述第二类目标子块进行至少一次二叉树划分。
  72. 根据权利要求69所述的装置,其特征在于,所述处理器具体用于根据第一类子块对应的比特值,确定第一类目标子块,所述第一类目标子块的比特值表示所述子块内包含三维数据点;
    对所述第一类目标子块进行至少一次四叉树划分。
  73. 根据权利要求70所述的装置,其特征在于,所述处理器具体用于根据第一类子块对应的比特值,确定第一类目标子块,所述第一类目标子块的比特值表示所述子块内包含三维数据点;
    对所述第一类目标子块进行至少一次二叉树划分。
  74. 根据权利要求67-73任一项所述的装置,其特征在于,所述处理器具体还用于解码第一标识符,所述第一标识符用于指示变更划分方式,所述划分方式为八叉树划分、四叉树划分或者二叉树划分;根据所述第一标识符,确定变更划分方式。
  75. 根据权利要求74任一项所述的装置,其特征在于,所述处理器具体还用于解码第二标识符,所述第二标识符用于指示到达最小边长的方向或者未到达最小边长的方向;根据所述第二标识符,确定到达最小边长的方向或者未到达最小边长的方向。
  76. 根据权利要求75所述的装置,其特征在于,所述处理器还用于解码第三标识符,所述第三标识符用于指示划分结束。
  77. 根据权利要求67所述的装置,其特征在于,当所述六面体为立方体时;
    所述处理器具体用于根据第一标识符和第二标识符确定进行四叉树划分或者二叉树划分;根据第三标识符确定划分结束。
  78. 根据权利要求67-77任一项所述的装置,其特征在于,所述处理器 具体用于解码待解码三维数据点的位置坐标在三个方向的最大值;根据所述三个方向的最大值,构建长方体。
  79. 根据权利要求67-77任一项所述的装置,其特征在于,所述处理器具体用于解码待解码三维数据点的位置坐标在三个方向的最大值的最大值;根据所述三个方向的最大值的最大值,构建立方体;根据划分得到的子块位置、所述三个方向的最大值的最大值以及划分到最后得到的子块的各边长的比值,得到待编码三维数据点的位置坐标。
  80. 根据权利要求79所述的装置,其特征在于,所述处理器具体用于根据划分得到的子块的位置,得到待编码三维数据点的第一位置坐标;获取所述划分到最后得到的子块的最短的边长分别与其余两个方向的边长比值;每个坐标在所述其余两个方向的坐标值均乘以所述方向的比值。
  81. 根据权利要求67-77任一项所述的装置,其特征在于,所述处理器具体用于解码待解码三维数据点的位置坐标在三个方向的最大值的最小值;根据所述三个方向的最大值的最小值,构建立方体;根据划分得到的子块的位置、所述三个方向的最大值的最小值以及划分到最后得到子块的各边长的比值,得到待编码三维数据点的位置坐标。
  82. 根据权利要求81所述的装置,其特征在于,所述处理器具体用于根据划分得到的子块的位置,得到待编码三维数据点的第一位置坐标;获取所述划分到最后得到的子块的最长的边长分别与其余两个方向的边长比值;每个坐标在所述其余两个方向的坐标值均乘以所述方向的比值。
  83. 一种编码器,其特征在于,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序,所述处理器执行所述程序时实现权利要求1-25任一项所述的三维数据点编码方法。
  84. 一种解码器,其特征在于,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序,所述处理器执行所述程序时实现权利要求26-41任一项所述的三维数据点解码方法。
PCT/CN2019/071494 2019-01-11 2019-01-11 三维数据点的编解码方法和装置 WO2020143063A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201980005594.6A CN111406408B (zh) 2019-01-11 2019-01-11 三维数据点的编解码方法和装置
PCT/CN2019/071494 WO2020143063A1 (zh) 2019-01-11 2019-01-11 三维数据点的编解码方法和装置
US17/371,999 US20210335015A1 (en) 2019-01-11 2021-07-09 Three-dimensional data point encoding and decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/071494 WO2020143063A1 (zh) 2019-01-11 2019-01-11 三维数据点的编解码方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/371,999 Continuation US20210335015A1 (en) 2019-01-11 2021-07-09 Three-dimensional data point encoding and decoding method and device

Publications (1)

Publication Number Publication Date
WO2020143063A1 true WO2020143063A1 (zh) 2020-07-16

Family

ID=71414905

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/071494 WO2020143063A1 (zh) 2019-01-11 2019-01-11 三维数据点的编解码方法和装置

Country Status (3)

Country Link
US (1) US20210335015A1 (zh)
CN (1) CN111406408B (zh)
WO (1) WO2020143063A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11252439B2 (en) * 2020-02-10 2022-02-15 Tencent America LLC Flexible tree partition and representation for point cloud coding
US11836953B2 (en) * 2020-10-06 2023-12-05 Sony Group Corporation Video based mesh compression

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1681330A (zh) * 2004-03-08 2005-10-12 三星电子株式会社 自适应2n叉树生成方法及3D体数据编码和解码方法和设备
US20110091118A1 (en) * 2009-10-16 2011-04-21 Samsung Electronics Co., Ltd. Apparatus and method for coding a three dimensional mesh
CN104243958A (zh) * 2014-09-29 2014-12-24 联想(北京)有限公司 三维网格数据的编码、解码方法以及编码、解码装置
CN105808672A (zh) * 2016-03-01 2016-07-27 重庆市勘测院 基于浏览器的海量三维点云数据的发布方法
CN108965873A (zh) * 2018-07-24 2018-12-07 北京大学 一种脉冲阵列编码的自适应划分方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1681330A (zh) * 2004-03-08 2005-10-12 三星电子株式会社 自适应2n叉树生成方法及3D体数据编码和解码方法和设备
US20110091118A1 (en) * 2009-10-16 2011-04-21 Samsung Electronics Co., Ltd. Apparatus and method for coding a three dimensional mesh
CN104243958A (zh) * 2014-09-29 2014-12-24 联想(北京)有限公司 三维网格数据的编码、解码方法以及编码、解码装置
CN105808672A (zh) * 2016-03-01 2016-07-27 重庆市勘测院 基于浏览器的海量三维点云数据的发布方法
CN108965873A (zh) * 2018-07-24 2018-12-07 北京大学 一种脉冲阵列编码的自适应划分方法

Also Published As

Publication number Publication date
US20210335015A1 (en) 2021-10-28
CN111406408B (zh) 2023-02-21
CN111406408A (zh) 2020-07-10

Similar Documents

Publication Publication Date Title
CN111247802B (zh) 用于三维数据点集处理的方法和设备
WO2020243874A1 (zh) 点云数据的位置坐标的编解码方法、系统和存储介质
US20210343047A1 (en) Three-dimensional data point encoding and decoding method and device
CN111247798B (zh) 对三维数据点集进行编码或解码的方法和设备
US20210335015A1 (en) Three-dimensional data point encoding and decoding method and device
CN114503440A (zh) 基于树的点云编解码的角度模式
KR20220166790A (ko) 지오메트리 기반 포인트 클라우드 압축에서의 각도 및 방위각 모드들에 대한 레이저 각도들의 코딩
US11580672B2 (en) Angular mode simplification for geometry-based point cloud compression
KR20220164702A (ko) 지오메트리 기반 포인트 클라우드 압축에서의 각도 및 방위각 모드들에 대한 레이저 각도들의 코딩
CN111566510A (zh) 测距装置及其扫描视场的均衡方法、移动平台
Tu et al. Motion analysis and performance improved method for 3D LiDAR sensor data compression
CN210199305U (zh) 一种扫描模组、测距装置及可移动平台
CN112740702A (zh) 点云的编解码方法和装置
CN113534105A (zh) 激光扫描控制方法、装置、mems振镜和激光雷达
CN108303702A (zh) 一种相位式激光测距系统及方法
US11842520B2 (en) Angular mode simplification for geometry-based point cloud compression
US20220108493A1 (en) Encoding/decoding method and device for three-dimensional data points
CN112689997B (zh) 点云的排序方法和装置
US20220082665A1 (en) Ranging apparatus and method for controlling scanning field of view thereof
US11924428B2 (en) Scale factor for quantization parameter values in geometry-based point cloud compression
US11871037B2 (en) Sorted laser angles for geometry-based point cloud compression (G-PCC)

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: 19908633

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19908633

Country of ref document: EP

Kind code of ref document: A1