3D pipe line mapping instrument
Patent Information
- Application Number
- CN202611344329.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-09-29
AI Technical Summary
[0008]管顶标高的测量、水上或水下的三维建模需要两个或多个设备分别下井测量,测量繁琐
(1)本发明中,通过将RGBD深度相机、可见光测距仪集成到一个测量终端上,能够实现对检查井的三维建模,同时通过可见光测距仪能够与检查井内的管顶对齐,通过竖向连接件上的刻度能够测得管顶标高,同时避免了现有技术中通过至少两次下井进行标高和建模,减少了下井次数,简化了下井步骤;融合深度信息,采用2D平面圆拟合和3D圆柱拟合算法,直接测量管道在RGBD深度相机坐标系下的真实尺寸,避免了拍摄距离和角度(拍摄的图像轴线倾斜)的影响,测量精度可达毫米级,适用于市政管网、工业管道、水下管道等多种检测场景。低成本地结合RGB图像与深度图像,既利用图像纹理进行交互式定位,又通过深度信息进行三维拟合,从根本上克服了纯二维视觉缺乏尺度信息的缺陷,为高精度测量奠定基础。通过生成多个候选圆柱轴线方向并进行择优,结合两次优化与异常值剔除,有效解决了圆柱拟合对初始值敏感的问题,显著提升了对点云噪声、局部遮挡及部分可见场景的鲁棒性,即使管道仅部分可见(如半水状态)或拍摄角度倾斜,仍能稳定拟合出准确的圆柱参数;通过多轴线尝试、异常值剔除等策略,即使在管道表面存在污渍、反光或部分遮挡的情况下,仍能稳定拟合圆柱,抗干扰能力强。无需将传感器伸入管道内部,只需手持RGBD深度相机拍摄管道图像,在平板上即可实时计算直径,操作简便,适用于各种复杂现场环境,提高了实用性;速度快:算法复杂度低,无需高性能计算设备,普通平板电脑或手机即可在数秒内完成测量,现场出结果;集成度高:同时输出2D圆拟合和3D圆柱拟合多种结果,用户可根据实际情况选择最优测量值,也可用于交叉验证。
Smart Images

