Method for automatically measuring outer diameter and length of cabin section

The method addresses inefficiencies in manual cabin section measurement by using point cloud processing and neural networks to accurately measure outer diameter and length, enhancing precision and automation in large compartment assessments.

CN119124016APending Publication Date: 2024-12-13AEROSUN CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411232705.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Existing methods for measuring the geometric parameters of large cabin sections are inefficient and inaccurate due to reliance on manual operations and the difficulty in distinguishing concentric cylindrical point clouds, leading to errors in outer diameter and length measurements.

Method used

A method involving point cloud processing techniques, including curvature calculation, threshold setting, multi-stage clustering, and cylindrical fitting, combined with neural network-based image analysis to automatically measure the outer diameter and length of cabin sections.

Benefits of technology

This method significantly improves measurement accuracy and efficiency by reducing errors caused by manual adjustments and point cloud quality issues, enabling precise automatic measurement of large compartments without manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119124016A_ABST
    Figure CN119124016A_ABST
Patent Text Reader

Abstract

The invention relates to a method for automatically measuring the outer diameter and the length of a cabin section, and belongs to the technical field of image analysis. According to the method, cabin point clouds are clustered into a plurality of point clouds according to curvature and a distance threshold value, then point clouds with least points are randomly selected to be clustered with adjacent point clouds according to angles and distances, and the point clouds are divided into candidate point clouds, to-be-screened point clouds and non-clustered point clouds; taking the percentage of the number of the points of the candidate point clouds on the fitting cylindrical surface and the number of the points of the candidate point clouds as a basis until correct candidate point clouds are obtained, selecting initial point clouds meeting conditions from the to-be-screened and non-clustered point clouds, expanding the candidate point clouds to obtain cabin rough point clouds, and finding out flange plane point clouds according to the rough point clouds; and then projecting the rough point cloud to a flange plane to generate a grey-scale map, obtaining a cabin section outer wall point cloud and a cabin section outer diameter by using a convolutional neural network, judging the perpendicularity of the outer wall point cloud and the flange surface until a correct outer wall point cloud and an axis are iterated, and finally projecting the outer wall point cloud to the axis to obtain the length of the cabin section.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for automatically measuring the outer diameter and length of a cabin section, and belongs to the technical field of image analysis (G06T7 / 00). Background Art

[0002] In the field of aviation and industrial manufacturing, the measurement of geometric parameters of processed cabin sections usually relies on manual methods. This method requires operators to manually measure the parameters of the cabin section at different locations, which greatly depends on the workers' experience and technical level. At present, most automated cabin section measurement technologies use fixed sensor positions and complete the measurement by moving the cabin section. This method requires sufficient space to move the cabin section, so it is not suitable for the measurement needs of large cabin section geometric parameters.

[0003] In order to meet the demand for automatic measurement of geometric parameters of large cabins, the RANSAC method is currently used to fit the cabin outer wall point cloud based on the cabin point cloud. However, in the case of multiple concentric cylindrical point clouds, the fitting parameters need to be adjusted, and the fitting parameters are often adjusted manually, resulting in the inability to accurately distinguish the concentric cylindrical point clouds, thereby affecting the fitting accuracy in the radius and axis directions. In addition, when scanning the cabin flange surface, the point cloud of the cabin inner wall will inevitably be recorded. If the cabin outer wall point cloud cannot be accurately separated, it will cause errors in measuring the outer diameter of the cabin. Therefore, in view of the above situation, there is an urgent need for a method that can automatically measure the outer diameter and length of the cabin when it is difficult to distinguish the cabin outer wall point cloud. Summary of the invention

[0004] The technical problem to be solved by the present invention is: how to realize automatic measurement of the outer diameter and length of a large compartment section.

[0005] The technical solution proposed by the present invention to solve the above technical problems is: a method for automatically measuring the outer diameter and length of a compartment, comprising the following steps:

[0006] Step 1: Scan the cabin, obtain the cabin point cloud and construct a plane coordinate system, input the coordinates of each point in the cabin point cloud into the kd search tree to obtain the neighboring point set of each point in the cabin point cloud;

[0007] At the same time, the curvature of each point in the cabin point cloud is calculated according to formula (1) and the eigenvector

[0008] ;

[0009] In formula (1), is the covariance matrix of each point with its neighboring points; is the number of points in the neighboring point set of each point; , are the coordinates of the ath and bth neighboring points of each point respectively; T is the transpose; I is the identity matrix; , , Both The eigenvalues ​​of is the minimum eigenvalue; det is the determinant.

[0010] Step 2: Set the curvature threshold. The curvature threshold value range is 0-1 / known theoretical outer diameter of the cabin;

[0011] Set the distance threshold, the distance threshold value range is 0-0.3 times the known theoretical wall thickness of the cabin;

[0012] Step 2.1: randomly select one of the points with the smallest curvature in the cabin point cloud as the first initial point, cluster all points in the cabin point cloud whose curvature is within the curvature threshold and whose distance from the first initial point is within the distance threshold with the first initial point to form a first initial point cloud;

[0013] Step 2.2: All boundary points of the first initial point cloud are used as second initial points. Among the points in the cabin point cloud that have not been clustered after step 2.1, all points whose curvature is within the curvature threshold and whose distance to any second initial point is within the distance threshold are clustered with the second initial points to expand the first initial point cloud to form a second initial point cloud. All boundary points of the second initial point cloud are used as third initial points, and so on, until there are no points that meet the two thresholds that can be clustered;

