A centerline fitting method for aviation pipelines based on joint constraints of normal and curvature
Through the combination of the joint constraint method based on normal and curvature and the AP-Net model, the problems of low efficiency and insufficient accuracy in aviation pipeline centerline measurement are solved, and efficient and accurate aviation pipeline centerline measurement is achieved.
Patent Information
- Application Number
- CN202411001038.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-25
AI Technical Summary
Traditional measurement methods result in low efficiency and low accuracy in measuring the centerline of aviation pipelines, making it difficult to install accurately in strict layout spaces.
The joint constraint method based on normal and curvature is used to preprocess the aviation pipeline point cloud data, and the AP-Net model is combined for image detection and least squares fitting to achieve high-precision measurement of the aviation pipeline centerline.
It improves measurement efficiency and accuracy, reduces manual intervention, enhances automation, and ensures the reliability and accuracy of measurement results.
Smart Images

Figure CN118537389B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of three-dimensional point cloud data processing, and in particular to an aviation pipeline centerline fitting method based on normal and curvature joint constraints. Background Art
[0002] During the aircraft assembly process, the position of aviation pipeline installation is particularly important. Due to the strict layout space restrictions, the overlapping and complex shapes of the pipelines, measuring the installation position of the pipeline has always been a major challenge. The centerline is an important feature of the aviation pipeline location, which indicates the ideal position and direction of the pipeline installation.
[0003] In aircraft design and manufacturing, it is crucial to determine the centerline position of the pipeline, as it directly affects the performance, stability and safety of the aircraft. However, traditional measurements mostly use manual measurement methods, which have problems such as low measurement efficiency, heavy tasks, and cumbersome procedures. In addition, due to the uncertainty of the centerline, the measurement results of the pipeline installation position are less accurate, making it more difficult to install the pipeline in a strictly restricted layout space. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides an aviation pipeline centerline fitting method based on the joint constraints of normal and curvature, which solves the current technical problem that it is difficult to accurately fit the centerline of the aviation pipeline.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for fitting the centerline of an aviation pipeline based on the joint constraints of normal and curvature, the method comprising the following steps:
[0006] S1. Obtain the input point cloud data of the aviation pipeline in any area and calculate the normal vector of each point in the input point cloud data. and principal curvature ;
[0007] S2, according to the normal vector of each point and principal curvature Applying joint constraints of normal and principal curvature to input point cloud data to obtain preprocessed pipeline point cloud data;
[0008] S3, using the AP-Net model to detect the aviation pipeline image, and output the pipeline location information including the pipeline center point and bounding box;
[0009] S4. Cluster the pipeline point cloud data according to the pipeline position information to obtain the main pipeline point cloud data of the aviation pipeline, and use the least squares method to perform centerline fitting on the main pipeline point cloud data.
[0010] Furthermore, in step S1, the specific process includes the following steps:
[0011] S11. Use KNN method to find any point in the input point cloud data The n nearest neighbors of ;
[0012] S12, calculate n nearest neighbor points The covariance matrix C of is:
[0013] ;
[0014] in, Represents n nearest neighbors The average coordinates of
[0015] S13, perform eigenvalue decomposition on the covariance matrix C, and take the eigenvector corresponding to the minimum eigenvalue as the point The normal vector of is:
[0016] ;
[0017] in, Indicate point The normal vector of Represents the minimum eigenvalue corresponding to the covariance matrix C The corresponding eigenvector;
[0018] S14, according to the minimum eigenvalue corresponding to the covariance matrix C and the maximum eigenvalue Calculation Point The principal curvature ,Right now:
[0019] ;
[0020] in, is the maximum eigenvalue corresponding to the covariance matrix C.
[0021] Furthermore, in step S2, the specific process includes the following steps:
[0022] S21, Randomly search for points Neighboring points , then point and adjacent points The difference in the normal angles is ;
[0023] S22, according to the difference of normal angle Define the normal angle error function , normal angle error function for:
[0024] ;
[0025] in, is the resolution of the input point cloud data acquisition device; D is the diameter of the pipeline when it is designed;
[0026] S23, calculate the principal curvatures respectively The curvature constraint error function ;
[0027] Principal curvature The curvature constraint error function for:
[0028] ;
[0029] Principal curvature The curvature constraint error function for:
[0030] ;
[0031] S24, according to the normal angle error function and the curvature constraint error function Determine the joint constraints of normal and curvature ,Right now:
[0032] ;
[0033] in, is the weight coefficient;
[0034] S25. Based on joint constraints Judgment Point Whether the constraints are met;
[0035] like When, it indicates a point If the constraints are met, the point is retained ;
[0036] like When, it indicates a point If the constraints are not met, delete the point ,in is the threshold of the error function.
[0037] Furthermore, in step S3, the specific process includes the following steps:
[0038] S31, obtaining image data containing the center point and bounding box of each pipeline as a training set;
[0039] S32, training the AP-Net model using the training set to adjust internal parameters of the AP-Net model;
[0040] S33. The aviation pipeline image is input into the trained AP-Net model to obtain pipeline location information for accurately locating the pipeline position.
[0041] Further, in step S32, the specific process includes the following steps:
[0042] S321. Generate a heat map of the ground truth of key points in the input image I during the prediction phase of the AP-Net model , and according to the heat map Locate the center point of the aviation pipeline;
[0043] S322. Use loss function Train the prediction phase of the AP-Net model;
[0044] S323, through the loss function Train the local bias term and use it to compensate the center point;
[0045] S324, generate the width and height of the bounding box centered on the key point according to the center point, that is, the pipeline position information including the pipeline center point and the bounding box, and use the loss function Conduct training;
[0046] S325. Construct a loss function for training the AP-Net model ,in:
[0047] ;
[0048] in, .
[0049] Furthermore, in step S321, the specific process includes the following steps:
[0050] S3211, detect the current Whether there is an air pipeline in the coordinates, assuming the category The corresponding one is the aviation pipeline;
[0051] when When The aviation pipeline is detected in the current coordinates and enters S3211;
[0052] when When There is no air pipeline in the current coordinates;
[0053] S3212, according to category Each ground truth key point , calculate a low-resolution equivalent of ,in, ,
[0054] S3213, using Gaussian function Splice all groundtruth keypoints into the heatmap middle, is the object size adaptive standard deviation;
[0055] S3214, based on the true center point of the aviation pipeline , width, and height to calculate the Gaussian kernel function , generate the real center point heat map of the aviation pipeline;
[0056] S3215. Perform non-maximum suppression (NMS) on the real center point heat map predicted by the AP-Net model to determine the prediction of the final center point of the air pipeline.
[0057] Furthermore, in step S322, the loss function The expression is:
[0058] ;
[0059] in, and is a hyperparameter of the loss function; is the number of keypoints in a single image; Indicates the pixel position Belongs to category ; is the model's prediction at pixel location Belongs to category probability.
[0060] Furthermore, in step S323, the loss function The expression is:
[0061] ;
[0062] in, is the bias value predicted by the network; It is a value calculated in advance during the training process;
[0063] The expression of the local bias term is: ;
[0064] Where W and H are the width and height of the input image I respectively; is the step size of the output corresponding to the original image.
[0065] Furthermore, in step S4, the specific process includes the following steps:
[0066] S41, mapping the pipeline location information to the three-dimensional point cloud space, and using a hierarchical clustering method to obtain the main pipeline point cloud data;
[0067] S42, establishing a least square fitting model based on the three-dimensional curve model C;
[0068] S43, calculate each point in the main pipeline point cloud data The residual ,Right now:
[0069] ;
[0070] S44, based on residual Calculation Point The residual sum of squares ,Right now:
[0071] ;
[0072] in, is all the points in the main pipeline point cloud, The radius fitted by the point cloud of the main pipeline;
[0073] S45, continuously optimize the residual sum of squares The parameters in make the residual sum of squares of all points in the main pipeline point cloud data The best least squares fitting model is obtained by minimizing the fitting, which is the center line of the main pipeline point cloud data.
[0074] By means of the above technical solution, the present invention provides an aviation pipeline centerline fitting method based on the joint constraints of normal and curvature, which has at least the following beneficial effects:
[0075] 1. The present invention realizes the rapid measurement of the center line of the aviation pipeline by processing the aviation pipeline point cloud data, which not only solves the problems of low measurement efficiency, heavy tasks, and complicated procedures, but also realizes high-precision measurement and ensures the reliability of the measurement results.
[0076] 2. The present invention improves the accuracy of fitting by preprocessing the point cloud and applying constraints. At the same time, it combines the AP-Net model to realize image detection, reduces manual intervention, and comprehensively utilizes multiple technologies such as point cloud processing, image detection and mathematical modeling to improve the efficiency and automation of fitting, and also improves the accuracy and efficiency of pipeline centerline fitting.
[0077] 3. The present invention utilizes a point cloud preprocessing step based on curvature and normal to effectively filter out noise points and retain key information, combines the image data training model to achieve accurate pipeline positioning, and finally performs centerline fitting through hierarchical clustering and least squares method, thereby realizing an efficient aviation pipeline centerline fitting method. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0079] Figure 1 It is a flow chart of the aviation pipeline centerline fitting method of the present invention;
[0080] Figure 2 The AP-Net network structure diagram for outputting pipeline location information of the present invention;
[0081] Figure 3 This is the clustering result diagram of the main pipeline point cloud data of the present invention. DETAILED DESCRIPTION
[0082] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.
[0083] In recent years, with the development and popularization of 3D scanning technology, 3D scanning technology has been widely used in military equipment measurement, mapping, industrial manufacturing and cultural heritage protection. 3D scanning technology is a technology that collects the spatial coordinates of a large number of discrete points on the surface of an object and converts these point cloud data into a digital 3D model. It can capture detailed information such as the shape, size, surface texture, etc. of an object, and convert the physical object into a digital form, which is convenient for subsequent analysis, design, simulation, manufacturing and other applications. Therefore, using 3D scanning technology to collect point cloud data of aviation pipelines and combining it with advanced point cloud processing algorithms for subsequent processing will inevitably improve the measurement efficiency of the centerline of aviation pipelines.
[0084] The pipeline system is one of the main components of the aircraft system. In modern aircraft, there are many pipeline systems with liquid or gas as the working medium. These systems are mainly composed of closed pipeline channels with pressure, consisting of hard pipes, hoses, joints, connectors and pipeline fixings to ensure that the liquid or gas flows and transfers energy in the channel. In the aircraft assembly process, the position of aviation pipeline installation is particularly important. Due to the strict layout space restrictions, the overlapping and staggered pipelines and complex shapes, measuring the installation position of the pipeline has always been a major problem. The centerline is an important feature of the location of aviation pipelines, which indicates the ideal location and direction of pipeline installation. In aircraft design and manufacturing, it is crucial to determine the centerline position of the pipeline because it directly affects the performance, stability and safety of the aircraft. Traditional measurements mostly use manual measurement methods, which have problems such as low measurement efficiency, heavy tasks and cumbersome processes. Therefore, measuring the centerline of aviation pipelines is of great significance. How to achieve centerline measurement of aviation pipelines and ensure high precision and high efficiency is a hot issue that needs to be solved urgently.
[0085] Based on the technical defects of the existing technology, please refer to Figure 1-Figure 3 This embodiment proposes a centerline fitting method for aviation pipelines based on the joint constraints of normal and curvature. It uses the point cloud preprocessing steps based on curvature and normal to effectively filter noise points and retain key information. It combines the image data training model to achieve accurate pipeline positioning. Finally, it performs centerline fitting through hierarchical clustering and least squares method, realizing an efficient centerline fitting method for aviation pipelines. The method includes the following steps:
[0086] S1. Obtain the input point cloud data of the aviation pipeline in any area and calculate the normal vector of each point in the input point cloud data. and principal curvature ; In step S1, the specific process includes the following steps:
[0087] S11. Use KNN method to find any point in the input point cloud data The n nearest neighbors of ;
[0088] S12, calculate n nearest neighbor points The covariance matrix C of is:
[0089] ;
[0090] in, Represents n nearest neighbors The average coordinates of
[0091] S13, perform eigenvalue decomposition on the covariance matrix C, and take the eigenvector corresponding to the minimum eigenvalue as the point The normal vector of is:
[0092] ;
[0093] in, Indicate point The normal vector of Represents the minimum eigenvalue corresponding to the covariance matrix C The corresponding eigenvector;
[0094] S14, according to the minimum eigenvalue corresponding to the covariance matrix C and the maximum eigenvalue Calculation Point The principal curvature ,Right now:
[0095] ;
[0096] in, is the maximum eigenvalue corresponding to the covariance matrix C.
[0097] In this embodiment, it is assumed that there is a point in the input point cloud data , use the KNN method to find its 5 nearest neighbor points, assuming that its 5 nearest neighbor points are , then the covariance matrix C can be expressed as: .in Represents the average coordinates of the five nearest neighbor points. Then perform eigenvalue decomposition on the covariance matrix C and take the eigenvector corresponding to the minimum eigenvalue as the target point The normal vector of : . Indicate point The normal vector of Represents the minimum eigenvalue corresponding to the covariance matrix C The corresponding feature vector.
[0098] The principal curvature The calculation formula is:
[0099] ;
[0100] in, are the maximum and minimum eigenvalues corresponding to the covariance matrix C respectively.
[0101] S2, according to the normal vector of each point and principal curvature Applying the joint constraint of the normal and the principal curvature to the input point cloud data obtains the preprocessed pipeline point cloud data; in step S2, the specific process includes the following steps:
[0102] S21, Randomly search for points Neighboring points , then point and adjacent points The difference in the normal angles is ;
[0103] S22, according to the difference of normal angle Define the normal angle error function , normal angle error function for:
[0104] ;
[0105] in, is the resolution of the input point cloud data acquisition device; D is the diameter of the pipeline when it is designed;
[0106] S23, calculate the principal curvatures respectively The curvature constraint error function ;
[0107] Principal curvature The curvature constraint error function for:
[0108] ;
[0109] Principal curvature The curvature constraint error function for:
[0110] ;
[0111] S24, according to the normal angle error function and the curvature constraint error function Determine the joint constraints of normal and curvature ,Right now:
[0112] ;
[0113] in, is the weight coefficient;
[0114] S25. Based on joint constraints Judgment Point Whether the constraints are met;
[0115] like When, it indicates a point If the constraints are met, the point is retained. ;
[0116] like When, it indicates a point If the constraints are not met, delete the point ,in is the threshold of the error function, The value of needs to be determined according to the diameter of the pipeline, so it is not specifically limited here.
[0117] This embodiment uses a joint constraint strategy and combines the normal and principal curvature information of the point cloud to accurately retain the pipeline point cloud data and effectively remove noise interference, thereby maintaining the integrity and accuracy of the pipeline point cloud data to the greatest extent.
[0118] S3, using the AP-Net model to detect the air pipeline image, and output the pipeline location information including the pipeline center point and the bounding box; wherein the air pipeline image and the location of the air pipeline in any area in S1 are in the same area, that is, the air pipeline in the area is photographed using an industrial camera or other shooting equipment to obtain the corresponding air pipeline image. Figure 2 As shown in the figure, the AP-Net model uses deep convolutional neural networks such as ResNet, DLA, and Hourglass as the backbone network and adopts a multi-scale feature fusion strategy to achieve accurate detection of aviation pipelines.
[0119] The AP-Net model is suitable for the detection of image data of aviation pipelines, and can efficiently and concisely extract the center point and bounding box of the pipeline. Compared with the traditional two-stage detection method, the AP-Net model has higher efficiency and accuracy in aviation pipeline detection, and is particularly good at processing small or dense targets. It also has multi-scale detection and good scalability. In step S3, the specific process includes the following steps:
[0120] S31, obtaining image data containing the center point and bounding box of each pipeline as a training set;
[0121] The image data including the center point and the boundary box of each pipeline can be obtained from a known database, or can be obtained after image acquisition and annotation according to actual conditions, which will not be described in detail here.
[0122] S32, training the AP-Net model using the training set to adjust the internal parameters of the AP-Net model; in step S32, the specific process includes the following steps:
[0123] S321. Generate a heat map of the ground truth of key points in the input image I during the prediction phase of the AP-Net model , and according to the heat map Locate the center point of the aviation pipeline; the input image is ,in and are the width and height of the image respectively. When predicting, the AP-Net model generates a heat map of key points, namely: ,in is the step size of the output corresponding to the original image, and is the number of detection categories corresponding to target detection. In step S321, the specific process includes the following steps:
[0124] S3211, detect the current Whether there is an air pipeline in the coordinates, assuming the category The corresponding one is the aviation pipeline;
[0125] when When The aviation pipeline is detected in the current coordinates and enters S3211;
[0126] when When There is no air pipeline in the current coordinates;
[0127] It should be noted that The AP-Net model predicts that Belongs to category The result of; input pipeline image Extract feature maps through convolutional neural networks , from the feature map Get the heat map , for the category , heat map Each pixel position Corresponding to a value , indicating that the location is a category possibility;
[0128] Set a threshold , used to determine which positions in the heat map are the center. If the heat map In Location The value at is greater than the threshold , then it is believed that The category was detected Objects, otherwise not detected:
[0129] ;
[0130] That is, based on feature extraction and calculation of the output feature map, the threshold is used to determine whether the position Detected categories of objects. is the convolutional layer; is the sigmoid function, which compresses the output to scope; The initial value of the threshold is set to 0.5, and then it is continuously adjusted to the optimal value based on the training effect of the network.
[0131] S3212, according to category Each ground truth key point , calculate a low-resolution equivalent of ,in, ;
[0132] S3213, using Gaussian function Splice all groundtruth keypoints into the heatmap middle;
[0133] in, is the object size adaptive standard deviation; it is adjusted during training based on the dataset and pipeline distribution.
[0134] S3214, based on the true center point of the aviation pipeline , width, and height to calculate the Gaussian kernel function , generate the real center point heat map of the aviation pipeline;
[0135] S3215. Perform non-maximum suppression (NMS) on the real center point heat map predicted by the AP-Net model to determine the prediction of the final center point of the air pipeline.
[0136] Specifically, input pipeline image Extract feature maps through convolutional neural networks , from the feature map Generate heat map through convolution layer , width and height and offset map ;
[0137] According to the true center point of the aviation pipeline The Gaussian kernel function is calculated based on the width and height of the air pipeline to generate the real center point heat map of the air pipeline. Finally, non-maximum suppression (NMS) is performed on the heat map predicted by the network to determine the final center point prediction of the air pipeline.
[0138] and All are convolutional layers.
[0139] S322. Use loss function The prediction phase of the AP-Net model is trained; the loss function The expression is:
[0140] ;
[0141] in, and is a hyperparameter of the loss function; is the number of keypoints in a single image; Indicates the pixel position Belongs to category ; is the model's prediction at pixel location Belongs to category probability.
[0142] S323, through the loss function The local bias term is trained and used to compensate the center point; where:
[0143] Loss Function The expression is:
[0144] ;
[0145] in, is the bias value predicted by the network; It is a value calculated in advance during the training process;
[0146] The expression of the local bias term is: ;
[0147] Where W and H are the width and height of the input image I respectively; is the step size of the output corresponding to the original image.
[0148] In this embodiment, the AP-Net model performs Downsampling will cause precision errors when the feature map is remapped to the original image, so a local bias value is used for the center point of each air pipeline: To compensate for it, use the loss function To train this bias value, the accuracy error caused by remapping the feature map to the original image is eliminated.
[0149] S324, generate the width and height of the bounding box centered on the key point according to the center point, that is, the pipeline position information including the pipeline center point and the bounding box, and use the loss function Conduct training;
[0150] In this embodiment, it is assumed that is the bounding box of target k, which belongs to the aviation pipeline category , its center point is . Use the key points to predict all the center points, and then regress the size of each target k, and finally regress to and use As the predicted value. In this process, the loss function is used Conduct training.
[0151] S325. Construct a loss function for training the AP-Net model ,in:
[0152] ;
[0153] in, .
[0154] The training method proposed in this embodiment can learn the feature representation and morphological information of the pipeline in the image by continuously adjusting the internal network parameters of the AP-Net model during the training process, thereby accurately locating and identifying the position and shape of the pipeline in the image.
[0155] S33, the aerial pipeline image is input into the trained AP-Net model to obtain pipeline location information for accurately locating the pipeline location. In this step, the center point and bounding box of the pipeline are identified by the AP-Net model and the information is output, so that the location of the pipeline can be more accurately located.
[0156] S4, clustering the pipeline point cloud data according to the pipeline position information to obtain the main pipeline point cloud data of the aviation pipeline, and using the least squares method to perform centerline fitting on the main pipeline point cloud data; in step S4, the specific process includes the following steps:
[0157] S41, mapping the pipeline location information to the three-dimensional point cloud space, and using the hierarchical clustering method to obtain the main pipeline point cloud data, such as Figure 3 As shown in Figure 1, Euclidean distance is used as the metric. and Point The Euclidean distance between for:
[0158] ;
[0159] In this embodiment, by setting the Euclidean distance threshold to , taking each point in the pipeline point cloud as an initial cluster, calculating the Euclidean distance between each pair of points, and merging the points with a Euclidean distance less than As the merging progresses, the distance between points in the point cloud is updated, and this process is repeated until all points are merged to a distance greater than until the cluster.
[0160] S42, establishing a least square fitting model based on the three-dimensional curve model C;
[0161] S43, calculate each point in the main pipeline point cloud data The residual ; A least square fitting model is established by selecting a suitable three-dimensional curve model C. The parameter equation of the three-dimensional curve model C is: .
[0162] S44, based on residual Calculation Point The residual sum of squares In this embodiment, it is assumed that there is a point , and its residual is expressed as:
[0163] ;
[0164] Then, the residual sum of squares of all points in the main pipeline point cloud data is expressed as:
[0165] ;
[0166] in, is all the points in the main pipeline point cloud, The radius of the main pipeline point cloud fitting.
[0167] S45, continuously optimize the residual sum of squares The parameters in make the residual sum of squares of all points in the main pipeline point cloud data The best least squares fitting model is obtained by minimizing the fitting, and the best least squares fitting model is the center line of the main pipeline point cloud data.
[0168] The present invention realizes rapid measurement of the center line of the aviation pipeline by processing the aviation pipeline point cloud data, which not only solves the problems of low measurement efficiency, heavy tasks, and complicated procedures, but also realizes high-precision measurement and ensures the reliability of the measurement results.
[0169] The present invention improves the accuracy of fitting by preprocessing point clouds and imposing constraints. It also combines the AP-Net model to realize image detection, reduces manual intervention, and comprehensively utilizes multiple technologies such as point cloud processing, image detection, and mathematical modeling to improve the efficiency and automation of fitting, and also improves the accuracy and efficiency of pipeline centerline fitting.
[0170] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, so the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0171] The above implementation methods have been described in detail. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for fitting the centerline of an aviation pipeline based on the joint constraints of normal and curvature, characterized in that: The method comprises the following steps: S1. Obtain the input point cloud data of the aviation pipeline in any area and calculate the normal vector N(P) of each point in the input point cloud data. i ) and principal curvatures k1, k2; S2, according to the normal vector N(P i ) and the principal curvatures k1 and k2 impose the joint constraints of the normal and the principal curvature on the input point cloud data to obtain the preprocessed pipeline point cloud data. The specific process includes the following steps: S21. Randomly search for point P i The adjacent point P j , then point P i and adjacent point P j The difference in the normal angle is θ(P i ,P j ); S22, according to the difference in normal angle θ(P i ,P j ) Define the normal angle error function L θ , normal angle error function L θ for: L θ =θ(P i ,P j )-θ0 Among them, Δd is the resolution of the input point cloud data acquisition device; D is the diameter of the pipeline when it is designed; S23, respectively calculate the curvature constraint error function of the principal curvatures k1 and k2 Curvature constraint error function for principal curvature k1 for: Curvature constraint error function for principal curvature k2 for: S24, according to the normal angle error function L θ and the curvature constraint error function Determine the joint constraint f(P i ,θ,k1,k2), that is: Among them, l0, l1, l2 are weight coefficients; S25, according to the joint constraint f(P i ,θ,k1,k2) judgment point P i Whether the constraints are met; If |f(P i ,θ,k1,k2)|≤σ, indicating point P i If the constraints are met, then point P is retained. i ; If |f(P i ,θ,k1,k2)|>σ, indicating point P i If the constraint condition is not met, delete point P. i , where σ is the threshold of the error function; S3. Use the AP-Net model to detect the aviation pipeline image and output the pipeline location information including the pipeline center point and the bounding box. The specific process includes the following steps: S31, obtaining image data containing the center point and bounding box of each pipeline as a training set; S32: training the AP-Net model using the training set to adjust the internal parameters of the AP-Net model. The specific process includes the following steps: S321. Generate a heat map of the ground truth of key points in the input image I during the prediction phase of the AP-Net model And according to the heat map Locate the center point of the aviation pipeline; S322, using the loss function L0 to train the prediction phase of the AP-Net model; S323, training the local bias term through the loss function L1, and using the local bias term to compensate the center point; S324, generating the width and height of the bounding box centered on the key point according to the center point, that is, the pipeline position information including the pipeline center point and the bounding box, and using the loss function L2 for training; S325. Construct the loss function L for training the AP-Net model det ,in: L det =L0+λ1L1+λ2L2 Among them, λ1=0.1, λ2=1; S33, the aviation pipeline image is input into the trained AP-Net model to obtain pipeline position information for accurately locating the pipeline position; S4. Clustering the pipeline point cloud data according to the pipeline position information to obtain the main pipeline point cloud data of the aviation pipeline, and using the least squares method to perform centerline fitting on the main pipeline point cloud data. The specific process includes the following steps: S41, mapping the pipeline location information to the three-dimensional point cloud space, and using a hierarchical clustering method to obtain the main pipeline point cloud data; S42, establishing a least square fitting model based on the three-dimensional curve model C; S43, calculate each point M in the main pipeline point cloud data i The residual e(M i ,C), that is: S44, according to the residual e(M i ,C) Calculation point M i The residual sum of squares E is: Among them, n is the number of all points in the main pipeline point cloud, and r is the radius fitted by the main pipeline point cloud; S45. Continuously optimize the parameters in the residual sum of squares E to minimize the residual sum of squares E of all points in the main pipeline point cloud data and fit the best least squares fitting model, which is the center line of the main pipeline point cloud data.
2. The aviation pipeline centerline fitting method according to claim 1, characterized in that: In step S1, the specific process includes the following steps: S11. Use KNN method to find any point P in the input point cloud data i The n nearest neighbors of P ij ,j=1,2,3,…; S12, calculate n nearest neighbor points P ij The covariance matrix C of is: in, Represents n nearest neighbor points P ij The average coordinates of S13, perform eigenvalue decomposition on the covariance matrix C, and take the eigenvector corresponding to the minimum eigenvalue as point P i The normal vector of is: N(P i )=eigenvector3; Among them, N(P i ) represents point P i The normal vector of ; eigenvector3 represents the eigenvector corresponding to the minimum eigenvalue λ3 of the covariance matrix C; S14, calculate point P according to the minimum eigenvalue λ3 and the maximum eigenvalue λ1 corresponding to the covariance matrix C i The principal curvatures k1 and k2 are: Among them, λ1 is the maximum eigenvalue corresponding to the covariance matrix C.
3. The aviation pipeline centerline fitting method according to claim 1, characterized in that: In step S321, the specific process includes the following steps: S3211, detecting whether there is an aviation pipeline in the current (x, y) coordinate of the input image I, assuming that the category p corresponds to the aviation pipeline; when , it means that the aviation pipeline is detected in the current (x, y) coordinates and enters S3211; when , it means that there is no aviation pipeline in the current (x, y) coordinate; S3212, according to each ground truth key point p∈R of category p 2 , calculate a low-resolution equivalent of in, S3213, using Gaussian function Splice all ground truth key points into the heat map In p is the object size adaptive standard deviation; S3214, based on the true center point of the aviation pipeline Width and height calculation Gaussian kernel function Y xyp , generate the real center point heat map of the aviation pipeline; S3215. Perform non-maximum suppression (NMS) on the real center point heat map predicted by the AP-Net model to determine the prediction of the final center point of the air pipeline.
4. The aviation pipeline centerline fitting method according to claim 1, characterized in that: In step S322, the expression of the loss function L0 is: Among them, α and β are the hyperparameters of the loss function; N is the number of key points in a single image; Y xyp Indicates whether the pixel position (x, y) belongs to category p; is the model's predicted probability that the pixel at position (x, y) belongs to category p.
5. The aviation pipeline centerline fitting method according to claim 1, characterized in that: In step S323, the expression of the loss function L1 is: in, is the bias value predicted by the network; It is a value calculated in advance during the training process; The expression of the local bias term is: Where W and H are the width and height of the input image I respectively; l is the step size of the output corresponding to the original image.
