Point cloud downsampling method
Through the point cloud downsampling method of voxel grid and curvature analysis, the problem of redundant point clouds in planar structure of industrial equipment parts is solved, effective retention of geometric structures and reduction of data volume is achieved, and solid for registration Base.
Patent Information
- Application Number
- CN202411011684.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-11-15
AI Technical Summary
The existing point cloud sampling methods cannot effectively meet the point cloud sampling needs of industrial equipment parts, especially the geometric structures of mechanical parts with a large number of planar structures.
Using the point cloud downsampling method based on voxel mesh, the maximum and minimum three-dimensional coordinates of the point cloud data set are obtained, and the voxel mesh latitude is calculated, and the point cloud points corresponding to the maximum curvature value are retained. The normal vector angle threshold is used to clear the redundant point cloud and form the target point cloud.
This method can effectively retain the geometric structure of industrial equipment parts, reduce the amount of point cloud data, while maintaining the geometric characteristics of the model, providing a solid foundation for subsequent registration.
Smart Images

Figure CN118967973A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image data processing, and in particular to a point cloud downsampling method. Background Art
[0002] Point cloud sampling can be applied to 3D scanning, reverse engineering and quality inspection of mechanical parts. After converting the 3D model of the mechanical part into point cloud data, by selecting appropriate methods (such as uniform sampling, Poisson disk sampling) and parameters (such as sampling interval), point cloud data that meets the requirements can be obtained for subsequent analysis and processing.
[0003] Currently, the technology of extracting representative subsets from the original point cloud data by uniform sampling aims to reduce the amount of data while maintaining the geometric structure and distribution characteristics, so as to obtain points with obvious geometric structure in the point cloud data.
[0004] However, when actually using the model of industrial equipment to perform point cloud downsampling, since most industrial equipment parts are regular and have a large number of planar structures, only obtaining points with obvious geometric structures cannot fully display the geometric structure of the model. In other words, the existing point cloud sampling method cannot meet the point cloud sampling requirements of industrial equipment parts. Summary of the invention
[0005] The embodiment of the present application provides a point cloud downsampling method, which can solve the technical problem that the existing point cloud sampling method cannot meet the point cloud sampling requirements of industrial equipment parts.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a point cloud downsampling method, the point cloud downsampling method comprising: obtaining a point cloud data set based on a target three-dimensional model; the point cloud data set comprises three-dimensional coordinates of a plurality of points; obtaining a first coordinate point and a second coordinate point based on the point cloud data; the first coordinate point is used to represent the maximum three-dimensional coordinate in the three-dimensional coordinates of the point cloud, and the second coordinate point is used to represent the minimum three-dimensional coordinate in the three-dimensional coordinates of the point cloud; obtaining a grid division result for each point in the point cloud data set based on a voxel grid and the second coordinate point; if the grid division result satisfies a first preset condition, retaining the point cloud corresponding to the grid division result; the first preset condition is used to represent that a point is located at an outer edge; based on voxel grid, first coordinate point and second coordinate point, calculate voxel grid latitude; based on voxel grid latitude, transform grid division result to obtain one-dimensional index result; based on the one-dimensional index result, obtain first voxel grid result; the first voxel grid result is used to characterize all non-empty voxel grids in the one-dimensional index result; calculate the curvature and normal vector of each point in the first voxel grid result to obtain a first geometric result; based on the first geometric result, obtain voxel downsampling points that meet the second preset condition; the voxel downsampling points are used to characterize the points corresponding to the maximum curvature in the first geometric result; if the voxel downsampling points meet the third preset condition, the voxel downsampling points are retained and recorded as the target point cloud.
[0008] Based on the above description of the point cloud downsampling method provided in the embodiment of the present application, it can be seen that the point cloud downsampling method is targeted at the structural rules of industrial parts, such as having a large number of planar structures, and can retain the geometric structure of the model, providing a solid foundation for subsequent alignment.
[0009] In a feasible implementation of the first aspect, when executing the step of obtaining a point cloud data set based on a target three-dimensional model, the point cloud downsampling method also includes: converting the target three-dimensional model into a point cloud based on a point cloud library grid sampling function; adjusting the spacing of the point cloud sampling grid and the output number of the point cloud sampling to obtain a uniform point cloud output.
[0010] In a feasible implementation of the first aspect, the calculation formula of the voxel grid latitude is:
[0011]
[0012] Among them, l voxel Expressed as the size of the voxel grid; x max Represented as the horizontal coordinate of the first coordinate point; y max Expressed as the ordinate of the first coordinate point; z max Expressed as the vertical coordinate of the first coordinate point; x min Represents the horizontal coordinate of the second coordinate point; y min Expressed as the ordinate of the second coordinate point; z min Expressed as the vertical coordinate of the second coordinate point.
[0013] In a feasible implementation of the first aspect, the calculation formula of the grid division result is:
[0014]
[0015] Among them, l voxel Expressed as the size of the voxel grid; x min Represents the horizontal coordinate of the second coordinate point; y min Expressed as the ordinate of the second coordinate point; z min Expressed as the vertical coordinate of the second coordinate point.
[0016] In a feasible implementation of the first aspect, when executing the step of retaining the point cloud corresponding to the grid division result if the grid division result satisfies the first preset condition, the point cloud downsampling method also includes: determining whether there are peripheral grid points on all rows and columns of the grid division result; if so, clearing all point clouds in the grid division result.
[0017] In a feasible implementation of the first aspect, the point cloud downsampling method further includes: a grid division result is (h x ,h y ,h z ); if h x1 <h x <h x2 ,h y1 <h y <h y2 ,h z1 <h z <h z2 ,(h x1 ,h y ,h z )、(h x2 ,h y ,h z )、(h x ,h y1 ,h z )、(h x ,h y2 ,h z )、(h x ,h y ,h z1 ) and (h x ,h y ,h z2 ) all have point clouds, then clear (h x ,h y ,h z ) within all point clouds.
[0018] In a feasible implementation of the first aspect, when executing the step of converting the grid division result based on the voxel grid latitude to obtain the one-dimensional index result, the calculation formula of the one-dimensional index result includes:
[0019] h=h x +h y *D x +h z *D z .
[0020] In a feasible implementation of the first aspect, when executing the step of retaining the voxel downsampling point and recording it as the target point cloud if the voxel downsampling point meets the third preset condition, the point cloud downsampling method also includes: calculating the normal vector angle between the voxel downsampling point and other points; if the normal vector angles are all less than a preset threshold, clearing the voxel downsampling point.
[0021] In a second aspect, an embodiment of the present application provides a point cloud downsampling system, which includes: at least one processor; a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided in the first aspect.
[0022] The point cloud downsampling system executes the method provided in the first aspect and is able to retain the geometric structure of the model according to the structural rules of industrial parts, such as a large number of planar structures, thereby providing a solid foundation for subsequent alignment.
[0023] In a third aspect, an embodiment of the present application provides a computer-readable medium having computer program instructions stored thereon, and the computer program instructions can be executed by a processor to implement the method provided in the first aspect.
[0024] The computer program instructions in the computer-readable medium implement the method provided in the first aspect, aiming at the structural rules of industrial parts, such as having a large number of planar structures, and can retain the geometric structure of the model, providing a solid foundation for subsequent alignment. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram of the structure of a point cloud downsampling system provided in an embodiment of the present application;
[0026] Figure 2 A schematic diagram of a process flow of a point cloud downsampling method provided in an embodiment of the present application;
[0027] Figure 3 A schematic diagram of a target three-dimensional model in a point cloud downsampling method provided in an embodiment of the present application;
[0028] Figure 4 for Figure 3Providing an initial point cloud of a target three-dimensional model in a point cloud downsampling method;
[0029] Figure 5 A schematic diagram of point cloud changes in a point cloud downsampling method provided in an embodiment of the present application;
[0030] Figure 6 A point cloud downsampling method provided in an embodiment of the present application and a schematic diagram of the change in the number of point clouds of existing downsampling;
[0031] Figure 7 A point cloud downsampling method provided in an embodiment of the present application and a schematic diagram of the change in the number of point clouds of existing downsampling;
[0032] Figure 8 A schematic diagram of a point cloud downsampling method and existing downsampling sampling results provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention. In the description of the embodiments of the present invention, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0034] In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the difference. At the same time, in the embodiments of the present invention, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0035] The principles and features of the present application are described below. The examples given are only used to explain the present application and are not used to limit the scope of the present application.
[0036] The embodiment of the present application provides a point cloud downsampling method, which is applicable to various industrial equipment. Industrial equipment is mostly an assembly, which may have geometric parts and structures inside. For example, industrial equipment with a large number of planar structures.
[0037] An embodiment of the present application provides a point cloud downsampling system, which can execute the point cloud downsampling method provided in the embodiment of the present application. Figure 1 A schematic diagram of the structure of a point cloud downsampling system provided in an embodiment of the present application.
[0038] like Figure 1 As shown, the point cloud downsampling system 001 includes at least one processor 011 and a memory 012 communicatively connected to the at least one processor; wherein the memory 012 stores instructions executable by the at least one processor 011, and the instructions are executed by the at least one processor 011 so that the at least one processor 011 can execute the point cloud downsampling method provided in an embodiment of the present application.
[0039] Figure 2 A schematic diagram of a process flow of a point cloud downsampling method provided in an embodiment of the present application. Figure 2 As shown, in some embodiments, the point cloud downsampling method includes the following steps:
[0040] S1, based on the target 3D model, obtain the point cloud dataset.
[0041] A point cloud dataset includes the three-dimensional coordinates of multiple points.
[0042] In some embodiments, when executing step S1, the point cloud downsampling method further includes the following steps:
[0043] S11, based on the point cloud library grid sampling function, converts the target three-dimensional model into a point cloud.
[0044] In some embodiments, the pcl_mesh_sampling function in the Point Cloud Library (PCL) is used to convert the target three-dimensional model in PLY or OBJ format into a point cloud.
[0045] Figure 3 Schematic diagram of a target three-dimensional model in a point cloud downsampling method provided in an embodiment of the present application. Figure 3 As shown, in some embodiments, the computer aided design (CAD) model obtained by the designer and consistent with the real model, whose file format is STEP, is converted into STL format through software such as 3dmax, and then converted into PLY or OBJ format through software such as CloudCompare or MeshLab.
[0046] S12, adjusting the spacing of the point cloud sampling grid and the output quantity of the point cloud sampling to obtain a uniform point cloud output.
[0047] Figure 4 for Figure 3 Provide the initial point cloud of the target 3D model in the point cloud downsampling method. Figure 4 As shown, after the target 3D model is converted into a point cloud, point clouds exist both in the device plane and on the contour.
[0048] S2, obtaining a first coordinate point and a second coordinate point based on the point cloud data.
[0049] The first coordinate point is used to represent the maximum three-dimensional coordinate in the three-dimensional coordinates of the point cloud, and the second coordinate point is used to represent the minimum three-dimensional coordinate in the three-dimensional coordinates of the point cloud. max Represents the horizontal coordinate of the first coordinate point. max Expressed as the ordinate of the first coordinate point. max Expressed as the vertical coordinate of the first coordinate point. min Represents the horizontal coordinate of the second coordinate point. min Expressed as the ordinate of the second coordinate point. min It is the vertical coordinate of the second coordinate point. The horizontal coordinate is the X-axis coordinate. The vertical coordinate is the Y-axis coordinate. The vertical coordinate is the Z-axis coordinate.
[0050] S3, based on the voxel grid and the second coordinate point, obtains the grid division result of each point in the point cloud dataset.
[0051] In a feasible implementation of the first aspect, the calculation formula of the grid division result is:
[0052]
[0053] Among them, l voxel Expressed as the size of the voxel grid. x min Represents the horizontal coordinate of the second coordinate point. min Expressed as the ordinate of the second coordinate point. min Expressed as the vertical coordinate of the second coordinate point. The floor symbol.
[0054] In one example, l voxel is 2, x min is 6, y min is 7, z min is 8, x is 12, y is 13, z is 14, then h x =(12-6) / 2=3,h y =(13-7) / 2=3,h z =(14-8) / 2=3.
[0055] S4: If the mesh division result satisfies the first preset condition, retaining the point cloud corresponding to the mesh division result.
[0056] The first preset condition is used to characterize that the point is located at the outer edge. By executing step S4, only the points on the outer surface of the model are retained, which reduces the result of downsampling, reduces the redundant calculation of the point cloud, and retains the geometric structure of the model.
[0057] In this way, it is determined whether there are any peripheral grid points on all rows and columns of the voxel grid. If so, the grid is inside the model point cloud, and all point clouds are cleared.
[0058] In some embodiments, when executing step S4, the point cloud downsampling method further includes the following steps:
[0059] S41, determining whether there are peripheral grid points on all rows and columns of the grid division result.
[0060] S42: If they all exist, clear all point clouds in the meshing result.
[0061] In one implementation, the grid division result is (h x ,h y ,h z ). If h x1 <h x <h x2 ,h y1 <h y <h y2 ,h z1 <h z <h z2 ,(h x1 ,h y ,h z )、(h x2 ,h y ,h z )、(h x ,h y1 ,h z )、(h x ,h y2 ,h z )、(h x ,h y ,h z1 ) and (h x ,h y ,h z2 ) all have point clouds, then clear (h x ,h y ,h z ) within all point clouds.
[0062] S5, calculating the voxel grid latitude based on the voxel grid, the first coordinate point and the second coordinate point.
[0063] In some embodiments, the voxel grid latitude is calculated as:
[0064]
[0065] Among them, l voxel Expressed as the size of the voxel grid. x max Represents the horizontal coordinate of the first coordinate point. max Expressed as the ordinate of the first coordinate point. max Expressed as the vertical coordinate of the first coordinate point. min Represents the horizontal coordinate of the second coordinate point. min Expressed as the ordinate of the second coordinate point. min Expressed as the vertical coordinate of the second coordinate point.
[0066] S6, based on the voxel grid latitude, transform the grid division result to obtain a one-dimensional index result.
[0067] In some embodiments, the calculation formula of the one-dimensional index result includes:
[0068] h=h x +h y *D x +h z *D z .
[0069] S7, obtaining a first voxel grid result based on the one-dimensional index result.
[0070] The first voxel grid result is used to characterize all non-empty voxel grids within the one-dimensional index result.
[0071] S8, calculating the curvature and normal vector of each point in the first voxel grid result to obtain a first geometric result.
[0072] By combining the point cloud downsampling strategy of curvature and geometric structure, the number of samples of the original point cloud is reduced, and at the same time, the feature redundancy is reduced by combining the actual application scenarios. For example, the device has a geometric plane structure, and there is no significant difference between the feature points on the plane, which is feature redundancy.
[0073] In some embodiments, the voxel is located on the outer surface of the model, and the point cloud curvature is calculated and the point with the largest point cloud curvature is saved as the point for mesh downsampling. At the same time, the points with little change in curvature on the plane are removed according to the angle of the normal vector to preserve the obvious geometric structure of the model.
[0074] S9, based on the first geometric result, obtain voxel downsampling points that meet a second preset condition.
[0075] The voxel downsampling points are used to represent the points corresponding to the maximum curvature in the first geometric result.
[0076] S10: If the voxel downsampling point meets the third preset condition, the voxel downsampling point is retained and recorded as a target point cloud.
[0077] In some embodiments, when executing step S10, the point cloud downsampling method further includes the following steps:
[0078] S101, calculating the normal vector angles between the voxel downsampling point and each point in the first point set.
[0079] The set constraint of the first point set may be preset and used to limit the number of points in the first point set. For example, the set constraint may be the K points closest to the voxel downsampling point. k is a positive integer greater than 1. Exemplarily, k may be any positive integer between 3 and 30. For another example, the set constraint may also be all points within the range of a circle with the voxel downsampling point as the center and R as the radius. The value of R may be any positive number greater than 0. Exemplarily, R may take 0.01n of the model diameter as a reference value. Wherein, n may be a positive integer.
[0080] S102: If the normal vector angles are all smaller than a preset threshold, clear the voxel downsampling points.
[0081] In some embodiments, the preset threshold is less than 90°, and may be 30° for example.
[0082] Figure 5 A schematic diagram of point cloud changes in a point cloud downsampling method provided in an embodiment of the present application. Figure 5 As shown, by executing steps S1 to S10, the downsampling of the point cloud is completed. The point cloud in the geometric plane structure is cleared and the contour features are retained.
[0083] Figure 6 A point cloud downsampling method provided in an embodiment of the present application and a schematic diagram of the change in the number of point clouds in the existing downsampling. Figure 6 As shown, compared with the existing downsampling method, the point cloud downsampling method provided in the embodiment of the present application obtains a smaller number of point clouds.
[0084] Figure 7 A point cloud downsampling method provided in an embodiment of the present application and a schematic diagram of the change in the number of point clouds in the existing downsampling. Figure 7 As shown, compared with the existing downsampling method, the point cloud downsampling method provided in the embodiment of the present application obtains a smaller number of point clouds.
[0085] Figure 8A point cloud downsampling method and a schematic diagram of the sampling results of the existing downsampling are provided in the embodiment of the present application. Figure 8 As shown, the sampling results of the industrial parts; Figure 8 (a) shows that the number of point clouds of the industrial part after voxel downsampling is 8380. Figure 8 (b) indicates that the number of point clouds after downsampling provided by the embodiment of the present application for the industrial part is 3742. The sampling result of the embodiment of the present application is much smaller than that of the existing voxel downsampling method, and the original geometric structure of the model is obviously retained.
[0086] from Figure 5 and Figure 8 It can be seen that the sampling results not only retain the points with larger curvature values, but also retain the points near the points with larger curvature values. The combination of the two can better represent the geometric structure of the model. Figure 6 and Figure 7 It can be seen that the downsampled points can be greatly reduced compared to the original sampling points.
[0087] Based on the same application concept, a point cloud downsampling system is also provided in an embodiment of the present application. The method corresponding to the point cloud downsampling system may be the point cloud downsampling method in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The point cloud downsampling system provided in an embodiment of the present application includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.
[0088] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application described above.
[0089] Specifically, the present embodiment may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device, or device.
[0090] Computer readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0091] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0092] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0093] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0094] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0095] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0096] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0097] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0098] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0100] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A point cloud downsampling method, characterized in that: include: Based on the target 3D model, a point cloud data set is obtained; The point cloud data set includes three-dimensional coordinates of a plurality of points; Based on the point cloud data, obtaining a first coordinate point and a second coordinate point; The first coordinate point is used to represent the maximum three-dimensional coordinate in the three-dimensional coordinates of the point cloud, and the second coordinate point is used to represent the minimum three-dimensional coordinate in the three-dimensional coordinates of the point cloud; Based on the voxel grid and the second coordinate point, obtain a grid division result for each point in the point cloud data set; If the grid division result satisfies a first preset condition, retaining the point cloud corresponding to the grid division result; The first preset condition is used to characterize that the point is located at the outer edge; Calculate the voxel grid latitude based on the voxel grid, the first coordinate point and the second coordinate point; Based on the voxel grid latitude, transform the grid division result to obtain a one-dimensional index result; Based on the one-dimensional index result, obtaining a first voxel grid result; The first voxel grid result is used to represent all non-empty voxel grids in the one-dimensional index result; Calculating the curvature and normal vector of each point in the first voxel grid result to obtain a first geometric result; Based on the first geometric result, obtaining a voxel downsampling point that meets a second preset condition; The voxel downsampling point is used to represent the point corresponding to the maximum curvature in the first geometric result; If the voxel downsampling point meets the third preset condition, the voxel downsampling point is retained and recorded as the target point cloud.
2. The point cloud downsampling method according to claim 1, characterized in that: When executing the step of acquiring a point cloud data set based on the target three-dimensional model, the point cloud downsampling method further includes: Based on the point cloud library grid sampling function, the target three-dimensional model is converted into a point cloud; Adjust the spacing of the point cloud sampling grid and the output number of point cloud sampling to obtain uniform point cloud output.
3. The point cloud downsampling method according to claim 1 or 2, characterized in that: The calculation formula of the voxel grid latitude is: Among them, l voxel Expressed as the size of the voxel grid; x max Represented as the horizontal coordinate of the first coordinate point; y max Expressed as the ordinate of the first coordinate point; z max Expressed as the vertical coordinate of the first coordinate point; x min Represents the horizontal coordinate of the second coordinate point; y min Expressed as the ordinate of the second coordinate point; z min Expressed as the vertical coordinate of the second coordinate point.
4. The point cloud downsampling method according to claim 3, characterized in that: The calculation formula of the grid division result is: Among them, l voxel Expressed as the size of the voxel grid; x min Represents the horizontal coordinate of the second coordinate point; y min Expressed as the ordinate of the second coordinate point; z min Expressed as the vertical coordinate of the second coordinate point.
5. The point cloud downsampling method according to claim 4, characterized in that: When executing the step of retaining the point cloud corresponding to the grid division result if the grid division result satisfies the first preset condition, the point cloud downsampling method further includes: It is determined whether there are peripheral grid points on all rows and columns of the grid division result; if so, all point clouds in the grid division result are cleared.
6. The point cloud downsampling method according to claim 5, characterized in that: The point cloud downsampling method further includes: The grid division result is (h x ,h y ,h z ); if h x1 <h x <h x2 ,h y1 <h y <h y2 ,h z1 <h z <h z2 , ( x1 ,h y ,h z ), (h x2 h y ,h z )、(h x ,h y1 ,h z )、(h x ,h y2 ,h z )、(h x ,h y ,h z1 ) and (h x ,h y ,h z2 ) all have point clouds, then clear (h x ,h y ,h z ) within all point clouds.
7. The point cloud downsampling method according to claim 4, characterized in that: When executing the step of converting the grid division result based on the voxel grid latitude to obtain a one-dimensional index result, the calculation formula of the one-dimensional index result is include: h=h x +h y *D x +h z *D z 。 8. The point cloud downsampling method according to claim 4, characterized in that: When executing the step of retaining the voxel downsampling point and recording it as the target point cloud if the voxel downsampling point meets the third preset condition, the point cloud downsampling method further includes: Calculating the normal vector angle between the voxel downsampling point and each point in the first point set; If the normal vector angles are all smaller than a preset threshold, the voxel downsampling point is cleared.
9. A point cloud downsampling system, characterized in that: include: at least one processor; a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 8.
10. A computer readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 8.