[0014] Step 2.3: Randomly select one of the points with the smallest curvature from the points in the cabin point cloud that have not been clustered after step 2.2 as the first new first initial point, repeat steps 2.1-2.2 to obtain the first new first initial point cloud, and then randomly select one of the points with the smallest curvature from the remaining unclustered points in the cabin point cloud as the second new first initial point and repeat steps 2.1-2.2, and so on, until all points in the cabin point cloud are clustered, and obtain An initial point cloud;

[0015] Step 3: Calculate the normal vector of each initial point cloud according to formula (2) and location

[0016] ;

[0017] In formula (2), is the number of points in each initial point cloud; is the minimum eigenvector of the i-th point in each initial point cloud; is the coordinate of the i-th point in each initial point cloud;

[0018] Step 4: Randomly select one of the initial point clouds with the least number of points as the first point cloud;

[0019] Step 4.1: Calculate the distance from the first point cloud to other initial point clouds according to formula (3) , the distance from the first point cloud position All the nearest initial point clouds are taken as neighboring point clouds

[0020] ;

[0021] In formula (3), is the position of other initial point clouds, is the position of the first point cloud;

[0022] Step 4.2: Calculate the angle between the normal vector of the first point cloud and the direction from the first point cloud position to each adjacent point cloud position according to equation (4):

[0023] ;

[0024] In formula (4), is the position of the neighboring point cloud; is the normal vector of the first point cloud;

[0025] Step 4.3: Calculate the angle between the normal vector of each neighboring point cloud and the direction from the first point cloud position to the respective neighboring point cloud position according to equation (5):

[0026] ;

[0027] In formula (5), is the normal vector of the neighboring point cloud;

[0028] Step 4.4: Cluster all initial point clouds in the neighboring point clouds that satisfy the following formula (6) with the first point cloud to obtain the first cluster point cloud

[0029] ;

[0030] Step 4.5: Calculate the normal vector and position of the first cluster point cloud according to formula (2), calculate and find the neighboring point cloud closest to the first cluster point cloud according to formula (3), calculate the angle between the normal vector of the first cluster point cloud and the direction from the first cluster point cloud position to each neighboring point cloud position according to formula (4), calculate the angle between the normal vector of each neighboring point cloud and the direction from the first cluster point cloud position to each neighboring point cloud position according to formula (5), cluster all the initial point clouds that meet formula (6) in the neighboring point cloud closest to the first cluster point cloud position with the first cluster point cloud to obtain the second cluster point cloud, calculate the normal vector and position of the second cluster point cloud according to formula (2), and so on, until there is no initial point cloud that meets formula (6) to be clustered, and take the last Nth cluster point cloud as the first candidate point cloud; N is the number of clustering in this step;

[0031] Repeat steps 4.4 to 4.5 , Satisfies formula (6) but The initial point cloud that does not satisfy equation (6) is used as the first point cloud to be screened;

[0032] Repeat steps 4.4 to 4.5 , The initial point cloud that does not satisfy equation (6) is taken as the first unclustered point cloud;

[0033] Step 5: Perform cylindrical fitting on the first candidate point cloud to obtain the first fitting cylinder and its radius, axis and axis direction vector. Calculate the number of points on the first fitting cylinder in the first candidate point cloud according to the following equations (7) and (8): The number of points in the first candidate point cloud Percentage

[0034] ;

[0035] In formula (7), R is the radius of the first fitting cylinder, is the axis direction vector of the first fitting cylinder, is the coordinate of any point on the axis of the first fitting cylinder, is the coordinate of any point in the first candidate point cloud;

[0036] ;

[0037] In formula (8), is the number of points in the first candidate point cloud that satisfy equation (8), i.e., the number of points located on the first fitting cylindrical surface;

[0038] like , the first candidate point cloud obtained in step 4.5 is used as the first candidate cylinder point cloud, the first point cloud to be screened in step 4.5 is used as the first cylinder point cloud to be screened, the first unclustered point cloud in step 4.5 is used as the first unclustered cylinder point cloud, the first fitting cylinder is used as the first candidate fitting cylinder, the axis of the first fitting cylinder is used as the first fitting axis, and the radius of the first fitting cylinder is used as the first fitting radius ;

[0039] like , randomly select one of the initial point clouds with the least points from the first unclustered point cloud obtained in step 4.5 as the second point cloud and substitute it into step 4 until step 4..5 to obtain the second candidate point cloud, the second point cloud to be screened and the second unclustered point cloud, then perform cylindrical fitting on the second candidate point cloud to obtain the second fitting cylinder and the radius, axis and axis direction vector of the second fitting cylinder, and calculate the percentage of the number of points on the second fitting cylinder in the second candidate point cloud to the number of points in the second candidate point cloud according to formulas (7) and (8): , and so on, until , take the second candidate point cloud as the first candidate cylinder point cloud, take the second point cloud to be screened as the first cylinder point cloud to be screened, take the second unclustered point cloud as the first unclustered cylinder point cloud, take the second fitting cylinder as the first candidate fitting cylinder, take the axis of the second fitting cylinder as the first fitting axis, and take the radius of the second fitting cylinder as the first fitting radius ;

[0040] Step 6: Calculate the angle between the normal vector of each initial point cloud in the first cylindrical point cloud to be screened and the first fitting axis according to formula (9)

[0041] ;

