Point cloud data generation method and device, readable storage medium and floor cleaning robot

By generating a bounding sphere of a 3D model and performing pre-sampling and Fibonacci spherical sampling, ordered point cloud data is generated and compressed into a one-dimensional array. This solves the problems of disordered point cloud data and high storage consumption in existing technologies, and improves the generation efficiency and accuracy of point cloud data.

CN114782630BActive Publication Date: 2026-01-30MIDEA ROBOZONE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210453514.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-27
Publication Date
2026-01-30
Estimated Expiration
2042-04-27

AI Technical Summary

Technical Problem

In existing technologies, the point cloud data extraction of 3D objects is disordered, resulting in high storage requirements and processing complexity.

Method used

By generating a bounding sphere of a 3D model, pre-sampling is performed to determine uniformly distributed sampling points. Rays are generated based on the sampling points, and point cloud data is determined by the intersection of the rays and the 3D model. The Fibonacci spherical sampling method is used to limit the ray angle, generating ordered point cloud data and compressing it into a one-dimensional array.

Benefits of technology

It enables the generation of ordered point cloud data, reduces storage space and processing complexity, and improves the efficiency and accuracy of point cloud data generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114782630B_ABST
    Figure CN114782630B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, readable storage medium, and a robotic vacuum cleaner for generating point cloud data. The method for generating point cloud data includes: determining a first sphere based on a 3D model, wherein the 3D model is located inside the first sphere; performing pre-sampled sampling on the surface of the first sphere to obtain N first sampling points, where N is a positive integer; determining M rays, where M is a positive integer, based on each first sampling point; determining corresponding distance information based on the intersection points of the rays with the surface of the 3D model; and determining the point cloud data corresponding to the 3D model based on the distance information. The embodiments of this application can obtain ordered point clouds, providing a one-to-one temporal relationship between the point cloud data. By storing point cloud data using one-dimensional data, compared to traditional 3D data storage, storage efficiency is higher and storage space is less, thus effectively reducing the memory footprint and processing complexity of point cloud data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of robot perception, in particular to a point cloud data generation method and device, readable storage medium and robot sweeper. BACKGROUND

[0002] In the related art, when extracting surface point cloud data of a three-dimensional object, only unordered point cloud data can be extracted, and these point cloud data are stored in the form of three-dimensional data of three-dimensional coordinates (x, y, z), and the memory occupation and processing complexity are both high. SUMMARY

[0003] The present application aims to at least solve one of the problems in the prior art or related art.

[0004] To this end, the first aspect of the present application provides a point cloud data generation method.

[0005] The second aspect of the present application provides a point cloud data generation device.

[0006] The third aspect of the present application provides a point cloud data generation device.

[0007] The fourth aspect of the present application provides a readable storage medium.

[0008] The fifth aspect of the present application provides a robot sweeper.

[0009] Therefore, the first aspect of the present application provides a point cloud data generation method, comprising: determining a first sphere according to a three-dimensional model, the three-dimensional model being located inside the first sphere; pre-sampling the spherical surface of the first sphere to obtain N first sampling points, N being a positive integer; determining M rays according to each first sampling point, M being a positive integer; determining corresponding distance information according to the intersection of the rays and the surface of the three-dimensional model; and determining the point cloud data corresponding to the three-dimensional model based on the distance information.

[0010] In this technical solution, when generating point cloud data of a three-dimensional model, first, a surrounding sphere of the model, i.e. the first sphere, is generated based on the shape of the three-dimensional model. It can be understood that the first sphere is a virtual sphere, and the coordinates of each point on the spherical surface of the first sphere can be determined without establishing the three-dimensional model.

[0011] After obtaining the first sphere, that is, the bounding sphere of the three-dimensional model, the spherical surface on the bounding sphere is pre-sampled. Understandably, the pre-sampling is uniform sampling, and through the pre-sampling, N uniformly distributed points on the bounding sphere of the model can be determined, which are the first sampling points. In some embodiments, N can be 3, and in other embodiments, N can be 5.

[0012] The N uniformly distributed points sampled on the bounding sphere can be regarded as virtual cameras for shooting the three-dimensional model, and the M rays determined according to the N first sampling points can be regarded as virtual light rays corresponding to the virtual cameras. The projection process of the virtual cameras is simulated through the virtual light rays.

[0013] Specifically, each first sampling point can generate a plurality of rays, the end points of the rays are the first sampling points, the directions of the rays are towards the three-dimensional model, and the directions of the rays are fixed.

[0014] Since the virtual cameras are distributed in a spherical manner, the observation directions of the virtual cameras simulated by the first sampling points on the three-dimensional model are more diverse, which can effectively avoid the "self-occlusion" problem caused by the single collection direction of the model itself.

[0015] When the ray intersects with the surface of the three-dimensional model, the distance between the first intersection point of the ray and the three-dimensional model and the first sampling point from which the ray is emitted is the point cloud data of the intersection point. Since the emission direction of the ray is known and fixed, when the point cloud of the three-dimensional model is regenerated, the point cloud data of the three-dimensional model can be easily recovered according to the distance information of each point. And since the first sampling points are determined and the arrangement of the first sampling points and the rays is fixed, the point cloud data of the three-dimensional model obtained is ordered point cloud data.

[0016] The embodiment of the present application generates a bounding sphere surrounding the three-dimensional model, generates first sampling points in a spherical distribution on the spherical surface of the bounding sphere, generates rays with the first sampling points as end points, generates ray depths of corresponding point positions based on the distance between the first intersection point of the ray and the three-dimensional model, and saves the point cloud data. Since the sampling points and the rays are fixedly arranged, ordered point cloud data can be obtained, which provides a one-to-one relationship in time sequence for the point cloud data. At the same time, the point cloud data only retains the ray depth information, that is, the point cloud data is saved by one-dimensional data. Compared with the traditional three-dimensional data (xyz coordinates) for saving point cloud data, the storage efficiency is higher and the storage space is smaller, so the memory occupation amount and the processing complexity of the point cloud data can be effectively reduced.

[0017] In addition, the point cloud data generation method in the above technical solution provided by the present application can also have the following additional technical features:

[0018] In the technical solution, according to each first sampling point, M rays are determined, including: taking the first sampling point as the center to generate a second sphere; performing preset sampling on the spherical surface of the second sphere to obtain M second sampling points; and taking the first sampling point as an end point to generate M rays respectively passing through the M second sampling points.

[0019] In the embodiments of the present application, when generating a ray based on a first sampling point, the first sampling point is taken as an end point of the ray. In order to determine the direction of the ray, the embodiments of the present application take the first sampling point as the center to generate a second sphere, and sample a plurality of second sampling points uniformly distributed on the spherical surface of the second sphere according to the same sampling mode of the first sampling point on the spherical surface of the first sphere, to obtain M second sampling points.

[0020] Based on the M second sampling points, M corresponding rays are generated, the end points of the rays are all the first sampling points, and the rays respectively pass through each of the M second sampling points. That is, taking the first sampling point as an end point of the ray, a ray in the direction from the first sampling point to the second sampling point is generated. It can be understood that M rays are generated for each first sampling point, and the total number of rays generated is N x M in the case that the number of first sampling points is N.

[0021] In any of the above technical solutions, the radius of the second sphere is smaller than the radius of the first sphere; and the preset sampling on the surface of the second sphere includes: preset sampling on the spherical surface of the second sphere located inside the first sphere.

