Cylindrical surface detection method and device

By performing plane grouping and point cloud slicing of the plane detection results of three-dimensional point clouds, the target point cloud collection and projection plane are selected, which solves the problem of low cylindrical surface detection accuracy in the prior art and achieves more accurate cylindrical surface recognition.

CN119205723BActive Publication Date: 2025-05-13FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411586457.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-05-13
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

When detecting cylindrical surfaces in three-dimensional point clouds, especially when the cylinder height is small, the detection accuracy is not high and is easily affected by noise points, resulting in inaccurate identification.

Method used

By plane grouping the plane detection results of the point cloud to be detected, dividing it into plane groups, and corresponding point cloud sets and projection planes are determined from the point cloud for each plane group. According to the projection point distribution of the point clouds on the projection plane, the target point cloud sets and target projection planes are filtered out, and the target cylinder surface is then detected.

Benefits of technology

The accuracy of cylindrical surface detection is improved, especially when the cylinder height is small, the cylindrical surface can be more accurately identified, reducing the influence of noise points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205723B_ABST
    Figure CN119205723B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a cylindrical surface detection method and device, which relates to the field of computer technology. The method includes: obtaining a plane detection result corresponding to a point cloud to be detected; dividing the approximately parallel planes in the plane detection result into plane groups; for each plane group, determining a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set from the point cloud to be detected, wherein the point cloud points in a point cloud set and the acquisition device used to obtain the point cloud to be detected are located on the same side of the projection plane corresponding to the point cloud set, and the projection plane is a plane in the corresponding plane group; according to the distribution of the projection points of the point cloud set on the corresponding projection plane, the target point cloud set and the target projection plane are determined from the obtained point cloud set and the corresponding projection plane; according to the target point cloud set and the target projection plane, the target cylindrical surface is detected. In this way, the cylindrical surface can be detected from the point cloud with high detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a cylindrical surface detection method and device. Background Art

[0002] Detecting cylindrical surfaces from point clouds is a computer vision and 3D point cloud processing task, which aims to detect and identify cylindrical objects or surfaces from 3D point cloud data. Currently, in the processing of 3D point clouds, it is sometimes necessary to detect cylindrical surfaces based on 3D point clouds. For example, when identifying welds in workpieces, it is necessary to identify cylindrical surfaces, and then determine the welds in the workpiece based on the identified cylindrical surfaces. Therefore, how to detect cylindrical surfaces from 3D point clouds has become a technical problem that technicians in this field need to solve urgently. Summary of the invention

[0003] The embodiments of the present application provide a cylindrical surface detection method, device, electronic device and readable storage medium, which can detect a cylindrical surface from a point cloud and have high detection accuracy.

[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 cylindrical surface detection method, the method comprising:

[0006] Obtain the plane detection result corresponding to the point cloud to be detected;

[0007] Dividing the planes in the plane detection result into plane groups, wherein when a plane group includes multiple planes, an angle between a plane in the plane group and a normal of each of the other planes is less than a preset angle;

[0008] For each plane group, a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set are determined from the point cloud to be detected, wherein the point cloud points in a point cloud set and the acquisition device used to obtain the point cloud to be detected are located on the same side of the projection plane corresponding to the point cloud set, and the projection plane is a plane in the corresponding plane group;

[0009] According to the distribution of projection points of the point cloud set on the corresponding projection plane, a target point cloud set and a target projection plane are determined from the obtained point cloud set and the corresponding projection plane;

[0010] The target cylindrical surface is detected according to the target point cloud set and the target projection plane.

[0011] In a second aspect, an embodiment of the present application provides a cylindrical surface detection device, the device comprising:

[0012] An acquisition module is used to obtain the plane detection result corresponding to the point cloud to be detected;

[0013] a grouping module, configured to divide the planes in the plane detection result into plane groups, wherein when a plane group includes multiple planes, an angle between a normal of one of the planes in the plane group and the normals of the other planes is less than a preset angle;

[0014] A point cloud segmentation module is used to determine, for each plane group, from the point cloud to be detected, a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set, wherein the point cloud points in a point cloud set and the acquisition device used to obtain the point cloud to be detected are located on the same side of the projection plane corresponding to the point cloud set, and the projection plane is a plane in the corresponding plane group;

[0015] A screening module, for determining a target point cloud set and a target projection plane from the obtained point cloud set and the corresponding projection plane according to the distribution of projection points of the point cloud set on the corresponding projection plane;

[0016] The detection module is used to detect the target cylindrical surface according to the target point cloud set and the target projection plane.

[0017] In a third aspect, an embodiment of the present application provides an electronic device, including 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 cylindrical surface detection 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 cylindrical surface detection method as described in the aforementioned embodiment is implemented.

[0019] The cylindrical surface detection method, device, electronic device and readable storage medium provided by the embodiment of the present application first obtain the plane detection result of the point cloud to be detected that needs to be detected for the cylindrical surface; then, divide the planes in the plane detection result into plane groups, wherein when a plane group includes multiple planes, the angle between the normal of one plane in the plane group and the normal of each of the other planes is less than a preset angle; then, for each plane group, determine the point cloud set corresponding to the plane group and the projection plane corresponding to the point cloud set from the above-mentioned point cloud to be detected, wherein the point cloud points in a point cloud set and the acquisition device used to obtain the point cloud to be detected are located on the same side of the projection plane corresponding to the point cloud set, and the projection plane is the plane in the corresponding plane group; then, according to the distribution of the projection points of the point cloud set on the corresponding projection plane, determine the target point cloud set and the target projection plane from the obtained point cloud set and the corresponding projection plane, and then detect the target cylindrical surface according to the target point cloud set and the target projection plane. In this way, the cylindrical surface can be detected from the point cloud with high detection accuracy. 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 A block diagram of an electronic device provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of a process flow of a cylindrical surface detection method provided in an embodiment of the present application;

[0023] Figure 3 for Figure 2 A schematic flow chart of the sub-steps included in step S120;

[0024] Figure 4 for Figure 2 A schematic flow chart of the sub-steps included in step S130;

[0025] Figure 5 A schematic diagram of the relationship between the j-th partial point cloud and the upper and lower planes provided in an embodiment of the present application;

[0026] Figure 6 for Figure 4 A schematic flow chart of the sub-steps included in sub-step S132;

[0027] Figure 7 for Figure 2 A schematic flow chart of the sub-steps included in step S140;

[0028] Figure 8 for Figure 7 A schematic flow chart of the sub-steps included in sub-step S142;

[0029] Fig. 9 for Figure 8 A schematic flow chart of the sub-steps included in sub-step S1422;

[0030] Fig.10 A schematic diagram of a straight line corresponding to a projection point;

[0031] Fig.11 A block diagram of a cylindrical surface detection device provided in an embodiment of the present application.

[0032] Icon: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication unit; 200 - cylindrical surface detection device; 210 - acquisition module; 220 - grouping module; 230 - point cloud segmentation module; 240 - screening module; 250 - detection module. DETAILED DESCRIPTION

[0033] 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.

[0034] 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.

[0035] 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.

[0036] Currently, the cylindrical surface in the point cloud is detected in the following way: first, the plane in the point cloud is detected by a voting algorithm, and the points on the plane are removed from the point cloud after the plane is detected; next, the cylinder axis is detected based on the remaining points using a voting algorithm, and the points that voted for the cylinder axis are projected onto a plane perpendicular to the cylinder axis, and the voting algorithm is used to detect circles on the plane, and the cylinder axis detection results and circle detection results are combined to obtain the cylinder surface detection results. The above cylindrical surface detection method in the point cloud may result in unstable cylinder axis detection when the cylinder height is very small.

[0037] For example, a workpiece contains a very small cylinder, the radius of which is 70mm and the height of which is 5mm. Since the height of the cylinder is very small, there are fewer points on the cylindrical surface. When these points are used to vote for the cylinder axis, it is easy to vote incorrectly for the cylinder axis. For example, there are very few points on the surface of the cylinder in the point cloud obtained, and it includes certain noise points. In this case, when the final identified cylinder axis is determined by voting, the inaccurate cylinder axis determined in combination with the noise points may be used as the final identified cylinder axis, which results in an inaccurate cylindrical surface identified based on the identified cylinder axis and the plane perpendicular to the cylinder axis.

[0038] In response to the above situation, the embodiments of the present application provide a cylindrical surface detection method, device, electronic device and readable storage medium, which divide the plane detected based on the point cloud to be detected into at least one plane group, and perform point cloud segmentation on the point cloud to be detected based on the at least one plane group to obtain a point cloud set corresponding to each plane group and a projection plane corresponding to the point cloud set, and then project the point cloud set onto the corresponding projection plane to evaluate the possibility that the projection point contains a circular curve, and finally select the point cloud set that is most likely to contain a circular curve to detect the cylindrical surface, thereby accurately detecting the cylindrical surface.

[0039] 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.

[0040] Please refer to Figure 1 , Figure 1 A 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 welding robot, etc. The electronic device 100 may include 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 may be electrically connected to each other via one or more communication buses or signal lines.

[0041] 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.

[0042] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores a cylindrical surface detection device 200, and the cylindrical surface detection 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 cylindrical surface detection device 200 in the embodiment of the present application, that is, realizing the cylindrical surface detection method in the embodiment of the present application.

[0043] 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.

[0044] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0045] Please refer to Figure 2 , Figure 2 The present invention provides a schematic flow chart of a cylindrical surface detection method according to an embodiment of the present invention. The method can be applied to the electronic device 100. The specific flow of the cylindrical surface detection method is described in detail below. In this embodiment, the method can include steps S110 to S150.

