Nearest neighbor search method, encoder, decoder, and storage medium
Patent Information
- Application Number
- JP2022564616
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-04-30
- Filing Date
- 2021-03-25
- Publication Date
- 2025-03-05
- Estimated Expiration
- 2041-03-25
Smart Images

Figure 0007640578000006 
Figure 0007640578000007 
Figure 0007640578000008
Abstract
Description
[Technical field]
[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application claims priority to a Chinese patent application bearing application number 202010366795.3, filed with the China Patent Office on April 30, 2020, the entire contents of which are incorporated herein by reference.
[0002] This application relates to the field of video coding, including but not limited to nearest neighbor search methods, encoders, decoders, and storage media. [Background technology]
[0003] In the related art, after splitting the Level of Detail (LOD) of a point cloud attribute, each time a layer of the LOD is split, a nearest neighbor search is performed on the currently split LOD layer. The search method is to search for a point corresponding to the first Morton code larger than the Morton code of the current point in the set sorted in ascending order of Morton codes, search around the index corresponding to the point, and then calculate the distance between each point and the current point, thereby obtaining the three nearest neighbor points.
[0004] However, Morton code has periodic trip points because it cannot well reflect the spatial distance between two points. However, it cannot guarantee that the neighbors of Morton code have similar spatial positions, so finding the nearest neighbors around the Morton code of the first point is inaccurate, and the performance and efficiency vary greatly depending on the size of the search range. Therefore, it cannot adaptively search for the nearest point, and the search accuracy decreases. Summary of the Invention [Problem to be solved by the invention]
[0005] The embodiments of the present application provide a nearest neighbor search method, an encoder, a decoder, and a storage medium that can improve the accuracy and success rate of the search. [Means for solving the problem]
[0006] The technical solution according to the embodiment of the present application is realized as follows.
[0007] An embodiment of the present application provides a nearest neighbor search method applied to an encoder, the method comprising: Obtaining a Morton code set for the point cloud data to be searched; layering the point cloud data based on the Morton code set and a first distance threshold to obtain data of a current layer; Shifting the Morton code bits of the predicted data corresponding to the data of the current layer in the point cloud data by a first predetermined number of bits to the right to obtain a corresponding first parent node set; determining an adjacent region for the first set of parent nodes based on a Morton code for the current layer of data, and determining a set of nearest neighbors for the current layer of data in the adjacent region; If the adjacent area is not determined, determining a search point of the current layer of data based on a second node set, and performing a search within a first predetermined search range corresponding to the search point to determine a nearest neighbor point set, wherein the second node set is a predicted data set corresponding to the current layer of data in the point cloud data.
[0008] An embodiment of the present invention provides a nearest neighbor search method applied to a decoder, the method comprising: Obtaining a Morton code set for the point cloud data to be searched; layering the point cloud data based on the Morton code set and a first distance threshold to obtain data of a current layer; Shifting the Morton code bits of the predicted data corresponding to the data of the current layer in the point cloud data by a first predetermined number of bits to the right to obtain a corresponding first parent node set; determining an adjacent region for the first set of parent nodes based on a Morton code for the current layer of data, and determining a set of nearest neighbors for the current layer of data in the adjacent region; If the adjacent area is not determined, determining a search point of the current layer of data based on a second node set, and performing a search within a first predetermined search range corresponding to the search point to determine a nearest neighbor point set, wherein the second node set is a predicted data set corresponding to the current layer of data in the point cloud data.
[0009] An embodiment of the present invention provides an encoder, the encoder comprising: a first acquisition unit configured to acquire a Morton code set for the point cloud data to be searched; a first division unit configured to divide the point cloud data into layers based on the Morton code set and a first distance threshold to obtain data of a current layer; A first shifting unit configured to right-shift a Morton code bit of predicted data corresponding to a current layer data in the point cloud data by a first predetermined number of bits to obtain a corresponding first set of parent nodes; a first determination unit configured to determine an adjacent region in the first parent node set based on a Morton code of the current layer data, determine a nearest neighbor set of the current layer data in the adjacent region, and if the adjacent region is not determined, determine a search point of the current layer data based on a second node set, and perform a search within a first predetermined search range corresponding to the search point to determine the nearest neighbor set, wherein the second node set is a predicted data set corresponding to the current layer data in the point cloud data.
[0010] An embodiment of the present invention provides a decoder, the decoder comprising: a second acquisition unit configured to acquire a Morton code set for the point cloud data to be searched; a second division unit configured to divide the point cloud data into layers based on the Morton code set and a first distance threshold to obtain data of a current layer; A second shifting unit configured to right-shift the Morton code bits of the prediction data corresponding to the data of the current layer in the point cloud data by a first predetermined number of bits to obtain a corresponding first set of parent nodes; a second determination unit configured to determine an adjacent region in the first parent node set based on a Morton code of the current layer data, determine a nearest point set of the current layer data in the adjacent region, and if the adjacent region is not determined, determine a search point of the current layer data based on a second node set, and perform a search within a first predetermined search range corresponding to the search point to determine the nearest point set, wherein the second node set is a predicted data set corresponding to the current layer data in the point cloud data.
[0011] An embodiment of the present application further provides an encoder, the encoder comprising: a first memory; and a first processor; the first memory is configured to store a computer program executable by the first processor; The first processor is configured, when executing the computer program, to perform an encoder-side nearest neighbor search method.
[0012] An embodiment of the present invention further provides a decoder, the decoder comprising: a second memory; and a second processor; the second memory is configured to store a computer program executable by the second processor; The second processor is configured, when executing the computer program, to perform a decoder-side nearest neighbor search method.
[0013] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, the computer program causing a first processor to execute a nearest neighbor search method on the encoder side, or causing a second processor to execute a nearest neighbor search method on the decoder side. [Brief description of the drawings]
[0014] [Figure 1] FIG. 2 is a flow diagram of G-PCC encoding according to an exemplary embodiment of the present application. [Diagram 2] FIG. 2 is a flow diagram of G-PCC decoding according to an exemplary embodiment of the present application. [Diagram 3] 4 is a flowchart of a nearest neighbor searching method according to an exemplary embodiment of the present application; [Figure 4] 4 is a flow chart for determining the number of initial right shift bits according to an exemplary embodiment of the present application; [Diagram 5] FIG. 2 is a schematic diagram of a spatial relationship between a current node and adjacent nodes according to an exemplary embodiment of the present application; [Figure 6] FIG. 2 is a schematic structural diagram of an encoder according to an exemplary embodiment of the present application; [Figure 7] FIG. 2 is a schematic diagram of a specific hardware structure of an encoder according to an exemplary embodiment of the present application; [Figure 8] FIG. 2 is a schematic structural diagram of a decoder according to an exemplary embodiment of the present application; [Figure 9] FIG. 2 is a schematic diagram of a specific hardware structure of a decoder according to an exemplary embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] In the following, the technical solutions of the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application.
[0016] An exemplary embodiment of the present application proposes a nearest neighbor search method, which is applied to a mobile device with a front camera or a rear camera function, and the mobile device may be implemented in various forms. For example, the mobile device described in an exemplary embodiment of the present application may include a mobile phone, a tablet computer, a palmtop computer, a personal digital assistant (PDA), etc. In addition, the function realized by the method can be realized by a processor in the mobile device calling a program code, and of course, the program code can be stored in a computer storage medium, and it can be understood that the mobile device includes at least a processor and a storage medium. In the point cloud G-PCC encoder framework, the point cloud of the input 3D image model is divided into slices, and then each slice is encoded separately.
[0017] Referring to FIG. 1, FIG. 1 is a flow diagram of G-PCC encoding according to a related technical solution. In the flow diagram of G-PCC encoding shown in FIG. 1, this method is applied to a point cloud encoder, and for point cloud data to be encoded, first, the point cloud data is divided into a number of slices by slice division. In each slice, the geometric information of the point cloud and the attribute information corresponding to each point cloud are encoded separately. In the geometry encoding process, first, a coordinate transformation is performed on the geometric information so that the point clouds are all contained in one bounding box, and then quantization is performed. This quantization step mainly plays a role of scaling, and because of the rounding of quantization, the geometric information of some point clouds will be the same, so it is determined whether to remove duplicate points based on a parameter. The process of quantizing and removing duplicate points is also called a voxelization process. Then, an octree division is performed on the bounding box. In the octree-based geometry information encoding process, the bounding box is divided equally into 8 subcubes, and the non-empty subcubes (containing the points in the point cloud) are continuously divided into 8 equal parts, and the division is stopped when the leaf node obtained by the division is a 1×1×1 unit cube, and arithmetic coding is performed on the points in the leaf node to generate a binary geometry bit stream, i.e., a geometry code stream. The trisoup (triangle soup)-based geometry information encoding process also requires octree division, but unlike the octree-based geometry information encoding, trisoup does not need to divide the point cloud into unit cubes with side lengths of 1×1×1, and stops the division when the side length of the block (subblock) becomes W, and based on the surface formed by the distribution of the point cloud in each block, obtains up to 12 vertices (intersections) generated by the surface and the 12 edges of the block, and performs arithmetic coding on the vertices (surface fitting based on the intersections) to generate a binary geometry bit stream, i.e., a geometry code stream.Vertex is also used to implement the geometry reconstruction process, and the reconstructed set information is used for attribute encoding of point clouds.
[0018] After geometry encoding is completed, the geometry information is reconstructed. Currently, attribute encoding is mainly performed on color information. In the attribute encoding process, first, the color information (i.e., attribute information) is converted from the RGB color space to the YUV color space. Then, the reconstructed geometry information is used to recolor the point cloud so that the uncoded attribute information corresponds to the reconstructed geometry information. In the color information encoding process, there are mainly two conversion methods, one method is the distance-based lifting transformation that relies on the Level of Detail (LOD) division, and currently, the LOD division is mainly divided into two methods: LOD division based on distance (mainly for Category1 sequences) and LOD division based on a fixed sampling rate (mainly for Category3 sequences). The other method is to directly perform the transformation of the Region Adaptive Hierarchal Transform (RAHT). Here, both of these two methods convert the color information from the spatial domain to the frequency domain, obtain the high-frequency and low-frequency coefficients through the transformation, and quantize the coefficients (i.e., coefficient quantization). Finally, the octree-divided and surface-fitted geometry encoded data and the coefficient-quantized attribute encoded data are slice-combined, and then the vertex coordinates of each block are sequentially coded (i.e., arithmetic coded) to generate a binary attribute bit stream, i.e., an attribute code stream.
[0019] Referring to FIG. 2, FIG. 2 is a flow diagram of G-PCC decoding according to a related technical solution. In the G-PCC decoding flow chart shown in FIG. 2, the method is applied to a point cloud decoder. For an acquired binary code stream, firstly, the geometry bit stream and the attribute bit stream in the binary code stream are decoded separately. When the geometry bit stream is decoded, the geometry information of the point cloud is obtained by arithmetic decoding-octree synthesis-surface fitting-geometry reconstruction-inverse coordinate transformation; when the attribute bit stream is decoded, the attribute information of the point cloud is obtained by arithmetic decoding-inverse quantization-LIFTING inverse transformation based on LOD or RAHT inverse transformation-inverse color transformation; and according to the geometry information and the attribute information, the 3D image model of the point cloud data to be encoded is restored.
[0020] In the related technical scheme, a technical scheme of LOD partitioning based on Morton code is proposed. Compared with the original technical scheme of LOD partitioning based on traverse search of all points, the technical scheme of LOD partitioning based on Morton code can reduce the computational complexity.
[0021] JPEG0007640578000001.jpg41170
[0022] JPEG0007640578000002.jpg48170
[0023] JPEG0007640578000003.jpg19170
[0024] The present embodiment provides a nearest neighbor search method that can be applied in an encoder (which can also be a point cloud encoder) or in a decoder (a point cloud decoder).
[0025] Hereinafter, each embodiment of the present application will be described in detail with reference to the drawings.
[0026] Please refer to Figure 3, which is a flowchart of a division method according to an embodiment of the present application. As shown in Figure 3, the method can be applied to an encoder or a decoder and includes the following steps:
[0027] In step S101, the Morton code set of the point cloud data to be searched is obtained.
[0028] Note that in a point cloud, the point cloud data can be all the points in the point cloud, or a subset of the points in the point cloud, which are relatively concentrated in space.
[0029] Also, please note that the present embodiment aims to improve the LOD generation process in lifting and predicting attribute transformation. That is, before performing lifting or predicting transformation, it is necessary to first perform LOD layer division using this division method. Specifically, the division method may be applied to the LOD generation part in the G-PCC encoding flow chart shown in FIG. 1, or may be applied to the LOD generation part in the G-PCC decoding flow chart shown in FIG. 2, or may be applied simultaneously to the LOD generation part in the G-PCC encoding flow chart shown in FIG. 1 and the LOD generation part in the G-PCC decoding flow chart shown in FIG. 2, but the present embodiment is not limited thereto.
[0030] In the present embodiment, the point cloud data to be searched can be understood as point cloud data for which the nearest point needs to be determined, and for example, in the process of compressing and encoding the point cloud data, the Morton code set of the point cloud data is first determined. In some possible implementations, the point cloud data to be searched, for example, point cloud data used to form a 3D video, is first obtained. Then, the Morton code of the point cloud data is determined, for example, a binary encoded data stream of the point cloud data is determined, and then the Morton code of the point cloud data can be determined based on the binary encoded data stream. Finally, the Morton codes of the point cloud data are arranged in ascending order to obtain the Morton code set including a plurality of Morton codes. In another embodiment, the Morton codes of the point cloud data can also be arranged in descending order to obtain the Morton code set including a plurality of Morton codes, or the Morton codes of the point cloud data can be arranged in any specific order (for example, an arbitrarily set order in which the middle is the largest and the numbers of the codes are successively smaller toward both ends) to obtain the Morton code set. That is, the arrangement of the Morton codes in the Morton code set is ordered.
[0031] In this way, after obtaining the point cloud data to be searched, the Morton codes of the points in the point cloud data to be searched are first calculated to obtain a Morton code set, and in subsequent iterative operations, the Morton codes can be used to search for adjacent nodes of the parent node corresponding to the current node. Therefore, when performing LOD layer division, it is advantageous to predict adjacent nodes using the current node as a sampling point.
[0032] In step S102, the point cloud data is layered based on the Morton code set and the first distance threshold to obtain data of a current layer.
[0033] Here, according to the first distance threshold, select a point from the Morton code set whose distance to the current point is smaller than the first distance threshold to obtain the data of the current layer, and each time the data of one layer is divided, the first distance threshold gradually increases, that is, the first distance threshold used when dividing the data of the next layer of the data of the current layer is larger than the first distance threshold used for the data of the current layer, that is, the density of the data of the next layer of the data of the current layer is smaller than the density of the data of the current layer.
[0034] In some possible implementations, a second set is first determined based on the Morton code set, the second set including at least the points corresponding to the first Morton code.
[0035] For example, the point corresponding to the first Morton code in the set of Morton codes sorted in ascending order is taken as the point in the second set.
[0036] Next, if the distance between the current point currently being processed in the point cloud data and a point in the second set is less than or equal to the first distance threshold, the current point is put into the first set.
[0037] It should be noted that initially, the first set is initialized to an empty set, and if the distance between the currently processed point in the point cloud data and a point in the second set is less than or equal to a first distance threshold, the current point is put into the first set, i.e., the initial first set is an empty set.
[0038] For example, from the Morton code set, determine points that are close to the current point, i.e., the density of points in the obtained first set is large, determine the distance between a point corresponding to a second Morton code in the Morton code set and all points in the second set, and if any distance is less than or equal to a first distance threshold, put the current point into the first set.
[0039] Also, if the distance between the current point and a point in the second set is greater than the first distance threshold, then the current point is placed in the second set.
[0040] In a specific example, the points are traversed in the order of the Morton code, and for a current point P being traversed, it is determined whether the distance between P and a point in the second set O(k) is equal to or less than a first distance threshold, and if so, P is put into the first set L(k), otherwise, P is put into O(k). Here, when determining the distance between P and a point in O(k), if the number of points in O(k) is greater than 128, only the last 128 points in O(k) are used to determine whether the distance between point P and these points is greater than the first distance threshold, and whether point P is put into the first set or the second set is determined. In this way, by determining the distance between a predetermined number of points arranged at the end of the second set and the current point to determine whether the current point should be put into the first set or the second set, the complexity is reduced, and the points arranged at the end of the second set are closer to the Morton code of the current point, so that the final neighboring region thus obtained is more likely to include the nearest neighbor.
[0041] Finally, a point in the second set whose distance from the current point is less than or equal to a second distance threshold is determined to obtain data for the current layer.
[0042] In some possible implementations, the second set may include a plurality of points, and the points whose distance between the current point in the point cloud data and the points in the second set is less than a first distance threshold are used as the first layer of data. Then, the distance between the remaining points in the point cloud data and the points in the updated second set is sequentially traversed, and the points whose distance is less than the second distance threshold are used as the second layer of data to obtain the updated second set again. Then, the distance between the remaining points in the point cloud data and the points in the updated second set is sequentially traversed, and the points whose distance is less than another distance threshold (the other distance threshold is greater than the second distance threshold) are used as the third layer of data, and the above process is repeated until the point cloud data is divided into multiple layers of data.
[0043] In step S103, the Morton code bits of the predicted data corresponding to the data of the current layer in the point cloud data are shifted right by a first predetermined number of bits to obtain a corresponding first parent node set.
[0044] Here, shifting the Morton code bits of the predicted data corresponding to the data of the current layer in the point cloud data to the right by a first predetermined number of bits can be understood as expanding the range corresponding to the Morton code of the predicted data by multiple times.
[0045] Please note that the first predetermined number of bits is a predetermined non-negative integer, including the case where the first predetermined number of bits is 0, i.e., no shifting. For example, if the current layer is the first layer, the first predetermined number of bits may be 0, and the embodiment of the present application is not limited thereto.
[0046] Exemplarily, the first predetermined number of bits is 3, that is, the range is 2 3 1. However, the embodiment of the present invention is not limited to this. Therefore, the first parent node set is the Morton code set of the predicted data after being right-shifted.
[0047] In this case, the second set of nodes is a predicted data set corresponding to the current layer of data in the point cloud data, where the predicted data are predicted points corresponding to the current layer of data, and the current layer of data are the points to be predicted.
[0048] In some embodiments of the present application, if the current layer is not the first layer, a first parent node set is obtained through a first predetermined number of bits, and the points of the data of the previous layer are predicted data of the point cloud data excluding the layered data, which is preset, for example, 3, but the embodiments of the present application are not limited thereto.
[0049] In this embodiment, when the encoder encodes, the encoder needs to write a first predetermined number of bits into the codestream, where the first predetermined number of bits is a predetermined non-negative integer.
[0050] Here, a first predetermined number of bits can be written into a parameter set data unit in the codestream.
[0051] In the decoding process of the decoder, when parsing the codestream to obtain the first predetermined number of bits, the decoder first needs to parse the parameter set data unit in the codestream to obtain the first predetermined number of bits, where the first predetermined number of bits is a non-negative integer.
[0052] In this embodiment, the parameter set data unit contains parameters used to decode some or all of the data units in the codestream.
[0053] In this embodiment, the parameter set data unit is a sequence parameter set data unit (Sequence Parameter Set).
[0054] In the present embodiment, the parameter set data unit includes attribute information of the point cloud data, where the attribute information is a scalar or vector attribute associated with a point in the point cloud data, i.e., the parameter set data unit may be an attribute parameter set.
[0055] In the present embodiment, the parameter set data unit includes geometry information of the point cloud data, where the geometry information is Cartesian coordinates associated with points in the point cloud data, i.e., the parameter set data unit may be a geometry parameter set.
[0056] In some embodiments of the present application, the process of obtaining the first predetermined number of bits includes: sampling a Morton code set according to a predetermined interval to obtain a sampling point set, where the Morton code set includes all or part of the Morton codes of the prediction data; right-shifting the Morton code bits of points in the sampling point set by n bits to obtain a sampling parent node set, where each sampling parent node corresponds to one right-shifted Morton code; determining adjacent points excluding the sampling points in a region corresponding to the sampling parent node set; and if the average number of adjacent points in the sampling parent node set is greater than a predetermined average threshold, determining the n-bit number as the value of the first predetermined number of bits, where n is a non-negative integer.
[0057] Here, the number of sampling points in the sampling point set is H, where H is a positive integer greater than 0, but the embodiment of the present application is not limited thereto.
[0058] In some embodiments of the present application, the rearranged Morton code is sampled to obtain a Morton code of K sampling points, where K is a positive integer greater than 0; performing a right-shift operation on the Morton code of the K sampling points to obtain K sampling points corresponding to the right-shifted Morton code; determining, with respect to the K sampling points corresponding to the right-shifted Morton code, whether each sampling point corresponds to at least one adjacent node on average; if the K sampling points corresponding to the right-shifted Morton code do not satisfy the condition that each sampling point corresponds to at least one adjacent node on average, continuing to perform a step of performing a right-shift operation on the Morton code of the K sampling points; if the K sampling points corresponding to the right-shifted Morton code satisfy the condition that each sampling point corresponds to at least one adjacent node on average, obtaining a right-shift bit number of the K sampling points; and determining the right-shift bit number as an initial right-shift bit number N0 of the Morton code of the point in the point cloud to be divided, where the initial right-shift bit number represents a right-shift bit number N0 corresponding to the 0th LOD layer of the Morton code of the point in the point cloud to be divided.
[0059] That is, when the LOD layer is divided for the first time, i.e., when the 0th LOD layer is divided, first, the Morton code of K sampling points is obtained by sampling the rearranged Morton code, then, until the K sampling points corresponding to the right-shifted Morton code satisfy the condition that each sampling point corresponds to at least one adjacent node on average, the right-shift process is continued on the Morton code of these K sampling points, and finally, the obtained number of right-shift bits is set as the initial number of right-shift bits N0.
[0060] For example, as shown in FIG. 4, this is realized as follows.
[0061] In step S1, the points are arranged in ascending order of the Morton code, and the indices arranged according to the Morton code are sampled.
[0062] For example, if H is assumed to be 100, then 100 equally spaced points are selected as sampling points.
[0063] In step S2, the initial number of right shift bits is set to zero.
[0064] Here, the initial right shift bit number n is set to 0.
[0065] In step S3, the Morton code of the sampling point is shifted right by 3 bits each time.
[0066] Here, the initial right shift bit number n is set to 0, and then, each time a layer is divided, the sampling point Morton Code Shift right by 3 bits.
[0067] In step S4, the number of adjacent points contained in the parent node corresponding to the right-shifted Morton code is determined.
[0068] In step S5, it is determined whether the average number of adjacent points of all the Morton codes is greater than one.
[0069] Here, the remaining points in the parent node except for the current point are considered to be the neighbors of the current point. If the average value is greater than 1, step S6 is executed, in which the right shift bit number n is the initial right shift bit number N, and the cyclic process is terminated; otherwise, return to step S3 and perform the operation of right shifting by 3 bits.
[0070] In step S6, the number of right shift bits n is the initial number of right shift bits N.
[0071] After the LOD layer is split, when performing the nearest neighbor search, for a predicted point P, the Morton code of its parent node can be found in O(k). As shown in FIG. 5, block 701 is the parent node of the current predicted point P. For the current parent node, there are 26 adjacent adjacent parent nodes. According to the coordinate difference between the adjacent parent node and the current parent node, a lookup table is established, and the Morton code of the adjacent parent node is calculated based on this lookup table. By using these Morton codes, the indexes corresponding to these adjacent Morton codes can be found in O(k), and the points corresponding to these indexes can be traversed to find the nearest neighbor of the predicted point P. In some embodiments, in addition to the 27 adjacent parent nodes that are themselves coplanar, collinear, and copoint, the range of the adjacent parent nodes can be expanded or reduced. In this way, the number of neighbors can be expanded outward. Similarly, for the selection of the neighbors, a part of the neighborhood can also be selected to perform the nearest neighbor search.
[0072] In step S104, an adjacent region is determined in the first parent node set based on the Morton code of the data of the current layer, and a set of nearest neighbor points of the data of the current layer is determined in the adjacent region.
[0073] Here, the adjacent region can be understood as the adjacent region close to the current parent node, and in this way, by searching the adjacent region via the Morton code, the search range can be reduced on the premise that the nearest point in the region can be accurately detected.
[0074] Here, for each layer of data, one set of nearest neighbors is determined. The set of nearest neighbors may be the nearest neighbors that contain a certain amount of data. The amount of the certain amount of data is not limited in the present embodiment.
[0075] Illustratively, the specific amount of data includes three.
[0076] In some possible implementations, first, the distance between the points in the adjacent region and the points in the data of the current layer is determined to obtain a distance set, for example, if there are M points in the data of the current layer, the distance between the M points and the points in the adjacent region is determined to obtain a distance set. Next, a target distance less than a third distance threshold is determined from the distance set, and in some embodiments, the third distance threshold can be set to a relatively small value, and the third distance threshold is less than the first distance threshold. In a specific example, K target distances (K is a positive integer greater than 0) having the smallest distances can be determined from the distance set. Finally, a nearest neighbor set of the current point is determined based on the points corresponding to the target distances. For example, the points corresponding to the N target distances are set as the nearest neighbor set of the current point. Also, some points having smaller distances can be determined as the nearest neighbor set of the current point from the points corresponding to the N target distances. For example, a point corresponding to a minimum distance value that satisfies a predetermined number is determined from the points corresponding to the target distances to obtain the nearest neighbor set of the current point. Here, M is a positive integer greater than 0.
[0077] In a specific example, from the points corresponding to the target distance, the points corresponding to a certain number of minimum distance values are determined to obtain a set of nearest neighbors of the current point, and in this way, the nearest neighbors are accurately found, and the encoding performance of the point cloud data is improved.
[0078] In some embodiments, if the distance set does not include a target distance whose distance is less than the third distance threshold, the points aligned at a predetermined position from the second set are determined as a nearest neighbor set of the current point, for example, the K nearest neighbor points aligned before and after the current point are determined as the nearest neighbor set.
[0079] In one exemplary embodiment of the present application, the adjacent regions are searched for based on the Morton code of the current layer data, and assuming that the adjacent regions can be found accurately, the search range for the nearest neighbor is reduced, thereby reducing the number of distance calculations and achieving better coding performance and efficiency.
[0080] In step S105, if the adjacent area is not determined, a search point of the current layer data is determined based on the second node set, and a search is performed within a first predetermined search range corresponding to the search point to determine a nearest neighbor point set, and the second node set is a predicted data set corresponding to the current layer data in the point cloud data.
[0081] In the present embodiment, if a nearest point set of the current layer data is not determined based on the Morton code of the current layer data and the first parent node set, a search point of the current layer data is determined based on the second node set, and a search is performed within a first predetermined search range corresponding to the search point, thereby determining a candidate point set, and from the candidate point set, K points closest to the current point are determined as a nearest point set, where the second node set is a predicted data set corresponding to the current layer data in the point cloud data, where K is a positive integer greater than 0.
[0082] Note that the second set of nodes is the second set obtained at the current layer.
[0083] In some embodiments of the present application, the first Morton code from the second set of nodes that is greater than the current Morton code of the current point in the current layer of data is determined, and the point corresponding to the first Morton code is set as the search point.
[0084] Illustratively, D0 (initial distance threshold) and ρ (the ratio of distance threshold when adjacent LOD layers are split) are user-defined initial parameters, respectively, and ρ>1. Suppose I represents the index of all points, in the kth iteration, for a point in LODk, the nearest neighbor, i.e., the point with the closest distance, is searched from LOD0 to LODk-1th layer, k=1,2,...,N-1. Here, N is the total number of layers of LOD splitting, and when k=0, in the 0th iteration, for a point in LOD0, the nearest neighbor is directly searched in LOD0. The specific process is as follows:
[0085] JPEG0007640578000004.jpg6106
[0086] (2) In the kth iteration, a set L(k) contains the points belonging to the LOD of the kth layer, and a set O(k) contains the point set of the LOD k layer or finer level, where the calculation process of L(k) and O(k) is as follows:
[0087] First, O(k) and L(k) are both initialized to the empty set.
[0088] JPEG0007640578000005.jpg48170
[0089] (3) In the process of each iteration, sets L(k) and O(k) are calculated separately, and the points in O(k) are used to predict the points in set L(k). Assuming that set R(k)=L(k)\L(k-1), that is, R(k) represents the point set of the difference between LOD(k-1) and LOD(k), for the points in set R(k), find the nearest h predicted neighbors in set O(k). The specific process of finding the nearest neighbors is as follows:
[0090] a, point P in set R(k) i , the Morton code corresponding to that point is M i It is.
[0091] b, set O(k), current point P i The corresponding Morton code M i Find the index j of the first point that is greater than
[0092] c, based on index j, in one search range [j-searchrange, j+searchrange] in set O(k), find the current point P i (where searchrange represents a search range, i.e., a first predetermined search range, typically taking values of 8, 16, 32, 64).
[0093] (4) ,By repeating the processes (1) to (3) until all the points in set I are traversed, a set of candidate ,points is obtained, and from these candidate point sets, the K points ,that are closest to the predicted point are found and used as a ,nearest neighbor point set to obtain the K nearest neighbor ,points.
[0094] That is, in this embodiment, all indexes are included in the input point cloud set I as the input point cloud of the first LOD split, and the algorithm is iterated continuously, and in the kth iteration, first perform LOD splitting, i.e., split the input point cloud set I into L(k) and O(k), and then perform nearest neighbor search in O(k) for the points belonging to L(k), where O(k) is used as the input point cloud set of the next iteration.
[0095] As can be seen, the current layer data is obtained by dividing the Morton code of the point cloud data, and then an adjacent region is determined based on the Morton code of the current layer data, and a nearest point set of the current layer data is determined in the adjacent region. In this way, the adjacent region is searched based on the Morton code of the current layer data, and on the premise that the adjacent region can be accurately found, the search range of the nearest point can be reduced, and if the adjacent region is not found based on the Morton code of the current layer data, the adjacent region can be searched based on the second set, thereby improving the search success rate.
[0096] In some embodiments of the present application, the implementation of step S104 may include steps S1041 to S1047 performed by a decoder, or may include steps S1041 to S1044 and steps S1046 to S1048 performed by an encoder.
[0097] In step S1041, in the first parent node set, the current parent node to which the current point in the current layer data belongs is determined.
[0098] In step S1042, a set of adjacent parent nodes adjacent to the current parent node is determined, where the set of adjacent parent nodes includes parent nodes of all adjacent nodes or parent nodes of some adjacent nodes.
[0099] In step S1043, the Morton code of the adjacent parent node is determined based on a preset lookup table, the Morton code of the current parent node, and the Morton code of the current layer data.
[0100] In step S1044, the area corresponding to the Morton code of the adjacent parent node is determined as the adjacent area.
[0101] In the present embodiment, the data of the current layer includes multiple current points, where in a first parent node set, a parent node to which each current point of the data of the current layer belongs is determined, and an adjacent parent node set adjacent to the current parent node is determined.
[0102] It should be noted that in this embodiment, the number of adjacent parent nodes of a parent node corresponding to one current point is multiple, and the embodiment of the present invention is not limited thereto.
[0103] In the present embodiment, the adjacent parent node set may include parent nodes of all adjacent nodes corresponding to the parent node of the current point, or may include parent nodes of some of the adjacent nodes corresponding to the parent node of the current point, and the present embodiment is not limited thereto.
[0104] Exemplarily, as shown in FIG. 5, block 701 is the parent node of the current predicted point P. For the current parent node, there are 26 adjacent parent nodes. The number of adjacent parent nodes can expand or contract the range of adjacent parent nodes in addition to the 27 adjacent parent nodes that are themselves coplanar, colinear, and copoint. In this way, the number of neighbors can be expanded outward.
[0105] In the present embodiment, a preset lookup table is set, which can represent the correspondence between the current parent node and a set of adjacent parent nodes, and is used to determine the Morton code of the adjacent parent node.
[0106] In some embodiments, establishing the lookup table may be accomplished in the following manner.
[0107] Method 1: First, determine the difference between the coordinate value of the adjacent parent node and the coordinate value of the current parent node to obtain a set of difference values.
[0108] For example, a difference value between the 3D coordinates of each adjacent parent node and the 3D coordinates of the current parent node is determined to obtain a set of difference values.
[0109] A lookup table is then established based on the membership relationships between the difference value set, the adjacent parent node set, and the current parent node.
[0110] Here, the affiliation is used to represent that the adjacent parent node set and the current parent node are adjacent to each other. Each difference value corresponds to one adjacent parent node, and each adjacent parent node has its own current parent node, so that after establishing the lookup table in this way, the 3D coordinates of the adjacent parent nodes can be determined based on the difference values in the lookup table and the 3D coordinates of the known current parent node, and thus the Morton code of each adjacent parent node can be obtained.
[0111] Method 2: Establish a lookup table based on the membership relationship and the distance value from the center point in the adjacent parent node set to the center of the current parent node.
[0112] In some possible implementations, the weight of adjacent nodes can be changed to a certain value and the complexity of the algorithm can be reduced by using a lookup table method, for example, the weight value of each adjacent point is set to the distance value from the center point of the adjacent parent node to the current point, and the distance value is used as the weight value in combination with the membership relationship to establish a lookup table, so that the 3D coordinates of the adjacent parent node can be obtained according to the distance value in the lookup table and the coordinate value of the current parent node, and the Morton code of the adjacent parent node can be obtained.
[0113] Method 3: First, determine the Hamming distance and Morton code difference value between the adjacent parent node and the current parent node based on the Morton code of the adjacent parent node and the Morton code of the current parent node. Then, establish a lookup table based on the Hamming distance, the Morton code difference value and the affiliation relationship. After the lookup table is established in this way, the Morton code of the adjacent parent node can be obtained based on the lookup table and the known coordinate value of the current parent node.
[0114] In this embodiment, the Morton code of the adjacent parent node is determined based on a preset lookup table, the Morton code of the current parent node, and the Morton code of the data of the current layer, and the area corresponding to the Morton code of the adjacent parent node is determined as the adjacent area.
[0115] It should be noted that the area occupied by the Morton code of the adjacent parent node is determined as the adjacent area, for example, first determine the sequence number of the Morton code of the adjacent parent node in the second set, then determine the area corresponding to the Morton code of the adjacent parent node according to the sequence number, and finally, at least a part of the area occupied by the Morton code of the adjacent parent node is determined as the adjacent area. For example, the entire area occupied by the Morton code of the adjacent parent node is determined as the adjacent area, or a part of the area occupied by the Morton code of the adjacent parent node is determined as the adjacent area. In this way, after obtaining the adjacent area, the order of searching for the nearest neighbor point can be searched in the order of coplanar, collinear, and common point by itself, and for the multiple neighbor points existing in this area, the selection is made according to the distribution of the spatial position, and by selecting three neighbor points with uniform spatial distribution, the situation where the three neighbor points are on the same side as the predicted point can be avoided, so that the detected nearest neighbor point set is more accurate.
[0116] In step S1045, the codestream is parsed to obtain a predetermined number of searches.
[0117] If implemented in a decoder, the decoder must first parse out the codestream the number of predefined searches that the encoder used to perform the encoding, and then reuse the predefined number of searches in subsequent processing. This process does not exist in the encoder.
[0118] In step S1046, in the neighbor region, traverse the points corresponding to the Morton codes of the neighbor parent nodes according to a predetermined number of searches to obtain a candidate neighbor set.
[0119] In step S1047, a set of nearest neighbors corresponding to the current point in the current layer of data is determined from the candidate neighbor set.
[0120] In the present embodiment, in the neighboring region, traverse the points corresponding to the Morton codes of the neighboring parent nodes according to a predetermined search number to obtain a candidate neighbor set, i.e., a candidate point set, and then find K nearest neighbor points, i.e., a nearest neighbor point set, that are closest to the current point from the candidate neighbor set, where K is a positive integer greater than 0.
[0121] In step S1048, the predetermined number of searches is written to the codestream.
[0122] In the present embodiment, the process of determining the nearest neighbor that corresponds to the current point requires the encoder to write the predetermined number of searches employed into the codestream for the decoder to use during decoding.
[0123] Please note that in this embodiment, the specified number of searches is an upper limit for the number of candidate points, and if the K nearest neighbor points are not found even after the specified number of searches is exceeded, the method of step S105 is used to process the K nearest neighbor points.
[0124] In the present embodiment, the predetermined number of searches can be represented by LiftingNeighborSearchTimes.
[0125] For example, for the current parent node, there are 26 adjacent parent nodes. According to the coordinate difference between the adjacent parent node and the current parent node, a lookup table is established, and the Morton code of the adjacent parent node is calculated based on the lookup table. Based on the above Morton code, the indexes corresponding to the Morton codes of the current parent node and these 26 neighbors or some of them can be found from O(k), and the points corresponding to these indexes can be traversed as candidate points, and the K nearest neighbors of the predicted point P (current point) can be found from the candidate points.
[0126] In some embodiments of the present application, the method of determining the nearest neighbor is to calculate the distance between the prediction point and the predicted point, find the K prediction points with the smallest distance, and take them as the neighboring points of the predicted point, i.e., the nearest neighbors, while the distance between the nearest neighbors and the predicted point is taken as the weight value between the predicted point and the prediction point.
[0127] 6 is a schematic structural diagram of an encoder according to an exemplary embodiment of the present application. As shown in FIG. 6, the encoder 1 includes: a first acquisition unit 10 configured to acquire a Morton code set of the point cloud data to be searched; a first division unit 11 configured to divide the point cloud data into layers based on the Morton code set and a first distance threshold to obtain data of a current layer; a first shifting unit 12 configured to right-shift the Morton code bits of the prediction data corresponding to the data of the current layer in the point cloud data by a first predetermined number of bits to obtain a corresponding first set of parent nodes; and a second determination unit 13 configured to determine an adjacent region in the first parent node set based on a Morton code of the current layer data, determine a nearest point set of the current layer data in the adjacent region, and if the adjacent region is not determined, determine a search point of the current layer data based on a second node set, and perform a search within a first predetermined search range corresponding to the search point to determine a nearest point set, wherein the second node set is a predicted data set corresponding to the current layer data in the point cloud data.
[0128] In some embodiments of the present application, the first determination unit 13 is further configured to determine, in the first parent node set, a current parent node to which a current point in the current layer data belongs, determine a set of adjacent parent nodes adjacent to the current parent node, determine a Morton code of the adjacent parent node based on a preset lookup table, the current parent node, and the Morton code of the current layer data, and determine an area corresponding to the Morton code of the adjacent parent node as the adjacent area.
[0129] In some embodiments of the present application, the encoder 1 further comprises a writing unit 14, The first determination unit 13 is further configured to traverse the points corresponding to the Morton codes of the adjacent parent nodes in the adjacent region according to a predetermined number of searches to obtain a candidate adjacent set, and determine the nearest neighbor point set corresponding to the current point of the current layer of data from the candidate adjacent set; The write unit 14 is configured to write the predetermined number of searches into a codestream.
[0130] In some embodiments of the present application, the first determination unit 13 is further configured to determine a first Morton code from the second node set that is greater than the current Morton code of the current point of the current layer of data, and set the point corresponding to the first Morton code as the search point.
[0131] In some embodiments of the present application, the first division unit 11 is further configured to determine a second set including at least a point corresponding to a first Morton code based on the Morton code set, and if a distance between a currently processed point in the point cloud data and a point in the second set is less than or equal to the first distance threshold, put the current point into the first set, and if a distance between the current point and a point in the second set is greater than the first distance threshold, put the current point into the second set, and determine points in the second set whose distances from the current point are less than or equal to a second distance threshold to obtain data of the current layer, wherein the first distance threshold is less than the second distance threshold.
[0132] In some embodiments of the present application, the first predetermined number of bits is a predetermined non-negative integer.
[0133] In some embodiments of the present application, the first acquisition unit 10 is further configured to sample a Morton code set according to a predetermined interval to obtain a sampling point set, where the Morton code set includes all or part of the Morton codes of the prediction data, right shift the Morton code bits of the points in the sampling point set by n bits to obtain a sampling parent node set, determine adjacent points excluding the sampling points in an area corresponding to the sampling parent node set, and if the average number of adjacent points in the sampling parent node set is greater than a predetermined average threshold, determine the n-bit number as the value of the first predetermined bit number, where n is a non-negative integer.
[0134] In some embodiments of the present application, the first acquisition unit 10 is further configured to acquire point cloud data to be searched, determine Morton codes for the point cloud data, and arrange the Morton codes for the point cloud data in ascending order to acquire the Morton code set including a plurality of Morton codes.
[0135] In some embodiments of the present application, the writing unit 14 is further configured to write the first predetermined number of bits into the codestream.
[0136] In some embodiments of the present application, the writing unit 14 is further configured to write the first predetermined number of bits into a parameter set data unit in the codestream.
[0137] In some embodiments of the present application, the parameter set data unit is a sequence parameter set data unit.
[0138] In some embodiments of the present application, the parameter set data unit includes attribute information of the point cloud data, where the attribute information is a scalar or vector attribute associated with points in the point cloud data.
[0139] In some embodiments of the present application, the parameter set data unit includes geometry information of the point cloud data, where the geometry information is Cartesian coordinates associated with points in the point cloud data.
[0140] In some embodiments of the present application, the set of adjacent parent nodes includes parent nodes of all adjacent nodes or parent nodes of some of the adjacent nodes.
[0141] In practical application, as shown in FIG. 7, FIG. 7 is a schematic diagram of a hardware entity of an encoder according to an exemplary embodiment of the present application, the encoder comprising: The system comprises a first processor 15 and a first memory 16 storing a computer program executable by the first processor 15, the first memory 16 operating dependently on the first processor 15 via a first communication bus 17, and the computer program causing the first processor 15 to execute the nearest neighbor search method relating to the encoder side described above.
[0142] In this embodiment, it can be understood that the "unit" may be a part of a circuit, a part of a processor, a part of a program, or software, and may of course be a module or a non-modular one. In addition, each component in this embodiment may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated unit may be realized in the form of hardware or in the form of a software functional module.
[0143] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in one computer-readable storage medium. Based on this understanding, the essential part of the technical solution of this embodiment, i.e., the part that contributes to the prior art, or all or part of the solution of the technology can be embodied in the form of a software product, and the computer software product is stored in one storage medium and includes several instructions for making a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0144] FIG. 8 is a schematic structural diagram of a decoder according to an exemplary embodiment of the present application. As shown in FIG. 8, the decoder 2 includes: a second acquisition unit 20 configured to acquire a Morton code set of the point cloud data to be searched; A second division unit 21 configured to divide the point cloud data into layers based on the Morton code set and a first distance threshold to obtain data of a current layer; A second shifting unit 22 configured to right-shift the Morton code bits of the prediction data corresponding to the data of the current layer in the point cloud data by a first predetermined number of bits to obtain a corresponding first set of parent nodes; and a second determination unit 23 configured to determine an adjacent region in the first parent node set based on a Morton code of the current layer data, determine a nearest point set of the current layer data in the adjacent region, and if the adjacent region is not determined, determine a search point of the current layer data based on a second node set, and perform a search within a first predetermined search range corresponding to the search point to determine a nearest point set, wherein the second node set is a predicted data set corresponding to the current layer data in the point cloud data.
[0145] In some embodiments of the present application, the second determination unit 23 is further configured to determine, in the first parent node set, a current parent node to which a current point in the current layer data belongs, determine a set of adjacent parent nodes adjacent to the current parent node, determine a Morton code of the adjacent parent node based on a preset lookup table, the current parent node, and the Morton code of the current layer data, and determine an area corresponding to the Morton code of the adjacent parent node as the adjacent area.
[0146] In some embodiments of the present application, the decoder 2 further comprises a parsing unit 24, The parsing unit 24 is configured to parse the codestream to obtain a predetermined number of searches; The second determination unit 23 is further configured to traverse, in the adjacent region, points corresponding to the Morton code of the adjacent parent node according to a predetermined search number to obtain a candidate adjacent set, and determine from the candidate adjacent set, the nearest neighbor point set corresponding to the current point of the current layer of data.
[0147] In some embodiments of the present application, the second determination unit 23 is further configured to determine a first Morton code from the second node set that is greater than the current Morton code of the current point of the current layer of data, and set the point corresponding to the first Morton code as the search point.
[0148] In some embodiments of the present application, the second division unit 21 is further configured to determine a second set including at least a point corresponding to a first Morton code based on the Morton code set, and if a distance between a currently processed point in the point cloud data and a point in the second set is less than or equal to the first distance threshold, put the current point into the first set, and if a distance between the current point and a point in the second set is greater than the first distance threshold, put the current point into the second set, and determine points in the second set whose distances from the current point are less than or equal to a second distance threshold to obtain data of the current layer, wherein the first distance threshold is less than the second distance threshold.
[0149] In some embodiments of the present application, the parsing unit 24 is further configured to parse the codestream to obtain the first predetermined number of bits, the first predetermined number of bits being a non-negative integer; The second shifting unit 22 is further configured to right-shift the Morton code of the predicted data corresponding to the data of the current layer of the point cloud data by the first predetermined number of bits to obtain the corresponding first set of parent nodes.
[0150] In some embodiments of the present application, the second acquisition unit 20 is further configured to sample a Morton code set according to a predetermined interval to obtain a sampling point set, where the Morton code set includes all or part of the Morton codes of the prediction data, right shift the Morton code bits of the points in the sampling point set by n bits to obtain a sampling parent node set, determine adjacent points excluding the sampling points in an area corresponding to the sampling parent node set, and if the average number of adjacent points in the sampling parent node set is greater than a predetermined average threshold, determine the n-bit number as the value of the first predetermined bit number, where n is a non-negative integer.
[0151] In some embodiments of the present application, the second acquisition unit 20 is further configured to acquire point cloud data to be searched, determine Morton codes for the point cloud data, and arrange the Morton codes for the point cloud data in ascending order to acquire the Morton code set including a plurality of Morton codes.
[0152] In some embodiments of the present application, the parsing unit 24 is further configured to parse parameter set data units in a codestream to obtain the first predetermined number of bits.
[0153] In some embodiments of the present application, the parameter set data unit is a sequence parameter set data unit.
[0154] In some embodiments of the present application, the parameter set data unit includes attribute information of the point cloud data, where the attribute information is a scalar or vector attribute associated with points in the point cloud data.
[0155] In some embodiments of the present application, the parameter set data unit includes geometry information of the point cloud data, where the geometry information is Cartesian coordinates associated with points in the point cloud data.
[0156] In some embodiments of the present application, the set of adjacent parent nodes includes parent nodes of all adjacent nodes or parent nodes of some of the adjacent nodes.
[0157] In practical application, as shown in FIG. 9, FIG. 9 is a schematic diagram of a hardware entity of a decoder according to an exemplary embodiment of the present application, the decoder comprising: The device comprises a second processor 25 and a second memory 26 storing a computer program executable by the second processor 25, the second memory 26 operating dependently on the second processor 25 via a second communication bus 27, and the computer program causing the second processor 25 to execute the nearest neighbor search method relating to the decoder side described above.
[0158] The processor may be an integrated circuit chip with signal processing functions. In the realization process, each step of the above method can be completed by a hardware integrated logic circuit in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc., and can realize or execute each method, step, and logic block disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly performed by a hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor. The software modules may be located in conventional storage media such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc. The storage medium is located in a memory, and the processor reads the information in the first memory and completes the steps of the above method in combination with the hardware.
[0159] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, the computer program causing a first processor to execute a nearest neighbor search method on the encoder side, or causing a second processor to execute a nearest neighbor search method on the decoder side.
[0160] It should be noted that, in this application, the terms "comprising," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a set of elements includes not only those elements, but also other elements not expressly listed or inherent elements of such process, method, article, or apparatus. Unless otherwise limited, an element defined with the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0161] The numbers of the above embodiments of the present invention are merely for the purpose of explanation and do not indicate superiority or inferiority of the embodiments.
[0162] The methods disclosed in the several method embodiments provided herein may be combined in any manner without conflict to obtain new method embodiments.
[0163] Features disclosed in the several product embodiments provided herein may be combined in any non-conflicting manner to obtain new product embodiments.
[0164] The features disclosed in any method or apparatus embodiment provided herein may be combined in any non-conflicting manner to obtain new method or apparatus embodiments.
[0165] The above are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. [Industrial Applicability]
[0166] The present embodiment discloses a nearest neighbor search method, an encoder, a decoder, and a storage medium, the method including: obtaining a Morton code set of point cloud data to be searched; layering the point cloud data based on the Morton code set and a first distance threshold to obtain current layer data; right-shifting the Morton code bits of predicted data corresponding to the current layer data in the point cloud data by a first predetermined number of bits to obtain a corresponding first parent node set; determining an adjacent region with the first parent node set based on the Morton code of the current layer data, and determining a nearest point set of the current layer data with the nearest point set; if the nearest point set is not determined, determining a search point of the current layer data based on a second node set, and performing a search within a first predetermined search range corresponding to the search point to determine the nearest point set, the second node set being a predicted data set corresponding to the current layer data in the point cloud data. In this way, by searching for adjacent regions based on the Morton code of the current layer data, on the premise that the adjacent regions can be accurately found, the search range for the nearest point can be reduced, and if the adjacent regions are not found based on the Morton code of the current layer data, the adjacent regions can be searched for based on the second set, thereby improving the search success rate.
Claims
1. A nearest neighbor search method applied to an encoder, comprising the steps of: Acquiring location information of point cloud data to be searched; Dividing the point cloud data into layers based on the position information and a first distance threshold to obtain data of a current layer; Obtaining a corresponding first parent node according to a first predetermined number of bits for right-shifting position information bits of data of a current layer in the point cloud data and prediction data corresponding to the data of the current layer in the point cloud data; determining an adjacent region in the first parent node based on position information of the data of the current layer, and determining a nearest point of the data of the current layer in the adjacent region; A nearest neighbor search method comprising: if the adjacent area is not determined, determining a search point of the current layer of data based on a second node, and performing a search within a first predetermined search range corresponding to the search point to determine a nearest neighbor point, wherein the second node is predicted data corresponding to the current layer of data in the point cloud data.
2. determining an adjacent region at the first parent node based on position information of the data of the current layer; determining, at the first parent node, a current parent node to which a current point in the current layer of data belongs; determining an adjacent parent node adjacent to the current parent node; determining position information of an adjacent parent node based on a preset lookup table, the current parent node, and position information of the data of the current layer; determining an area corresponding to position information of the adjacent parent node as the adjacent area; The nearest neighbor searching method of claim 1 .
3. Determining a nearest neighbor point of the current layer of data in the adjacent region includes: traversing the points corresponding to the position information of the adjacent parent node according to a predetermined number of searches in the adjacent region to obtain candidate adjacents; determining the closest point from the candidate neighbors that corresponds to the current point of the current layer of data; and writing said predetermined number of searches into a codestream. The nearest neighbor searching method according to claim 2 .
4. Determining a search point for the current layer of data based on the second node includes: determining from the second node an initial position information that is greater than a current position information of a current point of the current layer of data; setting a point corresponding to the initial position information as the search point. The nearest neighbor searching method of claim 1 .
5. Dividing the point cloud data into layers based on the position information and the first distance threshold to obtain data of a current layer, determining a corresponding point based on the position information; and and determining a point whose distance from the corresponding point to a current point currently being processed in the point cloud data is greater than the first distance threshold and less than or equal to a second distance threshold to obtain the current layer of data, wherein the first distance threshold is less than the second distance threshold. The nearest neighbor searching method of claim 1 .
6. Shifting position information bits of predicted data corresponding to data of a current layer in the point cloud data by a first predetermined number of bits to the right to obtain a corresponding first parent node, Sampling location information according to a predetermined interval to obtain sampling points, the location information including all or a part of the location information of the predicted data; Shifting the position information bits of the sampling points right by n bits to obtain a sampling parent node, and determining adjacent points excluding the sampling points within a region corresponding to the sampling parent node; if the average number of neighbors in the sampling parent node is greater than a predetermined average threshold, determining the n-bit number as the value of the first predetermined number of bits, where n is a non-negative integer; The nearest neighbor searching method of claim 1 .
7. The nearest neighbor search method includes: writing the first predetermined number of bits into a codestream. The nearest neighbor searching method of claim 1 .
8. A nearest neighbor search method applied to a decoder, comprising: Acquiring location information of point cloud data to be searched; Dividing the point cloud data into layers based on the position information and a first distance threshold to obtain data of a current layer; Obtaining a corresponding first parent node according to a first predetermined number of bits for right-shifting position information bits of data of a current layer in the point cloud data and prediction data corresponding to the data of the current layer of the point cloud data; determining an adjacent region in the first parent node based on position information of the data of the current layer, and determining a nearest point of the data of the current layer in the adjacent region; A nearest neighbor search method comprising: if the adjacent area is not determined, determining a search point of the current layer of data based on a second node, and performing a search within a first predetermined search range corresponding to the search point to determine a nearest neighbor point, wherein the second node is predicted data corresponding to the current layer of data in the point cloud data.
9. determining an adjacent region at the first parent node based on position information of the data of the current layer; determining, at the first parent node, a current parent node to which a current point in the current layer of data belongs; determining an adjacent parent node adjacent to the current parent node; determining position information of an adjacent parent node based on a preset lookup table, the current parent node, and position information of the data of the current layer; determining an area corresponding to position information of the adjacent parent node as the adjacent area; The nearest neighbor searching method according to claim 8.
10. Determining a nearest neighbor point of the current layer of data in the adjacent region includes: Analyzing the codestream to obtain a predetermined number of searches; traversing the points corresponding to the position information of the adjacent parent node according to the predetermined number of searches in the adjacent region to obtain candidate adjacents; determining, from the candidate neighbors, the nearest neighbor point that corresponds to the current point of the current layer of data; The nearest neighbor searching method according to claim 9.
11. Determining a search point for the current layer of data based on the second node includes: determining from the second node an initial position information that is greater than a current position information of a current point of the current layer of data; setting a point corresponding to the initial position information as the search point. The nearest neighbor searching method according to claim 8.
12. Dividing the point cloud data into layers based on the position information and the first distance threshold to obtain data of a current layer, determining a corresponding point based on the position information; and and determining a point whose distance from the corresponding point to a current point currently being processed in the point cloud data is greater than the first distance threshold and less than or equal to a second distance threshold to obtain the current layer of data, wherein the first distance threshold is less than the second distance threshold. The nearest neighbor searching method according to claim 8.
13. Shifting position information bits of the prediction data corresponding to the data of the current layer of the point cloud data to the right by a first predetermined number of bits to obtain a corresponding first parent node, Parsing the codestream to obtain the first predetermined number of bits; and right-shifting position information of the predicted data corresponding to the data of the current layer of the point cloud data by the first predetermined number of bits to obtain the corresponding first parent node. The nearest neighbor searching method according to claim 8.
14. Shifting position information bits of predicted data corresponding to data of a current layer in the point cloud data by a first predetermined number of bits to the right to obtain a corresponding first parent node, Sampling location information according to a predetermined interval to obtain sampling points, the location information including all or a part of the location information of the predicted data; Shifting the position information bits of the sampling points to the right by n bits to obtain a sampling parent node; determining adjacent points in a region corresponding to the sampling parent node, excluding the sampling point; if the average number of neighbors in the sampling parent node is greater than a predetermined average threshold, determining the n-bit number as the value of the first predetermined number of bits, where n is a non-negative integer; The nearest neighbor searching method according to claim 8.
15. 1. An encoder comprising: A first acquisition unit configured to acquire position information of point cloud data to be searched; a first division unit configured to divide the point cloud data into layers based on the position information and a first distance threshold to obtain data of a current layer; A first shifting unit is configured to obtain a corresponding first parent node according to a first predetermined number of bits for right-shifting position information bits of a current layer data in the point cloud data and a prediction data corresponding to the current layer data in the point cloud data; an encoder comprising: a first determination unit configured to determine, based on position information of the current layer data, an adjacent area at the first parent node, and to determine a nearest point of the current layer data at the adjacent area; and if the adjacent area is not determined, to determine a search point of the current layer data based on a second node, and to perform a search within a first predetermined search range corresponding to the search point to determine the nearest point, wherein the second node is predicted data corresponding to the current layer data in the point cloud data.
16. A decoder comprising: A second acquisition unit configured to acquire position information of the point cloud data to be searched; A second division unit configured to divide the point cloud data into layers based on the position information and a first distance threshold to obtain data of a current layer; A second shifting unit configured to obtain a corresponding first parent node according to a first predetermined number of bits for right-shifting position information of a current layer data in the point cloud data and a prediction data corresponding to the current layer data in the point cloud data; a second determination unit configured to determine, based on position information of the current layer data, an adjacent area at the first parent node, and determine a nearest point of the current layer data at the adjacent area, and if the adjacent area is not determined, determine a search point of the current layer data based on a second node, and perform a search within a first predetermined search range corresponding to the search point to determine the nearest point, wherein the second node is predicted data corresponding to the current layer data in the point cloud data.
17. An encoder comprising: a first memory; and a first processor; the first memory is configured to store a computer program executable by the first processor; An encoder, wherein the first processor is arranged to carry out the method according to any one of claims 1 to 7 when executing the computer program.
18. a decoder comprising: a second memory; and a second processor; the second memory is configured to store a computer program executable by the second processor; A decoder, wherein the second processor is configured to perform the method according to any one of claims 8 to 14 when executing the computer program.
19. A computer-readable storage medium having stored thereon a computer program for causing a first processor to execute the method according to any one of claims 1 to 7, or for causing a second processor to execute the method according to any one of claims 8 to 14.
Citation Information
Patent Citations
US2020/21856A1