[0042] In formula (9), is the first fitting axis direction vector, is the normal vector of each initial point cloud in the first cylindrical point cloud to be screened;

[0043] Step 6.1: Calculate the distance from each initial point cloud to the first fitting axis in the first cylindrical point cloud to be screened according to formula (10)

[0044] ;

[0045] In formula (10), is the position of each initial point cloud in the first cylindrical point cloud to be screened, is the coordinate of any point on the first fitting axis;

[0046] All the initial point clouds satisfying the following formula (11) in the first to-be-screened cylindrical point cloud are clustered with the first candidate cylindrical point cloud to form the first candidate cylindrical clustered point cloud, and the number of initial point clouds in the first candidate cylindrical clustered point cloud is recorded as

[0047] ;

[0048] Step 6.2: Perform cylinder fitting on the first candidate cylinder cluster point cloud to obtain the third fitting cylinder and its radius, axis and axis direction vector. Calculate the percentage of the number of points on the third fitting cylinder surface in the first candidate cylinder cluster point cloud to the number of points in the first candidate cylinder cluster point cloud according to equations (7) and (8): ;

[0049] like or , the first candidate cylinder cluster point cloud is used as the rough point cloud of the cabin;

[0050] like and , calculate the angle between the normal vector of each initial point cloud in the first unclustered cylindrical point cloud finally obtained in step 5 and the first fitting axis according to formula (9), calculate the distance from each initial point cloud in the first unclustered point cloud to the first fitting axis according to formula (10), cluster all the initial point clouds in the first unclustered cylindrical point cloud that satisfy formula (11) with the first candidate cylindrical clustered point cloud to form a rough point cloud of the cabin;

[0051] Step 7: Perform cylindrical fitting on the rough point cloud of the cabin to obtain the second fitting axis, the direction vector of the second fitting axis and the second fitting radius. According to the following formula (12), the angle between the normal vector of each initial point cloud that does not satisfy formula (11) in step 6 and the second fitting axis is calculated respectively:

[0052] ;

[0053] In formula (12), is the direction vector of the second fitting axis, is the normal vector of the initial point cloud that does not satisfy equation (11) in step 6;

[0054] Will The initial point cloud closest to 0° and containing the most points is taken as the first flange plane point cloud;

[0055] Step 8: Orthogonally project the rough point cloud of the cabin section onto the plane where the first flange plane point cloud is located, and generate a plane grayscale image with the intersection of the second fitting axis on the plane where the first flange plane point cloud is located as the center;

[0056] Step 9: Use the DLA-34 neural network to extract features from the planar grayscale image;

[0057] The extracted features are input into a multi-layer convolutional neural network to identify multiple plane circles and obtain the coordinates and radii of all plane circles;

[0058] The plane circle whose center is at the shortest distance from the intersection of the second fitting axis and the plane where the flange plane point cloud is located and whose radius length has the smallest difference with the third fitting radius length is taken as the projection of the cabin outer wall point cloud;

[0059] Points in the rough point cloud of the cabin corresponding to the projection points on the circumference of the plane circle form a candidate point cloud of the outer wall of the first cabin; the diameter of the plane circle is the outer diameter of the cabin; Step 10: Perform cylindrical fitting on the candidate point cloud of the outer wall of the first compartment to obtain the third fitting axis and the direction vector of the third fitting axis , calculate the flange plane point cloud normal vector according to formula (13) Angle with the third fitting axis

[0060] ;

[0061] like , taking the first cabin outer wall candidate point cloud as the cabin outer wall point cloud, taking the third fitting axis as the cabin axis, and taking the direction vector of the third fitting axis as the direction vector of the cabin axis;

[0062] like or , calculate the fourth fitting axis and the fourth fitting axis direction vector according to formula (14) , bring the fourth fitting axis into step 7-step 10 to obtain the second flange plane point cloud and the second compartment outer wall candidate point cloud, then perform cylindrical fitting on the second compartment outer wall candidate point cloud to obtain the fifth fitting axis and the direction vector of the fifth fitting axis, and calculate the angle between the second flange plane point cloud and the fifth fitting axis according to formula (13): , and so on, until , the candidate point cloud of the second compartment outer wall is used as the compartment outer wall point cloud, the fifth fitting axis is used as the compartment axis, and the direction vector of the fifth fourth fitting axis is used as the compartment axis direction vector

[0063] ;

[0064] In formula (14), c is the weight coefficient, 0 <c<1;

[0065] Step 11: Orthogonally project the point cloud of the cabin outer wall onto the cabin axis, and calculate the cabin length according to the following formula (15): ;

[0066] ;

[0067] In formula (15), The direction vector of the compartment axis; is the coordinate of the midpoint of the cabin outer wall point cloud, is the coordinate of any point on the axis of the compartment.

[0068] Furthermore, the cylinder fitting adopts the least square method.

[0069] Furthermore, in step 8, pixel grid division is performed with the intersection of the second fitting axis and the plane where the first flange plane point cloud is located as the center, and the length and width of the pixel grid are set to the difference between the upper error limit and the lower error limit of the point cloud measurement equipment. The number of projected points in each pixel grid is taken as the grayscale value, normalized to the range of 0-255, and a plane grayscale image is obtained. The length and width of the plane grayscale image are set to 1.3 times the known theoretical outer diameter of the cabin.