[0022] In the technical solution, the second sphere is a smaller sphere compared with the first sphere, that is, the radius of the second sphere is smaller than the radius of the first sphere. At the same time, since the center of the second sphere is on the spherical surface of the first sphere, the spherical surface of the first sphere can divide the second sphere into two parts, one part of the spherical surface of the second sphere is outside the first sphere, and the other part of the spherical surface of the second sphere is inside the first sphere.

[0023] When preset sampling is performed on the spherical surface of the second sphere, only the part of the spherical surface of the second sphere located inside the first sphere needs to be preset sampled, so that the M second sampling points obtained are all located inside the first sphere. Therefore, when the first sampling point is taken as an end point of the ray to generate a ray passing through the second sampling point, the direction of the ray is always towards the inside of the first sphere, so that the invalid rays emitted towards the outside of the first sphere can be effectively filtered out, the invalid calculation when determining the point cloud data is reduced, and the generation efficiency of the point cloud data is improved.

[0024] In any of the above technical solutions, the first sphere is determined according to the three-dimensional model, comprising: determining a maximum value of point coordinates of the three-dimensional model; determining a bounding box of the three-dimensional model according to the maximum value; and determining the first sphere based on the bounding box.

[0025] In this technical solution, the first sphere is an enclosing sphere of the three-dimensional model, in order to ensure that the enclosing sphere can completely enclose the three-dimensional model, the bounding box of the three-dimensional model can be determined first. Specifically, the bounding box of the three-dimensional model can be found by calculating the difference between the extreme values of the point coordinates of the three-dimensional model in each dimension.

[0026] The bounding box is used to track the spatial position of the object in three-dimensional object detection, and the bounding box can be a cuboid bounding box or a polyhedron bounding box. The bounding box can express the farthest boundary of the object in each direction, so that the first sphere determined based on the bounding box can completely enclose the three-dimensional model and ensure the integrity of the point cloud data.

[0027] In any of the above technical solutions, the first sphere is an inscribed sphere of the bounding box.

[0028] In this technical solution, the first sphere is an inscribed sphere of the bounding box, so that on the basis of ensuring that the first sphere completely encloses the three-dimensional model, the first sphere can be prevented from being too large to have a large amount of empty space inside the first sphere, thereby reducing the number of invalid rays that do not intersect with the three-dimensional object, reducing the operation amount and calculation amount of the point cloud data determination, and improving the generation efficiency of the point cloud data.

[0029] In any of the above technical solutions, the generation method further comprises: normalizing the three-dimensional model according to the radius of the first sphere.

[0030] In this technical solution, after obtaining the first sphere according to the bounding box of the three-dimensional model, the three-dimensional model is further normalized to the inside of the first sphere according to the radius of the first sphere, so that the first sphere completely encloses the three-dimensional model and ensures the integrity of the point cloud data.

[0031] In any of the above technical solutions, the opening angle of the spherical surface of the second sphere to the first sampling point is less than an included angle threshold; and the included angle threshold is related to the radius of the second sphere and the radius of the first sphere.

[0032] In this technical solution, the three-dimensional model is enclosed inside the first sphere, and the first sampling points are distributed on the spherical surface of the first sphere. The rays are generated with the first sampling points as end points, and the point cloud data of the corresponding intersection points is generated by the distance between the intersection points of the rays and the three-dimensional model and the first sampling points.

[0033] Wherein, since the three-dimensional model is enclosed inside the first sphere, when generating the rays, if the emission angle of the ray is towards the outside of the first sphere, or the emission angle does not point to the three-dimensional model, these rays cannot have intersection points with the three-dimensional model, i.e. invalid rays, which increase the operation amount and calculation amount when generating the point cloud data, resulting in reduced efficiency of generating the point cloud data.

[0034] In order to reduce the number of invalid rays, the embodiments of the present application limit the maximum opening angle of the spherical surface of the second sphere. Specifically, the maximum opening angle between the spherical surface of the second sphere and the center of the second sphere, i.e. the first sampling point, needs to satisfy that it is less than an opening angle threshold, wherein the opening angle threshold can be determined according to the radii of the first sphere and the second sphere.

[0035] For example, taking the radius of the second sphere as one fourth of the radius of the first sphere as an example, in this case, the opening angle threshold is ω, and the formula of ω is:

[0036]

[0037] Wherein, R is the radius of the first sphere, and r is the radius of the second sphere.

[0038] The present application limits the angle of the rays by limiting the maximum opening angle of the spherical surface of the second sphere, thereby reducing the invalid rays that cannot intersect with the three-dimensional model, reducing the operation amount and calculation amount when generating the point cloud data, and improving the generation efficiency of the point cloud data.

[0039] In any of the above technical solutions, the corresponding distance information is determined according to the intersection point of the ray and the surface of the three-dimensional model, including: determining the distance information corresponding to the ray according to the minimum value of the distance between the end point of the ray and the intersection point.

[0040] In the embodiments of the present application, since the three-dimensional model is a three-dimensional model, in the actual calculation process, the intersection point of the ray and the three-dimensional model can be multiple, wherein the first intersection point of the ray and the three-dimensional model is used to determine the point cloud information of the three-dimensional model. Specifically, the distance between the first intersection point of the ray and the three-dimensional model and the end point of the ray, i.e. the first sampling point, is the smallest one among all the intersection points of the ray and the three-dimensional model, therefore, according to the minimum distance between the end point of the ray and the intersection point, the corresponding distance information is determined, and the point cloud data is generated, which can ensure the accuracy of the point cloud data.

[0041] In any of the above technical solutions, the generation method further includes: in the M rays, including the case that the target ray does not intersect with the three-dimensional model, determining that the distance information corresponding to the target ray is zero.

[0042] In this technical solution, if there are M rays generated from a first sampling point that do not intersect with the 3D model, i.e., there are invalid rays, then the distance information corresponding to the invalid target ray is set to zero, thereby ensuring the accuracy of the point cloud data.

[0043] In determining whether a ray intersects with the 3D model, the following method can be used: When a ray intersects with the 3D model, the system algorithm automatically returns the distance between that intersection point and the first sampling point. If this distance is infinite, the ray is determined not to intersect with the 3D model and is therefore an invalid target ray.

[0044] In any of the above technical solutions, the preset sampling includes Fibonacci spherical sampling.

[0045] In this technical solution, the surfaces of the first sphere and the second sphere are pre-sampled, specifically including Fibonacci spherical sampling of the surfaces of the first sphere and the second sphere.

[0046] Specifically, the Fibonacci spherical sampling method is an approximate algorithm that can generate uniform sampling points on a unit sphere, where the unit sphere can be represented as: The main step is to map a two-dimensional Fibonacci mesh onto a sphere. A Fibonacci mesh is defined as a unit square, which can be represented as [0, 1). 2 There are an arbitrary number of n points uniformly distributed in the sphere, where the two-dimensional point with index i can be represented as:

[0047]

[0048] Where, p i Let i be a two-dimensional point, (x) i y i () is point p i Two-dimensional coordinates, n is the number of points evenly distributed in the Fibonacci grid, and the %1 operator represents taking the decimal part of the parameter.

[0049] By using the cylindrical equal-area projection to map the two-dimensional points on the Fibonacci grid onto the unit sphere, we can obtain uniformly distributed three-dimensional points, such as the aforementioned point p. i In spherical coordinates, this can be represented as:

[0050]

[0051] The embodiments of this application achieve a fixed arrangement of rays through the Fibonacci spherical sampling method, thereby enabling the orderly representation of point clouds extracted from the surface of a three-dimensional object.

[0052] In any of the above technical solutions, the generating method further comprises: compressing the point cloud data to obtain a corresponding one-dimensional array.

