Pipeline reconstruction and detection method based on virtual adapter

By optimizing pipeline inspection through a multi-camera vision system and SVD decomposition method, the camera viewing angle limitation and stitching error problems are solved, and high-precision pipeline accessory feature restoration and measurement data integrity are achieved.

CN120765646AActive Publication Date: 2025-10-10XINTUO 3D TECH (XIAN) CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202511271480.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-10-10
Estimated Expiration
2045-09-08

AI Technical Summary

Technical Problem

The existing technology has camera viewing angle limitations in pipeline accessory measurement, resulting in measurement blind spots. Multi-position shooting and stitching produce cumulative errors, making it difficult to fully restore the characteristics of pipeline accessories. In addition, the multi-viewing system cannot adapt to complex accessories.

Method used

A multi-viewing system is used to collect multi-angle images of the pipeline. The initial transformation matrix is ​​calculated by the SVD decomposition method. The projection point pixels and gradients are combined to iteratively optimize the objective function. The edge points are screened to adjust the matrix optimization and finally form a complete pipeline model.

Benefits of technology

It eliminates measurement blind spots, reduces pre-processing steps and the number of transfer and splicing times, improves pipeline detection accuracy and operational efficiency, adapts to pipelines with complex accessories, and ensures the integrity and reliability of measurement data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120765646A_ABST
    Figure CN120765646A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of three-dimensional measurement and digital reconstruction, and particularly discloses a pipeline reconstruction and detection method based on a virtual adapter, and the method comprises the steps: collecting a multi-angle image of a to-be-detected pipeline through a multi-view vision system, reconstructing the pipeline, and determining a bending point; the pipelines are aligned with the matched bending points, and an initial conversion matrix of a measurement and digital-analog coordinate system is obtained based on an SVD decomposition method; the digital-analog pipeline accessory is projected to a camera image, and an adjustment matrix is obtained through optimization of the minimum pixel sum and the maximum gradient sum; threshold screen edge points are set, and a final conversion matrix is obtained through maximum gradient sum optimization after projection; and converting the accessories to a measurement coordinate system, splicing the accessories with the reconstructed pipeline to form a complete model, and comparing the characteristic deviation of the bending points and the accessories. According to the invention, through initial calibration, projection optimization and edge point fine adjustment of coordinate conversion, pipelines containing complex accessories such as flanges, valves and the like are adapted, the characteristics of the pipelines and the accessories are completely restored, and the pipeline detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of three-dimensional measurement and digital reconstruction, and in particular relates to a pipeline reconstruction and detection method based on a virtual adapter. Background Art

[0002] Pipeline accessories, including flanges, valves, and clamps, are key components in piping systems, beyond straight pipe sections. They are crucial for ensuring system structural integrity, intelligent response, and safe operation. Flanges enable modular assembly and sealing, while valves control flow and ensure safety. Precise measurement has become a core requirement for ensuring system operation.

[0003] The main measurement methods currently include: contact measurement using three-coordinate equipment is suitable for complex and detachable accessories, which has high precision but has high operating requirements and a long cycle; structured light scanners can quickly obtain point clouds of complex accessories, but are affected by ambient light, and large accessories require multiple splicing and error accumulation; laser scanners are suitable for on-site measurement of large accessories, with a wide range but time-consuming scanning and splicing, and difficulty in capturing narrow spaces; multi-eye vision measurement systems are suitable for large pipelines and can quickly reconstruct data, but are limited to pipelines with fixed geometric shapes.

[0004] Existing technologies have significant bottlenecks: measurement blind spots are formed due to the limitation of camera viewing angle, resulting in incomplete feature information and long measurement cycles; multi-position shooting and stitching produce cumulative errors due to lighting differences; it is difficult to fully restore the characteristics of pipeline accessories; multi-viewing systems cannot adapt to pipelines with complex accessories, and targeted measurement methods are urgently needed. Summary of the Invention

[0005] The purpose of the present invention is to overcome the defects in the prior art and provide a pipeline reconstruction and detection method based on a virtual adapter.

[0006] The present invention provides a pipeline reconstruction and detection method based on a virtual adapter, comprising the following steps: S1. Collect multi-angle images of the pipeline to be tested through a multi-eye vision system, reconstruct the pipeline to be tested and determine the bending point data of the pipeline to be tested; S2. Determine the corresponding relationship between the bending point of the pipeline to be measured and the bending point of the corresponding digital model of the pipeline to be measured by aligning the pipeline, and calculate the initial transformation matrix from the measurement coordinate system to the digital model coordinate system based on the SVD decomposition method. ; S3, project the pipe accessories in the digital model to the image plane of each camera through the initial transformation matrix and camera parameters, and iteratively optimize the objective function by minimizing the sum of projected point pixels and maximizing the sum of gradients to obtain the adjustment matrix ; S4. Set the threshold range and adjust the matrix Filter the edge points of pipe accessories that meet the threshold conditions and project the edge points to the image plane to maximize the edge point gradient and adjust the matrix for the objective function optimization , and get the final transformation matrix ; S5. The pipe accessories in the digital model are connected through Convert to the measurement coordinate system and splice it with the reconstructed pipeline to be tested in step S1 to form a complete pipeline model. Compare the bending point position deviation and pipeline accessory feature deviation between the pipeline to be tested and the digital model.