Figure CN122835340A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of municipal engineering testing technology, and more specifically to a 3D pipeline mapping instrument. Background Technology
[0002] With the acceleration of urbanization, the digital and intelligent management of municipal drainage pipe networks, as core infrastructure of underground concealed engineering, has become a critical requirement for urban safety operation and maintenance. However, due to the complex structure, concealed spatial distribution, and lack of historical data of the pipe network system, its management still faces many challenges. Due to poor management of historical data, drainage pipe network data in many cities is scattered across different departments or storage media, and some data has even been lost or damaged, resulting in a lack of complete and accurate reference data when reconstructing the pipe network topology. Dynamically changing pipe network environments, such as pipe renovations, the addition of branch pipes, or emergency repairs, often fail to update data in a timely manner, causing a disconnect between the management system and the actual pipe network status. These problems not only reduce operation and maintenance efficiency but may also lead to safety hazards such as poor drainage, flooding, and even pipe collapses, threatening urban public safety.
[0003] Currently, pipe diameter measurement methods are mainly classified into the following categories: 1. Traditional contact measurement: This method involves directly contacting the inner wall of the pipe with tools such as calipers and measuring tapes. This method is cumbersome and difficult to implement for buried pipes, high-altitude pipes, or confined spaces; furthermore, human reading errors are significant, resulting in low efficiency and failing to meet the demands of modern rapid testing. 2. Non-contact measurement using laser sensors: A laser rangefinder or laser profile sensor is inserted into the pipe to scan its cross-section and acquire point cloud data, which is then used to calculate the diameter. This method has the following drawbacks: The sensor needs to be inserted into the pipe, which is difficult to achieve for eccentric wells, large well chambers, or curved pipes; the laser sensor must be strictly parallel to the pipe axis, otherwise the collected data will not be the true cross-sectional data, resulting in measurement errors; the operation is complicated and sensitive to ambient light and pipe material. 3. Two-dimensional vision measurement: This method involves capturing pipe images with a monocular camera, extracting pipe edges through image processing, and then calculating the diameter using geometric relationships. However, this method relies on two-dimensional image information, lacks depth dimension data, and the measurement results are greatly affected by the shooting distance and angle. In real-world environments, when the shooting distance is unknown or the camera's optical axis is not perpendicular to the pipe's axis, the measurement accuracy drops significantly. Furthermore, two-dimensional images struggle to distinguish between pipe surface texture and actual contours, resulting in large edge extraction errors and poor robustness against complex backgrounds. 4. 3D laser scanning: A 3D laser scanner is used to acquire point clouds of the pipeline, and the pipeline diameter is measured by modeling the point cloud. This method has high accuracy, but the equipment is expensive, bulky, and data processing is time-consuming, making it unsuitable for rapid on-site inspection.
[0004] Patent application CN120580256A discloses a method and system for 3D contour recognition of pipes against a background of the same color based on an RGBD camera. It acquires pipe data using an RGBD camera, identifies the image contour edges, and combines this with depth data to build a 3D point cloud model. The pipe axis (assuming the pipe is cylindrical) is extracted from the 3D point cloud model, and the pipe's spatial position is calculated, including the axis direction, position coordinates, the angle between the pipe axis and a reference direction, and the angle between the pipe flange and the reference direction. This patent requires the acquisition of complete pipe contour data, including flange connections, making it unsuitable for buried pipe measurement scenarios.
[0005] Patent application publication number CN118587268A discloses a method, system, medium, and device for fitting incomplete cylindrical point clouds. It calculates the normal direction of the segmented planes, generates multiple sets of cutting planes, projects and fits circular arcs, and then performs spatial straight-line fitting on the center of the circle to obtain the axis, ultimately solving for the cylinder's radius and length. This patent uses 3D equipment to collect point clouds, which is costly, and the collected data is incomplete cylindrical point cloud data. Furthermore, it requires idealized environmental conditions. In the first step, it calculates the normal direction of the segmented planes based on the cylindrical point cloud data, i.e., along the cylinder's axis, dividing it into multiple annular planes. However, for buried pipelines, generally only data from the opening can be collected; the interior of the pipeline is poorly lit, making it impossible to collect images of the pipe's interior. Secondly, during pipeline construction, it's impossible to guarantee that the pipeline axis is horizontal; if the axis is tilted, the fitted dimensions will be inaccurate.
[0006] Patent application publication number CN113822854A discloses a method for pipe type identification and structural parameter extraction based on 3D point clouds. This method is applicable to 3D point cloud data of pipes obtained from images taken inside the pipe. The method first identifies high-quality point cloud regions, calculates the pipe diameter, and adjusts the pipe pose to improve calculation accuracy and provide an initial pose. Next, the point cloud is segmented into regions, and the normal direction of each region is calculated based on its structural characteristics. Pipe type identification and structural feature information are obtained through the regional normal features of different pipe types. If the obtained pipe is a circular bend, the bend radius is calculated by fitting the bend using surface equations. This patent relies on a robot equipped with a vision system to collect data from inside the pipe. However, this method is more complex and redundant in the field of pipe surveying, involving type identification and structural feature analysis. Furthermore, it requires internal pipe data, resulting in large data volumes, slow identification, and an inability to meet the needs of rapid on-site measurement, and it is also costly.
[0007] Moreover, most cities still rely on traditional manual surveying methods for data collection, such as on-site geophysical exploration, which involves measuring information such as the pipe diameter, burial depth, latitude and longitude coordinates, and elevation coordinates of manholes.
[0008] Measuring the pipe top elevation and creating 3D models above or below water require two or more devices to be deployed into the well for measurement, which is cumbersome. Summary of the Invention
[0009] The technical problem to be solved by this invention is how to meet the requirements of high precision, strong robustness, low cost, and easy operation for rapid on-site measurement of underground pipe networks and simplify the steps of municipal drainage pipe network surveying.
[0010] This invention solves the above-mentioned technical problems through the following technical means: a 3D pipeline mapping instrument, capable of extending into the chamber of an inspection well, characterized in that it includes a vertical connector, a measuring terminal connected to the vertical connector, and a control terminal. The measuring terminal includes a terminal housing and an RGBD depth camera, a second camera, and a visible light rangefinder mounted on the terminal housing. The vertical connector is provided with a scale. The control terminal is communicatively connected to the measuring terminal and is configured to: acquire RGB images and depth images through the measuring terminal; acquire pipeline contour points in the RGB images to form a two-dimensional point set; perform circular fitting on the contour points to obtain the pixel radius, and calculate the pipeline diameter by combining it with the depth information, as the verification result of the 2D circle diameter calculation; extract 3D point clouds from the contour points and the depth images, perform 3D cylinder fitting based on the extracted 3D point clouds to obtain the pipeline diameter, as the verification result of the 3D diameter calculation; and perform multi-dimensional verification by combining the verification results of the 2D circle diameter calculation and the 3D diameter calculation to determine the credibility of the results.
[0011] As a preferred technical solution, obtaining the verification result of 2D circle diameter calculation includes: fitting a circle to the obtained two-dimensional point set using the least squares method to obtain the pixel circle radius; combining the pixel circle radius with depth information to obtain the pipe diameter; obtaining the verification result of 3D diameter calculation includes: extracting the principal component directions of the 3D point cloud coordinate axes using principal component analysis to generate multiple candidate cylinder axis directions; performing nonlinear least squares cylinder fitting on each of the multiple candidate cylinder axis directions to find the optimal axis and radius parameters, and selecting the optimal result as the verification result of 3D diameter calculation.
[0012] As a preferred technical solution, multiple candidate cylindrical axis directions are generated, including: Data centers for acquiring 3D point clouds: ; ; Calculate the covariance matrix: ; Perform eigenvalue decomposition on the covariance matrix: The eigenvalues satisfy the determinant: The feature vectors are obtained by solving the equations; and M vectors are randomly added to generate multiple candidate cylinder axis directions. in, For 3D point cloud data centers, The original point cloud coordinate matrix, For the centroid of the point cloud, For point cloud points, For the first One sample point, Let covariance matrix be the variance matrix. Transpose of a 3D point cloud data center. For the corresponding eigenvectors, For eigenvalues, It is an identity matrix.
[0013] As a preferred technical solution, nonlinear least-squares cylinder fitting is performed on each of the multiple candidate cylinder axis directions to find the optimal axis and radius parameters, including: Calculate initial parameters: use candidate directions as initial axes. The median center of the point cloud is used as the reference point on the initial axis. Calculate the median radial distance from all points to the axis as the initial radius. ;in, For reference point X, Y, Z axis coordinates This is the matrix transpose. Constructing the residual function: ;in, , For the residual vector, This is the difference vector from a spatial point to the axis reference point. for The projected length on the axis, The unit vector along the axis. Where is the radius of the cylinder. For spatial points The difference between the perpendicular distance to the cylinder axis and the estimated radius. For a spatial point in point cloud data, , , The X, Y, and Z coordinates are unit vectors along the axis of the cylinder. First optimization fitting: Fitting the parameters using nonlinear least squares method Optimize by iterating through parameters to minimize the sum of squared residuals; After the first optimization fit, outliers with residual absolute values greater than the threshold are removed. The remaining inliers are then used for a second nonlinear least squares optimization to minimize the sum of squared residuals. The parameters are iterated, and the root mean square error of the final fit is calculated. Among all candidate directions, the fitting parameter with the smallest root mean square error is selected as the result to be verified in the 3D diameter calculation.
[0014] As a preferred technical solution, 3D point cloud extraction is performed by combining contour points with depth information, including: Based on the contour points, a strip-shaped mask region with a certain thickness is generated. Desirable 1 pixel, traverse each pixel within the strip mask region If the depth value of the corresponding location in the depth image If effective, the pixel is converted into a 3D point in the RGBD depth camera coordinate system using the intrinsic parameters of the RGBD depth camera, which is then used as a 3D point cloud. The pipe contour points in the RGB image are obtained by manually drawing the pipe arc or by automatically detecting the edge.
[0015] As a preferred technical solution, a sonar is detachably connected to the terminal housing, and the control terminal is also configured to: acquire multiple frames of continuous sonar scan data; wherein, each frame of sonar scan data is the data acquisition end moving along the vertical direction of the inspection well, and each time it moves a distance, it completes one circumferential scan, including distance-angle data of the sonar facing the inner wall of the inspection well based on the single beam circumferential scan sonar, water depth data of the current scanning position, and pose data. The distance-angle data is transformed into coordinates and combined with water depth data to construct the horizontal cross-section of the inspection well corresponding to each frame of data, which serves as a local 3D point cloud of a single frame in the 3D model of the inspection well. A sliding window strategy combined with ICP registration algorithm and pose data is adopted to correct the pose offset during the movement of multi-frame horizontal sections, so that the layers are aligned. The optimized multi-frame horizontal sections are then stitched together to obtain the optimal 3D model of the inspection well.
[0016] As a preferred technical solution, the control terminal is further configured to: construct a horizontal section of the inspection well corresponding to each frame of data, including: After the distance-angle data is converted from polar coordinates to Cartesian coordinates, the center point of the current circumferential scan section is taken as the origin, the circumferential scan section is the XY plane, and the water depth at the current scanning position is the Z axis, thus constructing the horizontal section corresponding to each frame of data.
[0017] As a preferred technical solution, the control terminal is also configured to: acquire the optimal 3D model of the inspection well, including: S31. Establish the first frame reference point cloud, and calculate the direction difference between the local 3D point cloud of each subsequent frame and the local 3D point cloud of the previous frame. S32. Based on the orientation difference, the planar coordinates and pose data of the local 3D point cloud in the previous frame, construct the initial transformation matrix and perform ICP registration algorithm registration. S33. Perform ICP registration on the local 3D point cloud of the current frame and the local 3D point clouds of all historical frames within the sliding window respectively. During the registration process, select the effective registration results based on the evaluation index. S34. Based on the selection rules, select the optimal transformation matrix from the effective registration results; S35. Transform the local 3D point cloud of the current frame to the world coordinate system based on the optimal transformation matrix, and reconstruct to obtain the optimized local 3D point cloud; S36. Retain the most recent N frames of local 3D point cloud, and repeat steps S31-S35 until all frames of local 3D point cloud are reconstructed and stitched together to obtain the optimal inspection well 3D model; N is the preset sliding window size.
[0018] As a preferred technical solution, the control terminal is further configured to: clamp the direction difference, and construct a transformation matrix using the clamped direction difference; wherein, the method of clamping the direction difference is as follows: ; In the formula, The directional difference after clamping treatment The preset maximum yaw angle difference, For direction difference; The optimal transformation matrix is: ; In the formula, The optimal transformation matrix is... The rotation angle is about the Z-axis. , The translation in the XY direction within the plane; effective registration results are selected based on evaluation metrics, including: The registration results are evaluated for fit and root mean square error. Only registration results that meet the condition that the fit is greater than the fit threshold and the root mean square error is less than the root mean square error threshold are retained.
[0019] As a preferred technical solution, the control terminal is also configured such that the adaptability is obtained using the following formula: ; in, For compatibility, This refers to the number of interior points that meet the corresponding distance threshold during registration. This represents the total number of points in the point cloud of the current frame, where inlier points are determined as follows: ; ; In the formula, The maximum corresponding point distance is preset, and points that satisfy this formula are interior points. For the points in the current frame point cloud after a rigid transformation, For the point cloud in the current frame coordinates of an interior point For historical frames in the cloud and The corresponding nearest neighbor matching point coordinates, The Euclidean distance between the two points is... This is the optimal transformation matrix.
[0020] As the preferred technical solution, the selection rule is: select the registration result with the highest fit and the smallest root mean square error.
[0021] As a preferred technical solution, before performing ICP registration, dynamic distance filtering is first applied to the local 3D point cloud. This includes: calculating the distance from each point in the local 3D point cloud to the origin, determining a reasonable distance range based on dynamic threshold filtering, removing outliers that exceed this range, ensuring that enough valid contour points are retained, and obtaining the denoised local 3D point cloud for each frame. The dynamic threshold filtering is obtained through the following methods: ; In the formula, For the first The Euclidean distance from each scan point to the sonar center The minimum distance threshold, This is the maximum distance threshold.
[0022] As a preferred technical solution, the terminal housing is also equipped with signal acquisition equipment and geomagnetic direction angle acquisition equipment.
[0023] As a preferred technical solution, a control terminal is also included. A signal unit is provided at the end of the vertical connector away from the measurement terminal. The signal unit includes an RTK measuring instrument and a signal transmission device fixed on the vertical connector. The control terminal is electrically or communicatively connected to the signal output device, and the signal output device is electrically connected to the RGBD depth camera, visible light rangefinder, and sonar.
[0024] As a preferred technical solution, the two ends of the vertical connector are detachably fixed to the signal unit and the measurement terminal, respectively.
[0025] As a preferred technical solution, a depth measuring instrument and a lighting device are also fixedly connected to the terminal housing.
[0026] As a preferred technical solution, the vertical connector includes a telescopic rod, which includes a plurality of sleeve rods with different inner diameters that are fitted together in sequence, and adjacent sleeve rods are fixed by limiting clips.
[0027] As a preferred technical solution, the measuring ends of the RGBD depth camera and the visible light rangefinder are located on the same end face of the terminal housing.
[0028] As a preferred technical solution, the vertical connector is provided with a horizontal bubble.
[0029] As a preferred technical solution, a sonar bracket is detachably fixed at the bottom of the terminal housing, the sonar is fixedly connected to the sonar bracket, and a positioning rod is fixedly connected to the bottom of the sonar bracket.
[0030] As a preferred technical solution, a connecting block 1 is fixedly connected to one end of the sonar bracket connected to the terminal housing, and a connecting block 2 is provided at the other end of the terminal housing connected to the sonar bracket. The connecting block 1 is provided with at least one docking block, and the connecting block 2 is provided with a docking groove adapted to the docking block. The docking groove includes a vertical section and a horizontal section communicating with the vertical section.
[0031] The beneficial effects of this invention are as follows: (1) In this invention, by integrating an RGBD depth camera and a visible light rangefinder into a single measurement terminal, three-dimensional modeling of the inspection well can be achieved. Simultaneously, the visible light rangefinder can be used to align with the top of the pipe within the inspection well, and the elevation of the pipe top can be measured using the scale on the vertical connector. This avoids the need for at least two well-entry operations for elevation and modeling in existing technologies, reducing the number of well-entry attempts and simplifying the process. By fusing depth information and employing 2D planar circle fitting and 3D cylindrical fitting algorithms, the true dimensions of the pipe in the RGBD depth camera coordinate system can be directly measured, avoiding the influence of shooting distance and angle (inclination of the image axis). The measurement accuracy can reach millimeter level, making it suitable for various inspection scenarios such as municipal pipe networks, industrial pipelines, and underwater pipelines. This low-cost combination of RGB and depth images utilizes both image texture for interactive positioning and depth information for three-dimensional fitting, fundamentally overcoming the lack of scale information in pure two-dimensional vision and laying the foundation for high-precision measurement. By generating multiple candidate cylindrical axis directions and selecting the best one, combined with two optimizations and outlier removal, the problem of cylinder fitting being sensitive to initial values is effectively solved. This significantly improves robustness to point cloud noise, local occlusion, and partially visible scenes. Even when the pipe is only partially visible (e.g., in a semi-water state) or the shooting angle is tilted, accurate cylinder parameters can still be stably fitted. Through multi-axis trials and outlier removal strategies, cylinder fitting can still be stably performed even when there are stains, reflections, or partial occlusions on the pipe surface, demonstrating strong anti-interference capabilities. No sensor needs to be inserted into the pipe; simply take an image of the pipe with a handheld RGBD depth camera, and the diameter can be calculated in real time on a tablet. This simple operation is suitable for various complex field environments, improving practicality. It is fast: the algorithm has low complexity, requiring no high-performance computing equipment; ordinary tablets or mobile phones can complete the measurement within seconds, providing results on-site. It has high integration: it simultaneously outputs multiple results, including 2D circle fitting and 3D cylinder fitting, allowing users to select the optimal measurement value based on the actual situation, and can also be used for cross-validation.
[0032] (2) In this invention, by designing the terminal housing and the sonar bracket to be detachably connected, the sonar can be removed in the absence of water, which reduces the weight of the measurement terminal and the difficulty of surveying. At the same time, the vertical connector, the measurement terminal and the signal unit are set to be detachably connected, which facilitates transportation and carrying.
[0033] (3) In this invention, a single-beam ring scan sonar with a price of 30,000 to 60,000 yuan is selected to replace the multi-beam image sonar costing tens of thousands to hundreds of thousands of yuan; the fixed base, drive motor and electric lifting mechanism of the traditional solution are eliminated, and only a low-cost carbon fiber telescopic rod costing hundreds of yuan is used to lower the probe, which significantly reduces the investment in hardware procurement and maintenance.
[0034] (4) In this invention, on-site operation is convenient and efficient; the whole set of equipment is lightweight and can be easily deployed and data collected by hand without external power supply or complicated installation and debugging; a single underwater cavity contour acquisition only takes 3 to 5 minutes, which is suitable for rapid inspection and emergency investigation of municipal pipelines, and is more adaptable to narrow well chambers and restricted pipeline conditions.
[0035] (5) In this invention, portability and modeling accuracy are taken into account. To address the rotation and translation deviations of the interlayer contours caused by hand-held shaking and water flow impact, the ICP point cloud registration algorithm is used to correct the pose of each cross section layer by layer to achieve accurate alignment of the multi-layer contours. The three-dimensional reconstruction is completed by using the sonar scan contour as the XY coordinate and the water depth as the Z axis. Under the premise of simplifying the hardware architecture, the hand-held disturbance error is effectively offset, ensuring the accuracy of the three-dimensional model reconstruction of the underwater cavity, so as to measure the dimensions of the well chamber and pipeline.
[0036] (6) In this invention, to address the data rotation offset caused by jitter and water flow impact during the gradual release and slow insertion into the water, this invention proposes a method using pose optimization and point cloud registration to correct the rotation and offset of the edge contours between different water depths, aligning them between layers and establishing an accurate 3D model. This invention simplifies system design, reduces costs, and is quick and efficient to operate. It also solves the problems of data disturbance, offset, and rotation that arise after simplifying the system.
[0037] (7) In this invention, the ICP registration algorithm is used to automatically complete the stitching of multi-frame sonar data and global pose estimation, and the entire modeling process does not require manual intervention. Compared with the traditional L-bar manual measurement method, the automated process of this invention greatly improves the detection efficiency, while eliminating the subjective errors caused by manual recording and interpretation, ensuring the objectivity and repeatability of the modeling results. A three-dimensional model is directly generated and can be directly used for pipeline operation and maintenance, engineering design, and repair construction. The sonar probe is slowly lowered into the water using a handheld telescopic pole to collect spatial edge contour data, without the need for additional electric lifting equipment. Data collection takes approximately 3 to 5 minutes, making it highly efficient and fast in municipal pipeline network inspections.
[0038] (8) In this invention, the single-beam ring scan sonar can scan 360 degrees in all directions, without being limited by whether the wellhead position coincides with the center of the well chamber, and is suitable for various eccentric structures and large-diameter well chambers. Through the sliding window mechanism and structural change detection, the cumulative transmission of registration errors is effectively prevented, ensuring the accuracy of long-depth sequence modeling. Combined with dynamic distance threshold filtering, abnormal echoes in the sonar data (such as suspended matter in water and false echoes caused by multiple reflections) can be effectively removed, improving the point cloud quality. Through the registration quality evaluation index, structural change points such as the connection between the well chamber and the pipeline are automatically identified, avoiding model distortion caused by incorrect registration. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the overall structure provided in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the signal unit structure provided in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the measurement terminal structure provided in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the separated state of connecting block one and connecting block two provided in Embodiment 1 of the present invention; Figure 5 This is a schematic diagram of the docking groove structure provided in Embodiment 1 of the present invention; Figure 6 This is a schematic diagram of pipe top elevation measurement under waterless conditions provided in Embodiment 1 of the present invention, where a is the pipe top elevation; Figure 7 This is a schematic diagram of pipe top elevation measurement under water conditions provided in Embodiment 1 of the present invention, where a is the pipe top elevation; Figure 8 This is a schematic diagram of the vertical connector structure provided in Embodiment 1 of the present invention; Figure 9 This is a flowchart of the underground pipe diameter measurement method provided in Embodiment 2 of the present invention; Figure 10 This is a schematic diagram of the point cloud data of pipeline one in Embodiment 2 of the present invention; Figure 11 This is a schematic diagram of point cloud data extracted from a pipe opening in Embodiment 2 of the present invention; Figure 12 This is a schematic diagram of the measurement results of pipe 1 in Embodiment 2 of the present invention; Figure 13 This is a schematic diagram of the point cloud data of pipe two in Embodiment 2 of the present invention; Figure 14 This is a schematic diagram of the point cloud data extracted from the pipe opening of pipe 2 in Embodiment 2 of the present invention; Figure 15 This is a schematic diagram of the measurement results of pipe two in Embodiment 2 of the present invention; Figure 16 This is a schematic diagram of sonar scanning in Embodiment 3 of the present invention; Figure 17 This is a schematic diagram of sonar scanning in another scenario according to Embodiment 3 of the present invention; Figure 18 This is a comparison diagram before and after the optimization modeling in Embodiment 3 of the present invention; Figure 19 This is a comparison image before and after optimized modeling in another scenario of Embodiment 3 of the present invention; Reference numerals: 100, Signal unit; 101, RTK measuring instrument; 102, Signal transmission equipment; 103, Horizontal bubble; 200, Vertical connector; 201, Telescopic rod; 300, Measuring terminal; 301, Terminal housing; 302, RGBD depth camera; 303, Second camera; 304, Visible light rangefinder; 305, Sonar; 306, Water depth measuring instrument; 307, Signal acquisition equipment; 308, Battery; 309, Positioning rod; 310, Illumination component; 312, Sonar bracket; 313, Connecting block one; 314, Connecting block two; 315, Docking block; 316, Docking groove; 3161, Vertical section; 3162, Horizontal section; 400, Control terminal. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] Example 1 See Figure 1 A 3D pipeline mapping instrument includes a signal unit 100, a vertical connector 200, a measurement terminal 300, and a control terminal 400 (not shown in the figure). One end of the vertical connector 200 is detachably connected to the signal unit 100, and the other end is detachably connected to the measurement terminal 300. The measurement terminal 300 is electrically or communicatively connected to the control terminal 400, and the control terminal 400 includes a tablet computer, a PC, or an industrial control computer.
[0042] In this embodiment, the top of the vertical connector 200 facing the signal unit 100 is threadedly connected to the signal unit 100, and the bottom of the vertical connector 200 facing the measurement terminal 300 is threadedly connected to the measurement terminal 300. Of course, the connection between the vertical connector 200 and the signal unit 100 can also be made by snap-fit, interference fit, or other detachable means, and the connection between the other end of the vertical connector 200 and the measurement terminal 300 can also be made by snap-fit, interference fit, or other detachable means. The signal unit 100 includes an RTK (Real-Time Differential Positioning) measuring instrument 101 and a signal transmission device 102. The RTK measuring instrument 101 is used to acquire the latitude, longitude and elevation data of the measurement point to realize high-precision three-dimensional coordinate measurement of the inspection well. The RTK measuring instrument 101 can be selected from Haixingda iRTK20. The control terminal 400 communicates with the measurement terminal 300 through the signal transmission device 102. The RTK measuring instrument 101 is threaded to the top of the vertical connector 200, and the signal transmission device 102 is fixed to the vertical connector 200 by bolts. The signal transmission device 102 includes a WIFI transmitter or an industrial routing module.
[0043] See Figure 1 , Figure 8 In this embodiment, the vertical connector 200 includes a telescopic rod 201, which includes several sleeve rods with different inner diameters that are sequentially fitted together. Adjacent sleeve rods are fixed by limiting clips, which include U-shaped clips. The U-shaped clips are fitted onto the ends of each sleeve rod and can fix two slidable sleeve rods by bolts. The telescopic end of the vertical connector 200 is fixedly connected to the measuring terminal 300. The two ends of the telescopic rod 201 are respectively connected to an upper connecting nut and a lower connecting nut. The upper connecting nut is used to thread an extension rod. The extension rod has the same structure as the telescopic rod 201 to adapt to manholes of different depths for operation. The lower connecting nut is threadedly connected to the measuring terminal 300.
[0044] The telescopic rod 201 is provided with a scale. In this embodiment, each section of the rod is provided with a scale. In order to facilitate reading, the starting scale of the telescopic rod 201 is the height value of the visible light rangefinder 304. The telescopic rod 201 is also provided with a horizontal bubble 103, which is used to help confirm whether the device is in a horizontal position.
[0045] It should be noted that by aligning the visible light rangefinder 304 with the top of the pipe inside the inspection well, the elevation of the top of the pipe can be measured through the scale on the vertical connector 200. This avoids the need for at least two well-entry operations to perform elevation and modeling as required by existing technologies, reducing the number of well-entry operations, simplifying the well-entry process, and improving surveying efficiency.
[0046] The telescopic rod 201 is equipped with a spring mesh wire. One end of the spring mesh wire is connected to the measuring terminal 300, and the other end is connected to the signal transmission device 102. In this embodiment, the telescopic rod 201 is a non-circular irregular rod, such as a D-shaped rod, to prevent adjacent rods from rotating.
[0047] The measurement terminal 300 includes a terminal housing 301 and an RGBD depth camera 302, a second camera 303, a visible light rangefinder 304, a signal acquisition device 307, and a battery 308, all fixed inside the terminal housing 301. The signal acquisition device 307 includes an attitude acquisition device and a geomagnetic direction angle acquisition device. A sonar bracket 312 is detachably and fixedly connected to the bottom of the terminal housing 301. A sonar 305 and a depth measuring instrument 306 are fixedly connected to the sonar bracket 312. RGBD depth camera 302, second camera 303, water depth measuring instrument 306, signal acquisition device 307, visible light rangefinder 304, sonar 305 are electrically connected to battery 308 and powered by battery 308. The bottom of the sonar bracket 312 is also fixedly connected to a positioning rod 309, which has a pointed bottom. The data collected by the acquisition device of the measurement terminal 300 is transmitted to the control terminal 400. The acquisition device of the measurement terminal 300 includes an RGBD depth camera 302, a second camera 303, a signal acquisition device 307, a water depth measuring instrument 306, a visible light rangefinder 304, and a sonar 305. The RGBD depth camera 302 is used for 3D modeling of non-full wells and identification of the pipe diameter for photographing. It is an existing technology and can be used with commercially available RGBD depth cameras.
[0048] Sonar 305 is used for 3D modeling of full-water wells and identification of underwater pipe diameters. Sonar 305 can be a single-beam ring-scan sonar in the existing technology. The second camera 303 is used to photograph the pipe openings inside the inspection well chamber. The second camera 303 is a commercially available high-definition camera. The visible light rangefinder 304 can emit infrared and visible lasers, align the laser with the top of the pipe, and use the scale of the telescopic rod 201 to measure the elevation of the top of the pipe. The visible light rangefinder 304 can use a high-precision phase laser rangefinder sensor from the existing technology. The water depth measuring instrument 306 is used to measure the water depth inside the inspection well, and can be selected from existing water depth sensors. The attitude acquisition device within signal acquisition equipment 307 is used to monitor the attitude of measurement terminal 300; The geomagnetic orientation angle acquisition device inside the signal acquisition device 307 is used to acquire the orientation angle of the pipes inside the inspection well. The lighting element 310 is used to provide downhole inspection lighting, and the lighting element 310 includes two lighting lamps arranged side by side; The lighting component 310, the RGBD depth camera 302, the second camera 303, and the visible light rangefinder 304 are arranged sequentially from top to bottom along the measuring terminal 300.
[0049] See Figure 4 A connecting block 313 is fixedly connected to the top of the sonar bracket 312, and a connecting block 314 is fixedly connected to the bottom of the measuring terminal 300. The bottom of the sleeve closest to the sonar bracket 312 is threadedly connected to the connecting block 314. The connecting block 313 is provided with at least one mating block 315. In this embodiment, three mating blocks 315 are evenly arranged around the connecting block 313 as an example. The inner wall of the connecting block 314 is provided with a mating groove 316 that matches the mating block 315. The mating groove 316 includes a vertical section 3161 and a horizontal section 3162. The horizontal section 3162 has an arc-shaped structure. The vertical section 3161 and the horizontal section 3162 are connected. The plane where the bottom of the horizontal section 3162 is located is above the plane where the bottom of the vertical section 3161 is located. When the mating block 315 extends into the vertical section 3161 and reaches the top of the vertical section 3161, rotating the connecting block 1 313 or the connecting block 2 314 allows the mating block 315 to enter the horizontal section 3162 of the mating groove 316, thereby vertically fixing the connecting block 1 313 and the connecting block 2 314. Similarly, when separating the connecting block 1 313 and the connecting block 2 314, rotating the connecting block 1 313 or the connecting block 2 314 in the opposite direction allows the mating block 315 to move from the horizontal section 3162 of the mating groove 316 into the vertical section 3161 of the mating groove 316, and move along the axial direction of the connecting block 1 313, so that the mating block 315 moves out of the vertical section 3161 of the mating groove 316, thus completing the separation of the connecting block 1 313 and the connecting block 2 314.
[0050] When the manhole is full of water, a sonar bracket 312 can be installed at the bottom of the terminal housing 301. When the manhole is not full of water, it is not necessary to install a sonar bracket 312 at the bottom of the terminal housing 301.
[0051] Example 2 See Figure 9 The difference between this embodiment and Embodiment 1 is that, in order to simultaneously meet the requirements of high precision, robustness, low cost, and ease of operation for rapid on-site measurement of underground pipe networks, this embodiment provides a method for measuring the pipe diameter of a pipe network based on the second camera 303 and the RGBD depth camera 302 in the measurement terminal 300 of Embodiment 1, including the following steps: S10, the second camera 303 and the RGBD depth camera 302 based on the measurement terminal 300 acquire RGB images and depth images respectively; In this embodiment, the depth image is preprocessed: invalid depth values (such as 0 values, out-of-range values, and NaN values) are filtered out to eliminate depth noise.
[0052] Obtaining RGBD Depth Camera 302 Intrinsic Parameters: Obtain the RGBD depth camera 302 intrinsic parameter matrix, including focal length. and and the main point and ;in, , The pixel focal lengths are: x-axis (pixel focal length) and y-axis (pixel focal length). , Principal point of the image Coordinates, principal point of the image coordinate.
[0053] S20: Obtain the pipe contour points in the RGB image to form a two-dimensional point set; In this embodiment, the pipe curve is drawn manually on the RGB image or the pipe contour points are obtained through automatic edge detection. The two-dimensional point set of the pipe curve or contour points in the image coordinate system is recorded. The required number of points is no less than indivual, Customizable, generally no fewer than 5. Among them, For the first The pixel values of each sample.
[0054] S30, perform circular fitting on the contour points to obtain the pixel radius, and combine it with depth information to calculate the pipe diameter, which is used as the verification result of the 2D circle diameter calculation, including: 2D circle fitting: The obtained two-dimensional point set is fitted into a circle using the least squares method to obtain the center of the circle. and radius This is in pixels. The specific method is as follows: ; in, , Using pixel coordinates, expanding yields: ; Constructing a system of linear equations ,in: ; ; ; The solution is: ; Solving for the results Then calculate the radius. .in, .
[0055] 2D circle diameter calculation: The actual diameter of the pipe is calculated by combining the fitted pixel circle radius with depth information. ; ; ; in, Calculate the diameter based on the median depth. Calculate the diameter based on the average depth value. The average pixel focal length, The average depth of the point cloud. This represents the median depth value of the point cloud.
[0056] S40, extract 3D point cloud from contour points combined with depth image, perform 3D cylinder fitting based on extracted 3D point cloud, obtain pipe diameter, and use as the result to be verified in 3D diameter calculation. In this embodiment, based on the obtained arc or contour points and combined with depth information, a 3D cylinder fitting is performed to calculate the true diameter of the cylinder, i.e., the pipe diameter.
[0057] In this embodiment, 3D point cloud extraction is performed by combining contour points with depth information, including: generating a strip-shaped mask region with a certain thickness based on the contour points, wherein the mask thickness is... Desirable 1 pixel, traverse each pixel within the strip mask region If the depth value of the corresponding location in the depth image If valid, the pixel is converted into a 3D point in the RGBD depth camera 302 coordinate system using the intrinsic parameters of the RGBD depth camera 302, which is then used as a 3D point cloud. Combine all valid 3D points into a point cloud. In the formula, For the first A point cloud, , , The coordinates of the point cloud are 3D.
[0058] In this embodiment, 3D cylinder fitting: Cylindrical fitting is performed on the extracted point cloud to obtain the cylinder axis direction, a point on the axis, and the radius, specifically including: S41, Generating Candidate Cylindrical Axis Directions: Principal component analysis (PCA) is used to extract the principal component directions of the 3D point cloud coordinate axes as candidate coordinate axes, generating multiple candidate cylindrical axis directions. To prevent getting trapped in local optima, multiple possible axis directions are generated. PCA is used to extract the three principal component directions of the point cloud coordinates as candidate coordinate axes, and additional axis directions are randomly added to generate multiple possible axis directions. The core of PCA is to find the orthogonal direction with the largest data variance. S411, the data center for acquiring 3D point clouds: ; In the formula, For 3D point cloud data centers, The original point cloud coordinate matrix, For the centroid of the point cloud, The bold text represents the number of points in the point cloud. For the first One sample point, .
[0059] S412, Calculate the covariance matrix: ; Calculate using the formula: ; In the formula, Let covariance matrix be the variance matrix. For variance, For covariance. Transpose of a 3D point cloud data center.
[0060] S413, Perform eigenvalue decomposition on the covariance matrix: The eigenvalues satisfy the determinant: The eigenvectors are obtained by solving the equation. The eigenvalues satisfy: λ1 ≥ λ2 ≥ λ3 ≥ 0. (Bold text) For the corresponding eigenvectors (PCA principal direction, unit vector). It is an identity matrix.
[0061] Randomly supplement M vectors to generate multiple candidate cylinder axis directions: Randomly supplement M (e.g. 5) vectors to generate multiple possible axis directions, preventing getting trapped in local optima.
[0062] S42, perform nonlinear least squares cylinder fitting on the axial directions of multiple candidate cylinders one by one to find the optimal axis and radius parameters, and select the optimal result as the result to be verified in 3D diameter calculation; In this embodiment, nonlinear least-squares cylinder fitting is performed on each of the multiple candidate cylinder axis directions generated in the previous step to find the optimal axis and radius parameters. The nonlinear least-squares cylinder fitting uses two fitting steps. After the first fitting optimization, outliers with large residual absolute values are removed, and a second optimization fitting is performed to obtain more accurate parameters.
[0063] S421, Calculate initial parameters: Use candidate directions as initial axes. The median center of the point cloud is used as the reference point on the initial axis. Calculate the median radial distance from all points to the axis as the initial radius. ;in, For reference point XYZ axis coordinates, This is the matrix transpose. S422, Construct the residual function: ;in, , For the residual vector, This is the difference vector from a spatial point to the axis reference point. for The projected length on the axis, The unit vector along the axis. Where is the radius of the cylinder. For spatial points The difference between the perpendicular distance to the cylinder axis and the estimated radius. For a spatial point in point cloud data, , , The X, Y, and Z coordinates are unit vectors along the axis of the cylinder. S423, First Optimization Fit: Fitting parameters using nonlinear least squares method Optimize to minimize the sum of squared residuals Then, parameter iteration is performed. The parameter iteration methods can include the Gauss-Newton method, the LM method, etc. S424: After the first optimization fitting, outliers with residual absolute values greater than the threshold are removed. The remaining inliers are used for the second nonlinear least squares optimization to minimize the sum of squared residuals. The parameters are iterated, and the root mean square error of the final fit is calculated. After the first optimization, outliers with residual absolute values greater than a threshold (e.g., 0.02 meters) are removed, and the remaining interior points are used for a second nonlinear least squares optimization to obtain more accurate parameters.
[0064] S425, among all candidate directions, the fitting parameter with the smallest root mean square error is selected as the result to be verified in the 3D diameter calculation; Nonlinear least squares fitting is performed using the remaining interior points to fit the parameters. Optimize to minimize the sum of squared residuals Among all candidate directions, the fitting parameter with the smallest root mean square error (RMSE) is selected as the final cylinder parameter, and the cylinder diameter is the pipe diameter.
[0065] S50 combines the results of 2D circle diameter calculation and 3D diameter calculation to perform multi-dimensional verification and determine the credibility of the results.
[0066] The pipe diameter is verified by combining the results calculated using both 2D and 3D diameter methods. When the three values are close, the measurement result is highly reliable; when the values differ significantly, the measurement is repeated.
[0067] Please see Figures 10 to 12As shown, in one embodiment of the present invention, an experiment was conducted on a pipe section with a diameter of 500 mm: the 2D circle verification results were 499.54 mm and 503.06 mm, and the 3D verification result was 497.72 mm, with all accuracy within 10 mm.
[0068] Please see Figures 13 to 15 As shown, in one embodiment of the present invention, for the pipe section with a diameter of 500mm, the 2D circle verification results are 496.38mm and 495.23mm, and the 3D verification result is 494.78mm, with an accuracy of less than 10mm.
[0069] Example 3 The difference between this embodiment and Embodiment 1 is that it provides a method for three-dimensional modeling of inspection wells based on a measurement terminal 300, including: S10: Acquire multiple frames of continuous sonar scan data. Each frame of sonar scan data is generated by the data acquisition end moving vertically along the inspection well. Each movement of a certain distance completes one circumferential scan, including distance-angle data of the sonar pointing towards the inner wall of the inspection well based on single-beam circumferential scanning, water depth data at the current scanning position, and pose data.
[0070] In this embodiment, a single-beam circumferential scanning sonar probe is used for continuous 360° underwater scanning of the inner wall of the inspection well to acquire distance-angle data in polar coordinates. It is the core component for acquiring the inspection well profile, ensuring full circumference coverage without blind spots. The signal acquisition device 307 measures the probe's azimuth and attitude data in the horizontal plane, providing attitude reference for subsequent pose optimization and point cloud registration, avoiding modeling errors caused by probe attitude deviation. The depth gauge 306 is integrated inside or outside the probe, measuring the probe's depth (i.e., depth data) in real time. This data serves as the core data source for the Z-axis in three-dimensional coordinates, ensuring accurate spatial correspondence of the inspection well cross-sections at different depths. The vertical connector 200 controls the vertical movement of the data acquisition probe along the height of the inspection well, acquiring cross-sectional data at different depths to ensure full height coverage of the inspection well.
[0071] In this embodiment, during use, the data acquisition end is slowly inserted into the water to ensure the sensor's posture is stable, the scanning direction is perpendicular to the well wall, the system is started, and data acquisition begins.
[0072] The control measurement terminal 300 moves at a constant speed downwards or upwards along the vertical direction of the inspection well. Each time it moves a preset distance (e.g., 0.1m), it completes a 360° circumferential scan, acquiring one frame of raw data, including: distance data corresponding to each scanning angle (0°~360°), water depth data at the current scanning position, and scanning direction angle. This process is repeated until the entire height of the inspection well is scanned, acquiring multiple frames of continuous sonar scan data. Figure 16 , Figure 17 As shown, the outline edge map of the probe at different water depths.
[0073] In this embodiment, data preprocessing is performed before subsequent modeling: each frame of data is filtered to remove invalid data (such as outliers less than 0.1m apart, invalid data with incorrect format); missing data is supplemented (using adjacent valid data interpolation) to ensure the integrity of each frame of data; each frame of data is sorted according to the scanning order to prepare for subsequent coordinate transformation and point cloud stitching.
[0074] S20 transforms the distance-angle data into coordinates and combines it with the water depth data to construct the horizontal cross-section corresponding to each frame of data, which serves as the local three-dimensional point cloud of a single frame in the three-dimensional model of the inspection well.
[0075] In this embodiment, each frame of preprocessed sonar data is converted from polar coordinates to Cartesian coordinates: ; ; In the formula, The transformed planar coordinates, The original angles acquired by a single-beam ring-scan sonar. This is distance data acquired by a single-beam ring-scan sonar.
[0076] Then three-dimensional coordinates The formula for construction is: ;in, This is the water depth data for the current scanning location, i.e., the Z-axis coordinate, which can be set to increase or decrease from top to bottom according to actual needs.
[0077] Taking the center point of the current circumferential scan plane as the origin, the circumferential scan plane as the XY plane, and the water depth at the current scanning position as the Z-axis, the polar coordinates of each scanning point are determined according to the above formula. Convert to three-dimensional Cartesian coordinates That is, to construct the horizontal cross-section corresponding to each frame of data, as a single-frame local three-dimensional point cloud in the three-dimensional model of the inspection well.
[0078] In this embodiment, the local 3D point cloud of each frame is filtered and denoised. A fast and simple filtering algorithm can be used for denoising, such as dynamic distance filtering. The specific steps of dynamic distance filtering are as follows: S21, Calculate the distance from the scan point to the origin: ; In the formula, For the first The Euclidean distance from each scan point to the sonar center For the first The plane coordinates of each scan point.
[0079] S22, Set dynamic threshold filtering: ; In the formula, The minimum distance threshold, This is the maximum distance threshold.
[0080] Specific operation: Calculate the distance from each point in the local 3D point cloud to the origin (in the XY plane), dynamically determine a reasonable distance range based on the above formula, remove outliers that exceed the range, ensure that enough effective contour points are retained, and finally obtain the denoised local 3D point cloud for each frame.
[0081] S30 uses a sliding window strategy combined with ICP registration algorithm and pose data to correct pose offset during the movement of multi-frame horizontal sections, and stitches together the optimized multi-frame horizontal sections to obtain the optimal 3D model of the inspection well.
[0082] In this embodiment, obtaining the optimal 3D model of the inspection well includes: S31, establish the first frame reference point cloud, and calculate the direction difference between the local 3D point cloud of each subsequent frame and the local 3D point cloud of the previous frame.
[0083] The denoised local 3D point cloud of the first frame is used as the reference point cloud (initial world coordinate system), and it is stored in a sliding window. The orientation difference is obtained using the following formula: ; In the formula, For the difference in direction, The azimuth angle of the current frame scan. The azimuth angle of the previous frame scan is used; the azimuth angle is the angle that reflects direction information, starting at 0 degrees due north, increasing counterclockwise, and returning to due north at 360 degrees.
[0084] To prevent excessive directional deviation, the directional difference is clamped using the following formula: ; In the formula, The directional difference after clamping treatment The preset maximum yaw angle difference, for example, 20°.
[0085] S32: Based on the orientation difference, the planar coordinates of the local 3D point cloud in the previous frame, and the pose data, construct the initial transformation moments and perform ICP registration algorithm registration.
[0086] The initial transformation matrix serves as the initial value for registration using the ICP (Iterative Closest Point) registration algorithm, specifically as follows: ; In the formula, Let be the initial transformation matrix. This represents the translation of the 3D point cloud in the plane in the XY direction from the previous frame. If both values are 0 in the second frame... Let the initial rotation angle be around the Z-axis. , The rotation angle of the previous frame's 3D point cloud around the Z-axis.
[0087] S33, perform ICP registration between the local 3D point cloud of the current frame and the local 3D point clouds of all historical frames within the sliding window. During the registration process, select effective registration results based on evaluation indicators, including calculating the fit and root mean square error of the registration results; retain only the registration results that meet the requirements of a fit greater than the fit threshold and a root mean square error less than the root mean square error threshold.
[0088] 1. Fit measures the degree of fit of the registration, with a value ranging from 0 to 1, the closer to 1 the better. The specific calculation formula is as follows: ; in, For compatibility, This refers to the number of interior points that meet the corresponding distance threshold during registration. This represents the total number of points in the current frame's point cloud (source point cloud). The distance threshold can be adjusted based on actual conditions. Interior point determination is as follows: ; in, , which represents the points after a rigid transformation of the point cloud in the current frame.
[0089] In the formula, The maximum corresponding point distance is preset, and points that satisfy this formula are interior points. For the point cloud in the current frame coordinates of an interior point For historical frames in the cloud and The corresponding nearest neighbor matching point coordinates, The distance between the two points is the Euclidean distance.
[0090] 2. The root mean square (RMS) measures the registration error of interior points; a smaller value is better. The specific calculation formula is as follows: ; In the formula, It is the root mean square.
[0091] 3. Filter valid registration results: Only retain those that meet the requirements. and The registration result is taken as the valid registration result. This is the fitness threshold, for example, 0.3. This is the root mean square error threshold, for example, 0.2.
[0092] S34. Based on the selection rules, select the optimal transformation matrix from the effective registration results.
[0093] The selection criterion is to choose the registration result with the highest fit and the smallest root mean square error, and use its corresponding transformation matrix as the optimal transformation matrix. The latest registered frame point cloud is then loaded into a sliding window, where N is the size of the sliding window. After registering one frame of point cloud, the sliding window is updated to ensure that it contains the latest N frames of point cloud data.
[0094] S35 transforms the local 3D point cloud of the current frame to the world coordinate system based on the optimal transformation matrix, and then reconstructs and obtains the optimized local 3D point cloud.
[0095] Among them, the homogeneous coordinate transformation of the local 3D point cloud in the current frame: ; In the formula, The homogeneous coordinates of the current frame (Z-axis set to 0 for 2D ICP registration). The two-dimensional coordinates of the current frame. This is the matrix transpose.
[0096] World coordinate system coordinate transformation: ; in, This is the homogeneous vector after transformation to the world coordinate system. The optimized 4×4 transformation matrix has the following specific form: ; In the formula, The optimal transformation matrix is... The rotation angle is about the Z-axis. , This represents the translation in the XY direction within the plane.
[0097] Then the three-dimensional coordinates are restored: ; In the formula, , , This refers to the 3D coordinates of the current frame point in the world coordinate system, which is also the 3D coordinates of the optimized local 3D point cloud. It is the second vector The 0th component, It is the second vector The first component, This is the water depth data for the current frame.
[0098] S36, Retain the most recent Repeat the above process for each frame's local 3D point cloud until all frames' local 3D point clouds are reconstructed and stitched together to obtain the optimal 3D model of the inspection well. (See attached image.) Figure 18 , Figure 19 The left side of the attached figure shows the model before optimization, and the right side shows the model after optimization.
[0099] In one embodiment of the present invention, the above-mentioned optimal manhole 3D model can be further optimized: duplicate and redundant points generated during the splicing process are removed, the model is smoothed, and the integrity and accuracy of the model are enhanced; key dimensional parameters of the manhole (such as manhole diameter, manhole height, manhole bottom diameter, manhole wall thickness, etc.) are extracted, and finally a complete and accurate full-water manhole 3D model is generated.
[0100] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A 3D pipeline mapping instrument capable of extending into the chamber of a manhole, characterized in that, The system includes a vertical connector, a measurement terminal connected to the vertical connector, and a control terminal. The measurement terminal includes a terminal housing and an RGBD depth camera, a second camera, and a visible light rangefinder mounted on the terminal housing. The vertical connector has a scale. The control terminal is communicatively connected to the measurement terminal and is configured to: acquire RGB and depth images through the measurement terminal; acquire pipe contour points in the RGB images to form a two-dimensional point set; perform circular fitting on the contour points to obtain the pixel radius, and calculate the pipe diameter using the depth information as the verification result for the 2D circle diameter calculation; extract 3D point clouds from the contour points and depth images, perform 3D cylinder fitting based on the extracted 3D point cloud to obtain the pipe diameter as the verification result for the 3D diameter calculation; and perform multi-dimensional verification by combining the verification results for the 2D circle diameter calculation and the 3D diameter calculation to determine the reliability of the results.
2. The 3D pipeline mapping instrument according to claim 1, characterized in that, The process of obtaining the 2D circle diameter calculation results includes: fitting the obtained 2D point set to a circle using the least squares method to obtain the pixel circle radius; combining the pixel circle radius with depth information to obtain the pipe diameter. The process of obtaining the 3D diameter calculation results includes: extracting the principal component directions of the 3D point cloud coordinate axes using principal component analysis to generate multiple candidate cylinder axis directions; performing nonlinear least squares cylinder fitting on each of the multiple candidate cylinder axis directions to find the optimal axis and radius parameters, and selecting the optimal result as the 3D diameter calculation result to be verified.
3. The 3D pipeline mapping instrument according to claim 2, characterized in that, Generate multiple candidate cylinder axis directions, including: Data centers for acquiring 3D point clouds: ; ; Calculate the covariance matrix: ; Perform eigenvalue decomposition on the covariance matrix: The eigenvalues satisfy the determinant: The feature vectors are obtained by solving the equations; and M vectors are randomly added to generate multiple candidate cylinder axis directions. in, For 3D point cloud data centers, The original point cloud coordinate matrix, For the centroid of the point cloud, For point cloud points, For the first One sample point, Let covariance matrix be the variance matrix. Transpose of a 3D point cloud data center. For the corresponding eigenvectors, For eigenvalues, It is an identity matrix.
4. The 3D pipeline mapping instrument according to claim 2, characterized in that, Nonlinear least-squares cylinder fitting is performed on each of the multiple candidate cylinder axes to find the optimal axis and radius parameters, including: Calculate initial parameters: use candidate directions as initial axes. The median center of the point cloud is used as the reference point on the initial axis. Calculate the median radial distance from all points to the axis as the initial radius. ;in, For reference point X, Y, Z axis coordinates This is the matrix transpose. Constructing the residual function: ;in, , For the residual vector, This is the difference vector from a spatial point to the axis reference point. for The projected length on the axis, The unit vector along the axis. Where is the radius of the cylinder. For spatial points The difference between the perpendicular distance to the cylinder axis and the estimated radius. For a spatial point in point cloud data, , , The X, Y, and Z coordinates are unit vectors along the axis of the cylinder. First optimization fitting: Fitting the parameters using nonlinear least squares method Optimize by iterating through parameters to minimize the sum of squared residuals; After the first optimization fit, outliers with residual absolute values greater than the threshold are removed. The remaining inliers are then used for a second nonlinear least squares optimization to minimize the sum of squared residuals. The parameters are iterated, and the root mean square error of the final fit is calculated. Among all candidate directions, the fitting parameter with the smallest root mean square error is selected as the result to be verified in the 3D diameter calculation.
5. The 3D pipeline mapping instrument according to claim 2, characterized in that, 3D point cloud extraction is performed by combining contour points with depth information, including: Based on the contour points, a strip-shaped mask region with a certain thickness is generated. Desirable 1 pixel, traverse each pixel within the strip mask region If the depth value of the corresponding location in the depth image If effective, the pixel is converted into a 3D point in the RGBD depth camera coordinate system using the intrinsic parameters of the RGBD depth camera, which is then used as a 3D point cloud. The pipe contour points in the RGB image are obtained by manually drawing the pipe arc or by automatically detecting the edge.
6. The 3D pipeline mapping instrument according to claim 1, characterized in that, A sonar is detachably connected to the terminal housing, and the control terminal is also configured to acquire multiple frames of continuous sonar scan data. Each frame of sonar scan data is obtained by moving the data acquisition end along the vertical direction of the inspection well. Each time the data is moved a certain distance, a circumferential scan is completed. The data includes distance-angle data of the sonar towards the inner wall of the inspection well based on the single-beam circumferential scan sonar, water depth data at the current scanning position, and pose data. The distance-angle data is transformed into coordinates and combined with water depth data to construct the horizontal cross-section of the inspection well corresponding to each frame of data, which serves as a local 3D point cloud of a single frame in the 3D model of the inspection well. A sliding window strategy combined with ICP registration algorithm and pose data is adopted to correct the pose offset during the movement of multi-frame horizontal sections, so that the layers are aligned. The optimized multi-frame horizontal sections are then stitched together to obtain the optimal 3D model of the inspection well.
7. The 3D pipeline mapping instrument according to claim 6, characterized in that, The control terminal is also configured to: construct the horizontal section of the inspection well corresponding to each frame of data, including: After the distance-angle data is converted from polar coordinates to Cartesian coordinates, the center point of the current circumferential scan section is taken as the origin, the circumferential scan section is the XY plane, and the water depth at the current scanning position is the Z axis.
8. The 3D pipeline mapping instrument according to claim 6, characterized in that, The control terminal is also configured to: acquire the optimal 3D model of the inspection well, including: S31. Establish the first frame reference point cloud, and calculate the direction difference between the local 3D point cloud of each subsequent frame and the local 3D point cloud of the previous frame. S32. Based on the orientation difference, the planar coordinates and pose data of the local 3D point cloud in the previous frame, construct the initial transformation matrix and perform ICP registration algorithm registration. S33. Perform ICP registration on the local 3D point cloud of the current frame and the local 3D point clouds of all historical frames within the sliding window respectively. During the registration process, select the effective registration results based on the evaluation index. S34. Based on the selection rules, select the optimal transformation matrix from the effective registration results; S35. Transform the local 3D point cloud of the current frame to the world coordinate system based on the optimal transformation matrix, and reconstruct to obtain the optimized local 3D point cloud; S36. Retain the most recent N frames of local 3D point cloud, and repeat steps S31-S35 until all frames of local 3D point cloud are reconstructed and stitched together to obtain the optimal inspection well 3D model; N is the preset sliding window size.
9. The 3D pipeline mapping instrument according to claim 8, characterized in that, The control terminal is also configured to: clamp the direction difference, and construct a transformation matrix using the clamped direction difference; wherein the clamping method for the direction difference is as follows: ; In the formula, The directional difference after clamping treatment The preset maximum yaw angle difference, For direction difference; The optimal transformation matrix is: ; In the formula, The optimal transformation matrix is... The rotation angle is about the Z-axis. , The translation in the XY direction within the plane; effective registration results are selected based on evaluation metrics, including: The registration results are evaluated for fit and root mean square error. Only registration results that meet the condition that the fit is greater than the fit threshold and the root mean square error is less than the root mean square error threshold are retained.
10. The 3D pipeline mapping instrument according to claim 9, characterized in that, The control terminal is also configured such that the adaptability is obtained using the following formula: ; in, For compatibility, This refers to the number of interior points that meet the corresponding distance threshold during registration. This represents the total number of points in the point cloud of the current frame, where inlier points are determined as follows: ; ; In the formula, The maximum corresponding point distance is preset, and points that satisfy this formula are interior points. For the points in the current frame point cloud after a rigid transformation, For the point cloud in the current frame coordinates of an interior point For historical frames in the cloud and The corresponding nearest neighbor matching point coordinates, The Euclidean distance between the two points is... This is the optimal transformation matrix.
Citation Information
Patent Citations
Pipeline type identification and structure parameter extraction method based on three-dimensional point cloud
CN113822854A
Fitting method and system of incomplete cylindrical surface point cloud, medium and equipment
CN118587268A
Same-color background pipeline three-dimensional contour identification method and system based on RGBD camera
CN120580256A