[0053] In this technical solution, the point cloud data of each point position in the point cloud data is expressed by one-dimensional ray depth information, so that the obtained three-dimensional ordered point cloud is compressed into a one-dimensional array, which can effectively reduce the memory occupation of the point cloud data and reduce the processing complexity of the point cloud data.

[0054] The second aspect of the application provides a point cloud data generation device, comprising: a determination module for determining a first sphere according to a three-dimensional model, the three-dimensional model being located inside the first sphere; a sampling module for pre-sampling the spherical surface of the first sphere to obtain N first sampling points, N being a positive integer; the determination module is further configured to: determine M rays according to each first sampling point, M being a positive integer; determine corresponding distance information according to the intersection of the rays and the surface of the three-dimensional model; and determine the point cloud data corresponding to the three-dimensional model based on the distance information.

[0055] In this technical solution, when generating the point cloud data of the three-dimensional model, first, the enclosing sphere of the model, i.e. the first sphere, is generated based on the shape of the three-dimensional model. It can be understood that the first sphere is a virtual sphere, and the coordinates of each point position on the spherical surface of the first sphere can be determined without establishing the three-dimensional model.

[0056] After obtaining the first sphere, i.e. the enclosing sphere of the three-dimensional model, the spherical surface of the enclosing sphere is pre-sampled. It can be understood that the pre-sampling is uniform sampling, and through pre-sampling, N uniformly distributed points on the enclosing sphere of the model can be determined, which are the first sampling points described above. In some embodiments, N can be 3, and in other embodiments, N can be 5.

[0057] The N uniformly distributed points sampled on the enclosing sphere can be regarded as virtual cameras for shooting the three-dimensional model, and the M rays determined according to the N first sampling points can be regarded as virtual light rays corresponding to the virtual cameras, and the projection process of the virtual cameras is simulated through the virtual light rays.

[0058] Specifically, each first sampling point can generate multiple rays, the end point of the rays is the first sampling point, the direction of the rays is towards the three-dimensional model, and the direction of the rays is unchanged each time.

[0059] Since the virtual cameras are distributed in a spherical manner, the observation direction of the virtual cameras simulated by the first sampling points on the three-dimensional model is more diverse, which can effectively avoid the "self-occlusion" problem caused by the single collection direction of the model itself.

[0060] When the ray intersects with the surface of the three-dimensional model, the distance between the first intersection point of the ray and the three-dimensional model and the first sampling point from which the ray is emitted is the point cloud data of the intersection point. Since the emission direction of the ray is known and fixed, when the point cloud of the three-dimensional model is regenerated, the point cloud data of the three-dimensional model can be easily recovered according to the distance information of each point position. And since the first sampling point is determined, the arrangement of the first sampling point and the ray is fixed arrangement, so the obtained point cloud data of the three-dimensional model is ordered point cloud data.

[0061] The embodiment of the present application generates a surrounding sphere surrounding the three-dimensional model, generates first sampling points in a spherical distribution on the surface of the surrounding sphere, generates rays with the first sampling points as end points, generates ray depths of corresponding point positions based on the distance of the first intersection point of the rays and the three-dimensional model, and saves as point cloud data. Since the sampling points and the rays are fixed arrangement, an ordered point cloud can be obtained, which provides a one-to-one relationship in time sequence of the point cloud data, and the point cloud data only retains the ray depth information, that is, the point cloud data is saved by one-dimensional data. Compared with the traditional three-dimensional data (xyz coordinates) for saving the point cloud data, the storage efficiency is higher and the storage space is smaller, so the memory occupation and the processing complexity of the point cloud data can be effectively reduced.

[0062] The third aspect of the present application provides a point cloud data generation device, comprising: a memory having a program or instructions stored thereon; a processor for executing the program or instructions to realize the steps of the point cloud data generation method provided in any of the above technical solutions. Therefore, the point cloud data generation device also includes all the beneficial effects of the point cloud data generation method provided in any of the above technical solutions, which will not be repeated here to avoid repetition.

[0063] The fourth aspect of the present application provides a readable storage medium having a program or instructions stored thereon, which can realize the steps of the point cloud data generation method provided in any of the above technical solutions when executed by a processor. Therefore, the readable storage medium also includes all the beneficial effects of the point cloud data generation method provided in any of the above technical solutions, which will not be repeated here to avoid repetition.

[0064] The fifth aspect of the present application provides a sweeping robot, comprising: a point cloud data generation device provided in any of the above technical solutions; and / or a readable storage medium provided in any of the above technical solutions. Therefore, the sweeping robot also includes all the beneficial effects of the point cloud data generation device provided in any of the above technical solutions and / or the readable storage medium provided in any of the above technical solutions, which will not be repeated here to avoid repetition. BRIEF DESCRIPTION OF DRAWINGS

[0065] The above and / or additional aspects and advantages of the present application will become apparent and more readily appreciated from the following description, taken in conjunction with the following drawings in which:

[0066] Figure 1 A flow chart of a method for generating point cloud data according to an embodiment of the present application is shown;

[0067] Figure 2 A schematic diagram of a first sphere and a second sphere in a generating method according to an embodiment of the present application is shown;

[0068] Figure 3 A logic schematic diagram of a generating method according to an embodiment of the present application is shown;

[0069] Figure 4 A schematic diagram of a three-dimensional model and point cloud data according to an embodiment of the present application is shown;

[0070] Figure 5 A structural block diagram of a generating device for point cloud data according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0071] In order to more clearly understand the above objectives, features and advantages of the present application, the present application will be further described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0072] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, however, the present application can also be implemented in other ways different from those described herein, and therefore, the scope of protection of the present application is not limited by the specific embodiments disclosed below.

[0073] The following description refers to the accompanying drawings that show embodiments of the present application. Figures 1 to 5 Methods, devices, readable storage media and sweeping robots for generating point cloud data according to some embodiments of the present application are described.

[0074] Embodiment One

[0075] In some embodiments of the present application, a method for generating point cloud data is provided, Figure 1 A flow chart of a method for generating point cloud data according to an embodiment of the present application is shown, as shown in Figure 1 The method comprises the following steps:

[0076] Step 102, determining a first sphere according to a three-dimensional model, the three-dimensional model being located inside the first sphere;

[0077] Step 104, pre-sampling the spherical surface of the first sphere to obtain N first sampling points, N being a positive integer;

[0078] Step 106, according to each first sampling point, determine M rays, M is a positive integer;

[0079] Step 108, according to the intersection of the ray and the surface of the three-dimensional model, determine the corresponding distance information;

[0080] Step 110, based on the distance information, determine the point cloud data corresponding to the three-dimensional model.

[0081] In the embodiment of the application, when generating the point cloud data of the three-dimensional model, first, based on the shape of the three-dimensional model, a bounding sphere of the model is generated, that is, the first sphere described above. It can be understood that the first sphere is a virtual sphere. For the first sphere, a three-dimensional model can be formed or a three-dimensional model can not be established, and only the coordinate data of each point on the spherical surface of the first sphere is determined.

[0082] After obtaining the first sphere, that is, the bounding sphere of the three-dimensional model, the spherical surface of the bounding sphere is pre-sampled. It can be understood that the pre-sampling is uniform sampling. Through pre-sampling, N uniformly distributed points on the bounding sphere of the model can be determined. These points are the first sampling points described above. In some embodiments, N can be 3, and in other embodiments, N can be 5.

[0083] The N uniformly distributed points sampled on the bounding sphere can be regarded as virtual cameras for shooting the three-dimensional model. The M rays determined according to the N first sampling points can be regarded as virtual light rays corresponding to the virtual cameras. The projection process of the virtual cameras is simulated through the virtual light rays.