[0007] A further solution is that in step S1, the multi-camera vision system needs to be calibrated before collecting images. After calibration, the pipeline to be measured is placed in the measurement area, and the calibrated multi-camera vision system is used to photograph the pipeline to obtain pipeline images from all camera perspectives. The calibration process of the multi-camera vision system is as follows: Use a calibration plate that matches the measurement format, adjust the calibration plate's posture, and capture multiple sets of images using a multi-camera vision system. Based on the principle of close-range photogrammetry, the intrinsic and extrinsic parameters of each camera are solved; The internal parameters include: lens focal length , the camera's principal point deviation ( ), distortion deviation of camera lens ( ); The external parameters include: the rotation matrix from the measurement coordinate system to the camera coordinate system , translation matrix .

[0008] A further solution is that in step S2, the bending point analysis process of the pipeline to be tested is: The reconstructed tube model is sampled along the central axis and the local curvature is calculated with a fixed step size; Distinguish straight segments from curved segments by using curvature change thresholds; Fit the central axis of each straight line segment and solve the intersection of the axes of adjacent straight line segments as the bending point; The curvature change threshold is a preset threshold. A segment whose curvature change is less than the curvature change threshold is determined as a straight segment; a segment whose curvature change is greater than the curvature change threshold is determined as a bend segment.

[0009] A further solution is that in step S2, the initial transformation matrix The acquisition process is: The bending points of the pipeline to be tested obtained through actual measurement are analyzed according to their actual distribution order in space to analyze the connection structure relationship between them; For the pre-defined bending points in the numerical model, analyze the connection structure relationship at the design level according to the planning sequence in the design stage; Compare the two connection structure relationships, and on the basis of the consistency of the connection structure relationships between the two, match the bending point set of the pipeline to be tested with the bending point set of the digital model; Based on the existing bending points of the pipeline to be tested and the bending points of the corresponding digital model, the SVD decomposition method is applied to determine the initial transformation matrix of the measurement coordinate system where the pipeline to be tested is located and the digital model coordinate system where the digital model is located , the initial transformation matrix satisfy ; in, is the set of bending points of the pipeline to be tested, is the bending point set of the digital model; is the rotation matrix from the digital-analog coordinate system to the measurement coordinate system, is the translation matrix from the digital-analog coordinate system to the measurement coordinate system.

[0010] A further solution is that in step S3, the matrix is ​​adjusted The calculation process is: Set the digital model pipeline attachment points Through the initial transformation matrix Projection to the camera image coordinate system: ; in, yes Convert image point coordinates from the digital-analog coordinate system to the two-dimensional image coordinate system; Represents the specific transformation and projection matrix relationship, The formulas included are: ; in, The set of point coordinates of the pipe accessories representing the digital model in the measurement coordinate system; Project the pipe accessories from the measurement coordinate system to the camera's two-dimensional image coordinate system. The projection process expression is: ; in, It is the position coordinate of a certain point on the pipeline accessory in the measurement coordinate system; It is a point on the pipe fitting The actual image point coordinates projected from the measurement coordinate system to the two-dimensional image coordinate system, ( , , ) is the coordinate of the camera optical center in the measurement coordinate system, 、 Respectively expressed as: ; in, 、 、……、 Both are rotation components, used to describe the rotation relationship between the two coordinate systems. , , is the coordinate of the camera's optical center in the measurement coordinate system, which is used to describe the translation relationship between the two coordinate systems; Taking the maximum gradient sum and the minimum pixel sum as the objective function, the The two-dimensional projection point set is iteratively calculated to adjust the matrix transformation relationship from the digital model coordinate system to the measurement coordinate system .

[0011] A further solution is that in step S3, the objective function is constructed as follows: The coordinate point set of the pipeline accessories in the image coordinate system of a certain camera is: ; Calculate the pixel value and gradient sum for each projection point set in each camera image: ; Combine the pixel sum and the gradient sum to construct the global objective function: ; Where, express the magnitude of the image gradient in the camera image; express Image pixel values ​​in the camera image; Indicates the number of image points of the pipeline accessories in the current camera image; Indicates the number of all cameras in the vision system, .