[0070] The beneficial effects of the present invention are as follows: by calculating the point cloud curvature, normal vector, position and other information, combining precise threshold setting for point clustering, and then performing multi-stage point cloud clustering and cylinder fitting, it is possible to effectively process point clouds in concentric cylinders and complex geometric shapes, thereby reducing errors caused by manual adjustments. Moreover, when faced with point cloud data quality issues or scanning errors, multiple clustering and fitting iterations can effectively reduce the impact of errors on the final results and improve robustness. In general, this method automatically completes the measurement of large compartments from morphological fitting to final outer diameter and length based on point clouds, without the need for manual intervention, significantly improving measurement efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] The present invention will be further described below in conjunction with the accompanying drawings.

[0072] Figure 1 It is a planar grayscale image of the method for automatically measuring the outer diameter and length of a cabin section in an embodiment. DETAILED DESCRIPTION

[0073] Example

[0074] A method for automatically measuring the outer diameter and length of a compartment section in this embodiment includes the following steps:

[0075] Step 1: Scan the cabin, obtain the cabin point cloud and construct a plane coordinate system, input the coordinates of each point in the cabin point cloud into the kd search tree to obtain the neighboring point set of each point in the cabin point cloud;

[0076] The kd search tree is a data structure for efficient multidimensional data search, which belongs to the prior art. It recursively divides the data space into hyper-rectangular regions, each node represents a data point, and traverses the tree nodes to obtain the point coordinates stored in each node;

[0077] In this embodiment, the coordinates of each point in the cabin point cloud are input into the kd tree to generate a tree structure, the tree nodes are traversed, the coordinates of the points stored in each node are obtained, and the kd tree performs a range query to obtain the neighboring point set of each point;

[0078] At the same time, the curvature of each point in the cabin point cloud is calculated according to formula (1) and the eigenvector

[0079] ;

[0080] In formula (1), is the covariance matrix of each point and its neighboring points; is the number of points in the neighboring point set of each point; , are the coordinates of the ath and bth neighboring points of each point respectively; T is the transpose; I is the identity matrix; , , Both The eigenvalues ​​of is the minimum eigenvalue; det is the determinant.

[0081] Step 2: Set the curvature threshold. The curvature threshold value range is 0-1 / known theoretical outer diameter of the cabin;

[0082] Set the distance threshold, the distance threshold value range is 0-0.3 times the known theoretical wall thickness of the cabin;

[0083] In this embodiment, the curvature threshold is 0.001 and the distance threshold is 3 mm;

[0084] Step 2.1: randomly select one of the points with the smallest curvature in the cabin point cloud as the first initial point, cluster all points in the cabin point cloud whose curvature is within the curvature threshold and whose distance to the first initial point is within the distance threshold with the first initial point to form a first initial point cloud;

[0085] Step 2.2: All boundary points of the first initial point cloud are used as the second initial points. Among the points in the cabin point cloud that have not been clustered after step 2.1, all points whose curvature is within the curvature threshold and whose distance to any second initial point is within the distance threshold are clustered with the second initial points to expand the first initial point cloud to form the second initial point cloud. All boundary points of the second initial point cloud are used as the third initial points, and so on, until there are no points that meet the two thresholds that can be clustered;

[0086] Step 2.3: Randomly select one of the points with the smallest curvature from the points in the cabin point cloud that have not been clustered after step 2.2 as the first new first initial point, repeat steps 2.1-2.2 to obtain the first new first initial point cloud, and then randomly select one of the points with the smallest curvature from the remaining unclustered points in the cabin point cloud as the second new first initial point and repeat steps 2.1-2.2, and so on, until all points in the cabin point cloud are clustered, and obtain An initial point cloud;

[0087] In this embodiment, 164 initial point clouds are obtained.

[0088] Step 3: Calculate the normal vector of each initial point cloud according to formula (2) and location

[0089] ;

[0090] In formula (2), is the number of points in each initial point cloud; is the minimum eigenvector of the i-th point in each initial point cloud; are the coordinates of the i-th point in each initial point cloud.

[0091] Step 4: Randomly select one of the initial point clouds with the least number of points as the first point cloud;

[0092] Step 4.1: Calculate the distance from the first point cloud to other initial point clouds according to formula (3) , the distance from the first point cloud position All the nearest initial point clouds are taken as neighboring point clouds

[0093] ;

[0094] In formula (3), is the position of other initial point clouds, is the position of the first point cloud;

[0095] Step 4.2: Calculate the angle between the normal vector of the first point cloud and the direction from the first point cloud position to each adjacent point cloud position according to equation (4):

[0096] ;

[0097] In formula (4), is the position of the neighboring point cloud; is the normal vector of the first point cloud;

[0098] Step 4.3: Calculate the angle between the normal vector of each neighboring point cloud and the direction from the first point cloud position to the respective neighboring point cloud position according to equation (5):

[0099] ;

[0100] In formula (5), is the normal vector of the neighboring point cloud;

[0101] Step 4.4: Cluster all initial point clouds in the neighboring point clouds that satisfy the following formula (6) with the first point cloud to obtain the first cluster point cloud

[0102] ;

[0103] In this embodiment, δ is 0.5 and ε is 8 mm;