[0084] Specifically, each first sampling point can generate multiple rays. The end points of these rays are the first sampling points, and the direction of the rays is towards the three-dimensional model, and the direction of the rays is fixed each time.

[0085] Since the virtual cameras are distributed in a spherical manner, the observation direction of the virtual cameras simulated by the first sampling points on the three-dimensional model is more diverse, which can effectively avoid the "self-occlusion" problem caused by the single collection direction of the model itself.

[0086] When the ray intersects with the surface of the three-dimensional model, the distance between the first intersection point of the ray and the three-dimensional model and the first sampling point from which the ray is emitted is the point cloud data of the intersection point. Since the emission direction of the ray is known and fixed, when the point cloud of the three-dimensional model is regenerated, according to the distance information of each point, the point cloud data of the three-dimensional model can be easily recovered. And since the first sampling points and the arrangement of the rays are fixed after the first sampling points are determined, the point cloud data of the three-dimensional model obtained is ordered point cloud data.

[0087] The embodiment of the application generates a surrounding sphere surrounding the three-dimensional model, generates first sampling points in a spherical distribution on the spherical surface of the surrounding sphere, generates rays with the first sampling points as end points, generates ray depths of corresponding point positions based on the distance of the rays and the first intersection point of the three-dimensional model, and saves the ray depths as point cloud data. Since the sampling points and the rays are fixedly arranged, an ordered point cloud can be obtained, a one-to-one relationship of the point cloud data in time sequence is provided, and the point cloud data only retains the ray depth information, that is, the point cloud data is saved by one-dimensional data. Compared with saving the point cloud data by traditional three-dimensional data (xyz coordinates), the storage efficiency is higher and the storage space is smaller, so that the memory occupation amount and the processing complexity of the point cloud data can be effectively reduced.

[0088] On the basis of the above embodiment, M rays are determined according to each first sampling point, including: generating a second sphere with the first sampling point as the center; pre-sampling the spherical surface of the second sphere to obtain M second sampling points; and generating M rays respectively passing through the M second sampling points with the first sampling point as the end point.

[0089] In the embodiment of the application, when the rays are generated based on the first sampling points, the first sampling points are used as the end points of the rays. Figure 2 A schematic diagram of the first sphere and the second sphere in the generation method according to the embodiment of the application is shown in FIG. 2. Figure 2 As shown in FIG. 2, in order to determine the direction of the rays, the embodiment of the application generates a second sphere 204 with the first sampling point 202 on the spherical surface of the first sphere 200 as the center, and samples a plurality of second sampling points 2042 in a uniform distribution on the spherical surface of the second sphere according to the same sampling mode of the first sampling points on the spherical surface of the first sphere. Figure 2 In the embodiment, the three-dimensional model 206 is located in the first sphere 200.

[0090] Based on the M second sampling points, M rays corresponding to the M second sampling points are generated, the end points of the rays are all the first sampling points, and the rays respectively pass through each of the M second sampling points. That is, the rays in the direction from the first sampling point to the second sampling point are generated with the first sampling point as the end point of the rays. It can be understood that M rays are generated for each first sampling point, and the total number of the generated rays is N x M in the case that the number of the first sampling points is N.

[0091] On the basis of any of the above embodiments, the radius of the second sphere is smaller than the radius of the first sphere; and the pre-sampling of the surface of the second sphere includes: pre-sampling the spherical surface of the second sphere located in the first sphere.

[0092] In the embodiment of the present application, the second sphere is smaller than the first sphere, that is, the radius of the second sphere is smaller than the radius of the first sphere. At the same time, since the center of the second sphere is on the surface of the first sphere, the surface of the first sphere can divide the second sphere into two parts, one part of the surface of the second sphere is outside the first sphere, and the other part of the surface of the second sphere is inside the first sphere.

[0093] When the surface of the second sphere is preset sampled, only the part of the surface of the second sphere inside the first sphere needs to be preset sampled, so that the M second sampling points obtained are all inside the first sphere, and therefore, when the rays passing through the second sampling points are generated with the first sampling points as the end points of the rays, the directions of the rays are always towards the inside of the first sphere, so that the invalid rays emitted towards the outside of the first sphere can be effectively filtered out, the invalid calculation in determining the point cloud data is reduced, and the generation efficiency of the point cloud data is improved.

[0094] On the basis of any of the above embodiments, the first sphere is determined according to the three-dimensional model, comprising: determining the maximum value of the point coordinates of the three-dimensional model; determining the bounding box of the three-dimensional model according to the maximum value; and determining the first sphere based on the bounding box.

[0095] In the embodiment of the present application, the first sphere is the bounding sphere of the three-dimensional model, in order to ensure that the bounding sphere can completely surround the three-dimensional model, the bounding box of the three-dimensional model can be determined first. Specifically, the difference between the extreme values of the point coordinates of the three-dimensional model in each dimension can be calculated to find the bounding box of the three-dimensional model.

[0096] The bounding box is used to track the spatial position of the object in three-dimensional object detection, and the bounding box can be a cuboid bounding box or a polyhedral bounding box. The bounding box can express the farthest boundary of the object in each direction, so that the first sphere determined based on the bounding box can completely surround the three-dimensional model and ensure the integrity of the point cloud data.

[0097] On the basis of any of the above embodiments, the first sphere is an inscribed sphere of the bounding box.

[0098] In the embodiment of the present application, the first sphere is an inscribed sphere of the bounding box, so that on the basis of ensuring that the first sphere completely surrounds the three-dimensional model, the first sphere can be prevented from being too large to have a large amount of empty space inside the first sphere, thereby reducing the number of invalid rays that do not intersect with the three-dimensional object, reducing the operation amount and calculation amount of determining the point cloud data, and improving the generation efficiency of the point cloud data.

[0099] On the basis of any of the above embodiments, the generation method further comprises: performing normalization processing on the three-dimensional model according to the radius of the first sphere.

[0100] In the embodiment of the present application, after the bounding box according to the three-dimensional model is obtained, the first sphere is obtained, and then the three-dimensional model is normalized to the inside of the first sphere according to the radius of the first sphere, so that the first sphere completely encloses the three-dimensional model, thereby ensuring the integrity of the point cloud data.

[0101] On the basis of any of the above embodiments, the opening angle of the spherical surface of the second sphere to the first sampling point is less than the included angle threshold; wherein the included angle threshold is related to the radius of the second sphere and the radius of the first sphere.

[0102] In the embodiment of the present application, the three-dimensional model is enclosed inside the first sphere, and the first sampling points are distributed on the spherical surface of the first sphere. The rays are generated with the first sampling points as the end points. The point cloud data corresponding to the intersection points are generated by the distance between the intersection points of the rays and the three-dimensional model.

[0103] Wherein, since the three-dimensional model is enclosed inside the first sphere, and when the rays are generated, if the emission angle of the rays is towards the outside of the first sphere, or the emission angle is not directed to the three-dimensional model, these rays cannot intersect with the three-dimensional model, i.e. invalid rays, which will increase the operation amount and calculation amount when generating the point cloud data, resulting in a decrease in the efficiency of generating the point cloud data.

[0104] In order to reduce the number of invalid rays, the maximum opening angle of the spherical surface of the second sphere is limited in the embodiment of the present application. Specifically, the maximum opening angle between the spherical surface of the second sphere and the center of the second sphere, i.e. the first sampling point, needs to satisfy the condition that it is less than the opening angle threshold, wherein the opening angle threshold can be determined according to the radius of the first sphere and the radius of the second sphere.