[0012] A further solution is to A certain 2D image point on the pipe accessory, its image gradient Expressed as: ;

[0013] ; Where, Represents the gradient of the pixel value of the image in the horizontal direction; Represents the gradient of the pixel value of the image in the height direction.

[0014] A further solution is that in step S4, the optimization adjustment matrix The process is: Based on the adjustment matrix Set the digital model pipeline attachment points Transform to the measurement coordinate system: ; in, The set of point coordinates of the pipe accessories representing the digital model in the measurement coordinate system; Apply matrix transformation relationships , the normal vector set of each point on the pipeline accessories of the digital model in the digital model coordinate system Convert to the measurement coordinate system and get the corresponding normal vector set , the expression is as follows: ; For each camera in the vision system, connect the optical center to A point in Construction Point Light ; Calculating light and the corresponding normal vector Angle ; Set the angle threshold range [ 、 ], retain the angle Points in this range constitute the edge point candidate set ; The edge point candidate set The points in are projected onto the two-dimensional image plane of the corresponding camera to obtain a two-dimensional image point set ; Set pixel threshold , filter the two-dimensional image point set The pixel value is lower than Points, get the valid edge point set ; For each camera in the multi-view system, calculate the effective edge point set The image gradient sum of the projection point in the image is used to iteratively optimize the adjustment matrix with the maximum image gradient sum as the objective function , output the final transformation matrix .

[0015] A further solution is that step S5 includes: The pipe accessory point cloud in the digital model is transformed through the final transformation matrix Convert to the measurement coordinate system; The converted pipeline accessory point cloud is spatially spliced ​​with the pipeline point cloud to be measured reconstructed in step S1 to form a complete pipeline three-dimensional model including the pipeline accessories and the pipe body; Based on the complete pipeline 3D model, the following tests are performed: Compare the spatial position deviation between the bend point of the pipeline to be tested and the bend point of the digital model; Compare the key characteristic dimensional deviations of pipeline accessories, including at least one of the flange hole angle deviation, valve mounting surface position deviation, or clamp center distance deviation.