[0104] Step 4.5: Calculate the normal vector and position of the first cluster point cloud according to formula (2), calculate and find the neighboring point cloud closest to the first cluster point cloud according to formula (3), calculate the angle between the normal vector of the first cluster point cloud and the direction from the first cluster point cloud position to each neighboring point cloud position according to formula (4), calculate the angle between the normal vector of each neighboring point cloud and the direction from the first cluster point cloud position to each neighboring point cloud position according to formula (5), cluster all the initial point clouds that meet formula (6) in the neighboring point cloud closest to the first cluster point cloud position with the first cluster point cloud to obtain the second cluster point cloud, calculate the normal vector and position of the second cluster point cloud according to formula (2), and so on, until there is no initial point cloud that meets formula (6) to be clustered, and take the last Nth cluster point cloud as the first candidate point cloud; N is the number of clustering in this step;

[0105] This step of the present embodiment clusters 70 times, that is, the 70th cluster point cloud is taken as the first candidate point cloud;

[0106] Repeat steps 4.4 to 4.5 , Satisfies formula (6) but The initial point cloud that does not satisfy equation (6) is used as the first point cloud to be screened;

[0107] Repeat steps 4.4 to 4.5 , The initial point cloud that does not satisfy equation (6) is taken as the first unclustered point cloud.

[0108] Step 5: Perform cylindrical fitting on the first candidate point cloud to obtain the first fitting cylinder and its radius, axis and axis direction vector. Calculate the number of points on the first fitting cylinder in the first candidate point cloud according to the following equations (7) and (8): The number of points in the first candidate point cloud Percentage

[0109] ;

[0110] This embodiment Take 2mm;

[0111] In formula (7), R is the radius of the first fitting cylinder, is the axis direction vector of the first fitting cylinder, is the coordinate of any point on the axis of the first fitting cylinder, is the coordinate of any point in the first candidate point cloud;

[0112] ;

[0113] In formula (8), is the number of points in the first candidate point cloud that satisfy equation (8), i.e., the number of points located on the first fitting cylindrical surface;

[0114] In this embodiment, the following formula (7) and (8) are used to calculate: =85.3% >50%;

[0115] like , the first candidate point cloud obtained in step 4.5 is used as the first candidate cylinder point cloud, the first point cloud to be screened in step 4.5 is used as the first cylinder point cloud to be screened, the first unclustered point cloud in step 4.5 is used as the first unclustered cylinder point cloud, the first fitting cylinder is used as the first candidate fitting cylinder, the axis of the first fitting cylinder is used as the first fitting axis, and the radius of the first fitting cylinder is used as the first fitting radius ;

[0116] like , randomly select one of the initial point clouds with the least points from the first unclustered point cloud obtained in step 4.5 as the second point cloud and substitute it into step 4 until step 4..5 to obtain the second candidate point cloud, the second point cloud to be screened and the second unclustered point cloud, then perform cylindrical fitting on the second candidate point cloud to obtain the second fitting cylinder and the radius, axis and axis direction vector of the second fitting cylinder, and calculate the percentage of the number of points on the second fitting cylinder in the second candidate point cloud to the number of points in the second candidate point cloud according to formulas (7) and (8): , and so on, until , take the second candidate point cloud as the first candidate cylinder point cloud, take the second point cloud to be screened as the first cylinder point cloud to be screened, take the second unclustered point cloud as the first unclustered cylinder point cloud, take the second fitting cylinder as the first candidate fitting cylinder, take the axis of the second fitting cylinder as the first fitting axis, and take the radius of the second fitting cylinder as the first fitting radius .

[0117] Step 6: Calculate the angle between the normal vector of each initial point cloud in the first cylindrical point cloud to be screened and the first fitting axis according to formula (9)

[0118] ;

[0119] In formula (9), is the first fitting axis direction vector, is the normal vector of each initial point cloud in the first cylindrical point cloud to be screened;

[0120] Step 6.1: Calculate the distance from each initial point cloud to the first fitting axis in the first cylindrical point cloud to be screened according to formula (10)

[0121] ;

[0122] In formula (10), is the position of each initial point cloud in the first cylindrical point cloud to be screened, is the coordinate of any point on the first fitting axis;

[0123] All the initial point clouds satisfying the following formula (11) in the first to-be-screened cylindrical point cloud are clustered with the first candidate cylindrical point cloud to form the first candidate cylindrical clustered point cloud, and the number of initial point clouds in the first candidate cylindrical clustered point cloud is recorded as

[0124] The number of initial point clouds in the first candidate cylindrical cluster point cloud of this embodiment is recorded as =93;

[0125] ;

[0126] Step 6.2: Perform cylinder fitting on the first candidate cylinder cluster point cloud to obtain the third fitting cylinder and its radius, axis and axis direction vector. Calculate the percentage of the number of points on the third fitting cylinder surface in the first candidate cylinder cluster point cloud to the number of points in the first candidate cylinder cluster point cloud according to equations (7) and (8): ;

[0127] This example calculates =94.7%; Since the cabin point cloud obtained by scanning in step 1 has good quality and less noise, Get 50%;

[0128] like or , the first candidate cylinder cluster point cloud is used as the rough point cloud of the cabin

[0129] like and , calculate the angle between the normal vector of each initial point cloud in the first unclustered cylindrical point cloud obtained in step 5 and the first fitting axis according to formula (9), calculate the distance from each initial point cloud in the first unclustered point cloud to the first fitting axis according to formula (10), and cluster all the initial point clouds in the first unclustered cylindrical point cloud that satisfy formula (11) with the first candidate cylindrical clustered point cloud to form a rough point cloud of the cabin.

[0130] Step 7: Perform cylindrical fitting on the rough point cloud of the cabin to obtain the second fitting axis, the direction vector of the second fitting axis and the second fitting radius. According to the following formula (12), the angle between the normal vector of each initial point cloud that does not satisfy formula (11) in step 6 and the second fitting axis is calculated respectively:

[0131] ;

[0132] In formula (12), is the direction vector of the second fitting axis, is the normal vector of the initial point cloud that does not satisfy equation (11) in step 6;

[0133] Will The initial point cloud that is closest to 0° and contains the most points is taken as the first flange plane point cloud.

[0134] Step 8: Orthogonally project the rough point cloud of the cabin section onto the plane where the first flange plane point cloud is located, and generate a plane grayscale image with the intersection of the second fitting axis on the plane where the first flange plane point cloud is located as the center;

[0135] In this embodiment, pixel grid division is performed with the intersection of the second fitting axis and the plane where the first flange plane point cloud is located as the center. The length and width of the pixel grid are set to the difference between the upper error limit and the lower error limit of the point cloud measurement device. The number of projected points in each pixel grid is taken as the grayscale value, which is normalized to the range of 0-255 to obtain a plane grayscale image, such as Figure 1 As shown, the length and width of the plane grayscale image are set to 1.3 times the known theoretical outer diameter of the cabin.

[0136] Step 9: Use the DLA-34 neural network to extract features from the planar grayscale image;

[0137] The DLA-34 neural network is a deep convolutional neural network for image processing, which is designed to extract image features through an efficient hierarchical aggregation mechanism and belongs to the prior art. In this embodiment, a planar grayscale image is input into the DLA-34 neural network, and feature extraction is performed through multiple convolutional layers, activation layers, batch normalization layers, etc. Each layer extracts features at different levels. The DLA-34 then combines feature maps at different levels through a deep aggregation mechanism, and finally outputs a feature map.

[0138] The extracted features are input into a multi-layer convolutional neural network to identify multiple plane circles and obtain the coordinates and radii of all plane circles;

[0139] The plane circle whose center is at the shortest distance from the intersection of the second fitting axis and the plane where the flange plane point cloud is located and whose radius length has the smallest difference with the third fitting radius length is taken as the projection of the cabin outer wall point cloud;

[0140] Points in the cabin rough point cloud corresponding to the projection points on the circumference of the plane circle form a candidate point cloud for the first cabin outer wall; the diameter of the plane circle is the cabin outer diameter;

[0141] The diameter of the plane circle, i.e., the outer diameter of the cabin section, is calculated to be 99.7 mm in this embodiment. Step 10: Perform cylindrical fitting on the candidate point cloud of the outer wall of the first compartment to obtain the third fitting axis and the direction vector of the third fitting axis , calculate the flange plane point cloud normal vector according to formula (13) Angle with the third fitting axis

[0142] ;

[0143] In this embodiment, the formula (13) is used to calculate =0.1°;

[0144] like , taking the first cabin outer wall candidate point cloud as the cabin outer wall point cloud, taking the third fitting axis as the cabin axis, and taking the direction vector of the third fitting axis as the direction vector of the cabin axis;

[0145] like or , calculate the fourth fitting axis and the fourth fitting axis direction vector according to formula (14) , bring the fourth fitting axis into step 7-step 10 to obtain the second flange plane point cloud and the second compartment outer wall candidate point cloud, then perform cylindrical fitting on the second compartment outer wall candidate point cloud to obtain the fifth fitting axis and the direction vector of the fifth fitting axis, and calculate the angle between the second flange plane point cloud and the fifth fitting axis according to formula (13): , and so on, until , the candidate point cloud of the second compartment outer wall is used as the compartment outer wall point cloud, the fifth fitting axis is used as the compartment axis, and the direction vector of the fifth fourth fitting axis is used as the compartment axis direction vector

[0146] ;

[0147] In formula (14), c is the weight coefficient, 0 <c<1。

[0148] Step 11: Orthogonally project the point cloud of the cabin outer wall onto the cabin axis, and calculate the cabin length according to the following formula (15): ;

[0149] ;

[0150] In formula (15), The direction vector of the compartment axis; is the coordinate of the midpoint of the cabin outer wall point cloud, is the coordinate of any point on the axis of the compartment;

[0151] In this embodiment, the cabin length is calculated according to formula (15): =601.3mm.

[0152] The above description is only a preferred embodiment of the present invention, but the present invention is not limited thereto. All equivalent replacements or equivalent changes of the concepts and technical solutions according to the present invention should be included in the protection scope of the present invention.

Claims