[0046] Step S110, obtaining the plane detection result corresponding to the point cloud to be detected.

[0047] In this embodiment, the point cloud to be detected is a three-dimensional point cloud that needs to be detected by cylindrical surface, which can be determined by actual conditions. The point cloud to be detected can be subjected to plane detection by any plane detection algorithm, and the parameters of the detected plane can be saved in the plane detection result. Among them, the parameters of the plane are used to indicate the plane. It is also possible to receive the plane detection result obtained by other devices by performing plane detection on the point cloud to be detected. It can be understood that the above-mentioned method of obtaining the plane detection result is only an example, and can be determined in combination with actual needs.

[0048] Step S120: dividing the planes in the plane detection result into plane groups.

[0049] In this embodiment, the planes included in the initial plane detection can be grouped according to the parameters of each plane in the plane detection result to obtain at least one plane group. Among them, a plane group may include one plane or multiple planes, which is determined by the actual situation. When multiple plane groups are included in a plane group, the angle between one of the planes in the plane group and the normal of each other plane is less than a preset angle, that is, one of the planes in the plane group is parallel or approximately parallel to each other plane. The specific method of plane grouping can be determined in combination with actual needs and is not specifically limited here.

[0050] Step S130 : for each plane group, determine the point cloud set corresponding to the plane group and the projection plane corresponding to the point cloud set from the point cloud to be detected.

[0051] In this embodiment, for a plane group, a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set can be determined from the point cloud to be detected. The point cloud points in a point cloud set are the point cloud points in the point cloud to be detected, the point cloud points in a point cloud set and the acquisition device used to obtain the point cloud to be detected are located on the same side of the projection plane corresponding to the point cloud set, and the projection plane is a plane in the corresponding plane group; that is, the point cloud set and the acquisition device are located above the projection plane corresponding to the point cloud set. The acquisition device can be a 3D point cloud camera.

[0052] Repeat the above process for the remaining plane groups to obtain the point cloud set and projection plane corresponding to each of the remaining plane groups.

[0053] Among them, after obtaining all the plane groups, the point cloud set corresponding to each plane group and the projection plane corresponding to the point cloud set can be determined; after each plane group is obtained, the point cloud set corresponding to the plane group and the projection plane corresponding to the point cloud set can be obtained through analysis and processing for the plane group; other orders can also be used, which can be determined based on actual needs.

[0054] Step S140 , determining a target point cloud set and a target projection plane from the obtained point cloud set and the corresponding projection plane according to the distribution of projection points of the point cloud set on the corresponding projection plane.

[0055] In this embodiment, for each point cloud set, all the point cloud points in the point cloud set can be projected onto the projection plane corresponding to the point cloud set, and then according to the distribution of the projection points corresponding to each point cloud set, a target point cloud set can be determined from the obtained point cloud sets, and the projection plane corresponding to the target point cloud set can be used as the target projection plane. The target point cloud set is the screened point cloud set that is most likely to include a circular curve. The specific method for determining the target point cloud set can be determined in combination with actual needs.

[0056] Step S150: Detect a target cylindrical surface according to the target point cloud set and the target projection plane.

[0057] When the target point cloud set and the target projection plane are determined, the target point cloud set can be projected onto the target projection plane, and then the circle equation is determined according to the obtained projection points, and then the cylinder axis equation is determined according to the circle equation and the target plane projection plane, so as to determine the target cylindrical surface, and the target cylindrical surface is indicated by the circle equation and the cylinder axis equation. In this way, the cylindrical surface can be detected from the point cloud with high detection accuracy.

[0058] In this embodiment, in order to facilitate the determination of the projection plane, Figure 3 Please refer to Figure 3 , Figure 3 for Figure 2 Schematic diagram of the flow of sub-steps included in step S120. In this embodiment, step S120 may include sub-steps S121 to S123.

[0059] Sub-step S121, for each plane in the plane detection result, according to the initial normal and initial distance parameters of the plane and the position of the acquisition device, obtain the normal and distance parameters of the plane.

[0060] In this embodiment, the plane detection result includes the initial normal of each detected plane. and initial distance parameters , initial normal and initial distance parameters The initial normal and initial distance parameters of a plane are obtained by performing plane detection on the point cloud to be detected, that is, the initial normal and initial distance parameters of the plane are used to indicate the plane. Represents the distance from the coordinate origin to the plane, which may be positive or negative.

