Improved point cloud cylinder detection method and device and electronic equipment

By detecting real planes in the point cloud and merging planes that meet certain conditions, the problem of point deletion caused by misdetecting the side of a cylinder as a plane is solved, thus improving the accuracy of cylinder detection.

CN118887361APending Publication Date: 2024-11-01FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410945182.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In point cloud cylinder detection, existing technologies often mistakenly detect the side of a cylinder as a plane, leading to the deletion of points, affecting detection accuracy, or even causing detection failure.

Method used

By detecting multiple planes in the point cloud, the real plane is determined and the planes that meet the conditions are merged. The points on these planes and the real planes are then deleted from the point cloud to obtain the deleted point cloud. Then, cylinder detection is performed.

Benefits of technology

This improves the accuracy of cylinder detection, avoids the problem of incorrectly deleting points on the side of the cylinder, and ensures the reliability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887361A_ABST
    Figure CN118887361A_ABST
Patent Text Reader

Abstract

The invention provides an improved point cloud cylinder detection method and device and electronic equipment, and the method comprises the steps: firstly detecting and obtaining a plurality of planes in a to-be-processed point cloud, determining a real plane in the plurality of planes, and determining a plane meeting a merging condition with the real plane in the plurality of planes; and deleting the points on the plane meeting the merging condition and the real plane from the point cloud to obtain the deleted point cloud. And finally, carrying out cylinder detection on the deleted point cloud to obtain a detected cylinder. According to the scheme, the plane which can be combined with the real plane is determined, the real plane and the plane which can be combined are deleted, and then cylinder detection is carried out, so that the problem that the cylinder detection is influenced by deleting points on the side surface of the cylinder can be avoided, and the accuracy of cylinder detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional point cloud processing, and in particular to an improved point cloud cylinder detection method, device and electronic equipment. Background Art

[0002] For workpiece point clouds, there is often a need for cylinder detection. When performing cylinder detection on point clouds, the plane in the point cloud is generally detected first, and then the detected plane is deleted from the point cloud, and then the cylinder detection is performed on the deleted point cloud, so as to avoid the points on the plane from affecting the cylinder detection process.

[0003] In existing detection methods, when detecting planes in point clouds, the side of a cylinder may be detected as a plane. For example, the inner arc of a cylinder may be detected as multiple vertically arranged narrow planes. Since cylinder detection is performed based on the point cloud after deleting the plane, in this case, the points on the side of the cylinder will also be deleted as points on the plane. Therefore, when performing cylinder detection based on the point cloud after deleting the plane, the detection accuracy will be affected, and even the cylinder detection will fail. Summary of the invention

[0004] The objectives of the present invention include, for example, providing an improved point cloud cylinder detection method, device and electronic device, which can avoid the deletion of points on the cylindrical surface and affect the cylinder detection, and can improve the accuracy of cylinder detection.

[0005] The embodiments of the present invention can be implemented as follows:

[0006] In a first aspect, the present invention provides an improved point cloud cylinder detection method, the method comprising:

[0007] Detect and obtain multiple planes in the point cloud to be processed;

[0008] Determine a real plane among the multiple planes, and determine a plane among the multiple planes that satisfies a merging condition with the real plane;

[0009] Deleting the plane that meets the merging condition and the points on the real plane from the point cloud to obtain a deleted point cloud;

[0010] Perform cylinder detection on the deleted point cloud to obtain the detected cylinder.

[0011] In an optional implementation, the step of determining a real plane among the multiple planes comprises:

[0012] For each of the multiple planes, obtaining scale feature information corresponding to the plane;

[0013] The real plane is determined according to the size relationship of the scale feature information of each of the planes.

[0014] In an optional implementation, the step of obtaining scale feature information corresponding to the plane includes:

[0015] Calculating a covariance matrix of the plane based on points on the plane;

[0016] Decomposing the covariance matrix to obtain multiple eigenvectors and multiple eigenvalues;

[0017] Scale feature information corresponding to the plane is obtained based on the multiple feature values.

[0018] In an optional implementation, the step of obtaining scale feature information corresponding to the plane based on the multiple feature values ​​includes:

[0019] Determine a characteristic value corresponding to the length direction and a characteristic value corresponding to the width direction among the plurality of characteristic values;

[0020] The scale feature information is obtained based on the magnitude relationship between the feature value corresponding to the length direction and the feature value corresponding to the width direction.

[0021] In an optional implementation, the step of determining a plane among the multiple planes that satisfies a merging condition with the real plane includes:

[0022] Based on the normal vector of the real plane and the normal vectors of each of the multiple planes, screen out a plane that satisfies a first preset condition with the real plane as a plane to be merged;

[0023] For each of the planes to be merged, it is detected whether the plane to be merged and the real plane satisfy a second preset condition. If so, it is determined that the plane to be merged satisfies the merging condition.