1. A method for automatically measuring the outer diameter and length of a compartment, characterized in that The steps include: Step 1: Scan the cabin, obtain the cabin point cloud and construct a plane coordinate system, input the coordinates of each point in the cabin point cloud into the kd search tree to obtain the neighboring point set of each point in the cabin point cloud; At the same time, the curvature of each point in the cabin point cloud is calculated according to formula (1) and the eigenvector ; In formula (1), is the covariance matrix of each point with its neighboring points; is the number of points in the neighboring point set of each point; , are the coordinates of the ath and bth neighboring points of each point respectively; T is the transpose; I is the identity matrix; , , Both The eigenvalues ​​of is the minimum eigenvalue; det is the determinant; Step 2: Set the curvature threshold. The curvature threshold value range is 0-1 / known theoretical outer diameter of the cabin; Set the distance threshold, the distance threshold value range is 0-0.3 times the known theoretical wall thickness of the cabin; Step 2.1: randomly select one of the points with the smallest curvature in the cabin point cloud as the first initial point, cluster all points in the cabin point cloud whose curvature is within the curvature threshold and whose distance from the first initial point is within the distance threshold with the first initial point to form a first initial point cloud; Step 2.2: All boundary points of the first initial point cloud are used as second initial points. Among the points in the cabin point cloud that have not been clustered after step 2.1, all points whose curvature is within the curvature threshold and whose distance to any second initial point is within the distance threshold are clustered with the second initial points to expand the first initial point cloud to form a second initial point cloud. All boundary points of the second initial point cloud are used as third initial points, and so on, until there are no points that meet the two thresholds that can be clustered; Step 2.3: Randomly select one of the points with the smallest curvature from the points in the cabin point cloud that have not been clustered after step 2.2 as the first new first initial point, repeat steps 2.1-2.2 to obtain the first new first initial point cloud, and then randomly select one of the points with the smallest curvature from the remaining unclustered points in the cabin point cloud as the second new first initial point and repeat steps 2.1-2.2, and so on, until all points in the cabin point cloud are clustered, and obtain An initial point cloud; Step 3: Calculate the normal vector of each initial point cloud according to formula (2) and location ; In formula (2), is the number of points in each initial point cloud; is the minimum eigenvector of the i-th point in each initial point cloud; is the coordinate of the i-th point in each initial point cloud; Step 4: Randomly select one of the initial point clouds with the least number of points as the first point cloud; Step 4.1: Calculate the distance from the first point cloud to other initial point clouds according to formula (3) , the distance from the first point cloud position All the nearest initial point clouds are taken as neighboring point clouds ; In formula (3), is the position of other initial point clouds, is the position of the first point cloud; Step 4.2: Calculate the angle between the normal vector of the first point cloud and the direction from the first point cloud position to each adjacent point cloud position according to equation (4): ; In formula (4), is the position of the neighboring point cloud; is the normal vector of the first point cloud; Step 4.3: Calculate the angle between the normal vector of each neighboring point cloud and the direction from the first point cloud position to the respective neighboring point cloud position according to equation (5): ; In formula (5), is the normal vector of the neighboring point cloud; Step 4.4: Cluster all initial point clouds in the neighboring point clouds that satisfy the following formula (6) with the first point cloud to obtain the first cluster point cloud ; Step 4.5: Calculate the normal vector and position of the first cluster point cloud according to formula (2), calculate and find the neighboring point cloud closest to the first cluster point cloud according to formula (3), calculate the angle between the normal vector of the first cluster point cloud and the direction from the first cluster point cloud position to each neighboring point cloud position according to formula (4), calculate the angle between the normal vector of each neighboring point cloud and the direction from the first cluster point cloud position to each neighboring point cloud position according to formula (5), cluster all the initial point clouds that meet formula (6) in the neighboring point cloud closest to the first cluster point cloud position with the first cluster point cloud to obtain the second cluster point cloud, calculate the normal vector and position of the second cluster point cloud according to formula (2), and so on, until there is no initial point cloud that meets formula (6) to be clustered, and take the last Nth cluster point cloud as the first candidate point cloud; N is the number of clustering in this step; Repeat steps 4.4 to 4.5 , Satisfies formula (6) but The initial point cloud that does not satisfy equation (6) is used as the first point cloud to be screened; Repeat steps 4.4 to 4.5 , The initial point cloud that does not satisfy equation (6) is taken as the first unclustered point cloud; Step 5: Perform cylindrical fitting on the first candidate point cloud to obtain the first fitting cylinder and the radius, axis and axis direction vector of the first fitting cylinder. Calculate the number of points on the first fitting cylinder surface in the first candidate point cloud according to the following formulas (7) and (8): The number of points in the first candidate point cloud Percentage ; In formula (7), R is the radius of the first fitting cylinder, is the axis direction vector of the first fitting cylinder, is the coordinate of any point on the axis of the first fitting cylinder, is the coordinate of any point in the first candidate point cloud; ; In formula (8), is the number of points in the first candidate point cloud that satisfy equation (8), i.e., the number of points located on the first fitting cylindrical surface; like , the first candidate point cloud obtained in step 4.5 is used as the first candidate cylinder point cloud, the first point cloud to be screened in step 4.5 is used as the first cylinder point cloud to be screened, the first unclustered point cloud in step 4.5 is used as the first unclustered cylinder point cloud, the first fitting cylinder is used as the first candidate fitting cylinder, the axis of the first fitting cylinder is used as the first fitting axis, and the radius of the first fitting cylinder is used as the first fitting radius ; like , randomly select one of the initial point clouds with the least points from the first unclustered point cloud obtained in step 4.5 as the second point cloud and substitute it into step 4 until step 4..5 to obtain the second candidate point cloud, the second point cloud to be screened and the second unclustered point cloud, then perform cylinder fitting on the second candidate point cloud to obtain the second fitting cylinder and the radius, axis and axis direction vector of the second fitting cylinder, and calculate the percentage of the number of points on the second fitting cylinder in the second candidate point cloud to the number of points in the second candidate point cloud according to formulas (7) and (8): , and so on, until , take the second candidate point cloud as the first candidate cylinder point cloud, take the second point cloud to be screened as the first cylinder point cloud to be screened, take the second unclustered point cloud as the first unclustered cylinder point cloud, take the second fitting cylinder as the first candidate fitting cylinder, take the axis of the second fitting cylinder as the first fitting axis, and take the radius of the second fitting cylinder as the first fitting radius ; Step 6: Calculate the angle between the normal vector of each initial point cloud in the first cylindrical point cloud to be screened and the first fitting axis according to formula (9) ; In formula (9), is the first fitting axis direction vector, is the normal vector of each initial point cloud in the first cylindrical point cloud to be screened; Step 6.1: Calculate the distance from each initial point cloud to the first fitting axis in the first cylindrical point cloud to be screened according to formula (10) ; In formula (10), is the position of each initial point cloud in the first cylindrical point cloud to be screened, is the coordinate of any point on the first fitting axis; All the initial point clouds satisfying the following formula (11) in the first to-be-screened cylindrical point cloud are clustered with the first candidate cylindrical point cloud to form the first candidate cylindrical clustered point cloud, and the number of initial point clouds in the first candidate cylindrical clustered point cloud is recorded as ; Step 6.2: Perform cylinder fitting on the first candidate cylinder cluster point cloud to obtain the third fitting cylinder and its radius, axis and axis direction vector. Calculate the percentage of the number of points on the third fitting cylinder surface in the first candidate cylinder cluster point cloud to the number of points in the first candidate cylinder cluster point cloud according to equations (7) and (8): ; like or , the first candidate cylinder cluster point cloud is used as the rough point cloud of the cabin; like and , calculate the angle between the normal vector of each initial point cloud in the first unclustered cylindrical point cloud finally obtained in step 5 and the first fitting axis according to formula (9), calculate the distance from each initial point cloud in the first unclustered point cloud to the first fitting axis according to formula (10), cluster all the initial point clouds in the first unclustered cylindrical point cloud that satisfy formula (11) with the first candidate cylindrical clustered point cloud to form a rough point cloud of the cabin; Step 7: Perform cylindrical fitting on the rough point cloud of the cabin to obtain the second fitting axis, the direction vector of the second fitting axis and the second fitting radius. According to the following formula (12), the angle between the normal vector of each initial point cloud that does not satisfy formula (11) in step 6 and the second fitting axis is calculated respectively: ; In formula (12), is the direction vector of the second fitting axis, is the normal vector of the initial point cloud that does not satisfy equation (11) in step 6; Will The initial point cloud closest to 0° and containing the most points is taken as the first flange plane point cloud; Step 8: Orthogonally project the rough point cloud of the cabin section onto the plane where the first flange plane point cloud is located, and generate a plane grayscale image with the intersection of the second fitting axis on the plane where the first flange plane point cloud is located as the center; Step 9: Use the DLA-34 neural network to extract features from the planar grayscale image; The extracted features are input into a multi-layer convolutional neural network to identify multiple plane circles and obtain the coordinates and radii of all plane circles; The plane circle whose center is shortest in distance to the intersection of the second fitting axis on the plane where the flange plane point cloud is located and whose radius length has the smallest difference with the third fitting radius length is taken as the projection of the cabin outer wall point cloud; Points in the rough point cloud of the cabin corresponding to the projection points on the circumference of the plane circle are used to form a candidate point cloud of the outer wall of the first cabin; the diameter of the plane circle is the outer diameter of the cabin; Step 10: Perform cylindrical fitting on the candidate point cloud of the outer wall of the first compartment to obtain the third fitting axis and the direction vector of the third fitting axis , calculate the flange plane point cloud normal vector according to formula (13) Angle with the third fitting axis ; like , taking the first cabin outer wall candidate point cloud as the cabin outer wall point cloud, taking the third fitting axis as the cabin axis, and taking the direction vector of the third fitting axis as the direction vector of the cabin axis; like or , calculate the fourth fitting axis and the fourth fitting axis direction vector according to formula (14) , bring the fourth fitting axis into step 7-step 10 to obtain the second flange plane point cloud and the second compartment outer wall candidate point cloud, then perform cylindrical fitting on the second compartment outer wall candidate point cloud to obtain the fifth fitting axis and the direction vector of the fifth fitting axis, and calculate the angle between the second flange plane point cloud and the fifth fitting axis according to formula (13): , and so on, until , the candidate point cloud of the second compartment outer wall is used as the compartment outer wall point cloud, the fifth fitting axis is used as the compartment axis, and the direction vector of the fifth fourth fitting axis is used as the compartment axis direction vector ; In formula (14), c is the weight coefficient, 0 <c<1; Step 11: Orthogonally project the point cloud of the cabin outer wall onto the cabin axis, and calculate the cabin length according to the following formula (15): ; ; In formula (15), The direction vector of the compartment axis; is the coordinate of the midpoint of the cabin outer wall point cloud, is the coordinate of any point on the axis of the compartment.

2. The method for automatically measuring the outer diameter and length of a compartment according to claim 1, characterized in that: The cylinder fitting adopts the least square method.

3. The method for automatically measuring the outer diameter and length of a compartment according to claim 1, characterized in that: In step 8, pixel grid division is performed with the intersection of the second fitting axis and the plane where the first flange plane point cloud is located as the center. The length and width of the pixel grid are set to the difference between the upper error limit and the lower error limit of the point cloud measurement equipment. The number of projected points in each pixel grid is taken as the grayscale value, normalized to the range of 0-255, and a plane grayscale image is obtained. The length and width of the plane grayscale image are set to 1.3 times the known theoretical outer diameter of the cabin.

Citation Information

Cited By

  • Circle diameter measurement error compensation method based on CCD image sensor

    CN120635176A