[0061] For each plane in the plane detection result, combined with the position of the acquisition device when the acquisition device is used to acquire the point cloud to be detected, it can be determined whether the initial normal of the plane is facing the acquisition device. If the initial normal of the plane is facing the acquisition device, the initial normal of the plane is used as the normal of the plane, and the initial distance parameter of the plane is used as the distance parameter of the plane. If the initial normal of the plane is not facing the acquisition device, the initial normal and the initial distance parameter of the plane are both reversely processed, and the processed initial normal is used as the normal of the plane, and the processed initial distance parameter is used as the distance parameter of the plane. In this way, the normal and distance parameters of each plane can be obtained. When the normal of a plane faces the acquisition device and the initial normal of a plane is opposite to the normal, the initial distance parameter of the plane is the opposite of the distance parameter.

[0062] Optionally, as a possible implementation method, the following method can be used to determine whether the initial normal direction of a plane i points to the direction of the acquisition device. Assuming the eye-in-hand mode, that is, the acquisition device is located at the end of the robot, the robot's TCP (Tool Center Position) position can be used as the acquisition device position. The centroid position m of the point cloud to be detected can be calculated, and the TCP position is set to , the following vector is calculated: , which points from the point cloud centroid to the TCP position. The initial normal of plane i is The initial distance parameter is , calculated and If the inner product is less than 0, it means that the initial normal direction of plane i is the same as On the contrary, at this time, the initial normal Reverse the initial normal direction and use it as the normal direction of plane i, and reverse the initial distance parameter and use it as the distance parameter of plane i. If the inner product is not less than 0, it means that the initial normal direction of plane i is the same as If they are the same, the initial normal is directly used as the normal of plane i, and the initial distance parameter is directly used as the distance parameter of plane i.

[0063] Optionally, to avoid missing a plane, the variable i can be used to traverse the plane detection results, and the normal and distance parameters of each plane can be obtained by traversal processing. At the beginning of the traversal, i=0; determine whether i is less than the number of planes included in the plane detection result; if less than, obtain the normal and distance parameters of the plane based on the initial normal and initial distance parameters of the plane, and then update the variable i by adding 1; after the update, execute again: determine whether i is less than the number of planes included in the plane detection result, until i is not less than the number of planes included in the plane detection result.

[0064] Sub-step S122, according to the distance parameters of each plane, the planes in the plane detection result are sorted in the order of the distance parameters from small to large to obtain a plane list.

[0065] In this embodiment, the distance parameters of each plane can be obtained through the processing of sub-step S121. , according to the distance parameter The planes indicated by the plane detection results are sorted in ascending order to obtain a plane list, so that the planes farther from the acquisition device are arranged at the front of the list, and the planes closer to the acquisition device are arranged at the back of the list.

[0066] Sub-step S123, traverse the planes in the plane list according to the plane order in the plane list, take the first traversed plane that is not divided into the plane group as the base plane of a plane group, and traverse the plane list based on the base plane and the plane order, and add the planes that are not divided into the plane group and whose normals have an angle less than the preset angle with the normal of the base plane that are determined during the traversal process to the plane group where the base plane is located.

[0067] In this embodiment, when the plane list is obtained, the planes in the plane list can be sequentially traversed according to the plane order in the plane list. For the traversed plane, it is determined whether the plane has been divided into a plane group. If the plane has not been divided into a plane group, the plane is used as the base plane plane_0 of a plane group. After determining the base plane plane_0 of a plane group, the planes in the plane list are traversed according to the plane order. For the traversed plane, it is determined whether the plane has been divided into a plane, and whether the plane is approximately parallel to the base plane plane_0. If the traversed plane is not divided into a plane group and is approximately parallel to the base plane plane_0, the plane is saved in the plane group where the base plane plane_0 is located, and the traversal is continued until the planes in the plane list are traversed, so that the plane in the plane list that is approximately parallel to the base plane plane_0 can be obtained, and the plane that is approximately parallel to the base plane plane_0 and the base plane plane_0 are located in a plane group. Among them, the planes in a plane group are sorted according to the distance parameters of the planes, with the planes with smaller distance parameters sorted first and the planes with larger distance parameters sorted last. The order of the planes in the plane group is used to determine the planes with adjacent spatial positions in the plane group and to determine the projection plane in the subsequent determination of the point cloud set and the projection plane.

[0068] Whether a plane is approximately parallel to the base plane plane_0 can be determined based on whether the angle between the normals of the two planes is less than a preset angle. For example, the dot product of the normals of the two planes can be calculated. If the result is greater than or equal to a preset value, it can be determined that the two planes have very close normals, that is, the two planes are approximately parallel; if the result is less than the preset value, it can be determined that the two planes are not approximately parallel.

[0069] After that, continue to traverse the plane list to determine the base plane plane_0 of the new plane group, and then determine a new plane group until the grouping of the planes in the plane list is completed.

[0070] The above grouping method by traversal can be represented by the following process. Initialize a processed array, which is an array of all 0s and whose size is equal to the size of the plane list (that is, equal to the number of planes in the plane list). 0 means that the plane has not been visited, and if it has been visited, it indicates that it has been grouped; 1 means that the plane has been visited.

[0071] Use variable i to traverse the planes in the plane list. First, determine whether processed[i] is equal to 1. If so, jump directly to the step of increasing i. If processed[i] is not equal to 1, set processed[i] = 1, take out plane i, use this plane as plane 0 (i.e., the base plane of a plane group), get the normal n0 of plane 0, and then store plane 0 in planes_seg. planes_seg represents a group of planes used to segment the point cloud, i.e., a plane group. Plane 0 is the 0th plane in this group. In this plane group, this plane has the smallest distance parameter ρ, i.e., it is the farthest from the acquisition device.

[0072] After determining plane 0 of a plane group, we then use variable j to traverse the planes, initially j = i + 1. First, we check whether processed[j] is equal to 1. If so, we jump directly to the step of increasing j. If not, we get the normal n of plane j. j , determine whether the following conditions are met: If the above conditions are met, set processed[j] = 1, and store plane j in planes_seg. After traversing j, all planes in the plane list that are approximately parallel to plane 0 are found. This group of planes constitutes a plane group, which corresponds to a segmentation scheme for segmenting the point cloud.

[0073] In this embodiment, for a plane group, the point cloud to be detected can be segmented in the following manner to obtain a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set. Repeat the point cloud segmentation process to obtain a point cloud set corresponding to each plane group and a projection plane corresponding to the point cloud set. Among them, a plane group corresponds to one point cloud set or multiple point cloud sets, and a point cloud set corresponds to a projection plane, which is a plane immediately below the point cloud set.

[0074] For a plane group, determine whether the number of planes in the plane group is equal to 1.

[0075] If the number of plane groups in the plane group is equal to 1, it means that there is only one plane in the plane group, namely the base plane (i.e. plane 0, plane_0). Use the base plane to segment the point cloud to be detected, and obtain a segmented part as a point cloud set corresponding to the plane group, and use the base plane as the projection plane corresponding to the point cloud set. The point cloud points in the point cloud set are the point cloud points in the point cloud to be detected that are located above the base plane 0. The point cloud points located above a plane indicate that the point cloud points and the acquisition device are located on the same side of the plane.