[0024] In an optional implementation, the step of screening out a plane that satisfies a first preset condition with respect to the real plane based on the normal vector of the real plane and the normal vectors of each of the multiple planes comprises:

[0025] For each of the multiple planes, calculating an angle between a normal vector of the plane and a normal vector of the real plane;

[0026] It is detected whether the angle is smaller than a preset angle. If so, it is determined that a first preset condition is satisfied between the plane and the real plane.

[0027] In an optional implementation, the step of detecting whether the plane to be merged and the real plane satisfy a second preset condition includes:

[0028] Clustering the points on the plane to be merged and the points on the real plane respectively to obtain a clustering result of the plane to be merged and a clustering result of the real plane;

[0029] After merging the points on the plane to be merged with the points on the real plane, clustering the merged points to obtain a merged clustering result;

[0030] Based on the clustering result of the plane to be merged, the clustering result of the real plane and the merged clustering result, it is determined whether the plane to be merged and the real plane satisfy a second preset condition.

[0031] In an optional implementation, the step of determining whether the plane to be merged and the real plane meet a second preset condition based on the clustering result of the plane to be merged, the clustering result of the real plane, and the merged clustering result includes:

[0032] Obtaining a first number of clusters in the clustering result of the plane to be merged, a second number of clusters in the clustering result of the real plane, and a third number of clusters in the clustering result after merging;

[0033] It is detected whether the sum of the first cluster number and the second cluster number is greater than the third cluster number. If so, it is determined that the plane to be merged and the real plane meet a second preset condition.

[0034] In a second aspect, the present invention provides an improved point cloud cylinder detection device, the device comprising:

[0035] A plane detection module, used for detecting and obtaining multiple planes in the point cloud to be processed;

[0036] A determination module, configured to determine a real plane among the multiple planes, and determine a plane among the multiple planes that satisfies a merging condition with the real plane;

[0037] A deleting module, used for deleting the plane satisfying the merging condition and the points on the real plane from the point cloud to obtain a deleted point cloud;

[0038] The cylinder detection module is used to perform cylinder detection on the deleted point cloud to obtain the detected cylinder.

[0039] In a third aspect, the present invention provides an electronic device comprising one or more memories and one or more processors communicating with the memories, wherein the one or more memories store machine executable instructions executable by the processors, and when the electronic device is running, the processor executes the machine executable instructions to perform the method described in any one of the aforementioned embodiments.

[0040] The beneficial effects of the embodiments of the present invention include, for example:

[0041] The present invention provides an improved point cloud cylinder detection method, device and electronic device, which first detect and obtain multiple planes in a point cloud to be processed, determine a real plane among the multiple planes, and determine a plane among the multiple planes that meets a merging condition with the real plane. The plane that meets the merging condition and the points on the real plane are deleted from the point cloud to obtain a deleted point cloud. Finally, cylinder detection is performed on the deleted point cloud to obtain a detected cylinder. In this solution, by determining a plane that can be merged with the real plane, and then deleting the real plane and the mergeable plane before performing cylinder detection, the problem of deleting points on the side of the cylinder and thus affecting cylinder detection can be avoided, thereby improving the accuracy of cylinder detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention 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 creative work.

[0043] Figure 1 is a schematic diagram of the point cloud to be detected;

[0044] Figure 2 This is a schematic diagram of the result after plane detection is performed on the point cloud to be detected;

[0045] Figure 3 A flowchart of an improved point cloud cylinder detection method provided by an embodiment of the present invention;

[0046] Figure 4 for Figure 3 A flowchart of the sub-steps included in S12;

[0047] Figure 5 for Figure 4 A flowchart of the sub-steps included in S121;

[0048] Figure 6 for Figure 5 A flowchart of the sub-steps included in S1213;

[0049] Figure 7 for Figure 3 Another flow chart of the sub-steps included in S12;

[0050] Figure 8 for Figure 7 A flowchart of the sub-steps included in S123;

[0051] Fig. 9 for Figure 7 A flowchart of the sub-steps included in S124;

[0052] Fig.10 for Fig. 9 A flowchart of the sub-steps included in S1243;

[0053] Fig.11 A functional module block diagram of an improved point cloud cylinder detection device provided by an embodiment of the present invention;

[0054] Fig.12 This is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0056] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0058] In the description of the present invention, it should be noted that the terms "first", "second", "third", etc., if used, are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0059] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.

[0060] In point cloud cylinder detection, point cloud plane detection is usually performed first, and after deleting the points on the detected plane, cylinder detection is performed based on the deleted point cloud. However, when performing point cloud plane detection, the side of the cylinder may be detected as a plane, which may lead to incorrect point deletion. For example, Figure 1 is the point cloud to be processed, Figure 2 For Figure 1 The result obtained after plane detection on the point cloud in , where different areas represent different planes.