[0105] For example, taking the radius of the second sphere as one fourth of the radius of the first sphere as an example, in this case, the opening angle threshold is ω, and the formula of ω is:

[0106]

[0107] Wherein, R is the radius of the first sphere, and r is the radius of the second sphere.

[0108] The present application limits the maximum opening angle of the spherical surface of the second sphere to limit the angle of the rays, thereby reducing the invalid rays that cannot intersect with the three-dimensional model, reducing the operation amount and calculation amount when generating the point cloud data, and improving the efficiency of generating the point cloud data.

[0109] On the basis of any of the above embodiments, the distance information corresponding to the intersection of the ray and the surface of the three-dimensional model is determined, including: determining the distance information corresponding to the ray according to the minimum value of the distance between the end point of the ray and the intersection point.

[0110] In the embodiments of the present application, since the three-dimensional model is a solid model, in the actual calculation process, the intersection of the ray and the three-dimensional model can be multiple, wherein the first intersection of the ray and the three-dimensional model is used to determine the point cloud information of the three-dimensional model. Specifically, the distance between the first intersection of the ray and the three-dimensional model and the end point of the ray, i.e. the first sampling point, is the smallest one among all the intersections of the ray and the three-dimensional model, so according to the smallest distance between the end point of the ray and the intersection, the corresponding distance information is determined, and the point cloud data is generated, which can ensure the accuracy of the point cloud data.

[0111] On the basis of any of the above embodiments, the generation method further comprises: in the M rays, in the case that the target ray does not intersect with the three-dimensional model, determining that the distance information corresponding to the target ray is zero.

[0112] In the embodiments of the present application, if there is a ray which does not intersect with the three-dimensional model in the M rays generated by a first sampling point, i.e. there is an invalid ray, the distance information corresponding to the invalid target ray is determined as zero, thereby ensuring the accuracy of the point cloud data.

[0113] Wherein, when determining whether a ray intersects with the three-dimensional model, the following judgment method can be used: when a ray intersects with the three-dimensional model, the system algorithm will automatically return the distance between the intersection and the first sampling point. When the distance value is infinite, it is determined that the ray does not intersect with the three-dimensional model, which is an invalid target ray.

[0114] On the basis of any of the above embodiments, the preset sampling comprises Fibonacci spherical sampling.

[0115] In the embodiments of the present application, the spherical surface of the first sphere and the second sphere is preset sampled, specifically including Fibonacci spherical sampling on the spherical surface of the first sphere and the spherical surface of the second sphere.

[0116] Specifically, the Fibonacci spherical sampling method is an approximate algorithm which can generate uniform sampling points on a unit sphere, wherein the unit sphere can be represented as: The main step is to map the two-dimensional Fibonacci grid to the spherical surface. The definition of the Fibonacci grid is a unit square, which can be represented as [0, 1) 2 Wherein, there are any number of n points uniformly distributed, wherein the two-dimensional point with index i can be represented as:

[0117]

[0118] Wherein, p i For all two-dimensional points i, (x i , y i ) is the two-dimensional coordinate of point p i , n is the number of uniformly distributed points in the Fibonacci grid, the %1 operator represents the decimal part of the parameter.

[0119] The three-dimensional points can be obtained by using cylindrical equal-area projection to map the two-dimensional points on the Fibonacci grid to the unit sphere. i In the spherical coordinate system, it can be expressed as:

[0120]

[0121] The embodiment of the application realizes the fixed arrangement of the rays by the Fibonacci spherical sampling method, and then can sequentially represent the point cloud extracted from the surface of the three-dimensional object.

[0122] On the basis of any of the above embodiments, the generating method further comprises: compressing the point cloud data to obtain a corresponding one-dimensional array.

[0123] In the embodiment of the application, the point cloud data of each point position in the point cloud data is expressed by one-dimensional ray depth information, so that the obtained three-dimensional ordered point cloud is compressed into a one-dimensional array, which can effectively reduce the memory occupation of the point cloud data and reduce the processing complexity of the point cloud data.

[0124] Embodiment two

[0125] In some embodiments of the application, a method for directly extracting an ordered point cloud from the surface of a three-dimensional object is provided, which can eliminate the inherent disorder of the traditional point cloud representation method and provide the correlation of the object in time sequence. In addition, the three-dimensional ordered point cloud obtained by the method can be compressed into a one-dimensional array, which greatly reduces the memory occupation and processing complexity.

[0126] Specifically, the embodiment of the application simulates a high-resolution camera array model with spherical distribution, and the application proposes a virtual light field sampling model to extract an ordered point cloud by scanning a three-dimensional object from multiple angles, thereby recovering the geometric shape thereof.

[0127] The scheme first uniformly samples on the sphere surrounding the object, and emits a cluster of fixed-direction rays from each sampling point to the surface of the object. By judging the intersection of the rays and the surface of the object, the distance of each ray to the surface of the object is obtained, and the three-dimensional coordinates of the intersection point can be calculated by using the known starting point and direction of the ray. The orderliness of the point cloud comes from the uniformly distributed fixed ray cluster on the sphere. In addition, the scheme can represent the point cloud in a more compact manner, because it only needs to store a one-dimensional scalar array, i.e. the depth along the ray direction.

[0128] The embodiment of the application maps the two-dimensional Fibonacci grid to the sphere by the Fibonacci spherical sampling method. The Fibonacci spherical sampling method is a method for uniformly sampling the unit sphere. The approximate algorithm for generating uniform sampling points mainly operates to map a two-dimensional Fibonacci grid to a spherical surface. The definition of a Fibonacci grid is a unit square [0, 1) 2 where n points are uniformly distributed, and the two-dimensional point with index i can be expressed as:

[0129]

[0130] where p i is the two-dimensional coordinate of point p i , (x i , y i ) is the two-dimensional coordinate of point p i , and n is the number of points uniformly distributed in the Fibonacci grid. The %1 operator represents the decimal part of the parameter.

[0131] Then, the two-dimensional points on the Fibonacci grid are mapped to the unit sphere using cylindrical equal-area projection to obtain uniformly distributed three-dimensional points, and the point p i can be expressed in the spherical coordinate system as:

[0132]

[0133] The construction of the virtual light field model proposed in the application mainly involves three steps of extracting an enclosing sphere, setting a ray cluster, and projecting a virtual light ray, Figure 3 The generation method logic diagram according to an embodiment of the application is shown in the figure, and the detailed contents of each step include:

[0134] Step 1, Extracting an enclosing sphere: In order to find the enclosing sphere of a three-dimensional object, we first calculate the difference between the extreme values of the point coordinates in each dimension to find its bounding box. In three-dimensional object detection, the bounding box is used to track the spatial position of the object. At this time, the circumscribed sphere of the bounding box is the enclosing sphere of the object. According to the radius of the sphere, the object is further normalized to a unit sphere.

[0135] Step 2, Setting a ray cluster: The unit sphere obtained from step 1 is uniformly sampled using the Fibonacci spherical sampling method, and a virtual light ray is placed at each sampling point to simulate the projection process of the camera. The view angle is distributed in a spherical manner here mainly because the observation direction is more diverse, which can greatly alleviate the self-occlusion problem in the sampling process. In addition, the configuration of the spherical view is also commonly used in 2.5D rendering.

[0136] In order to structurally define the ray cluster emitted from each viewpoint, a smaller sphere is placed at each primary sampling point on the unit sphere. Here, the radius of the small sphere can be set to one quarter of the unit sphere. It can be understood that the radius of the small sphere can be freely set, and the above radius relationship is only used for illustration and does not have a limiting effect.