[0076] A plane divides the space into two parts. In this embodiment, only the part of points close to the acquisition device, that is, the point cloud located above the plane, is taken. When determining the point cloud set, the normal n0 and ρ parameter (i.e., distance parameter) ρ0 of the base plane are obtained, and the variable k is used to traverse the points in the point cloud to be detected to determine whether the following conditions are met, that is, to determine whether Is it true? If the condition is true, then p k The points are stored in cluster. The cluster and plane 0 form plane_cluster and store it in plane_clusters. Plane_clusters includes the point cloud set obtained based on the point cloud to be detected and the projection plane corresponding to the point cloud set.

[0077] If the number of plane groups in the plane group is greater than 1, Figure 4 The method shown in the figure determines the point cloud set corresponding to a plane group and the projection plane corresponding to the point cloud set. Figure 4 , Figure 4 for Figure 2 Schematic diagram of the flow of sub-steps included in step S130. In this embodiment, step S130 may include sub-steps S131 and S132.

[0078] Sub-step S131, when the number of planes in the plane group is greater than 1, for each plane pair in the plane group, obtain the point cloud points located in the plane pair from the point cloud to be detected to obtain an initial point cloud set corresponding to the plane pair, and use the lower plane in the plane pair as the initial projection plane corresponding to the initial point cloud set.

[0079] Sub-step S132, obtaining the point cloud set and the projection plane corresponding to the plane group according to the initial point cloud set and the initial projection plane corresponding to each plane pair.

[0080] In this embodiment, at least one plane pair can be determined from the plane group by dividing two planes adjacent in spatial position into a plane pair according to the spatial position of each plane in the plane group. The upper plane in the plane pair is close to the acquisition device, and the lower plane is far from the acquisition device.

[0081] For a plane pair, point cloud points located between the two planes of the plane pair can be screened out from the point cloud to be detected as point cloud points in an initial point cloud set corresponding to the plane pair, and the lower plane in the plane pair can be used as an initial projection plane corresponding to the initial point cloud set.

[0082] like Figure 5 As shown in the figure, a plane alignment includes an upper plane and a lower plane, and the upper plane and the acquisition device are located on the same side of the lower plane. Figure 5 The partial point cloud between the upper plane and the lower plane shown is used as the initial point cloud set corresponding to the plane pair.

[0083] Optionally, when an initial point cloud set and an initial projection plane corresponding to a plane pair are obtained, the initial point cloud set and the initial projection plane corresponding to the plane pair can be directly used as a point cloud set and a projection plane corresponding to the plane group; further analysis can also be performed to determine whether the initial point cloud set and the initial projection plane corresponding to the plane pair are the point cloud set and the projection plane.

[0084] As a possible implementation, Figure 6 The method shown in FIG. 1 determines whether an initial point cloud set is a point cloud set. Optionally, after obtaining an initial point cloud set, the Figure 6 After all the initial point cloud sets are obtained, the processing can be performed on each initial point cloud set in sequence or in parallel. Figure 6 Other execution orders can also be used, which can be determined based on actual needs. Figure 6 , Figure 6 for Figure 4Schematic diagram of the flow of sub-steps included in sub-step S132. In this embodiment, sub-step S132 may include sub-steps S1321 to S1323.

[0085] Sub-step S1321, for each initial point cloud set, calculate the centroid of the initial point cloud set, and obtain the number of point cloud points in the initial point cloud set.

[0086] Sub-step S1322, calculating and obtaining a first distance between the mass center and an upper plane in the corresponding plane pair, and a second distance between the mass center and a lower plane in the corresponding plane pair.

[0087] Sub-step S1323, determining whether to use the initial point cloud set and the initial projection plane as a point cloud set and a projection plane corresponding to the plane group according to the number of point cloud points in the initial point cloud set, the corresponding first distance and the second distance.

[0088] In this embodiment, for an initial point cloud set of a plane pair, the centroid position of the initial point cloud set is calculated; then, the distance between each of the two planes of the plane pair and the centroid position is calculated, that is, the first distance and the second distance are obtained, wherein the first distance is the distance between the centroid position and the lower plane of the plane pair, and the second distance is the distance between the centroid position and the upper plane of the plane pair. Then, it can be determined whether to regard the initial point cloud set as a point cloud set according to the specific sizes of the above two distances; or, it can be determined whether to regard the initial point cloud set as a point cloud set according to the specific sizes of the above two distances and the number of point cloud points of the initial point cloud set.

[0089] As a possible implementation, the first distance is subtracted from the second distance to obtain a distance difference, and it is determined whether the preset difference is greater than the preset distance difference. The preset distance difference can be determined in combination with actual needs, and the preset distance difference is used to analyze whether the initial point cloud set obtained by segmentation is farther from the lower plane. It is also determined whether the number of point cloud points in the initial point cloud set is greater than the first preset number, wherein the first preset number can be determined in combination with actual needs, for example, set to 0. If the number of point cloud points in the initial point cloud set is greater than the first preset number and the distance difference is less than the preset distance difference, the initial point cloud set and the initial projection plane are used as a point cloud set and projection plane corresponding to the plane group. If the number of point cloud points in the initial point cloud set is less than or equal to the first preset number, or the distance difference is greater than or equal to the preset distance difference, the initial point cloud set is not used as a point cloud set corresponding to the plane group.

[0090] To avoid omissions, the point cloud set and the projection plane can be determined based on a plane group including multiple planes by traversal. The specific process can be shown as follows.

[0091] Assume that there are n planes in a plane group planes_seg. Then, we obtain n-1 partial point clouds from the point cloud to be detected as the initial point cloud set, and use seg to save these n-1 parts. seg is a vector, and each element of it is a point cloud pointer. In the process of segmenting the point cloud, the centroid of each partial point cloud needs to be calculated at the same time.

[0092] Use variable j to traverse the planes in the plane group planes_seg and get the normal n of the jth plane j and ρ parameter ρ j , get the normal n of the j+1th plane j+1 and ρ parameter ρ j+1 Then, use the variable k to traverse the point cloud points in the point cloud to be detected. First, determine whether the x component of the point cloud point is a non-number. If so, jump directly to the step of increasing k; if not, determine whether the following conditions are met: and If it holds, then p k The point is stored in the jth part of seg, and the x component of the kth point is set to a non-number.

[0093] After traversing k, calculate the centroid coordinates m of the jth part of the point cloud j , and then calculate m j The distance to plane j is dis_1 and m j The distance dis_2 to plane j+1, {dis_1, dis_2} is stored in dis_2s. dis_2s is a vector containing n-1 elements; each element is a 2-tuple, indicating the distance from the centroid of the j-th part to the two cutting planes. When the j-th part is cut out, plane j is used as the initial projection plane of the part.