[0061] Depend on Figure 2 From the results in , we can see that the points on the cylinder are also detected as points on the plane. For example, the inner arc of the cylinder is detected as multiple vertically arranged narrow planes, such as Figure 2 There are multiple narrow planes in the box. The reason for this is that when the cylinder has a high height, the narrow surface extending along the axis of the cylinder is easily detected as a plane because these points have very close normals and close distance parameters (the distance from the coordinate origin to the plane). Therefore, the plane detection algorithm can easily detect the narrow surface extending along the axis of the cylinder as a plane.

[0062] After the plane detection is completed, the points on the plane will be deleted, and then the cylinder detection will be performed on the remaining points. In the above case, when the side of the cylinder is detected as a plane, the points on the side will be deleted, resulting in the lack of points on the cylinder surface during cylinder detection, which will affect the cylinder detection result, and even cause the cylinder detection to fail in serious cases.

[0063] Based on the above research findings, the present invention provides an improved point cloud cylinder detection solution, which determines the real plane after plane detection, and determines the plane that can be merged with the real plane, and then deletes the real plane and the mergeable plane before performing cylinder detection. This can avoid the problem of deleting points on the side of the cylinder and affecting the cylinder detection, and improve the accuracy of cylinder detection.

[0064] See also Figure 3 , is a flow chart of an improved point cloud cylinder detection method provided by an embodiment of the present invention, the improved point cloud cylinder detection method can be performed by an improved point cloud cylinder detection device, the improved point cloud cylinder detection device can be implemented by software and / or hardware, and can be configured in an electronic device, the electronic device can be a computer device, a programmable logic controller, etc. The detailed steps of the improved point cloud cylinder detection method are introduced as follows.

[0065] S11, detecting and obtaining multiple planes in the point cloud to be processed.

[0066] S12, determining a real plane among the multiple planes, and determining a plane among the multiple planes that satisfies a merging condition with the real plane.

[0067] S13, deleting the plane that meets the merging condition and the points on the real plane from the point cloud to obtain a deleted point cloud.

[0068] S14, performing cylinder detection on the deleted point cloud to obtain a detected cylinder.

[0069] In this embodiment, the point cloud to be processed may be a point cloud in an image obtained by photographing the workpiece using a depth camera. The workpiece may be a workpiece including a cylinder, such as a cylindrical groove, a cylindrical protrusion, and the like.

[0070] Commonly used plane detection algorithms can be used to detect all planes in the point cloud to be processed, such as deterministic voting algorithm, random Hough transform algorithm, random sampling consensus algorithm, etc. When performing plane detection, when judging whether a point belongs to a certain plane, a more stringent judgment condition can be used to ensure that if a point on the cylindrical surface is detected as a point on the plane, the plane is a narrow plane extending along the axis of the cylinder.

[0071] Taking the deterministic voting algorithm for plane detection as an example, when the number of votes exceeds a certain number, a set of plane parameters will be determined, including the normal vector n and the distance parameter ρ. When judging which points in the point cloud belong to the plane corresponding to the set of plane parameters, the judgment conditions include the normal condition and the distance condition. Among them, the normal condition is: arccos(|n i ·n|)<preset normal threshold, distance condition is: |n·p i -ρ|<preset distance threshold. Where n i represents the normal vector of the i-th point, p i Represents the coordinates of the i-th point. When the i-th point satisfies both the normal condition and the distance condition mentioned above, the point is considered to belong to the plane.

[0072] In order to ensure that when a point on the cylindrical surface is detected as a point on a plane, the plane is a narrow plane extending along the axis of the cylinder, the preset normal threshold and the preset distance threshold are set to be smaller, for example, the preset normal threshold is set to 5°, and the preset distance threshold is set to 1.

[0073] After all planes in the point cloud are detected, some of them may be misjudged as planes because they are actually cylindrical surfaces, while some are real planes in the point cloud (i.e., not cylindrical surfaces). Although it is impossible to accurately determine whether each detected plane is a real plane or a cylindrical surface, by comparing multiple planes, for example, by comparing the scale features of the planes, the plane most likely to be the real plane can be determined.

[0074] On this basis, we then detect which planes other than the real plane meet the merging condition with the real plane. If the merging condition is met, it means that the plane that meets the merging condition is actually the real plane. The remaining plane that does not meet the merging condition may be a cylinder.

[0075] Based on this, in this embodiment, the points on the plane that meets the merging condition and the real plane are deleted from the point cloud, so that the points on the cylindrical surface can be retained. Then, cylinder detection is performed based on the deleted point cloud to obtain the detected cylinder.

[0076] In this solution, after all planes in the point cloud are detected, the real planes are determined, and the planes that can be merged with the real planes are determined, and then the real planes and the mergeable planes are deleted before the cylinder detection is performed. This can avoid the problem of deleting points on the side of the cylinder and affecting the cylinder detection, and improve the accuracy of cylinder detection.

