Point cloud processing method and device, electronic equipment and readable storage medium
Through point cloud processing method, the supporting components in metal additive manufacturing are automatically identified and compressed, which solves the problems of low manual identification efficiency and high manpower consumption in the prior art, and achieves more efficient identification and saves manpower.
Patent Information
- Application Number
- CN202510057927.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-13
AI Technical Summary
In the metal additive manufacturing process, the prior art relies on manual identification and removal of support structures, resulting in low recognition efficiency and a large amount of manpower.
Through point cloud processing methods, support components are automatically identified and compressed in the growth direction to maintain component integrity and reduce unnecessary segmentation.
It improves the identification efficiency of supporting components, saves manpower, and reduces segmentation complexity, ensuring the quality and accuracy of the workpiece.
Smart Images

Figure CN119991591A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a point cloud processing method, device, electronic device and readable storage medium. Background Art
[0002] In the process of metal additive manufacturing, it is necessary to perform post-processing to remove the support structure. Removing the support structure is a key step to ensure the quality and accuracy of the workpiece. Currently, each support component in the support structure is generally identified manually, and then each support component is manually removed. This method has low support component identification efficiency and consumes a lot of manpower. Summary of the invention
[0003] The embodiments of the present application provide a point cloud processing method, device, electronic device and readable storage medium, which can automatically identify support components, thereby improving recognition efficiency and saving manpower, and maintain the integrity of the support components by compressing them in the growth direction of the support structure to avoid unnecessary segmentation.
[0004] The embodiments of the present application can be implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a point cloud processing method, the method comprising:
[0006] Obtaining a first point cloud of a support structure in a near-net-shape workpiece, wherein the first point cloud is obtained by performing point cloud acquisition on the near-net-shape workpiece, and the first point cloud includes a plurality of first point cloud points;
[0007] Clustering the first point cloud to obtain at least one first clustering result;
[0008] Taking each first clustering result whose number of point cloud points is not greater than a preset number as a second point cloud of a supporting component, and compressing each first clustering result whose number of point cloud points is greater than the preset number in the growth direction of the supporting structure to obtain a second clustering result;
[0009] For each second clustering result, clustering the second clustering result to obtain a third clustering result;
[0010] For each third clustering result, a first point cloud point corresponding to the third clustering result is determined to obtain a second point cloud of a support component corresponding to the third clustering result.
[0011] In a second aspect, an embodiment of the present application provides a point cloud processing device, the device comprising:
[0012] A point cloud acquisition module, used to obtain a first point cloud of a support structure in a near-net-shape workpiece, wherein the first point cloud is obtained by performing point cloud acquisition on the near-net-shape workpiece, and the first point cloud includes a plurality of first point cloud points;
[0013] A first clustering module, used for clustering the first point cloud to obtain at least one first clustering result;
[0014] an analysis module, configured to respectively use each first clustering result whose number of point cloud points is not greater than a preset number as a second point cloud of a supporting component, and to compress each first clustering result whose number of point cloud points is greater than the preset number in a growth direction of the supporting structure to obtain a second clustering result;
[0015] A second clustering module is used to cluster the second clustering results for each second clustering result to obtain a third clustering result;
[0016] The determination module is used to determine, for each third clustering result, a first point cloud point corresponding to the third clustering result, so as to obtain a second point cloud of a support component corresponding to the third clustering result.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the point cloud processing method described in the aforementioned embodiment.
[0018] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the point cloud processing method as described in the aforementioned embodiment is implemented.
[0019] The point cloud processing method, device, electronic device and readable storage medium provided by the embodiment of the present application first obtain a first point cloud of a support structure in a near-net-shape workpiece, the first point cloud is obtained by performing point cloud collection on the near-net-shape workpiece, and the first point cloud includes a plurality of first point cloud points; then, at least one first clustering result is obtained by clustering the first point cloud, and each first clustering result with a point cloud point number not greater than a preset number is respectively used as a second point cloud of a support component, and in the growth direction of the support structure, each first clustering result with a point cloud point number greater than a preset number is compressed to obtain a second clustering result; then, for each second clustering result, the second clustering result is clustered to obtain at least one third clustering result; finally, for each third clustering result, the first point cloud point corresponding to the third clustering result is determined to obtain a second point cloud of a support component corresponding to the third clustering result. In this way, the support component can be automatically identified, thereby improving the identification efficiency and saving manpower; and by compressing the scale of the support structure growth direction, the segmentation complexity in this direction can be reduced, avoiding unnecessary segmentation during the segmentation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 Schematic diagram of a workpiece manufactured using metal additive manufacturing;
[0022] Figure 2 A block diagram of an electronic device provided in an embodiment of the present application;
[0023] Figure 3 One of the flow charts of the point cloud processing method provided in the embodiment of the present application;
[0024] Figure 4 This is a schematic diagram of the support structure point cloud after segmentation;
[0025] Figure 5 for Figure 3 A schematic flow chart of the sub-steps included in step S130;
[0026] Figure 6 for Figure 3 A schematic flow chart of the sub-steps included in step S140;
[0027] Figure 7 The second flowchart of the point cloud processing method provided in the embodiment of the present application;
[0028] Figure 8 The third flowchart of the point cloud processing method provided in the embodiment of the present application;
[0029] Fig. 9 One of the block diagrams of the point cloud processing device provided in the embodiment of the present application;
[0030] Fig.10 The second block diagram of the point cloud processing device provided in the embodiment of the present application.
[0031] Icon: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication unit; 200 - point cloud processing device; 210 - point cloud acquisition module; 220 - first clustering module; 230 - analysis module; 240 - second clustering module; 250 - determination module; 260 - processing module. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0033] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0034] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0035] The metal additive manufacturing process produces Figure 1The near-net-shape workpiece shown in a in FIG. Figure 1 The original workpiece (i.e., the target workpiece after the support structure is removed from the near-net-shape workpiece) and the support structure shown in b in FIG. After the near-net-shape workpiece is manufactured, the support structure needs to be effectively removed.
[0036] Currently, each supporting component in the supporting structure is generally identified manually, and then each supporting component is manually removed. This method has low identification efficiency and consumes a lot of manpower.
[0037] In order to improve the recognition efficiency, it may be thought of to perform support component recognition and segmentation based on the collected point cloud of the support structure in the following way: map the point cloud data to the voxel space, and project it along the main axis direction of the point cloud data to obtain a multi-layer image; then, perform a connected domain analysis on each layer of images to obtain a connected domain of each layer of images; based on the connected domain of each layer of images, perform a voxel connected domain analysis on each layer of images, and finally segment the point cloud data through the connected domain of the voxel space. The segmentation result represents the segmented support component.
[0038] The above method segments the point cloud data by mapping the point cloud data to voxel space and performing connected domain analysis on multi-layer images. However, this method focuses on improving computational efficiency through principal axis projection and connected domain analysis, without considering the growth direction of the support material, which may lead to unnecessary segmentation in this direction, affecting computational efficiency and the accuracy of the results. Unnecessary segmentation will produce many "components" that have no connection points with the target workpiece. If the connection point analysis is subsequently performed based on the segmented components, the unnecessary segmentation will increase the amount of calculation of the connection points between each component and the target workpiece, reducing the efficiency of the support removal process. Therefore, in the segmentation process of the support structure point cloud, the growth direction of the support material must be considered to avoid segmentation in this direction to improve computational efficiency, thereby ensuring the smooth progress of the subsequent automatic support removal process.
[0039] In response to the above situation, the embodiments of the present application provide a point cloud processing method, device, electronic device and readable storage medium to improve the clustering algorithm, ensure the integrity of the support component in the growth direction of the support material, avoid unnecessary segmentation, and improve computing efficiency.
[0040] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0041] Please refer to Figure 2 , Figure 2A block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be, but is not limited to, a computer, a server, a robot, a robot control device, etc. The electronic device 100 includes a memory 110, a processor 120, and a communication unit 130. The memory 110, the processor 120, and the communication unit 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines.
[0042] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0043] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, a point cloud processing device 200 is stored in the memory 110, and the point cloud processing device 200 includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes various functional applications and data processing by running software programs and modules stored in the memory 110, such as the point cloud processing device 200 in the embodiment of the present application, that is, realizing the point cloud processing method in the embodiment of the present application.
[0044] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network, and to send and receive data through the network.
[0045] It should be understood that Figure 2 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations are shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0046] Please refer to Figure 3 , Figure 3 This is one of the flow diagrams of the point cloud processing method provided in the embodiment of the present application. The method can be applied to the above-mentioned electronic device. The specific flow of the point cloud processing method is described in detail below. In this embodiment, the method may include steps S110 to S150.
[0047] Step S110, obtaining a first point cloud of a support structure in a near-net-shape workpiece.
[0048] In this embodiment, a first point cloud of the support structure in the near-net-shape workpiece may be obtained first. The first point cloud is obtained by performing point cloud acquisition on the near-net-shape workpiece, and the first point cloud includes a plurality of first point cloud points, which may be represented by a three-dimensional coordinate. The near-net-shape workpiece is a workpiece that requires the support structure to be removed. The first point cloud may be obtained by other equipment by processing the point cloud of the near-net-shape workpiece, or may be obtained by the electronic equipment by processing the point cloud of the near-net-shape workpiece, which may be determined in combination with actual needs.
[0049] Step S120: clustering the first point cloud to obtain at least one first clustering result.
[0050] In this embodiment, when the first point cloud is obtained, clustering processing can be performed by a clustering algorithm that requires pre-specification of the number of clusters, such as the K-Means algorithm, or a clustering algorithm that does not require pre-specification of the number of clusters, such as the DBSCAN algorithm, HDBSCAN (density-based hierarchical spatial clustering) algorithm, etc., so as to segment the first point cloud and obtain at least one first clustering result, that is, obtain at least one cluster.
[0051] In step S130, each first clustering result whose number of point cloud points is not greater than a preset number is respectively used as a second point cloud of a supporting component, and in the growth direction of the supporting structure, each first clustering result whose number of point cloud points is greater than the preset number is compressed to obtain a second clustering result.
[0052] After clustering the first point cloud, for each first clustering result obtained, the number of first point cloud points included in the first clustering result is counted as the number of point cloud points of the first clustering result, and then it is determined whether the number of point cloud points is greater than a preset number. The preset number is used to represent a preset maximum point number threshold of a support component, which can be set in combination with actual needs. If the number of point cloud points of a first clustering result is not greater than the preset number, the first clustering result is directly used as the second point cloud of a support component.
[0053] If the number of point cloud points of a first clustering result is greater than the preset number, the first clustering result is compressed in spatial scale in the growth direction of the support structure, and the compressed first clustering result is used as a second clustering result. The growth direction of the support structure can also be described as the growth direction of the support material, and the growth direction of the support material is usually consistent with the growth direction of the target workpiece. The compressed first point cloud point can be used as the second point cloud point. It can be understood that the distance between the two first point cloud points in the growth direction is greater than the distance between the corresponding two second point cloud points (i.e., the two first point cloud points after compression) in the growth direction.
[0054] Step S140: clustering each second clustering result to obtain a third clustering result.
[0055] Step S150: for each third clustering result, determine the first point cloud point corresponding to the third clustering result to obtain a second point cloud of a support component corresponding to the third clustering result.
[0056] In this embodiment, for each second clustering result, the second clustering result is taken as a clustering analysis object, and the second clustering result is clustered, so as to obtain at least one third clustering result corresponding to the second clustering result. Wherein, when clustering a second clustering result, the clustering algorithm used may be a clustering algorithm that requires a pre-specified number of clusters, or a clustering algorithm that does not require a pre-specified number of clusters, which may be determined in combination with actual needs.
[0057] The point cloud points included in the obtained third clustering result are the second point cloud points obtained after compression. For each obtained third clustering result, the first point cloud points corresponding to the second point cloud points in the third clustering result can be determined, and the determined first point cloud points can be used as the first point cloud points included in the second point cloud of a support component corresponding to the third clustering result. In this way, the support structure point cloud can be segmented into support components. For example, the effect diagram of the support structure point cloud segmentation is as follows: Figure 4 As shown, Figure 4 The support structure shown is Figure 1 The supporting structure shown in c.
[0058] In this embodiment, the first point cloud is first segmented, so as to avoid mixing two different support components together during compression processing and then performing a second clustering. Figure 4 The split support structure shown (i.e. Figure 1The dark green component represents support component 1, and the gray component above the dark green component represents support component 2. If the first segmentation is not performed before compression, the point cloud of support component 1 and the point cloud of support component 2 will be mixed together after compression. When segmentation is performed again after mixing, support component 1 and support component 2 will be identified as one component, or part of the structure of support component 1 will be considered as the structure of support component 2. After the first segmentation, each first clustering result whose number of point cloud points in the first clustering result obtained by the first segmentation is not greater than the preset number is respectively regarded as a point cloud of a support component. In this way, the segmentation of the segmented component due to the second segmentation can be avoided, and the compression and second segmentation in the growth direction are performed for each first clustering result whose number of point cloud points in the first clustering result obtained by the first segmentation is greater than the preset number, thereby performing unnecessary segmentation in the growth direction. The above method can effectively improve the computational efficiency of point cloud segmentation and reduce unnecessary calculation amount.
[0059] Optionally, the near-net-shape workpiece may be firstly subjected to point cloud acquisition to obtain a workpiece point cloud. Then, a structural point cloud in the workpiece point cloud may be determined, and then a first point cloud of the support structure may be determined based on the structural point cloud. The structural point cloud is used to indicate the support structure in the near-net-shape workpiece.
[0060] Optionally, a target point cloud in the workpiece point cloud can be identified, and then the target point cloud in the workpiece point cloud can be removed to obtain a structure point cloud, wherein the target point cloud is the point cloud of the target workpiece. For example, a standard model point cloud of the target workpiece can be generated based on a standard three-dimensional model of the target workpiece, and then the target point cloud in the workpiece point cloud can be identified in combination with the standard model point cloud.
[0061] Alternatively, the structural point cloud in the workpiece point cloud may be directly identified. For example, a model point cloud of the target workpiece may be generated based on a three-dimensional model corresponding to a supporting structure, and then the structural point cloud in the workpiece point cloud may be identified in combination with the model point cloud.
[0062] Optionally, the structural point cloud can be directly used as the first point cloud. Alternatively, the structural point cloud can be preprocessed, such as denoising and downsampling, and the preprocessed structural point cloud can be used as the first point cloud of the supporting structure. In this way, the efficiency and accuracy of subsequent processing can be improved.
[0063] As a possible implementation, the HDBSCAN algorithm may be used to perform a first segmentation on the first point cloud to form K “clusters”, that is, to obtain at least one first clustering result. The HDBSCAN algorithm can recognize clusters of any shape and size and can automatically determine the number K of clusters.
[0064] After obtaining the first clustering result, each first clustering result with a point cloud point number not greater than a preset number can be used as a second point cloud of a supporting component, and each first clustering result with a point cloud point number greater than a preset number can be used as a first clustering result to be processed, and execute Figure 5 Please refer to Figure 5 , Figure 5 for Figure 3 Schematic diagram of the flow of sub-steps included in step S130. In this embodiment, step S130 may include sub-steps S131 to S132.
[0065] Sub-step S131, obtaining a first to-be-processed clustering result in the target coordinate system.
[0066] Sub-step S132, for each first to-be-processed clustering result located in the target coordinate system, compressing the target coordinate value of each point cloud point in the first to-be-processed clustering result located in the target coordinate system on the target coordinate axis to obtain a second clustering result.
[0067] In this embodiment, before compressing the coordinate values, it can be determined whether the coordinate system used by the coordinates of the first point cloud point in the first point cloud is the target coordinate system, wherein one of the coordinate axes of the target coordinate system is the target coordinate axis, and the target coordinate axis represents the growth direction.
[0068] If the coordinate system used by the coordinates of the first point cloud point is not the target coordinate system, after obtaining the first point cloud, the first point cloud may be converted to the target coordinate system, and then the first segmentation may be performed to obtain the first clustering result to be processed in the target coordinate system; or after determining the first clustering result to be processed, for each first clustering result to be processed, the coordinates of the first point cloud point in the first clustering result to be processed may be converted to the coordinates in the target coordinate system to obtain the first clustering result to be processed in the target coordinate system. If the coordinate system used by the coordinates of the first point cloud point in the first point cloud is the target coordinate system, the first clustering result to be processed determined after the first segmentation of the first point cloud will be directly used as the first clustering result to be processed in the target coordinate system.
[0069] For each first clustering result to be processed in the target coordinate system, the coordinate value of each point cloud point in the first clustering result to be processed in the target coordinate system on the target coordinate axis is determined as the target coordinate value, and then the target coordinate value is compressed to reduce the absolute value, and the second point cloud point indicated by the three-dimensional coordinate after the processing is used as a point cloud point in a second clustering result. In this way, the spatial scale of the growth direction can be compressed to avoid unnecessary segmentation in the growth direction later.
[0070] For example, if the Z axis is the target coordinate axis, then for each point cloud point in the first to-be-processed clustering result under the target coordinate system, the z coordinate of the point cloud point can be multiplied by the compression coefficient z_scale, while keeping the x and y coordinates unchanged, thereby obtaining the coordinates of the second point cloud point (x, y, z*z_scale), where z_scale can be a proportional coefficient between 0 and 1, and z_scale is less than 1.
[0071] In order to ensure the segmentation effect, as a possible implementation method, Figure 6 The recursive clustering method shown in FIG. 1 is used to cluster each of the second clustering results to obtain a third clustering result. Figure 6 , Figure 6 for Figure 3 Schematic diagram of the flow of sub-steps included in step S140. In this embodiment, step S140 may include sub-steps S141 to S145.
[0072] Sub-step S141 : for each current clustering object, clustering is performed on the current clustering object to obtain a clustering result of this clustering.
[0073] Sub-step S142, for each clustering result obtained by this clustering, it is determined whether the number of point cloud points in the clustering result is greater than the preset number.
[0074] Sub-step S143, when there are clustering results with point cloud points not greater than the preset number in the clustering results obtained by this clustering, each clustering result with point cloud points not greater than the preset number in the clustering results obtained by this clustering is respectively used as a third clustering result.
[0075] Sub-step S144, when there is a to-be-processed clustering result whose number of point cloud points is greater than the preset number in the clustering results obtained by the current clustering, the existing to-be-processed clustering result is updated as the current clustering object.
[0076] Sub-step S145 , when the clustering result to be processed does not exist in the clustering result obtained by the current clustering, determining that the clustering processing of the obtained second clustering result is completed.
[0077] In this embodiment, each second clustering result obtained can be processed as follows. First, the second clustering result is used as the current clustering object, that is, when a second clustering result is clustered for the first time, the current clustering object is the second clustering result, and the second clustering result is clustered (i.e., segmented) using a clustering algorithm to obtain the clustering result of this clustering of the second clustering result. Among them, the clustering algorithm used can be a clustering algorithm that requires the pre-specification of the number of clusters, or a clustering algorithm that does not require the pre-specification of the number of clusters. Since the K-means algorithm tends to find spherical clusters and has the characteristics of high computational efficiency and fast convergence, as a possible implementation method, the current clustering object is clustered by the K-means algorithm.
[0078] For each clustering result of this clustering corresponding to the second clustering result, the number of point cloud points included in the clustering result is statistically obtained, and then it is determined whether the number of point cloud points is greater than the preset number. If the number of point cloud points of a clustering result obtained in this clustering is greater than the second preset number, the clustering result is regarded as a pending clustering result that needs to be clustered again, the clustering result is updated as the current clustering object, and the updated clustering object is clustered using the same clustering algorithm. If the number of point cloud points of a clustering result obtained in this clustering is not greater than the preset number, the clustering result is regarded as a third clustering result. If there is no pending clustering result with a point cloud point number greater than the preset number in the clustering results obtained in a certain clustering, it is determined that the second clustering processing of the second clustering result is completed. When the above processing is completed for each second clustering result obtained, it can be determined that the second clustering of each second clustering result obtained has been completed.
[0079] Since compression is performed in the growth direction, the second clustering mentioned above can be approximately regarded as recursive segmentation of the second clustering result obtained after compression on a plane perpendicular to the growth direction until the number of points in the obtained clusters is within a preset number.
[0080] The following takes the K-means algorithm used as the clustering algorithm to perform a second segmentation on a second clustering result A as an example to illustrate the above recursive segmentation.
[0081] Assume that the second clustering result A is first clustered by the K-means algorithm and divided into three clusters A1, A2, and A3 (i.e., the clustering results of this clustering). Assume that: the number of point cloud points in clusters A1 and A2 is greater than the preset number, and the number of point cloud points in cluster A3 is not greater than the preset number; therefore, cluster A3 is directly used as a third clustering result, and then the first point cloud points corresponding to the point cloud points in the third clustering result can be used as the point cloud points in the second point cloud corresponding to a supporting component; and it is determined that clusters A1 and A2 need to be split again.
[0082] Cluster A1 is divided into three clusters B1, B2, and B3 by K-means algorithm. Assumption: Clusters B1, B2, and B3 are not greater than the preset number, so clusters B1, B2, and B3 are directly used as the third clustering result.
[0083] Cluster A2 is divided into three clusters B4, B5, and B6 by the K-means algorithm. Assume that the number of point cloud points in cluster B4 is greater than the preset number, and the number of point cloud points in clusters B5 and B6 is not greater than the preset number; therefore, clusters B5 and B6 are directly used as the third clustering results, and it is determined that cluster B4 needs to be split again.
[0084] The K-means algorithm is used to divide B4 into three clusters C1, C2, and C3. Assumption: The number of point clouds in clusters C1, C2, and C3 is not greater than the preset number, so clusters C1, C2, and C3 are directly used as a third clustering result.
[0085] In this way, the second segmentation of the second clustering result A is completed, and the third clustering result corresponding to the second clustering result A is obtained: cluster A3, cluster B1, cluster B2, cluster B3, cluster B5, cluster B6, cluster C1, cluster C2, cluster C3.
[0086] Optionally, as a possible implementation, a point cloud point identifier (such as a point ID) may be set for the first point cloud point in the first point cloud, and the first point cloud point before compression and the second point cloud point obtained by compressing the first point cloud point use the same point cloud point identifier. The third clustering result may include the coordinates of the second point cloud point. After obtaining each third clustering result, the point cloud point identifier of each point cloud point in the third clustering result may be determined for each third clustering result, and then the first point cloud point corresponding to each point cloud point in the third clustering result may be determined based on the point cloud point identifier, thereby obtaining a second point cloud of a support component.
[0087] Optionally, as another possible implementation method, the third clustering result may include the coordinates of the second point cloud point. According to the compression method, the coordinates of the second point cloud point in each third clustering result before compression can be directly determined, that is, the first point cloud point corresponding to the second point cloud point in each third clustering result is obtained, thereby obtaining a second point cloud of a support component.
[0088] In this embodiment, the HDBSCAN algorithm can be used to perform preliminary segmentation on the support structure point cloud (i.e., the first point cloud) to obtain K clusters for initialization of the K-means algorithm. This method can identify and mark noise points, reduce their interference with the K-means clustering results, and improve the accuracy of clustering. Afterwards, for the points in each cluster with a point number greater than a preset number, they are compressed in the growth direction of the support material, and then the compressed clusters are secondary segmented using the recursive K-means algorithm to identify smaller sub-clusters that meet the point number requirements. The local point clouds corresponding to the smaller sub-clusters in the support structure point cloud are the support components. That is, HDBSCAN is used for preliminary complex point cloud clustering, and then the K-means algorithm is applied to the preliminary segmentation results with a compressed point number greater than a preset number for recursive segmentation. In this way, the advantages of the two algorithms can be utilized, taking into account both accuracy and efficiency, and by avoiding unnecessary segmentation in the growth direction of the support material, the computational efficiency of point cloud segmentation can be effectively improved and unnecessary computation can be reduced.
[0089] Please refer to Figure 7 , Figure 7 The second flowchart of the point cloud processing method provided in the embodiment of the present application is as follows. In this embodiment, after step S150, the method may include step S160.
[0090] Step S160: for the second point cloud of each supporting component, determine the connection point according to the second point cloud.
[0091] In this embodiment, when a second point cloud of a support component is determined, a connection point can be determined for the second point cloud in combination with the point cloud of the target workpiece in the near-net-shape workpiece. The connection point is located on the support component and the distance from the target workpiece in the near-net-shape workpiece is less than a preset distance. After the corresponding connection point is determined according to each second point cloud, the connection point can be sent to other devices for display to prompt the staff to manually process the connection point, thereby removing the support structure in the near-net-shape workpiece and obtaining the target workpiece.
[0092] Among them, the method of determining the connection points according to the second point cloud of a support component and the point cloud of the target workpiece can be determined in combination with actual needs, and is not specifically limited here. As a possible implementation method, the nearest neighbor algorithm can be used to calculate the connection points between the segmented support component and the target workpiece. In this method, for the second point cloud of a support component, points belonging to the second point cloud and whose distance from the point cloud of the target workpiece is within a certain distance threshold range can be determined, and the determined points are used as connection points determined based on the second point cloud.
[0093] Please refer to Figure 8 , Figure 8The third flowchart of the point cloud processing method provided in the embodiment of the present application. In this embodiment, after step S160, the method may further include step S170.
[0094] Step S170: Control the robot to remove the support structure according to the determined connection points.
[0095] In this embodiment, a tool (e.g., a chisel) for removing the support structure may be provided at the end of the robot. After the connection point is determined, the robot may be controlled to process the connection point, thereby removing the support structure in the support structure in the near-net-shape workpiece to obtain the target workpiece. In this way, manpower can be further saved and processing efficiency can be improved.
[0096] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing the point cloud processing device 200 is given below. Optionally, the point cloud processing device 200 can adopt the above Figure 2 The device structure of the electronic device 100 is shown. Fig. 9 , Fig. 9 This is one of the block diagrams of the point cloud processing device 200 provided in the embodiment of the present application. It should be noted that the basic principle and technical effects of the point cloud processing device 200 provided in this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above-mentioned embodiments. In this embodiment, the point cloud processing device 200 may include: a point cloud acquisition module 210, a first clustering module 220, an analysis module 230, a second clustering module 240 and a determination module 250.
[0097] The point cloud acquisition module 210 is used to obtain a first point cloud of a support structure in a near-net-shape workpiece, wherein the first point cloud is obtained by performing point cloud acquisition on the near-net-shape workpiece, and the first point cloud includes a plurality of first point cloud points.
[0098] The first clustering module 220 is used to cluster the first point cloud to obtain at least one first clustering result.
[0099] The analysis module 230 is used to take each first clustering result whose number of point cloud points is not greater than a preset number as a second point cloud of a supporting component, and to compress each first clustering result whose number of point cloud points is greater than the preset number in the growth direction of the supporting structure to obtain a second clustering result.
[0100] The second clustering module 240 is used to cluster the second clustering results for each second clustering result to obtain a third clustering result.
[0101] The determination module 250 is used to determine, for each third clustering result, a first point cloud point corresponding to the third clustering result, so as to obtain a second point cloud of a support component corresponding to the third clustering result.
[0102] Please refer to Fig.10 , Fig.10 The second block diagram of the point cloud processing device 200 provided in the embodiment of the present application. In this embodiment, the point cloud processing device 200 may further include a processing module 260. The processing module 260 is used to: for the second point cloud of each support component, determine a connection point according to the second point cloud, wherein the connection point is located on the support component and the distance from the target workpiece in the near-net-shape workpiece is less than a preset distance.
[0103] Optionally, in this embodiment, the processing module 260 may also be used to: control the robot to remove the support structure according to the determined connection points.
[0104] Optionally, the above modules can be stored in the form of software or firmware. Figure 2 The memory 110 shown in the figure may be fixed in the operating system (OS) of the electronic device 100 and may be Figure 2 Meanwhile, the data and program codes required for executing the above modules may be stored in the memory 110.
[0105] An embodiment of the present application also provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the point cloud processing method is implemented.
[0106] In summary, the embodiment of the present application provides a point cloud processing method, device, electronic device and readable storage medium. First, first, a first point cloud of a support structure in a near-net-shape workpiece is obtained, the first point cloud is obtained by performing point cloud collection on the near-net-shape workpiece, and the first point cloud includes a plurality of first point cloud points; then, at least one first clustering result is obtained by clustering the first point cloud, and each first clustering result with a point cloud point number not greater than a preset number is respectively used as a second point cloud of a support component, and in the growth direction of the support structure, each first clustering result with a point cloud point number greater than a preset number is compressed to obtain a second clustering result; then, for each second clustering result, the second clustering result is clustered to obtain at least one third clustering result; finally, for each third clustering result, the first point cloud point corresponding to the third clustering result is determined to obtain a second point cloud of a support component corresponding to the third clustering result. In this way, the support component can be automatically identified, thereby improving the identification efficiency and saving manpower; and by compressing the scale of the growth direction of the support structure, the segmentation complexity in this direction can be reduced, avoiding unnecessary segmentation during the segmentation process.
[0107] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes 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 box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0109] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0110] The above description is only an optional embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A point cloud processing method, characterized in that: The method comprises: Obtaining a first point cloud of a support structure in a near-net-shape workpiece, wherein the first point cloud is obtained by performing point cloud acquisition on the near-net-shape workpiece, and the first point cloud includes a plurality of first point cloud points; Clustering the first point cloud to obtain at least one first clustering result; Taking each first clustering result whose number of point cloud points is not greater than a preset number as a second point cloud of a supporting component, and compressing each first clustering result whose number of point cloud points is greater than the preset number in the growth direction of the supporting structure to obtain a second clustering result; For each second clustering result, clustering the second clustering result to obtain a third clustering result; For each third clustering result, a first point cloud point corresponding to the third clustering result is determined to obtain a second point cloud of a support component corresponding to the third clustering result.
2. The method according to claim 1, characterized in that: The step of compressing each first clustering result having a point cloud point number greater than the preset number in the growth direction of the support structure to obtain a second clustering result includes: Obtaining a first clustering result to be processed in a target coordinate system, wherein the first clustering result to be processed is a first clustering result in which the number of point cloud points is greater than the preset number, one of the coordinate axes of the target coordinate system is a target coordinate axis, and the target coordinate axis represents the growth direction; For each first to-be-processed clustering result located in the target coordinate system, the target coordinate value of each point cloud point in the first to-be-processed clustering result located in the target coordinate system on the target coordinate axis is compressed to obtain a second clustering result.
3. The method according to claim 1, characterized in that The step of clustering the second clustering results to obtain a third clustering result includes: For each current clustering object, clustering is performed on the current clustering object to obtain a clustering result of this clustering, wherein when clustering is performed for the first time on a second clustering result, the current clustering object is the second clustering result; For each clustering result obtained by this clustering, determining whether the number of point cloud points of the clustering result is greater than the preset number; In the case that there are clustering results whose number of point cloud points is not greater than the preset number in the clustering results obtained by the current clustering, each clustering result whose number of point cloud points is not greater than the preset number in the clustering results obtained by the current clustering is respectively taken as a third clustering result; If there is a to-be-processed clustering result whose number of point cloud points is greater than the preset number in the clustering results obtained by this clustering, the existing to-be-processed clustering result is updated as the current clustering object; When the clustering result to be processed does not exist in the clustering result obtained by the current clustering, it is determined that the clustering processing of the obtained second clustering result is completed.
4. The method according to any one of claims 1 to 3, characterized in that: The clustering of the first point cloud to obtain at least one first clustering result includes: When the number of clusters is unknown, clustering is performed on the first point cloud to obtain the first clustering result; and / or, The step of clustering the second clustering results to obtain a third clustering result includes: The second clustering result is clustered by using a K-means algorithm to obtain the third clustering result.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: For the second point cloud of each supporting component, a connection point is determined according to the second point cloud, wherein the connection point is located on the supporting component and the distance from the target workpiece in the near-net-shape workpiece is less than a preset distance.
6. The method according to claim 5, characterized in that The method further comprises: According to the determined connection points, the robot is controlled to remove the support structure.
7. A point cloud processing device, characterized in that: The device comprises: A point cloud acquisition module, used to obtain a first point cloud of a support structure in a near-net-shape workpiece, wherein the first point cloud is obtained by performing point cloud acquisition on the near-net-shape workpiece, and the first point cloud includes a plurality of first point cloud points; A first clustering module, used for clustering the first point cloud to obtain at least one first clustering result; an analysis module, configured to respectively use each first clustering result whose number of point cloud points is not greater than a preset number as a second point cloud of a supporting component, and to compress each first clustering result whose number of point cloud points is greater than the preset number in a growth direction of the supporting structure to obtain a second clustering result; A second clustering module, used for clustering the second clustering results to obtain a third clustering result; The determination module is used to determine, for each third clustering result, a first point cloud point corresponding to the third clustering result, so as to obtain a second point cloud of a support component corresponding to the third clustering result.
8. The device according to claim 7, characterized in that The analysis module is specifically used for: Obtaining a first clustering result to be processed in a target coordinate system, wherein the first clustering result to be processed is a first clustering result in which the number of point cloud points is greater than the preset number, one of the coordinate axes of the target coordinate system is a target coordinate axis, and the target coordinate axis represents the growth direction; For each first to-be-processed clustering result located in the target coordinate system, the target coordinate value of each point cloud point in the first to-be-processed clustering result located in the target coordinate system on the target coordinate axis is compressed to obtain a second clustering result.
9. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the point cloud processing method described in any one of claims 1-6.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the point cloud processing method according to any one of claims 1 to 6 is implemented.