[0137] The intersection of the unit sphere and each small sphere cuts the small sphere into a spherical surface facing the interior of the unit sphere, and the use of Fibonacci sampling on these spherical surfaces again can obtain a fixed arrangement of secondary sampling points. Thus, starting from the primary sampling points and passing through the secondary sampling points on the interior spherical surface can obtain a ray. The opening angle of the ray cluster can be controlled by the opening angle of the interior spherical surface.

[0138] Suppose the radii of the large sphere and the small sphere are R and r respectively, then the maximum opening angle of the interior spherical surface is:

[0139]

[0140] where R is the radius of the first sphere and r is the radius of the second sphere.

[0141] The opening angle ω and the number of rays are the design hyperparameters of the virtual light field model.

[0142] Step 3, projecting virtual light rays: finally, the set ray cluster is projected to the surface of the three-dimensional object, the intersection of each ray with the surface of the object is judged and the distance between the first intersection point and the surface is returned. For the rays that do not intersect with the surface, the distance needs to be manually set to zero.

[0143] Since the viewpoint and the ray direction are known, the three-dimensional point cloud can be easily recovered from the depth value of the ray. Compared with three-dimensional point coordinates, one-dimensional distance values have higher storage efficiency. Moreover, the fixed arrangement of rays can generate an ordered point cloud, providing a one-to-one relationship in time sequence.

[0144] The virtual light field sampling model proposed in the embodiments of the present application realizes the fixed arrangement of rays by using the Fibonacci spherical sampling method, and can then sequentially represent the point cloud extracted from the surface of the three-dimensional object. Moreover, the present application only needs to store one-dimensional depth values to recover the original point cloud from the fixed ray parameters, greatly saving memory.

[0145] In specific implementation, first, the extreme difference of the point coordinates of the object surface along each dimension is calculated to obtain the bounding box of the object, and the diagonal of the bounding box can be used to find the circumscribed sphere. Then, the radius of the circumscribed sphere is used to normalize the three-dimensional object enclosed in the unit sphere.

[0146] Fibonacci spherical sampling method is used to uniformly sample the unit sphere surface to obtain primary sampling points, and then a small sphere with a radius of one quarter of the unit sphere radius is placed at each primary sampling point, and Fibonacci spherical sampling is performed again on the spherical surface facing the interior formed by the intersection of the two spheres to obtain secondary sampling points.

[0147] A ray can be obtained by passing through a secondary sampling point from a primary sampling point. The total number of rays is determined by the primary sampling points and the secondary sampling points, i.e., the number of rays is equal to the product of the number of primary sampling points and the number of secondary sampling points. The more the number of rays is, the denser the point cloud extracted from the surface of the object is, and the more complete the geometry of the object is.

[0148] In addition, the opening angle of a cluster of rays (starting from the same primary sampling point) is controlled by the opening angle of the spherical surface towards the inside, wherein the maximum opening angle is about 83°. In order to balance the utilization rate of rays and the completeness of shape, the opening angle can be set to 60°.

[0149] Finally, the cluster of rays is projected to the surface of the object, the intersection of the rays with the surface of the object is judged, and the distance of the first intersection point of the rays along the direction of the rays with the surface is returned. The depth of the ray without intersection with the object is manually set to zero. According to the stored one-dimensional depth value and the known starting point and direction of the ray, the ordered point cloud about the three-dimensional object is finally recovered, Figure 4 A schematic diagram of a three-dimensional model and point cloud data according to an embodiment of the present application is shown, and a specific ordered point cloud is shown as Figure 4 .

[0150] Embodiment Three

[0151] In some embodiments of the present application, a point cloud data generation device is provided, Figure 5 A structural block diagram of a point cloud data generation device according to an embodiment of the present application is shown, as Figure 5 shown, the point cloud data generation device 500 comprises:

[0152] A determination module 502 is configured to determine a first sphere according to a three-dimensional model, and the three-dimensional model is located inside the first sphere;

[0153] A sampling module 504 is configured to pre-sample the spherical surface of the first sphere to obtain N first sampling points, N being a positive integer;

[0154] The determination module 502 is further configured to: determine M rays according to each first sampling point, M being a positive integer; determine corresponding distance information according to the intersection of the rays with the surface of the three-dimensional model; and determine the point cloud data corresponding to the three-dimensional model based on the distance information.

[0155] In the embodiment of the present application, when generating the point cloud data of the three-dimensional model, first, the enclosing sphere of the model, i.e., the above-mentioned first sphere, is generated based on the shape of the three-dimensional model. It can be understood that the first sphere is a virtual sphere, and for the first sphere, the coordinates of each point on the spherical surface can be determined without establishing the three-dimensional model.

[0156] After obtaining the first sphere, i.e., the bounding sphere of the three-dimensional model, the spherical surface of the bounding sphere is pre-sampled. Understandably, the pre-sampling is uniform sampling, and through the pre-sampling, N uniformly distributed points on the bounding sphere of the model can be determined, which are the first sampling points. In some embodiments, N can be 3, and in other embodiments, N can be 5.

[0157] The N uniformly distributed points sampled on the bounding sphere can be regarded as virtual cameras for shooting the three-dimensional model, and the M rays determined according to the N first sampling points can be regarded as virtual light rays corresponding to the virtual cameras. The projection process of the virtual cameras is simulated through the virtual light rays.

[0158] Specifically, each first sampling point can generate a plurality of rays, the end points of the rays are the first sampling points, the directions of the rays are towards the three-dimensional model, and the directions of the rays are fixed.

[0159] Since the virtual cameras are distributed in a spherical manner, the observation directions of the virtual cameras simulated by the first sampling points on the three-dimensional model are more diverse, which can effectively avoid the "self-occlusion" problem caused by the single collection direction of the model itself.

[0160] When the ray intersects with the surface of the three-dimensional model, the distance between the first intersection point of the ray and the three-dimensional model and the first sampling point from which the ray is emitted is the point cloud data of the intersection point. Since the emission direction of the ray is known and fixed, when the point cloud of the three-dimensional model is regenerated, the point cloud data of the three-dimensional model can be easily recovered according to the distance information of each point. And since the first sampling points are determined and the arrangement of the first sampling points and the rays is fixed, the point cloud data of the three-dimensional model obtained is ordered point cloud data.

[0161] The embodiment of the present application generates a bounding sphere surrounding the three-dimensional model, generates first sampling points in a spherical distribution on the spherical surface of the bounding sphere, generates rays with the first sampling points as end points, generates ray depths of corresponding point positions based on the distance between the first intersection point of the ray and the three-dimensional model, and saves the point cloud data. Since the sampling points and the rays are fixed, the ordered point cloud can be obtained, which provides a one-to-one relationship in time sequence for the point cloud data. At the same time, the point cloud data only retains the ray depth information, i.e., the point cloud data is saved by one-dimensional data. Compared with the traditional three-dimensional data (xyz coordinates) for saving the point cloud data, the storage efficiency is higher and the storage space is smaller, so the memory occupancy and processing complexity of the point cloud data can be effectively reduced.

[0162] On the basis of the above embodiment, the point cloud data generation device further comprises:

[0163] The generating module is configured to generate a second sphere with the first sampling point as the center; the sampling module is further configured to perform preset sampling on the spherical surface of the second sphere to obtain M second sampling points; and the generating module is further configured to generate M rays respectively passing through the M second sampling points with the first sampling point as the end point.