[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention reconstructs the pipe body data through a multi-eye vision system, combines the optimization of the digital-analog projection relationship with the fine adjustment of edge points, breaks through the camera's viewing angle limitation to eliminate measurement blind spots, and eliminates the need for pre-processing such as marking point pasting and matte paint spraying on the pipe surface, reducing the number of transfer stations and splicing times. At the same time, through initial calibration of coordinate transformation, projection optimization, and fine adjustment of edge points to adapt to pipelines containing complex accessories such as flanges and valves, the characteristics of the pipelines and accessories are completely restored, thereby improving the accuracy of pipeline detection.

[0017] The present invention uses the SVD decomposition method to achieve initial alignment of bending points, combines the projection point gradient and the pixel and objective function to iteratively optimize the coordinate transformation relationship, and then uses edge point screening and gradient sum maximization to fine-tune, effectively eliminating the cumulative splicing errors caused by changes in lighting and shadows, making the detection of pipeline bending point position deviations and accessory feature deviations more accurate, further ensuring the reliability of complete measurement data, and providing a high-precision foundation for subsequent detection.

[0018] The present invention eliminates the surface pretreatment step and reduces the number of transfer stations and splicing times, thereby improving operational efficiency while ensuring complete measurement. At the same time, it breaks through the limitation of existing multi-eye vision systems that are only applicable to cross-sectionally symmetrical pipelines, and can effectively process pipelines with complex features such as flange hole positions, valve mounting surfaces, and clamp center distances. The pipeline accessories are converted from the digital-analog coordinate system to the measurement coordinate system through the final conversion matrix, and are spliced ​​with the pipe body data to form a complete three-dimensional model containing the pipe body and accessories, ensuring the spatial consistency of the measurement data, and providing complete data support for the accurate detection of bending point position deviations and accessory feature size deviations, making the results of the complete measurement more valuable in application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The following drawings are merely provided for illustrative purposes only and are not intended to limit the scope of the present invention. Figure 1 : Reconstruction and detection flow chart of the present invention; Figure 2 : Digital model with some pipe accessories (flange); Figure 3 : Schematic diagram of the camera imaging point residual geometric model; Figure 4 : Schematic diagram of coordinate system projection relationship; Figure 5 : The image of flange (pipeline accessory) projected on each camera; Figure 6 : Schematic diagram of the camera image of the flange after objective function adjustment. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution, design method and advantages of the present invention more clear, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0021] like Figure 1 As shown, the present invention provides a pipeline reconstruction and detection method based on a virtual adapter, comprising the following steps: S1. Collect multi-angle images of the pipeline to be tested through a multi-eye vision system, reconstruct the pipeline to be tested and determine the bending point data of the pipeline to be tested; wherein, the multi-eye vision system is composed of at least two industrial cameras, which are fixed around the pipeline to be tested by a bracket to form a multi-view observation network; when implementing this step, first calibrate the multi-eye vision system, determine the internal and external parameters of the multi-eye vision system, and establish a measurement coordinate system with the center of the shooting format of the multi-eye vision system as the origin. Among them, the internal and external parameters of the multi-eye vision system are important parameters for establishing the connection between three-dimensional space coordinates and two-dimensional image coordinates. Then, use the calibrated vision system to shoot or scan the pipeline to be tested, obtain the image or point cloud data of the pipeline to be tested, and three-dimensionally reconstruct the pipe type data of the pipeline to be tested excluding the pipeline accessories. Finally, distinguish the straight segments and bending segments of the reconstructed pipe type model, and digitize the reconstructed pipeline to be tested, and solve the intersection of the axes of adjacent straight segments of the pipeline to be tested as the bending point; S2. Determine the corresponding relationship between the bending point of the pipeline to be measured and the bending point of the corresponding digital model of the pipeline to be measured by aligning the pipeline, and calculate the initial transformation matrix from the measurement coordinate system to the digital model coordinate system based on the SVD decomposition method. During implementation, first extract the bending point data of the pipeline to be tested and analyze the bending point data of the digital model; then, through pipeline alignment, determine the corresponding relationship between the bending points of the pipeline to be tested and the bending points of the digital model; finally, based on the existing bending points of the pipeline to be tested and the corresponding bending points of the digital model, apply the SVD (singular value) decomposition method to determine the initial transformation matrix between the measurement coordinate system of the pipeline to be tested and the digital model coordinate system of the pipeline digital model , where the projection relationship between coordinate systems is as follows Figure 4 As shown; S3, the pipe accessories in the digital model (such as Figure 2 As shown in the figure, the digital model of the flange is projected onto the image plane of each camera through the initial transformation matrix and camera parameters. The projection results are shown in Figure 5As shown, taking the flange as an example, its image in each camera is displayed, minimizing the sum of projected point pixels and maximizing the gradient sum as the objective function to iteratively optimize and obtain the adjustment matrix , the image of the adjusted flange in the camera is as follows Figure 6 As shown, multiple images correspond to different camera angles in the multi-eye vision system, and after adjusting the matrix The optimized flange projection image, each image corresponds to a camera's observation angle, and Figure 5 compared to, Figure 6 After the image in the image is optimized through the minimum pixel sum, maximum gradient and objective function, the projection position of the flange is more consistent with the actual image characteristics, making the edge clearer and more clearly distinguishable from the background, reflecting the accuracy improvement after the optimization of the coordinate transformation matrix; specifically, the matrix transformation relationship is determined by pipeline alignment , combined with the internal and external parameters of the camera determined in the calibration phase, the matrix transformation relationship of the digital model pipeline accessories projected into each camera image is established; then, with the maximum gradient sum and the minimum pixel sum as the objective function, the image point coordinates of the digital model pipeline accessories in all camera images are required to adjust the matrix transformation relationship between the measurement coordinate system and the digital model coordinate system, and output the adjusted adjustment matrix ; S4. Set the threshold range and adjust the matrix Filter the edge points of pipe accessories that meet the threshold conditions and project the edge points to the image plane to maximize the edge point gradient and adjust the matrix for the objective function optimization , and get the final transformation matrix Specifically, set the threshold range and combine it with the existing adjustment matrix , filter the edge points of pipe accessories that meet the threshold conditions. Then, continue to apply the adjustment matrix , combined with the internal and external parameters of the camera determined in the calibration phase, establish the matrix transformation relationship of the edge points of the digital model pipe accessories projected onto each camera image; it should be noted that before establishing this matrix transformation relationship, the edge points of the filtered pipe accessories must be projected back to the camera image coordinate system, and the pixel threshold must be set to filter and determine the edge projection points of the pipe accessories. Finally, with the maximum gradient sum as the objective function, the image point coordinates of the edge points of the digital model pipe accessories in all camera images are required to adjust the matrix transformation relationship between the measurement coordinate system and the digital model coordinate system, and output the final transformation matrix. .

[0022] S5. Transform the pipe fittings in the digital model through the final conversion matrix Convert to the measurement coordinate system, and splice it with the reconstructed pipeline to be tested in step S1 to form a complete pipeline model, and compare the bending point position deviation and pipeline accessory feature deviation of the pipeline to be tested with the digital model. Specifically, the pipeline accessory point cloud in the digital model is converted through the final transformation matrix Convert to measurement coordinate system; spatially splice the converted pipeline accessory point cloud with the reconstructed pipeline point cloud in step S1 to form a complete pipeline three-dimensional model containing the pipeline accessories and the pipeline body; based on the complete pipeline three-dimensional model, the following detections are performed: comparison of the spatial position deviation of the bend points of the pipeline to be measured and the bend points of the numerical model; comparison of the key feature size deviation of the pipeline accessories, including at least one of the flange hole position angle deviation, the valve mounting surface position deviation, or the clamp center distance deviation.

[0023] In the above, the calibration method of the multi-view vision system comprises: using a calibration board matched with the measurement surface, continuously adjusting the pose of the calibration board, based on the close-range photogrammetry principle, the multi-view vision system captures the calibration board in different poses to solve the internal and external parameters of the multi-view vision system, and a measurement coordinate system with the center point of the calibration board as the origin is established. The internal parameters include: lens focal length , principal point deviation of the camera , distortion deviation of the camera lens ; the external parameters include: rotation matrix , translation matrix from the measurement coordinate system to the camera coordinate system. The method for solving the bend point comprises: sampling the reconstructed pipeline model along the center axis to calculate the local curvature with a fixed step size; distinguishing a straight line segment from a bend segment by a curvature change threshold; fitting the center axis of each straight line segment to solve the intersection point of the axes of adjacent straight line segments as the bend point; The curvature change threshold is a preset threshold. A segment with a curvature change less than the curvature change threshold is determined as a straight line segment, and a segment with a curvature change greater than the curvature change threshold is determined as a bend segment.

[0024] In step S2, the process of determining the correspondence relationship between the bend points of the pipeline to be measured and the bend points of the corresponding numerical model of the pipeline to be measured through pipeline alignment is as follows: first, determine all the bend points of the pipeline to be measured according to pipeline digitization; at the same time, analyze the numerical model corresponding to the pipeline to be measured to determine all the bend points of the numerical model. Then, determine the correspondence relationship between all the bend points of the pipeline to be measured and the bend points of the numerical model by applying pipeline alignment. Finally, based on the existing bend points of the pipeline to be measured and the bend points of the corresponding numerical model, apply the SVD (singular value) decomposition method to determine the initial conversion matrix between the measurement coordinate system in which the pipeline to be measured is located and the numerical model coordinate system in which the numerical model is located. The formula is expressed as follows: ; Wherein, , are the bend point set of the pipeline to be measured and the bend point set of the numerical model of the pipeline, respectively. , They are the rotation matrix relationship and translation matrix relationship from the digital-analog coordinate system to the measurement coordinate system respectively; Represents the matrix transformation relationship from the digital-analog coordinate system to the measurement coordinate system.

[0025] In step S3, the initial transformation matrix is ​​iteratively optimized to minimize the sum of the projected point pixels and maximize the gradient sum as the objective function The process is: Initial transformation matrix determined based on pipeline alignment , combined with the internal and external parameters of the camera determined by calibration, the matrix transformation relationship of the digital model pipeline accessories projected to each camera image is established. The formula is expressed as follows: ; in, Is the set of points on the pipe accessories Convert and project the image point coordinates from the digital-analog coordinate system to the two-dimensional image coordinate system; Represents the specific transformation and projection matrix relationship, The actual formula included is as follows: ; in, A set of point coordinates representing the piping accessories of the digital model in the measurement coordinate system.

[0026] Combined with the camera's internal and external parameters determined by calibration, the pipe accessories are projected from the measurement coordinate system to the camera's two-dimensional image coordinate system. The projection process is expressed as follows: ; in, It is the position coordinate of a certain point on the pipeline accessory in the measurement coordinate system; Figure 3 As shown, It is a point on the pipe fitting The actual image point coordinates projected from the measurement coordinate system to the two-dimensional image coordinate system, It is a point on the pipe fitting Theoretical image point coordinates projected from the measurement coordinate system to the two-dimensional image coordinate system; is the image point deviation caused by the distortion of the camera lens; ( ) is the principal point deviation of the camera; is the focal length of the lens, which is also the distance from the optical center of the lens to the principal point of the image plane; 、 are the rotation matrix and translation matrix from the measurement coordinate system to the camera coordinate system, respectively, and: ; in, 、 、……、 Both are rotation components, used to describe the rotation relationship between the two coordinate systems. , , is the coordinate of the camera's optical center in the measurement coordinate system, which is used to describe the translation relationship between the two coordinate systems; Then, the maximum gradient sum and the minimum pixel sum are used as the objective function to calculate the The two-dimensional projection point set is iteratively calculated to adjust the adjustment matrix from the digital model coordinate system to the measurement coordinate system .

[0027] The objective function is expressed as follows: The coordinate point set of the pipeline accessories in the image coordinate system of a certain camera is , in the camera image, calculate the sum of the image gradients and the sum of the image pixels corresponding to the image point coordinates of the pipeline accessories. Analysis shows that when all the image points of the pipeline accessories meet the maximum image gradient sum and the minimum pixel sum, the corresponding matrix transformation relationship between the digital-analog coordinate system and the measurement coordinate system reaches the optimal value, so the following objective function is defined : ; Where, represents the pixel sum, represents the gradient and, express The magnitude of the image gradient in the camera image, express image pixel values ​​in the camera image, Indicates the number of image points of pipeline accessories in the current camera image. . Apply all projection points of pipe accessories in the image coordinate system , requiring that in all camera images, the objective function minimize, Indicates the number of all cameras in the vision system, , Represents the total number of cameras in the multi-view vision system. Optimize and solve to obtain the adjustment matrix from the adjusted measurement coordinate system to the camera coordinate system Among them, the image gradient represents the rate of change of the pixel value of the image in the horizontal and height directions. For a certain 2D image point on the pipeline accessory, its image gradient It can be expressed as: ; ; Where, Represents the gradient of the pixel value of the image in the horizontal direction; Represents the gradient of the pixel value of the image in the height direction.

[0028] Considering that there may be special-shaped structures in the center area of ​​pipeline accessories in actual projects, the matrix is ​​adjusted. It is impossible to completely transform the pipe accessories from the measurement coordinate system to the digital model coordinate system, so the edge points of the pipe accessories are extracted, and the edge points of the pipe accessories are required to be projected back to the camera image to meet the maximum gradient, thereby adjusting the matrix transformation relationship between the measurement coordinate system and the digital model coordinate system. Specifically, in step S4, the final transformation matrix is ​​obtained. The process is: Set the threshold range and filter the edge points of pipe accessories that meet the threshold conditions. Apply the adjustment matrix after the first optimization , the point set of the digital model pipe accessories in the digital model coordinate system Converted to the measurement coordinate system, the expression is as follows: ; in, The point coordinate set of the pipeline accessories representing the digital model in its own digital model coordinate system; Represents the adjusted matrix The converted digital model of the pipe fittings is the set of point coordinates in the measurement coordinate system. At the same time, the adjustment matrix is ​​applied The normal vector set of each point on the pipeline accessories of the digital model in the digital model coordinate system Convert to the measurement coordinate system and get the corresponding normal vector set , the expression is as follows: ; Select a camera in the multi-view system and connect the optical center position of the camera with the point set A point in Construction Point Light , Indicates the number of spatial points of pipeline accessories in the measurement coordinate system. . And calculate the light and the corresponding normal vector Angle , set the upper and lower angle thresholds 、 , those that meet the threshold are the edge points of the pipe accessories under the current camera perspective; otherwise, they are the non-edge area points of the pipe accessories under the current camera perspective. The expression is as follows: ; Where, In the measurement coordinate system, point The corresponding light vector; In the measurement coordinate system, point The corresponding normal vector.

[0029] Then, continue to apply the matrix transformation relationship , combined with the internal and external parameters of the camera determined in the calibration phase, the matrix transformation relationship of the edge points of the digital model pipe accessories projected to each camera image is established. Before establishing the matrix transformation relationship from the digital model coordinate system to the image coordinate system, the edge points of the pipe accessories need to be eliminated twice. After the above elimination process, the edge point set of the pipe accessories that meets the requirements in the measurement coordinate system can be preliminarily determined. Considering that the pipe accessories may have special-shaped feature structures, all edge point sets of the pipe accessories in the measurement coordinate system are eliminated. , projected back to the two-dimensional camera image coordinate system, and obtain the two-dimensional image point set . Set pixel threshold If the pixel value exceeds the threshold, the edge area point will continue to be retained; otherwise, the point will be determined as a non-edge area point and will be eliminated. The specific expression is: ; After two rounds of elimination, the edge point set of the pipeline accessories in the image coordinate system is determined. . Based on the edge point set The edge point set corresponding to the numerical model Establish a matrix transformation relationship, namely: ; It represents the matrix transformation relationship from the digital-analog coordinate system of the edge points of the pipe accessories to the measurement coordinate system, and then projecting from the measurement coordinate system to the camera image coordinate system.

[0030] Then, the maximum gradient sum and the minimum pixel sum are used as the objective function to calculate the The two-dimensional projection point set is iteratively calculated to adjust the matrix transformation relationship from the digital model coordinate system to the measurement coordinate system .

[0031] Finally, the maximum gradient sum is used as the objective function to calculate the The two-dimensional projection point set is iteratively calculated to adjust the matrix transformation relationship from the digital model coordinate system to the measurement coordinate system The specific solution process is as follows: ; Where, Representing a point set A point in Image gradient magnitude in the camera image; is the objective function with the maximum image coordinate gradient of all edge points in the camera image.

[0032] Execute the above optimized matrix transformation relationship for all cameras to obtain the accurate matrix transformation relationship The expression for all cameras to synchronously execute the above optimization process is: ; Where, Indicates the first A camera, .

[0033] In step S5, given the final transformation matrix , the point cloud of the pipe accessories can be converted from the digital model coordinate system to the measurement coordinate system to complete the measurement of the pipe accessories. Combined with the pipe body data determined by the pipeline measurement, the complete pipeline measurement data can be output. Pipe alignment is then applied to determine the measured deviation of the bend points of the measured pipe and the pipe digital model. The characteristic data of the pipe accessories is compared to determine the measured deviation of the measured pipe and the pipe accessories in the pipe digital model.

[0034] While various embodiments of the present invention have been described above, the above descriptions are intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A pipeline reconstruction and detection method based on a virtual adapter, characterized in that: The following steps are involved: S1. Collect multi-angle images of the pipeline to be tested through a multi-eye vision system, reconstruct the pipeline to be tested and determine the bending point data of the pipeline to be tested; S2. Determine the corresponding relationship between the bending point of the pipeline to be measured and the bending point of the corresponding digital model of the pipeline to be measured by aligning the pipeline, and calculate the initial transformation matrix from the measurement coordinate system to the digital model coordinate system based on the SVD decomposition method. ; S3, project the pipe accessories in the digital model to the image plane of each camera through the initial transformation matrix and camera parameters, and iteratively optimize the objective function by minimizing the sum of projected point pixels and maximizing the sum of gradients to obtain the adjustment matrix ; S4. Set the threshold range and adjust the matrix Filter the edge points of pipe accessories that meet the threshold conditions and project the edge points to the image plane to maximize the edge point gradient and optimize the adjustment matrix for the objective function , and get the final transformation matrix ; S5. Transform the pipe fittings in the digital model through the final conversion matrix Convert to the measurement coordinate system and splice it with the reconstructed pipeline to be tested in step S1 to form a complete pipeline model. Compare the bending point position deviation and pipeline accessory feature deviation between the pipeline to be tested and the digital model.

2. A pipeline reconstruction and detection method based on a virtual adapter according to claim 1, characterized in that: In step S1, the multi-camera vision system needs to be calibrated before collecting images. After calibration, the pipeline to be measured is placed in the measurement area, and the calibrated multi-camera vision system is used to photograph the pipeline to obtain pipeline images from all camera perspectives. The calibration process of the multi-camera vision system is as follows: Use a calibration plate that matches the measurement format, adjust the calibration plate's position, and capture multiple sets of images using a multi-camera vision system. Based on the principle of close-range photogrammetry, the intrinsic and extrinsic parameters of each camera are solved; The internal parameters include: lens focal length , the camera's principal point deviation ( ), distortion deviation of camera lens ( ); The external parameters include: the rotation matrix from the measurement coordinate system to the camera coordinate system , translation matrix .

3. A pipeline reconstruction and detection method based on a virtual adapter according to claim 2, characterized in that: In step S2, the bending point analysis process of the pipeline to be tested is as follows: The reconstructed tube model is sampled along the central axis and the local curvature is calculated with a fixed step size; Distinguish straight segments from curved segments by using curvature change thresholds; Fit the central axis of each straight line segment and solve the intersection of the axes of adjacent straight line segments as the bending point; The curvature change threshold is a preset threshold. A segment whose curvature change is less than the curvature change threshold is determined as a straight segment; a segment whose curvature change is greater than the curvature change threshold is determined as a bend segment.

4. A pipeline reconstruction and detection method based on a virtual adapter according to claim 3, characterized in that: In step S2, the initial transformation matrix The acquisition process is: The bending points of the pipeline to be tested obtained through actual measurement are analyzed according to their actual distribution order in space to analyze the connection structure relationship between them; For the pre-defined bending points in the numerical model, analyze the connection structure relationship at the design level according to the planning sequence in the design stage; Compare the two connection structure relationships, and on the basis of the consistency of the connection structure relationships between the two, match the bending point set of the pipeline to be tested with the bending point set of the digital model; Based on the existing bending points of the pipeline to be tested and the bending points of the corresponding digital model, the SVD decomposition method is applied to determine the initial transformation matrix of the measurement coordinate system where the pipeline to be tested is located and the digital model coordinate system where the digital model is located , the initial transformation matrix satisfy ; in, is the set of bending points of the pipeline to be tested, is the set of bending points of the digital model; is the rotation matrix from the digital-analog coordinate system to the measurement coordinate system, is the translation matrix from the digital-analog coordinate system to the measurement coordinate system.

5. A pipeline reconstruction and detection method based on a virtual adapter according to claim 4, characterized in that: In step S3, the matrix is ​​adjusted The calculation process is: Set the digital model pipeline attachment points Through the initial transformation matrix Projection to the camera image coordinate system: ; in, yes Convert image point coordinates from the digital-analog coordinate system to the two-dimensional image coordinate system; Represents the specific transformation and projection matrix relationship, The formulas included are: ; in, Represents the point coordinate set of the digital-analog pipeline accessories in the measurement coordinate system; Project the pipe accessories from the measurement coordinate system to the camera's two-dimensional image coordinate system. The projection process expression is: ; in, It is the position coordinate of a certain point on the pipeline accessory in the measurement coordinate system; It is a point on the pipe fitting The actual image point coordinates projected from the measurement coordinate system to the two-dimensional image coordinate system, ( , , ) is the coordinate of the camera optical center in the measurement coordinate system, 、 Respectively expressed as: ; ; in, 、 、……、 Both are rotation components, used to describe the rotation relationship between the two coordinate systems. , , is the coordinate of the camera's optical center in the measurement coordinate system, which is used to describe the translation relationship between the two coordinate systems; Taking the maximum gradient sum and the minimum pixel sum as the objective function, for all cameras The two-dimensional projection point set is iteratively calculated to adjust the matrix transformation relationship from the digital model coordinate system to the measurement coordinate system .

6. A pipeline reconstruction and detection method based on a virtual adapter according to claim 5, characterized in that: In step S3, the objective function is constructed as follows: The coordinate point set of the pipeline accessories in the image coordinate system of a certain camera is: ; Calculate the pixel value and gradient sum for each projection point set in each camera image: ; ; Combine the pixel sum and the gradient sum to construct the global objective function:

7. In the formula, express the magnitude of the image gradient in the camera image; express Image pixel values ​​in the camera image; Indicates the number of image points of the pipeline accessories in the current camera image; Indicates the number of all cameras in the vision system, .

8. A pipeline reconstruction and detection method based on a virtual adapter according to claim 6, characterized in that: for A certain 2D image point on the pipe accessory, its image gradient Expressed as: ; ; Where, Represents the gradient of the pixel value of the image in the horizontal direction; Represents the gradient of the pixel value of the image in the height direction.

9. A pipeline reconstruction and detection method based on a virtual adapter according to claim 7, characterized in that: In step S4, the optimization adjustment matrix The process is: Based on the adjustment matrix Set the digital model pipeline attachment points Transform to the measurement coordinate system: ; in, The set of point coordinates of the pipe accessories representing the digital model in the measurement coordinate system; Apply matrix transformation relationships , the normal vector set of each point on the pipeline accessories of the digital model in the digital model coordinate system Convert to the measurement coordinate system and get the corresponding normal vector set , the expression is as follows: ; For each camera in the vision system, connect the optical center to A point in Construction Point Light ; Calculating light and the corresponding normal vector Angle ; Set the angle threshold range [ 、 ], retain the angle Points in this range constitute the edge point candidate set ; The edge point candidate set The points in are projected onto the two-dimensional image plane of the corresponding camera to obtain a two-dimensional image point set ; Set pixel threshold , filter the two-dimensional image point set The pixel value is lower than Points, get the valid edge point set ; For each camera in the multi-view system, calculate the effective edge point set The image gradient sum of the projection point in the image is used to iteratively optimize the adjustment matrix with the maximum image gradient sum as the objective function , output the final transformation matrix .

10. A pipeline reconstruction and detection method based on a virtual adapter according to claim 8, characterized in that: The step S5 comprises: The pipe accessory point cloud in the digital model is transformed through the final transformation matrix Convert to the measurement coordinate system; The converted pipeline accessory point cloud is spatially spliced ​​with the pipeline point cloud to be measured reconstructed in step S1 to form a complete pipeline three-dimensional model including the pipeline accessories and the pipe body; Based on the complete pipeline 3D model, the following tests are performed: Compare the spatial position deviation between the bend point of the pipeline to be tested and the bend point of the digital model; Compare the key characteristic dimensional deviations of pipeline accessories, including at least one of the flange hole angle deviation, valve mounting surface position deviation, or clamp center distance deviation.

Citation Information

Patent Citations

  • Complex multi-pipeline system detection method

    CN107218928A

  • Three-dimensional reconstruction method, device and equipment

    CN108288292A

  • Pipeline 3D reconstruction method combining topological relation and polar constraint

    CN109285210A

  • Pipeline measurement method based on multi-view vision

    CN110766669A

  • Pipeline reverse modeling method

    CN112487576A