[0077] See also Figure 4 In this embodiment, after detecting multiple planes, the step of determining the real plane among them can be implemented in the following manner:

[0078] S121: For each of the multiple planes, obtain scale feature information corresponding to the plane.

[0079] S122, determining a real plane according to the size relationship of the scale feature information of each of the planes.

[0080] In this embodiment, the scale feature information of each plane may reflect the shape feature of each plane. For example, the scale feature information may be feature information in the length direction, width direction, height direction, etc. Although there is no absolute specification for the scale feature information of each plane, when all planes are detected, by comparing the sizes of the scale feature information of all planes, the plane most likely to be the real plane can be determined.

[0081] Specifically, see Figure 5 In this embodiment, the scale feature information corresponding to the plane can be obtained by:

[0082] S1211, calculating the covariance matrix of the plane based on the points on the plane.

[0083] S1212, decomposing the covariance matrix to obtain multiple eigenvectors and multiple eigenvalues.

[0084] S1213: Obtain scale feature information corresponding to the plane based on the multiple feature values.

[0085] In this embodiment, when calculating the covariance matrix of each plane, the centroid point can be first calculated based on the points on the plane, and the covariance matrix of the plane can be calculated based on each point in the plane, the centroid point and the number of points on the plane.

[0086] The calculation formula of the centroid is as follows:

[0087]

[0088] in, represents the center of mass, p j represents the jth point in the plane, and N represents the number of points in the plane.

[0089] On this basis, the covariance matrix C of the plane is calculated according to the following formula:

[0090]

[0091] By performing eigenvalue decomposition on the covariance matrix of the plane, three eigenvalues ​​and three eigenvectors are obtained. The three eigenvalues ​​correspond to the three eigenvectors one by one. Among them, each eigenvector can represent the scale in the direction where the corresponding eigenvector is located. And each eigenvector corresponds to each direction of the plane. Therefore, the scale feature information of the plane can be obtained based on the three eigenvalues ​​obtained.

[0092] See also Figure 6 In this embodiment, specifically, the scale feature information corresponding to the plane can be obtained by:

[0093] S12131, determining the eigenvalues ​​corresponding to the length direction and the eigenvalues ​​corresponding to the width direction among the multiple eigenvalues.

[0094] S12132, obtaining scale feature information based on the magnitude relationship between the feature value corresponding to the length direction and the feature value corresponding to the width direction.

[0095] In this embodiment, the directions of the three obtained eigenvectors may correspond to the normal direction, width direction and length direction of the plane respectively. Accordingly, the three eigenvalues ​​may represent the scales of the normal direction, width direction and length direction of the plane respectively.

[0096] Among the three eigenvalues, the smallest eigenvalue represents the scale of the plane in the normal direction, the middle eigenvalue represents the scale of the plane in the width direction, and the largest eigenvalue represents the scale of the plane in the length direction. For the real plane and cylindrical surface in the point cloud, the scale of the real plane in the length direction and the scale of the width direction will not be very different, while the cylindrical surface is detected as a plane because it is a narrow plane, so the scale of the length direction is much larger than the scale of the width direction.

[0097] Based on this, in this embodiment, a ratio can be obtained by dividing the characteristic value of the plane in the corresponding width direction by the characteristic value in the corresponding length direction. The ratio can be understood as the scale characteristic information of the plane.

[0098] Arrange the ratios of all planes from large to small, where the ratio of the plane that is most likely to be a true plane will be ranked first, and the ratio of the plane corresponding to the cylindrical surface will be ranked last.

[0099] Therefore, based on the above comparison method, the real plane among the detected planes can be determined, for example, the plane with the largest ratio obtained above.

[0100] It should be understood that the above is only an example. For example, the ratio can be obtained by dividing the eigenvalue corresponding to the length direction by the eigenvalue corresponding to the width direction, and the plane with the smaller ratio is the real plane. Alternatively, when sorting the planes, they can be arranged in order from large to small ratios, or in order from small to large ratios, and there is no specific limitation.

[0101] After determining the true plane, you also need to determine the plane that meets the merging conditions with the true plane. Figure 7 In this embodiment, this step can be implemented in the following way:

[0102] S123: Based on the normal vector of the real plane and the normal vectors of each of the multiple planes, screen out a plane that meets a first preset condition with the real plane as a plane to be merged.

[0103] S124: for each of the planes to be merged, detecting whether the plane to be merged and the real plane satisfy a second preset condition; if so, determining that the plane to be merged satisfies a merging condition.

[0104] In this embodiment, firstly, based on the normal vector of the real plane and the normal vectors of other planes, the planes that meet the first preset condition are screened out based on the dimension of the normal vector. The planes that meet the first preset condition can be stored in a set, and then it is determined whether each plane in the set meets the second preset condition. If so, the plane can be merged into the real plane.