[0164] In the embodiments of the present application, when generating the rays based on the first sampling points, the first sampling points are taken as the end points of the rays. Figure 2 The schematic diagram of the first sphere and the second sphere in the generating method according to the embodiments of the present application is shown in FIG. 2. Figure 2 As shown in FIG. 2, in order to determine the direction of the rays, the embodiments of the present application generate a second sphere 204 with the first sampling point 202 on the spherical surface of the first sphere 200 as the center, and sample a plurality of second sampling points 2042 uniformly distributed on the spherical surface of the second sphere 204 according to the same sampling manner of sampling the first sampling points on the spherical surface of the first sphere 200, and obtain M second sampling points in total. Figure 2 In the embodiments of the present application, the three-dimensional model 206 is located in the first sphere 200.

[0165] Based on the M second sampling points, M rays corresponding to the M second sampling points are generated, the end points of the rays are all the first sampling points, and the rays respectively pass through each of the M second sampling points. That is, the rays in the direction from the first sampling point to the second sampling point are generated with the first sampling point as the end point of the rays. It can be understood that M rays are generated for each first sampling point, and the total number of the generated rays is N×M in the case that the number of the first sampling points is N.

[0166] On the basis of any of the above embodiments, the radius of the second sphere is smaller than the radius of the first sphere; and the sampling module is further configured to perform preset sampling on the spherical surface of the second sphere located in the first sphere.

[0167] In the embodiments of the present application, the second sphere is a smaller sphere compared with the first sphere, that is, the radius of the second sphere is smaller than the radius of the first sphere. At the same time, since the center of the second sphere is on the spherical surface of the first sphere, the spherical surface of the first sphere can divide the second sphere into two parts, one part of the spherical surface of the second sphere is outside the first sphere, and the other part of the spherical surface of the second sphere is inside the first sphere.

[0168] When preset sampling is performed on the spherical surface of the second sphere, only the part of the spherical surface of the second sphere located inside the first sphere needs to be preset sampled, so that the M second sampling points obtained are all located inside the first sphere, and thus when the first sampling points are taken as the end points of the rays and the rays passing through the second sampling points are generated, the directions of these rays are always towards the inside of the first sphere, so that invalid rays emitted towards the outside of the first sphere can be effectively filtered out, invalid calculation in determining the point cloud data is reduced, and the generation efficiency of the point cloud data is improved.

[0169] On the basis of any of the above embodiments, the determining module is further configured to determine a maximum value of the point coordinates of the three-dimensional model; determine a bounding box of the three-dimensional model according to the maximum value; and determine the first sphere based on the bounding box.

[0170] In the embodiment of the present application, the first sphere is an enclosing sphere of the three-dimensional model, and in order to ensure that the enclosing sphere can completely enclose the three-dimensional model, the bounding box of the three-dimensional model can be determined first. Specifically, the bounding box of the three-dimensional model can be found by calculating the difference between the extreme values of the point coordinates of the three-dimensional model in each dimension.

[0171] The bounding box is used to track the spatial position of the object in three-dimensional object detection, and the bounding box can be a cuboid bounding box or a polyhedral bounding box. The bounding box can express the farthest boundary of the object in each direction, so that the first sphere determined based on the bounding box can completely enclose the three-dimensional model, and the integrity of the point cloud data is ensured.

[0172] On the basis of any of the above embodiments, the first sphere is an inscribed sphere of the bounding box.

[0173] In the embodiment of the present application, the first sphere is an inscribed sphere of the bounding box, so that on the basis of ensuring that the first sphere completely encloses the three-dimensional model, the first sphere can be prevented from being too large to cause a large amount of empty space in the first sphere, thereby reducing the number of invalid rays that do not intersect with the three-dimensional object, reducing the operation amount and calculation amount of the point cloud data determination, and improving the generation efficiency of the point cloud data.

[0174] On the basis of any of the above embodiments, the point cloud data generation device further comprises a processing module configured to normalize the three-dimensional model according to the radius of the first sphere.

[0175] In the embodiment of the present application, after the first sphere is obtained according to the bounding box of the three-dimensional model, the three-dimensional model is further normalized to the inside of the first sphere according to the radius of the first sphere, so that the first sphere completely encloses the three-dimensional model and the integrity of the point cloud data is ensured.

[0176] On the basis of any of the above embodiments, the solid angle of the spherical surface of the second sphere to the first sampling point is less than an included angle threshold; wherein the included angle threshold is related to the radius of the second sphere and the radius of the first sphere.

[0177] In the embodiments of the present application, the three-dimensional model is enclosed inside the first sphere, the first sampling points are distributed on the spherical surface of the first sphere, the rays are generated with the first sampling points as the end points, and the point cloud data of the corresponding intersection points are generated through the distance between the intersection points of the rays and the three-dimensional model and the first sampling points.

[0178] Wherein, since the three-dimensional model is enclosed inside the first sphere, and when the rays are generated, if the emission angle of the rays is towards the outside of the first sphere, or the emission angle is not directed to the three-dimensional model, these rays cannot generate intersection points with the three-dimensional model, i.e. invalid rays, which will increase the operation amount and calculation amount when generating the point cloud data, and reduce the efficiency of generating the point cloud data.

[0179] In order to reduce the number of invalid rays, the embodiments of the present application limit the maximum solid angle of the spherical surface of the second sphere. Specifically, the maximum solid angle between the spherical surface of the second sphere and the center of the second sphere, i.e. the first sampling point, needs to satisfy less than the solid angle threshold, wherein the solid angle threshold can be determined according to the radius of the first sphere and the radius of the second sphere.

[0180] For example, taking the radius of the second sphere as one fourth of the radius of the first sphere as an example, in this case, the solid angle threshold is ω, and the formula of ω is:

[0181]

[0182] Wherein, R is the radius of the first sphere, and r is the radius of the second sphere.

[0183] The present application limits the maximum solid angle of the spherical surface of the second sphere to limit the angle of the rays, thereby reducing the invalid rays that cannot intersect with the three-dimensional model, reducing the operation amount and calculation amount when generating the point cloud data, and improving the generation efficiency of the point cloud data.

[0184] On the basis of any of the above embodiments, the determining module is further configured to determine the distance information corresponding to the rays according to the minimum value of the distance between the end points and the intersection points of the rays.

[0185] In the embodiments of the present application, since the three-dimensional model is a solid model, in the actual calculation process, the intersection of the ray and the three-dimensional model can be multiple, wherein the first intersection of the ray and the three-dimensional model is used to determine the point cloud information of the three-dimensional model. Specifically, the distance between the first intersection of the ray and the three-dimensional model and the end point of the ray, i.e. the first sampling point, is the smallest one among all the intersections of the ray and the three-dimensional model, so according to the smallest distance between the end point of the ray and the intersection, the corresponding distance information is determined, and the point cloud data is generated, which can ensure the accuracy of the point cloud data.

[0186] On the basis of any of the above embodiments, the determining module is further configured to, in the M rays, determine the distance information corresponding to the target ray as zero in the case that the target ray does not intersect the three-dimensional model.

[0187] In the embodiments of the present application, if there is a ray that does not intersect the three-dimensional model in the M rays generated by a first sampling point, i.e. there is an invalid ray, the distance information corresponding to the invalid target ray is determined as zero, thereby ensuring the accuracy of the point cloud data.

[0188] In the embodiments of the present application, when determining whether a ray intersects the three-dimensional model, the following judgment method can be used: when a ray intersects the three-dimensional model, the system algorithm will automatically return the distance between the intersection and the first sampling point. When the distance value is infinite, it is determined that the ray does not intersect the three-dimensional model, and is an invalid target ray.

[0189] On the basis of any of the above embodiments, the preset sampling includes Fibonacci spherical sampling.

[0190] In the embodiments of the present application, the spherical surface of the first sphere and the second sphere is preset sampled, specifically including performing Fibonacci spherical sampling on the spherical surface of the first sphere and the spherical surface of the second sphere.