[0094] Wherein, optionally, in determining a p k The point is stored in the jth part of seg, that is, the following calculation is performed: m 总 =m 总 + p k , m is always 0 at the initial time. When it is determined that the jth part of the point cloud has been segmented, the following calculation can be performed: m j = m 总 / The number of points in the j-th part, thereby obtaining the centroid coordinates of the j-th part of the point cloud.

[0095] Through the above processing, we get the distances from n-1 partial point clouds (i.e. the initial point cloud set) to the two split planes. We can use the variable j to traverse these distance values. dis_2s[j][0] represents the distance from the centroid of the jth partial point cloud to the lower plane, and dis_2s[j][1] represents the distance from the centroid of the jth partial point cloud to the upper plane.

[0096] If dis_2s[j][0]-dis_2s[j][1]>= 10 or the size of seg[j] is 0, skip this part. dis_2s[j][0] - dis_2s[j][1]>= 10, indicating that the distance between the segmented part of the point cloud and the lower plane is farther and the distance between the upper plane is closer. At this time, it can be determined that this part of the point cloud is not the required point cloud set. It can be understood that the above 10 is only an example of the preset distance difference, and the above 0 is only an example of the first preset number. seg[j] represents the jth initial point cloud set corresponding to a plane group.

[0097] The purpose of segmenting the point cloud is to segment the cylindrical surface. No matter how the acquisition device is used to shoot, the cylindrical surface always forms an arc with the lower plane. Figure 5 As shown in the figure, the distance between the centroid of the jth part of the point cloud and the lower plane should be smaller than the distance between it and the upper plane. If the distance between the centroid of the jth part of the point cloud and the lower plane is significantly greater than or equal to the distance between it and the upper plane, then the part cannot be a cylindrical surface. Taking the welding scene as an example, the setting principle of the above requirements is explained: the arc to be welded is concave. If the plane and the cylinder form a concave weld, the cylinder must be above the plane and cannot be below the plane. Therefore, the distance between the centroid of the jth part of the point cloud and the lower plane should be smaller than the distance between it and the upper plane.

[0098] At the same time, if the number of point cloud points in this part of the point cloud is 0, it cannot be the required point cloud set.

[0099] If the above conditions are not met, that is, if dis_2s[j][0]-dis_2s[j][1]>= 10 or the size of seg[j] is 0, then the j-th point cloud seg[j] is stored in cloud_clusters of plane_cluster, and plane_down[j] is stored in plane_downs of plane_cluster.

[0100] As a possible implementation, when the number of planes in the plane group is greater than 1, point cloud points located above the plane closest to the acquisition device in the plane group can also be obtained from the point cloud to be detected, and the part of the point cloud points is used as the point cloud points in a point cloud set corresponding to the plane group, and the plane closest to the acquisition device in the plane group is used as the projection plane corresponding to the point cloud set. Among them, the plane closest to the acquisition device in the plane group is the plane with the largest distance parameter in the plane group obtained by the sub-step S121 to sub-step S123. The method of obtaining the point cloud set corresponding to the plane closest to the acquisition device is the same as the method of obtaining the point cloud set when only one plane is included in the plane group described above, and will not be repeated here. In this way, when the number of planes in a plane group is multiple (i.e. greater than 1), the point cloud set corresponding to the plane group includes a point cloud set determined based on the plane pair and a point cloud set determined based on the plane closest to the acquisition device in the plane group. The point cloud set determined based on the plane group and the corresponding projection plane can be added to plane_clusters.

[0101] In the above process, a variety of plane combinations are used to segment the point cloud to be detected. Every time a plane 0 is determined, a point cloud segmentation scheme is determined. However, only one segmentation scheme is the correct segmentation scheme, that is, the plane that forms the intersection line with the cylindrical surface is plane 0 or a plane parallel to plane 0. At this time, this segmentation scheme is the correct segmentation scheme. In order to find the correct segmentation scheme and the segmentation part corresponding to the cylinder in the correct segmentation scheme (that is, the point cloud set corresponding to the cylinder), each segmentation part can be analyzed to determine the target point cloud set and the target projection plane for cylindrical surface detection. Among them, the segmentation scheme corresponding to a plane group includes the point cloud set corresponding to the plane group and the projection plane corresponding to the point cloud set.

[0102] Please refer to Figure 7 , Figure 7 for Figure 2 Schematic diagram of the flow of sub-steps included in step S140. In this embodiment, step S140 may include sub-steps S141 to S143.

[0103] Sub-step S141 , for each point cloud set, projecting the point cloud points in the point cloud set onto the corresponding projection plane to obtain projection points.

[0104] Sub-step S142 , for each point cloud set, according to the projection points corresponding to the point cloud set, calculate the average width corresponding to the point cloud set.

[0105] Sub-step S143 , taking the point cloud set corresponding to the maximum average width among the obtained average widths as the target point cloud set, and determining the target projection plane.

[0106] In this embodiment, for a point cloud set, all the point cloud points in the point cloud set can be projected onto the corresponding projection plane to obtain the projection points; then, based on the position distribution of the obtained projection points, the average width corresponding to the point cloud set is analyzed, wherein the average width corresponding to the point cloud set is calculated according to the width of the minimum bounding box of the projection point set that meets the arc feature. Repeat the above process to obtain the average width corresponding to each point cloud set. Finally, the average widths corresponding to the point cloud sets are compared to determine the maximum average width, and then the point cloud set corresponding to the maximum average width is used as the target projection set, and the projection plane corresponding to the point cloud set corresponding to the maximum average width is used as the target projection plane.

[0107] Optionally, as a possible implementation, Figure 8 The method shown below obtains the average width of a point cloud set. Figure 8 , Figure 8 for Figure 7 Schematic diagram of the flow of sub-steps included in sub-step S142. In this embodiment, sub-step S142 may include sub-steps S1421 to S1424.

[0108] Sub-step S1421, obtaining at least one first cluster corresponding to the point cloud set by clustering according to the projection points corresponding to the point cloud set.

[0109] In this embodiment, the projection points of a point cloud set on the corresponding projection plane may be clustered using the Euclidean clustering algorithm, and at least one obtained cluster part may be used as at least one first cluster corresponding to the point cloud set.

[0110] Sub-step S1422 , for each second cluster, calculate the width of the minimum bounding box of the second cluster and the corresponding average line width.

[0111] Optionally, all the obtained first clusters can be used as second clusters, or the second clusters can be determined from the obtained first clusters based on preset rules. For example, for each first cluster, the number of projection points of the first cluster is obtained. If the number of projection points of the first cluster is less than the second preset number, the first cluster is not regarded as a second cluster; if the number of projection points of the first cluster is greater than or equal to the second preset number, the first cluster is regarded as a second cluster. In this way, the first cluster with a larger number of projection points can be screened out as the second cluster for subsequent calculations. Among them, the second preset number can be specifically determined in combination with actual needs, for example, set to 10.

[0112] For each second cluster, the minimum bounding box of each second cluster can be analyzed and determined. The minimum bounding box is a 2D figure, which is a rectangle with length and width. The width of the minimum bounding box can be obtained. The width of the minimum bounding box of a second cluster can represent the overall characteristics of the second cluster. It is also necessary to analyze and obtain the average line width of the lines corresponding to each second cluster. The average line width represents the local average characteristics of the second cluster. The average line width of the arc line is smaller.