[0105] See also Figure 8 In this embodiment, when judging whether each plane meets the first preset condition, it can be achieved in the following way:

[0106] S1231: For each of the multiple planes, calculate the angle between the normal vector of the plane and the normal vector of the real plane.

[0107] S1232, detecting whether the angle is smaller than a preset angle, and if so, determining that a first preset condition is satisfied between the plane and the real plane.

[0108] In this embodiment, the plane that meets the first preset condition can be used as the plane to be merged, and the process of determining the plane to be merged can be a multiple iteration process. In each round of iteration, the plane that is most likely to be the real plane is determined from all planes in the above manner, and then the angle between the normal vectors of other planes and the real plane is used to determine whether it meets the first preset condition. If it does, the real plane and the plane that meets the first preset condition between the real plane and the real plane can be marked, and the marked plane will no longer participate in the next round of detection and judgment. In the next round, the plane that is most likely to be the real plane is determined from all unmarked planes, and then the normal vector angles of other planes and the real plane are calculated to determine the plane that meets the first preset condition in this round. And so on, until there is no plane that meets the first preset condition. At this time, all the planes to be merged are determined. Then, it is detected whether the plane to be merged meets the second preset condition.

[0109] From the above, it can be seen that the so-called true plane does not refer to a specific plane, but a plane that is most likely to be the true plane is determined from multiple planes in each round.

[0110] For the list of planes to be merged that meet the first preset condition, an array planes_need_merge can be constructed to represent it. First, a processed array is initialized. The size of the array is equal to the number of detected planes. The elements in the array are 0 or 1. 0 indicates that the corresponding plane has not been processed, and 1 indicates that the corresponding plane has been processed. When initialized, all elements in the processed array are 0.

[0111] In the above arrangement of arranging the real plane in front and other planes in the back, use the variable i to traverse each plane to determine whether the plane has been processed. If it has been processed, skip the plane. If it has not been processed, determine whether the number of points of the plane is less than the preset number of points (the preset number of points can be set to 1000). If it is less than the preset number of points, it indicates that the plane cannot be a real plane and can be skipped. If not, set processed[i] = 1, add the plane to planes_need_merge, add i to index_need_merge, and get the normal n of the plane. i Then, in the remaining unprocessed planes, find iAll planes whose angle is less than the preset angle (usually set to 5°). Use variable j to traverse the planes. The value range of j is: j>=i+1, j<input the number of planes, and determine whether the plane has been processed. If so, skip the plane. If not, get the normal n of the plane. j , judge n i and n j Is the angle of is less than the preset angle? If not, skip the plane. If yes, add plane j to planes_need_merge and add j to index_need_merge until j is traversed.

[0112] Then determine whether the size of planes_need_merge is greater than or equal to 1. If so, jump out of the loop of i and enter the subsequent plane merging step. From the above process of obtaining planes_need_merge, it can be seen that the plane is taken from the sorted plane list. Since the plane closer to the real plane is placed in front of the plane list, because the first plane selected is the plane with a certain number of points and closest to the real plane, then all planes that are very close to its normal are selected as the planes to be merged. Each time, one is selected from the plane closest to the real plane, and the number of points on the plane meets the requirements, and then the planes that are very close to its normal are selected to form the list of planes to be merged. Since the plane of the cylindrical surface does not meet the point number requirement, the list of planes to be merged will not use the plane on the cylindrical surface as the first plane.

[0113] After the planes to be merged are determined as above, it is then detected whether the planes to be merged meet the second preset requirement. For details, please refer to Fig. 9 , in this embodiment, it can be achieved in the following ways:

[0114] S1241 , clustering the points on the plane to be merged and the points on the real plane respectively to obtain a clustering result of the plane to be merged and a clustering result of the real plane.

[0115] S1242: After merging the points on the plane to be merged with the points on the real plane, clustering the merged points to obtain a merged clustering result.

[0116] S1243: Determine whether the plane to be merged and the real plane satisfy a second preset condition based on the clustering result of the plane to be merged, the clustering result of the real plane, and the merged clustering result.

[0117] Assume that the two planes are plane 1 and plane 2. In this way, the clustering result of plane 1, the clustering result of plane 2, and the clustering result after the points of plane 1 and plane 2 are merged can be obtained. If the two planes are adjacent planes, the two planes are planes that can be merged. Through the above clustering method, based on the clustering result of plane 1, the clustering result of plane 2, and the clustering result after the points of plane 1 and plane 2 are merged, it can be determined whether the two planes are adjacent, and then it can be determined whether the two planes can be merged.

[0118] See also Fig.10 In this embodiment, when judging whether the second preset condition is met based on the clustering results of the two planes respectively and the clustering results after the points of the two planes are merged, it can be achieved in the following way:

[0119] S12431, obtaining a first number of clusters in the clustering result of the plane to be merged, a second number of clusters in the clustering result of the real plane, and a third number of clusters in the merged clustering result.

[0120] S12432: Detect whether the sum of the first cluster number and the second cluster number is greater than the third cluster number; if so, determine that the plane to be merged and the real plane satisfy a second preset condition.

[0121] In this embodiment, if two planes are adjacent, after the points of the two planes are merged, the points at the merged point of the two planes may be aggregated into the same cluster cluster when the same clustering parameters as when the planes are clustered are used. Before the merger, these points are at the edge positions of the two planes and will be clustered into a cluster cluster respectively. Therefore, it is possible to judge whether two planes are adjacent planes by comparing the number of clusters of the clusters of each plane and the number of clusters of the merged cluster.

[0122] Specifically, the cluster numbers of the clusters of each plane are superimposed to obtain the sum of the cluster numbers. The sum of the cluster numbers and the cluster numbers of the clusters in the merged clustering result are compared. If the sum of the cluster numbers is greater than the cluster numbers of the clusters in the merged clustering result, it is determined that the two planes can be merged. If the sum of the cluster numbers is equal to the cluster number of the clusters in the merged clustering result, it is determined that the two planes may be isolated planes, that is, the two planes cannot be merged.

[0123] In this embodiment, taking the above as an example, determine whether the size of planes_need_merge is greater than 1. If so, set number_plane = the size of planes_need_merge, and initialize the processed_need_merge array, whose value is all 0 and the size is number_plane. Use j to traverse the plane, determine whether processed_need_merge is 1, if so, skip the plane, if not, set processed_need_merge[j] = 1, processed[index_need_merge[j]] = 1, set plane_in = planes_need_merge[j], plane_in always represents the first plane to be merged (in this embodiment, the first plane to be merged is the real plane). Use k to traverse the plane, determine whether processed_need_merge[k] is 1, if so, skip the plane, if not, take out planes_need_merge[k] as the second plane to be merged, and input the plane merging function.

[0124] The plane merge function determines whether the two planes can be merged based on the number of clusters contained in the two planes and the relationship between the number of clusters of the points after the two planes are merged. The return value is 1 or 0. Returning 1 means that the plane can be merged. The plane merging result is in plane_out. Let plane_in = plane_out, and let processed_need_merge[k] = 1, processed[index_need_merge[k]] = 1. If it cannot be merged, skip the plane. If it can be merged, jump out of the loop of k. Determine whether k is equal to number_plane. If not, return to the position of k = 0 to traverse the plane. If so, add plane_in to planes_out. The purpose of judging whether k is equal to number_plane here is to determine whether k has traversed to the end without merging. At this time, it means that no plane can be merged with plane_in. After the j loop ends, enter the loop of i = 0. Get the list of planes to be merged again.

[0125] Until no new planes enter planes_need_merge in the loop of i, all the planes that should be merged are merged. If there are still unprocessed planes in the input planes, they are the planes on the cylinder.

[0126] Through the above method, all planes that are not cylindrical surfaces can be determined, and then the points on these planes can be deleted from the point cloud, and the points on the cylindrical surface can be retained. On this basis, cylinder detection is performed based on the remaining points after deletion. The cylinder detection method can adopt the currently commonly used method, which is not limited in this embodiment.

[0127] The improved point cloud cylinder detection method provided in this embodiment can detect all planes in the point cloud, and when merging planes, do not merge the planes on the cylinder surface, but only merge the real planes in the point cloud and the planes that meet the merging conditions with the real planes. In this way, the points on the cylinder surface can be retained, ensuring the smooth execution of subsequent cylinder detection and improving the accuracy of cylinder detection.

[0128] Based on the same inventive concept, please refer to Fig.11 , shows a schematic diagram of the functional modules of the improved cylinder detection device provided by an embodiment of the present invention. This embodiment can divide the functional modules of the improved cylinder detection device according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic, which is only a logical function division, and there may be other division methods in actual implementation.

[0129] For example, when each functional module is divided into corresponding functional modules, Fig.11 The improved cylinder detection device shown is only a schematic diagram of the device. The improved cylinder detection device may include a plane detection module, a determination module, a deletion module and a cylinder detection module. The functions of each functional module of the improved cylinder detection device are described in detail below.

[0130] A plane detection module, used for detecting and obtaining multiple planes in the point cloud to be processed;

[0131] It can be understood that the above-mentioned plane detection module can be used to execute the above-mentioned S11. The detailed implementation of the plane detection module can refer to the relevant content of the above-mentioned S11.

[0132] A determination module, configured to determine a real plane among the multiple planes, and determine a plane among the multiple planes that satisfies a merging condition with the real plane;