[0191] Specifically, the Fibonacci spherical sampling method is an approximate algorithm that can generate uniform sampling points on a unit sphere, wherein the unit sphere can be represented as: The main step is to map the two-dimensional Fibonacci grid to the spherical surface. The definition of the Fibonacci grid is a unit square, which can be represented as [0, 1) 2 wherein a plurality of n points are uniformly distributed, wherein the two-dimensional point with index i can be represented as:

[0192]

[0193] wherein p i is the two-dimensional point with index i, and (x i , y i ) is the two-dimensional coordinate of the point p i . n is the number of points in the Fibonacci grid that are uniformly distributed, and the %1 operator represents taking the fractional part of the parameter.

[0194] The three-dimensional points can be obtained by using cylindrical equal-area projection to map the two-dimensional points on the Fibonacci grid to the unit sphere, and the above point p i In the spherical coordinate system, it can be expressed as:

[0195]

[0196] The embodiment of the application realizes the fixed arrangement of the rays by using the Fibonacci spherical sampling method, and then can sequentially represent the point cloud extracted from the surface of the three-dimensional object.

[0197] On the basis of any of the above embodiments, the point cloud data processing device further comprises a compression module configured to compress the point cloud data to obtain a corresponding one-dimensional array.

[0198] In the embodiment of the application, the point cloud data of each point position in the point cloud data is expressed by one-dimensional ray depth information, so that the three-dimensional ordered point cloud obtained is compressed into a one-dimensional array, which can effectively reduce the memory occupation of the point cloud data and reduce the processing complexity of the point cloud data.

[0199] Embodiment Four

[0200] In some embodiments of the application, a point cloud data generation device is provided, which comprises a memory having a program or instructions stored thereon, and a processor configured to execute the program or instructions to implement the steps of the point cloud data generation method provided in any of the above embodiments, so that the point cloud data generation device also comprises all the beneficial effects of the point cloud data generation method provided in any of the above embodiments. To avoid repetition, details are not described herein.

[0201] Embodiment Five

[0202] In some embodiments of the application, a readable storage medium having a program or instructions stored thereon is provided, and the program or instructions are executed by a processor to implement the steps of the point cloud data generation method provided in any of the above embodiments, so that the readable storage medium also comprises all the beneficial effects of the point cloud data generation method provided in any of the above embodiments. To avoid repetition, details are not described herein.

[0203] Embodiment Six

[0204] In some embodiments of the present application, a sweeping robot is provided, comprising: the point cloud data generation apparatus provided in any of the above embodiments; and / or the readable storage medium provided in any of the above embodiments, thus the sweeping robot simultaneously comprises all the beneficial effects of the point cloud data generation apparatus provided in any of the above embodiments and / or the readable storage medium provided in any of the above embodiments, and for the sake of brevity, no further elaboration is made here.

[0205] In the description of the present application, the term "a plurality of" refers to two or more, unless otherwise explicitly limited, and the terms "upper", "lower", and the like indicate the orientation or positional relationship shown in the drawings based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application; the terms "connection", "installation", "fixation" and the like should be understood in a broad sense, for example, "connection" can be fixed connection, can also be detachable connection, or integral connection; can be directly connected, or indirectly connected through an intermediate medium. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0206] In the description of the present application, the terms "one embodiment", "some embodiments", "a specific embodiment", and the like, mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0207] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for generating point cloud data, the method comprising: The method comprises the following steps: determining a first sphere according to a three-dimensional model, the three-dimensional model being inside the first sphere; performing preset sampling on the spherical surface of the first sphere to obtain N first sampling points, N being a positive integer; determining M rays according to each first sampling point, M being a positive integer; determining corresponding distance information according to the intersection points of the rays and the surface of the three-dimensional model; determining point cloud data corresponding to the three-dimensional model based on the distance information; wherein the preset sampling is uniform sampling; determining M rays according to each first sampling point, M being a positive integer, comprises the following steps: generating a second sphere with the first sampling point as the center; performing the preset sampling on the spherical surface of the second sphere to obtain M second sampling points; generating M rays respectively passing through the M second sampling points with the first sampling point as the end point; determining corresponding distance information according to the intersection points of the rays and the surface of the three-dimensional model, comprises the following steps: determining the distance information corresponding to the ray according to the minimum value of the distance between the end point of the ray and the intersection point.

2. The generation method of claim 1, wherein, The radius of the second sphere is smaller than the radius of the first sphere; performing the preset sampling on the spherical surface of the second sphere, comprises the following steps: performing the preset sampling on the spherical surface of the second sphere inside the first sphere.

3. The generation method of claim 1, wherein, determining a first sphere according to a three-dimensional model, the three-dimensional model being inside the first sphere, comprises the following steps: determining the maximum value of the coordinates of the points of the three-dimensional model; determining a bounding box of the three-dimensional model according to the maximum value; determining the first sphere based on the bounding box.

4. The generation method of claim 3, wherein, The first sphere is an inscribed sphere of the bounding box.

5. The generation method of claim 3, wherein, The method further comprises the following steps: performing normalization processing on the three-dimensional model according to the radius of the first sphere.

6. The generation method of claim 1 or 2, wherein, The maximum angle of the spherical surface of the second sphere to the first sampling point is smaller than an angle threshold value; wherein the angle threshold value is related to the radius of the second sphere and the radius of the first sphere.

7. The generation method of any one of claims 1 to 5, wherein, The method further comprises the following steps: in the case that the M rays include a target ray not intersecting with the three-dimensional model, determining the distance information corresponding to the target ray as zero.

8. The generation method of claim 1, wherein, The preset sampling comprises Fibonacci spherical sampling.

9. The generation method of any one of claims 1 to 5, wherein, The method further comprises the following steps: performing compression on the point cloud data to obtain a corresponding one-dimensional array.

10. An apparatus for generating point cloud data, the apparatus comprising: The method comprises the following steps: a determining module is configured to determine a first sphere according to a three-dimensional model, the three-dimensional model being inside the first sphere; a sampling module is configured to perform preset sampling on the spherical surface of the first sphere to obtain N first sampling points, N being a positive integer; the determining module is further configured to: determine M rays according to each first sampling point, M being a positive integer; determine corresponding distance information according to the intersection points of the rays and the surface of the three-dimensional model; determine point cloud data corresponding to the three-dimensional model based on the distance information; wherein the preset sampling is uniform sampling; a generating module is configured to generate a second sphere with the first sampling point as the center; the sampling module is further configured to perform the preset sampling on the spherical surface of the second sphere to obtain M second sampling points; the generating module is further configured to generate M rays respectively passing through the M second sampling points with the first sampling point as the end point; The determining module is further configured to determine distance information corresponding to the ray according to a minimum value of a distance between an end point of the ray and the intersection point.

11. An apparatus for generating point cloud data, the apparatus comprising: The method comprises: a memory having stored thereon programs or instructions; a processor configured to implement the generating method according to any one of claims 1 to 9 when executing the programs or instructions.

12. A readable storage medium, on which a program or instructions are stored, characterized in that, The programs or instructions, when executed by a processor, implement the method according to any one of claims 1 to 9.

13. A robot vacuum cleaner characterised in that The method comprises: the generating apparatus according to claim 10 or 11; and / or the readable storage medium according to claim 12.

Citation Information

Patent Citations

  • Full-view point cloud data fixed-length ordered coding method and device and storage medium

    CN110910463A

  • Foreign matter three-dimensional detection system and method in vehicle bottom security check system

    CN113009590A