[0113] Optionally, the variable i may be used to traverse the second clusters corresponding to a point cloud set to obtain the minimum bounding box width and average line width of each second cluster, thereby avoiding omissions.

[0114] Optionally, you can Fig. 9 The average line width corresponding to a second cluster is obtained in the manner shown. Fig. 9 , Fig. 9 for Figure 8 Schematic diagram of the flow of sub-steps included in sub-step S1422. In this embodiment, sub-step S1422 may include sub-steps S14221 to S14223.

[0115] Sub-step S14221, for each projection point in the second cluster, determine the straight line corresponding to the projection point.

[0116] Sub-step S14222, for each straight line corresponding to a projection point, determine the projection value of the projection point in the second cluster located near the straight line on the straight line, and take the difference between the maximum projection value and the minimum projection value among the projection values ​​obtained based on the straight line as the projection width corresponding to the projection point.

[0117] Sub-step S14223, taking the average of the projection widths corresponding to the projection points in the second cluster as the average line width corresponding to the second cluster.

[0118] In this embodiment, for a projection point in the second cluster, the projection point is used as the point to be passed, and the normal of the projection point is used as the direction vector to determine the straight line corresponding to the projection point. Fig.10 As shown, the projection point is p j , the projection point p j The normal direction is n j , a straight line can be determined, which passes through the projection point p j , and the projection point p j The normal n j For direction.

[0119] For the straight line corresponding to the projection point, the distance between each projection point in the second cluster and the straight line is calculated, and the projection point whose distance is less than the preset distance is used as the projection point in the second cluster near the straight line. The preset distance can be determined in combination with actual needs. For each projection point in the second cluster near the straight line, the projection value of each projection point on the straight line is calculated, and then the maximum projection value and the minimum projection value are determined by comparison, and the difference between the maximum projection value and the minimum projection value is used as the projection width corresponding to the projection point. Among them, the projection value corresponding to a projection point is: , d pro represents the projection value, p k Indicates the projection point where the projection value needs to be calculated, p j is the projection point through which the straight line passes, n j is the normal direction corresponding to the straight line.

[0120] Repeat the above process for the remaining projection points in the second cluster to obtain a projection width corresponding to each projection point in the second cluster. Then, calculate the average of the projection widths corresponding to each projection point in the second cluster as the average line width corresponding to the second cluster.

[0121] Sub-step S1423, determining the minimum bounding box width and the corresponding average line width of the target cluster according to the minimum bounding box width and the corresponding average line width of each second cluster.

[0122] In this embodiment, after obtaining the minimum bounding box width and average line width of a second cluster in a point cloud set, it can be analyzed to determine whether the second cluster is a second cluster that meets the arc feature. If so, the second cluster is used as a target cluster corresponding to the point cloud set; if not, the second cluster is not used as a target cluster corresponding to the point cloud set.

[0123] The inventor of the present application has found through research that when a cluster is a straight line or an arc, its average line width has a smaller value; when cluster i is a point cloud, its average line width has a larger value. Based on the above findings, whether a second cluster is a target cluster can be determined in the following way.

[0124] For the second cluster corresponding to a point cloud set, determine whether the width of the minimum bounding box of the second cluster is not less than the first preset width, and determine whether the average line width of the second cluster is not greater than the second preset width. Wherein, the first preset width and the second preset width can be determined in combination with actual needs. If the width of the minimum bounding box of the second cluster is not less than the first preset width, and the average line width of the second cluster is not greater than the second preset width, it can be determined that the second cluster meets the arc feature, and the second cluster can be used as a target cluster. On the contrary, if the width of the minimum bounding box of the second cluster is less than the first preset width, or the average line width of the second cluster is greater than the second preset width, it can be determined that the second cluster does not meet the arc feature, and the second cluster is not used as a target cluster.

[0125] By repeating the above steps for other second clusters corresponding to a point cloud set, each target cluster corresponding to a point cloud set can be obtained.

[0126] Sub-step S1424, taking the average value of the widths of the minimum bounding boxes of the target cluster obtained as the average width corresponding to the point cloud set.

[0127] When each target cluster corresponding to a point cloud set is determined, the average value of the widths of the minimum bounding boxes of each target cluster corresponding to the point cloud set may be calculated and used as the average width corresponding to the point cloud set.

[0128] If a point cloud set does not include the target cluster, a smaller preset value may be set as the average width corresponding to the point cloud set. For example, -1 may be set as the average width corresponding to a point cloud set including the target cluster.

[0129] The following example illustrates how to obtain the average width corresponding to a point cloud set in a traversal manner.

[0130] Use the variable i to traverse the second cluster corresponding to a point cloud set.

[0131] For the traversed second cluster i, the width of the minimum bounding box of the second cluster i is calculated, and the width of the minimum bounding box of the second cluster i can represent the overall characteristics of the cluster.

[0132] In addition, the average line width of the second cluster i needs to be calculated. The calculation method is as follows. Use variable j to traverse each point in the second cluster i and obtain the point position p j , calculate the normal n of the point j , with n j As the direction vector of the straight line, we get a line passing through p jUse variable k to traverse each point in the second cluster i and calculate the vertical distance from the point to the line. The calculation formula is as follows: , where p k is the kth point in the second cluster i, n j is the direction vector of the line, p j is the point through which the line passes. If d ver Less than a preset distance d th , it indicates that the point is near the straight line, and then the projection value of the point on the straight line is calculated. The projection value calculation formula is as follows: After traversing k, the projection values ​​of all points in the second cluster i that are near the straight line on the straight line are obtained. By comparison, the maximum projection value d can be determined. pro, max and the minimum projection value d pro, min , and then the projection width d of point j can be calculated width = d pro, max -d pro, min After traversing j, the average of all the projection widths is taken to get the average line width of the second cluster i. The average line width represents the local average characteristics of the second cluster i.

[0133] When the minimum bounding box width and the corresponding average line width of a second cluster i are obtained, it can be determined whether the following conditions are met: the minimum bounding box width >= the first preset width, and the average line width <= the second preset width. If so, it indicates that the second cluster meets the arc feature, and num_circle can be added by 1, and the minimum bounding box width can be added to the total width. The initial value of num_circle is 0. After completing the traversal of the second cluster for a point cloud set, the obtained num_circle can represent the number of cylinders contained in the point cloud set.

[0134] After completing the traversal of the second cluster for a point cloud set, the final total width can be divided by num_circle, and the calculated value is the average width corresponding to the point cloud set. If num_circle in a point cloud set is 0, -1 can be used as the average width corresponding to the point cloud set.

[0135] When the average width of all point cloud sets is obtained, the point cloud set corresponding to the maximum average width can be used as the optimal segmentation part, and the part of the point cloud is projected onto the corresponding projection plane to detect the cylinder.