[0133] It can be understood that the above-mentioned determination module can be used to execute the above-mentioned S12. The detailed implementation of the determination module can refer to the relevant content of the above-mentioned S12.

[0134] A deleting module, used for deleting the plane satisfying the merging condition and the points on the real plane from the point cloud to obtain a deleted point cloud;

[0135] It can be understood that the above-mentioned deletion module can be used to execute the above-mentioned S13. The detailed implementation method of the deletion module can refer to the relevant content of the above-mentioned S13.

[0136] The cylinder detection module is used to perform cylinder detection on the deleted point cloud to obtain the detected cylinder.

[0137] It can be understood that the above-mentioned cylinder detection module can be used to execute the above-mentioned S14. The detailed implementation of the cylinder detection module can refer to the relevant content of the above-mentioned S14.

[0138] In a possible implementation, the above-mentioned determination module may be used to:

[0139] For each of the multiple planes, obtaining scale feature information corresponding to the plane;

[0140] The real plane is determined according to the size relationship of the scale feature information of each of the planes.

[0141] In a possible implementation, the above-mentioned determination module may be specifically used for:

[0142] Calculating a covariance matrix of the plane based on points on the plane;

[0143] Decomposing the covariance matrix to obtain multiple eigenvectors and multiple eigenvalues;

[0144] Scale feature information corresponding to the plane is obtained based on the multiple feature values.

[0145] In a possible implementation, the above-mentioned determination module may be specifically used for:

[0146] Determine a characteristic value corresponding to the length direction and a characteristic value corresponding to the width direction among the plurality of characteristic values;

[0147] The scale feature information is obtained based on the magnitude relationship between the feature value corresponding to the length direction and the feature value corresponding to the width direction.

[0148] In a possible implementation, the above-mentioned determination module may be used to:

[0149] Based on the normal vector of the real plane and the normal vectors of each of the multiple planes, screen out a plane that satisfies a first preset condition with the real plane as a plane to be merged;

[0150] For each of the planes to be merged, it is detected whether the plane to be merged and the real plane satisfy a second preset condition. If so, it is determined that the plane to be merged satisfies the merging condition.

[0151] In a possible implementation, the above-mentioned determination module may be specifically used for:

[0152] For each of the multiple planes, calculating an angle between a normal vector of the plane and a normal vector of the real plane;

[0153] It is detected whether the angle is smaller than a preset angle. If so, it is determined that a first preset condition is satisfied between the plane and the real plane.

[0154] In a possible implementation, the above-mentioned determination module may be specifically used for:

[0155] Clustering the points on the plane to be merged and the points on the real plane respectively to obtain a clustering result of the plane to be merged and a clustering result of the real plane;

[0156] After merging the points on the plane to be merged with the points on the real plane, clustering the merged points to obtain a merged clustering result;

[0157] Based on the clustering result of the plane to be merged, the clustering result of the real plane and the merged clustering result, it is determined whether the plane to be merged and the real plane satisfy a second preset condition.

[0158] In a possible implementation, the above-mentioned determination module may be specifically used for:

[0159] Obtaining a first number of clusters in the clustering result of the plane to be merged, a second number of clusters in the clustering result of the real plane, and a third number of clusters in the clustering result after merging;

[0160] It is detected whether the sum of the first cluster number and the second cluster number is greater than the third cluster number. If so, it is determined that the plane to be merged and the real plane meet a second preset condition.

[0161] See also Fig.12 , is a block diagram of an electronic device provided in an embodiment of the present invention, the electronic device may be a computer device, etc., and the electronic device includes a memory, a processor, and a communication module. The memory, the processor, and the communication module 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.

[0162] The memory is used to store programs or data. The memory may be, but is not limited to, random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), etc.

[0163] The processor is used to read / write data or programs stored in the memory and execute the improved point cloud cylinder detection method provided by any embodiment of the present invention.

[0164] The communication module is used to establish a communication connection between the electronic device and other communication terminals through the network, and is used to send and receive data through the network.

[0165] It should be understood that Fig.12 The structure shown is only a schematic diagram of the structure of the electronic device. The electronic device may also include Fig.12 More or fewer components as shown, or with Fig.12 Different configurations shown.

[0166] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are executed, the improved point cloud cylinder detection method provided in the above embodiment is implemented.

[0167] Specifically, the computer-readable storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the computer-readable storage medium is executed, the above-mentioned improved point cloud cylinder detection method can be executed. Regarding the process involved when the computer-readable storage medium and its executable instructions are executed, reference can be made to the relevant description in the above-mentioned method embodiment, which will not be described in detail here.