[0136] In this embodiment, first, for the plane in the plane detection result of the point cloud to be detected, the initial normal direction and initial distance parameters of the plane are adjusted according to the position of the acquisition device, so that the plane normal direction of the plane points to the TCP direction; then, according to the normal and distance parameters of the plane obtained after the above processing, the plane indicated by the plane detection result is divided into plane groups, each group of planes corresponds to a segmentation scheme, and multiple segmentation schemes are used to segment the point cloud to be detected, and multiple point cloud sets and corresponding projection planes are obtained; then, the point cloud points in the point cloud set are projected onto the corresponding projection plane, and the possibility of the projection points containing circular curves is evaluated, and finally the point cloud set that is most likely to include circular curves is selected to detect the cylindrical surface. In this way, the cylindrical surface detection can be performed more stably, and the cylindrical surface detection has higher accuracy.

[0137] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a cylindrical surface detection device 200 is given below. Optionally, the cylindrical surface detection device 200 can adopt the above Figure 1 The device structure of the electronic device 100 is shown. Fig.11 , Fig.11 A block diagram of a cylindrical surface detection device 200 provided in an embodiment of the present application. It should be noted that the basic principle and technical effects of the cylindrical surface detection 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 cylindrical surface detection device 200 may include: an acquisition module 210, a grouping module 220, a point cloud segmentation module 230, a screening module 240, and a detection module 250.

[0138] The obtaining module 210 is used to obtain the plane detection result corresponding to the point cloud to be detected.

[0139] The grouping module 220 is used to divide the planes in the plane detection result into plane groups. Wherein, when a plane group includes multiple planes, the angle between the normal of one plane in the plane group and the normal of the other planes is less than a preset angle.

[0140] The point cloud segmentation module 230 is used to determine, for each plane group, from the point cloud to be detected, a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set. Wherein, the point cloud points in a point cloud set and the acquisition device used to obtain the point cloud to be detected are located on the same side of the projection plane corresponding to the point cloud set, and the projection plane is a plane in the corresponding plane group.

[0141] The screening module 240 is used to determine a target point cloud set and a target projection plane from the obtained point cloud set and the corresponding projection plane according to the distribution of projection points of the point cloud set on the corresponding projection plane.

[0142] The detection module 250 is used to detect the target cylindrical surface according to the target point cloud set and the target projection plane.

[0143] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 110 shown in the figure may be fixed in the operating system (OS) of the electronic device 100 and may be Figure 1 Meanwhile, the data and program codes required for executing the above modules may be stored in the memory 110.

[0144] 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 cylindrical surface detection method is implemented.

[0145] In summary, the embodiments of the present application provide a cylindrical surface detection method, device, electronic device and readable storage medium. First, a plane detection result of a point cloud to be detected that needs to be detected is obtained; then, the planes in the plane detection result are divided into plane groups, wherein, when a plane group includes multiple planes, the angle between the normal of one of the planes in the plane group and the normal of each of the other planes is less than a preset angle; then, for each plane group, a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set are determined from the above-mentioned point cloud to be detected, wherein the point cloud points in a point cloud set and the acquisition device used to obtain the point cloud to be detected are located on the same side of the projection plane corresponding to the point cloud set, and the projection plane is a plane in the corresponding plane group; then, according to the distribution of the projection points of the point cloud set on the corresponding projection plane, a target point cloud set and a target projection plane are determined from the obtained point cloud set and the corresponding projection plane, and then the target cylindrical surface is detected according to the target point cloud set and the target projection plane. In this way, the cylindrical surface can be detected from the point cloud with high detection accuracy.

[0146] 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.

[0147] 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.

[0148] If the function is implemented in the form of a software function module and sold or used as an independent product, it 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 and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the 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 (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0149] 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 cylindrical surface detection method, characterized in that: The method comprises: Obtain the plane detection result corresponding to the point cloud to be detected; Dividing the planes in the plane detection result into plane groups, wherein when a plane group includes multiple planes, an angle between a plane in the plane group and a normal of each of the other planes is less than a preset angle; For each plane group, a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set are determined from the point cloud to be detected, wherein the point cloud points in a point cloud set and the acquisition device used to obtain the point cloud to be detected are located on the same side of the projection plane corresponding to the point cloud set, and the projection plane is a plane in the corresponding plane group; According to the distribution of projection points of the point cloud set on the corresponding projection plane, a target point cloud set and a target projection plane are determined from the obtained point cloud set and the corresponding projection plane; Detecting a target cylindrical surface according to the target point cloud set and the target projection plane; Wherein, determining the target point cloud set and the target projection plane from the obtained point cloud set and the corresponding projection plane according to the distribution of the projection points of the point cloud set on the corresponding projection plane includes: For each point cloud set, project the point cloud points in the point cloud set onto the corresponding projection plane to obtain the projection points; For each point cloud set, according to the projection points corresponding to the point cloud set, the average width corresponding to the point cloud set is calculated, wherein the average width is calculated according to the width of the minimum bounding box of the projection point set that meets the arc feature; The point cloud set corresponding to the maximum average width among the obtained average widths is used as the target point cloud set, and the target projection plane is determined; Wherein, for each point cloud set, according to the projection points corresponding to the point cloud set, the average width corresponding to the point cloud set is calculated, including: according to the projection points corresponding to the point cloud set, at least one first cluster corresponding to the point cloud set is obtained by clustering; for each second cluster, the width of the minimum bounding box of the second cluster and the corresponding average line width are calculated, wherein the second cluster is the first cluster determined from the obtained first clusters; according to the width of the minimum bounding box of each second cluster and the corresponding average line width, the width of the minimum bounding box of the target cluster and the corresponding average line width are determined, wherein the target cluster is the second cluster that meets the arc feature; the average value of the width of the minimum bounding box of the obtained target cluster is used as the average width corresponding to the point cloud set; The step of calculating the average line width corresponding to each second cluster includes: determining the straight line corresponding to each projection point in the second cluster, wherein the straight line of the projection point passes through the projection point and has the normal direction of the projection point as its direction; determining the projection value of the projection point in the second cluster located near the straight line on the straight line for each projection point, and taking the difference between the maximum projection value and the minimum projection value among the projection values ​​obtained based on the straight line as the projection width corresponding to the projection point; and taking the average of the projection widths corresponding to the projection points in the second cluster as the average line width corresponding to the second cluster; Among them, the method of determining the width of the minimum bounding box and the corresponding average line width of the target cluster based on the width of the minimum bounding box of each second cluster and the corresponding average line width includes: for each second cluster, judging whether the width of the minimum bounding box of the second cluster is not less than a first preset width, and judging whether the average line width of the second cluster is not greater than a second preset width; if the width of the minimum bounding box of the second cluster is not less than the first preset width, and the average line width of the second cluster is not greater than the second preset width, then determining that the second cluster is a target cluster.