[0168] In summary, the improved point cloud cylinder detection method, device and electronic device provided by the embodiments of the present invention first detect and obtain multiple planes in the point cloud to be processed, determine the real plane among the multiple planes, and determine the plane among the multiple planes that meets the merging conditions with the real plane. The plane that meets the merging conditions and the points on the real plane are deleted from the point cloud to obtain the deleted point cloud. Finally, cylinder detection is performed on the deleted point cloud to obtain the detected cylinder. In this solution, by determining the plane that can be merged with the real plane, and then deleting the real plane and the mergeable plane before performing cylinder detection, the problem of deleting the points on the side of the cylinder and thus affecting the cylinder detection can be avoided, thereby improving the accuracy of cylinder detection.

[0169] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. An improved point cloud cylinder detection method, characterized in that: The method comprises: Detect and obtain multiple planes in the point cloud to be processed; Determine a real plane among the multiple planes, and determine a plane among the multiple planes that satisfies a merging condition with the real plane; Deleting the plane that meets the merging condition and the points on the real plane from the point cloud to obtain a deleted point cloud; Perform cylinder detection on the deleted point cloud to obtain the detected cylinder.

2. The improved point cloud cylinder detection method according to claim 1, characterized in that: The step of determining a real plane among the multiple planes comprises: For each of the multiple planes, obtaining scale feature information corresponding to the plane; The real plane is determined according to the size relationship of the scale feature information of each of the planes.

3. The improved point cloud cylinder detection method according to claim 2, characterized in that: The step of obtaining the scale feature information corresponding to the plane includes: Calculating a covariance matrix of the plane based on points on the plane; Decomposing the covariance matrix to obtain multiple eigenvectors and multiple eigenvalues; Scale feature information corresponding to the plane is obtained based on the multiple feature values.

4. The improved point cloud cylinder detection method according to claim 3, characterized in that: The step of obtaining scale feature information corresponding to the plane based on the multiple feature values ​​includes: Determine a characteristic value corresponding to the length direction and a characteristic value corresponding to the width direction among the plurality of characteristic values; The scale feature information is obtained based on the magnitude relationship between the feature value corresponding to the length direction and the feature value corresponding to the width direction.

5. The improved point cloud cylinder detection method according to claim 1, characterized in that: The step of determining a plane among the multiple planes that satisfies a merging condition with the real plane comprises: Based on the normal vector of the real plane and the normal vectors of each of the multiple planes, screen out a plane that satisfies a first preset condition with the real plane as a plane to be merged; For each of the planes to be merged, it is detected whether the plane to be merged and the real plane satisfy a second preset condition. If so, it is determined that the plane to be merged satisfies the merging condition.

6. The improved point cloud cylinder detection method according to claim 5, characterized in that: The step of screening out a plane that satisfies a first preset condition with respect to the real plane based on the normal vector of the real plane and the normal vectors of each of the multiple planes comprises: For each of the multiple planes, calculating an angle between a normal vector of the plane and a normal vector of the real plane; It is detected whether the angle is smaller than a preset angle. If so, it is determined that a first preset condition is satisfied between the plane and the real plane.

7. The improved point cloud cylinder detection method according to claim 5, characterized in that: The step of detecting whether the plane to be merged and the real plane satisfy a second preset condition comprises: Clustering the points on the plane to be merged and the points on the real plane respectively to obtain a clustering result of the plane to be merged and a clustering result of the real plane; After merging the points on the plane to be merged with the points on the real plane, clustering the merged points to obtain a merged clustering result; Based on the clustering result of the plane to be merged, the clustering result of the real plane and the merged clustering result, it is determined whether the plane to be merged and the real plane satisfy a second preset condition.

8. The improved point cloud cylinder detection method according to claim 7, characterized in that: The step of determining whether the plane to be merged and the real plane meet a second preset condition based on the clustering result of the plane to be merged, the clustering result of the real plane and the merged clustering result comprises: Obtaining a first number of clusters in the clustering result of the plane to be merged, a second number of clusters in the clustering result of the real plane, and a third number of clusters in the clustering result after merging; It is detected whether the sum of the first cluster number and the second cluster number is greater than the third cluster number. If so, it is determined that the plane to be merged and the real plane meet a second preset condition.

9. An improved point cloud cylinder detection device, characterized in that: The device comprises: A plane detection module, used for detecting and obtaining multiple planes in the point cloud to be processed; A determination module, configured to determine a real plane among the multiple planes, and determine a plane among the multiple planes that satisfies a merging condition with the real plane; A deleting module, used for deleting the plane satisfying the merging condition and the points on the real plane from the point cloud to obtain a deleted point cloud; The cylinder detection module is used to perform cylinder detection on the deleted point cloud to obtain the detected cylinder.

10. An electronic device, characterized in that: The electronic device comprises one or more memories and one or more processors communicating with the memories, wherein the one or more memories store machine executable instructions executable by the processors, and when the electronic device is running, the processor executes the machine executable instructions to perform the method described in any one of claims 1 to 8.

Citation Information

Cited By

  • Weld joint construction method and electronic equipment

    CN119863575A