2. The method according to claim 1, characterized in that The step of determining, for each plane group, a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set from the point cloud to be detected includes: When the number of planes in the plane group is greater than 1, for each plane pair in the plane group, point cloud points located in the plane pair are obtained from the point cloud to be detected to obtain an initial point cloud set corresponding to the plane pair, and the lower plane in the plane pair is used as an initial projection plane corresponding to the initial point cloud set, wherein the plane pair is two planes in the plane group that are adjacent in spatial position, the upper plane in the plane pair is close to the acquisition device, and the lower plane is far away from the acquisition device; According to the initial point cloud set and the initial projection plane corresponding to each plane pair, the point cloud set and the projection plane corresponding to the plane group are obtained.

3. The method according to claim 2, characterized in that The step of obtaining the point cloud set and the projection plane corresponding to the plane group according to the initial point cloud set and the initial projection plane corresponding to each plane pair includes: For each initial point cloud set, the centroid of the initial point cloud set is calculated, and the number of point cloud points of the initial point cloud set is obtained; Calculate a first distance between the center of mass and a lower plane in the corresponding plane pair, and a second distance between the center of mass and an upper plane in the corresponding plane pair; According to the number of point cloud points of the initial point cloud set, the corresponding first distance and the second distance, it is determined whether to use the initial point cloud set and the initial projection plane as a point cloud set and a projection plane corresponding to the plane group.

4. The method according to claim 3, characterized in that The step of determining whether to use the initial point cloud set and the initial projection plane as a point cloud set and a projection plane corresponding to the plane group according to the number of point cloud points of the initial point cloud set, the corresponding first distance, and the second distance includes: Determining that the number of points in the point cloud is greater than a first preset number; Determine whether the distance difference is less than a preset distance difference, wherein the distance difference is a value obtained by subtracting the second distance from the first distance; If the number of points in the point cloud is greater than the first preset number and the distance difference is less than the preset distance difference, the initial point cloud set and the initial projection plane are used as a point cloud set and a projection plane corresponding to the plane group.

5. The method according to claim 2, characterized in that: The step of determining, for each plane group, a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set from the point cloud to be detected further comprises: When the number of planes in the plane group is 1, point cloud points located above the planes in the plane group are obtained from the point cloud to be detected to obtain a point cloud set corresponding to the plane group, and the planes in the plane group are used as projection planes corresponding to the point cloud set, wherein a point cloud point located above a plane indicates that the point cloud point and the acquisition device are located on the same side of the plane; and / or, When the number of planes in the plane group is greater than 1, point cloud points located above the plane in the plane group that is closest to the acquisition device are obtained from the point cloud to be detected to obtain a point cloud set corresponding to the plane group, and the plane in the plane group that is closest to the acquisition device is used as the projection plane corresponding to the point cloud set. When there are multiple planes in a plane group, the point cloud set corresponding to the plane group includes a point cloud set determined based on the plane pair and a point cloud set determined based on the plane in the plane group that is closest to the acquisition device.

6. The method according to claim 2, characterized in that The dividing the planes in the plane detection result into plane groups includes: For each plane in the plane detection result, according to the initial normal and initial distance parameters of the plane and the position of the acquisition device, the normal and distance parameters of the plane are obtained, wherein the initial normal and initial distance parameters of a plane are used to indicate the plane, the normal of a plane faces the acquisition device, and when the initial normal of a plane is opposite to the normal, the initial distance parameter of the plane and the distance parameter are opposite numbers; According to the distance parameters of each plane, the planes in the plane detection result are sorted in the order of the distance parameters from small to large to obtain a plane list; The planes in the plane list are traversed according to the plane order in the plane list, and the first traversed plane that is not divided into the plane group is used as the base plane of a plane group, and the plane list is traversed based on the base plane and the plane order, and the planes that are not divided into the plane group and whose normals have an angle less than the preset angle with the normal of the base plane determined during the traversal process are added to the plane group where the base plane is located, wherein the planes in the plane group are sorted according to the distance parameters of the planes, and the order of the planes in the plane group is used to determine the planes that are spatially adjacent in the plane group.

7. A cylindrical surface detection device, characterized in that: The device comprises: An acquisition module is used to obtain the plane detection result corresponding to the point cloud to be detected; a grouping module, configured to divide the planes in the plane detection result into plane groups, wherein when a plane group includes multiple planes, an angle between a normal of one of the planes in the plane group and the normals of the other planes is less than a preset angle; A point cloud segmentation module is used to determine, for each plane group, from the point cloud to be detected, a point cloud set corresponding to the plane group and a projection plane corresponding to the point cloud set, wherein the point cloud points in a point cloud set and the acquisition device used to obtain the point cloud to be detected are located on the same side of the projection plane corresponding to the point cloud set, and the projection plane is a plane in the corresponding plane group; A screening module, for determining a target point cloud set and a target projection plane from the obtained point cloud set and the corresponding projection plane according to the distribution of projection points of the point cloud set on the corresponding projection plane; A detection module, used for detecting a target cylindrical surface according to the target point cloud set and the target projection plane; Wherein, the screening module is specifically used for: For each point cloud set, project the point cloud points in the point cloud set onto the corresponding projection plane to obtain the projection points; For each point cloud set, according to the projection points corresponding to the point cloud set, the average width corresponding to the point cloud set is calculated, wherein the average width is calculated according to the width of the minimum bounding box of the projection point set that meets the arc feature; The point cloud set corresponding to the maximum average width among the obtained average widths is used as the target point cloud set, and the target projection plane is determined; The screening module obtains the average width corresponding to each point cloud set in the following manner: according to the projection points corresponding to the point cloud set, at least one first cluster corresponding to the point cloud set is obtained by clustering; for each second cluster, the width of the minimum bounding box of the second cluster and the corresponding average line width are calculated, wherein the second cluster is the first cluster determined from the obtained first cluster; according to the width of the minimum bounding box of each second cluster and the corresponding average line width, the width of the minimum bounding box of the target cluster and the corresponding average line width are determined, wherein the target cluster is the second cluster that meets the arc feature; the average value of the width of the minimum bounding box of the obtained target cluster is used as the average width corresponding to the point cloud set; The screening module obtains the average line width corresponding to each second cluster in the following manner: for each projection point in the second cluster, determine the straight line corresponding to the projection point, wherein the straight line of the projection point passes through the projection point and has the normal direction of the projection point as the direction; for each straight line corresponding to the projection point, determine the projection value of the projection point in the second cluster located near the straight line on the straight line, and use the difference between the maximum projection value and the minimum projection value among the projection values ​​obtained based on the straight line as the projection width corresponding to the projection point; use the average value of the projection widths corresponding to the projection points in the second cluster as the average line width corresponding to the second cluster; Among them, the screening module obtains and determines the target cluster in the following manner: for each second cluster, determine whether the width of the minimum bounding box of the second cluster is not less than the first preset width, and determine whether the average line width of the second cluster is not greater than the second preset width; if the width of the minimum bounding box of the second cluster is not less than the first preset width, and the average line width of the second cluster is not greater than the second preset width, then determine that the second cluster is a target cluster.

Citation Information

Patent Citations

  • Coal mine tunnel global deformation monitoring method and device based on three-dimensional point cloud

    CN116793242A

  • Cylinder detection method combined with point cloud registration and electronic equipment

    CN118799368A