Pipeline structural defect detection method using a pipeline robot
By identifying material features and correcting the illumination distribution field, the problems of changes in optical reflection characteristics and posture deflection in pipeline robot inspection were solved, generating high-precision pipeline structural defect detection results and improving detection accuracy and positioning precision.
Patent Information
- Application Number
- CN202611167379.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-11-24
AI Technical Summary
Existing pipeline robots cannot adapt to changes in the optical reflectivity of different materials when detecting structural defects in water supply networks. This results in specular highlights or shadows in the images, which obscure the texture of the defects. At the same time, the robot's posture deflection causes the camera's optical axis to deviate from the central axis of the pipeline, resulting in severe geometric distortion in the generated panoramic images and reducing the accuracy of defect recognition.
By extracting the material features of the pipe inner wall image, the optical reflection model is dynamically invoked to establish the illumination distribution field, the diffuse reflection image components are separated for pixel-by-pixel radiometric correction, and the relative pose is calculated based on the pose information. The image is then back-projected, unfolded, and stitched together to generate a panoramic unfolded image, which is then input into the defect recognition model for detection.
It eliminates lighting interference and geometric distortion, provides standardized input data, and improves the accuracy and positioning precision of pipeline network structural defect detection.
Smart Images

Figure CN123160441A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of visual inspection technology, specifically to a method for detecting structural defects in pipeline networks using a pipeline robot. Background Technology
[0002] Urban water supply networks are crucial infrastructure for ensuring urban operation and management. Structural defects in these networks (such as ruptures, leaks, and deformations) directly damage the structural strength and lifespan of the pipelines. If not repaired promptly, they can easily lead to serious consequences such as road subsidence. Currently, using pipeline robots equipped with cameras for endoscopic inspection is the primary method for defect detection.
[0003] However, in actual inspections, water supply networks often exhibit material differences across different pipe sections (such as cement, PVC, and cast iron), with drastically different optical reflection characteristics. Combined with complex environments like bends and diameter changes, a single brightness equalization or diffuse reflection correction scheme cannot adapt to material variations, easily producing strong specular highlights or dark shadows in the image, obscuring the true texture of defects. Furthermore, when the robot moves within the pipe, it is affected by undulations and slopes at the pipe bottom, causing its posture to dynamically deflect, resulting in the camera's optical axis deviating from the pipe's central axis. Traditional image unfolding and stitching methods typically do not adequately compensate for this relative pose deviation, leading to severe geometric distortion in the generated panoramic image, which significantly reduces the detection accuracy of subsequent defect recognition models. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a method for detecting structural defects in pipeline networks using a pipeline robot, thereby resolving existing issues.
[0005] The present application proposes a method for detecting structural defects in pipeline networks using a pipeline robot, which employs the following technical solution: One embodiment of this application provides a method for detecting structural defects in a pipeline network using a pipeline robot, the method comprising the following steps: Acquire the sequence of images of the inner wall of the pipe collected by the pipe robot, as well as the pose information and light source parameters of the pipe robot; Extract image features from the sequence of images of the inner wall of the pipe, and combine them with the pose information to determine the material identification result of the current inner wall of the pipe; based on the material identification result, call the corresponding optical reflection model from the pre-established material characteristic parameter library, and combine it with the light source parameters to establish a light propagation model to calculate the light distribution field of the current pipe. The diffuse reflection image component is separated and extracted from the image sequence of the inner wall of the pipe, and the diffuse reflection image component is radiometrically corrected pixel by pixel using the illumination distribution field to obtain the corrected image sequence. Based on the pose information, the relative pose of the camera with respect to the geometric center axis of the pipe is calculated. Using this relative pose as a reference, the corrected image sequence is unfolded and stitched together by back projection to generate a panoramic unfolded image of the inner wall of the pipe. By inputting a panoramic view of the inner wall of the pipeline into a pre-trained defect recognition model, the detection results of structural defects in the pipeline network can be obtained.
[0006] In one embodiment, determining the material identification result of the current pipe inner wall includes: Visual features of the pipeline inner wall image sequence are extracted, and the visual prediction probability of the current pipeline inner wall belonging to various candidate materials is output through a preset classification model. Based on the position data in the pose information, the prior probability of each candidate material corresponding to the current position of the pipe is determined. The visual prediction probability and the prior probability are fused together to make a decision, and the comprehensive posterior probability of each candidate material is obtained. The material of the current pipe inner wall is identified using the comprehensive posterior probability.
[0007] In one embodiment, if the maximum value in the comprehensive posterior probability is greater than or equal to a preset threshold, then the candidate material corresponding to the maximum value is determined as the material identification result; otherwise, the preset benchmark roughness material is determined as the material identification result.
[0008] In one embodiment, extracting the visual features of the image sequence of the inner wall of the pipe includes: Color features, texture features, and roughness features are extracted from the image sequence of the inner wall of the pipe. The color features, texture features, and roughness features are combined to construct a feature vector as the visual features.
[0009] In one embodiment, the calculation of the current illumination distribution field of the pipeline includes: Based on the light intensity distribution and spectral power distribution in the light source parameters, combined with the geometric model of the pipe and the determined optical reflection model, the light propagation simulation algorithm is used to track the reflection and scattering path of the light emitted by the light source in the pipe, and accumulate the light energy reaching each pixel position on the inner wall of the pipe to generate the corresponding irradiance distribution map as the illumination distribution field.
[0010] In one embodiment, the extraction process of the diffuse reflection image component is as follows: The specular highlight region in the pipeline inner wall image sequence is detected based on the pixel chromaticity distribution features. The specular highlight region is then replaced by spatial weighted interpolation using neighboring non-highlight pixels to extract the diffuse reflection image component.
[0011] In one embodiment, obtaining the corrected image sequence includes: The light distribution field is subjected to extreme value normalization processing to obtain a normalized irradiance field, and the global statistical value of the normalized irradiance field is extracted as a reference irradiance. By combining the light source intensity factor transmitted across frames, the diffuse image component and the normalized irradiance field are used to perform pixel-by-pixel illuminance compensation calculation, and the compensation result is mapped to the target grayscale range using the reference irradiance to generate the corrected image sequence.
[0012] In one embodiment, a luminance deviation ratio is calculated based on the grayscale mean of the corrected current frame image and the reference irradiance, the light source intensity factor is updated based on the luminance deviation ratio, and the updated light source intensity factor is applied to the radiometric correction of the next frame image.
[0013] In one embodiment, generating a panoramic unfolded view of the pipe's inner wall includes: Obtain the contour offset measurement data of the pipe wall, and combine it with the inertial measurement data and odometer data in the pose information to calculate the relative yaw angle and relative pitch angle of the camera optical axis relative to the current geometric center axis of the pipe, which are used as the relative pose. The corrected image is then subjected to adaptive neighborhood weighted compensation, adaptive local contrast enhancement, and texture enhancement with soft thresholding in sequence. Using the relative pose as the geometric unfolding reference, the annular pipe wall region in the texture-enhanced image is back-projected into a rectangular image according to the cylindrical model. Based on the mileage data, the rectangular images of consecutive frames are feature-matched and stitched together to generate the panoramic unfolded image of the inner wall of the pipe.
[0014] In one embodiment, obtaining the detection results of structural defects in the pipeline network includes: The defect identification model is used to identify the category information and geometric size characteristics of the defect area in the panoramic unfolding image. Based on the preset hazard factors corresponding to the geometric size characteristics and the category information, the defect quantitative assessment value is calculated. The severity level of the current defect is determined by matching the quantitative assessment value of the defect with a clustering grading benchmark pre-built based on historical defect data. The detection result is generated by combining the category information, the severity level, and the corresponding collection location information.
[0015] This application has at least the following beneficial effects: This application determines the pipe wall material by extracting image features and pose information, and dynamically calls the corresponding optical reflection model to establish the illumination distribution field. This solves the problem that a single diffuse reflection correction scheme cannot be compatible with the physical properties of various pipe materials, making the illumination simulation consistent with the actual pipe network environment. Furthermore, separating the diffuse reflection image components and using the illumination distribution field for pixel-by-pipe radiometric correction eliminates specular highlight interference caused by direct light shining on the smooth pipe wall, compensates for spatial illuminance attenuation, restores the pipe wall texture obscured by shadows or bright spots, and prevents defects from being missed or misjudged due to visual blind spots. Based on the calculated camera pose relative to the central axis of the pipe, the corrected image is back-projected, unfolded, and stitched together, eliminating perspective and radial geometric distortions caused by the cylindrical surface of the pipe wall and the robot's posture fluctuations. This provides a flat physical spatial geometric reference and avoids distortion of the size and shape of structural defects. By inputting the panoramic unfolded image after eliminating illumination interference and geometric distortion into the defect identification model, the environmental interference sources in actual inspections are eliminated at the root, providing standardized input data for the target detection network and improving the accuracy and positioning precision of pipeline structural defect detection. Attached Figure Description
[0016] Figure 1 This application provides a flowchart of the steps involved in a method for detecting structural defects in a pipeline network using a pipeline robot. Detailed Implementation
[0017] The following description, in conjunction with the accompanying drawings, details a specific scheme for a pipeline network structural defect detection method using a pipeline robot provided in this application.
[0018] This application provides an embodiment of a method for detecting structural defects in pipeline networks using a pipeline robot. Specifically, it provides the following method for detecting structural defects in pipeline networks using a pipeline robot. Please refer to [link to relevant documentation]. Figure 1 The method includes the following steps: Step S001: Obtain the sequence of images of the inner wall of the pipe collected by the pipe robot, as well as the pose information and light source parameters of the pipe robot.
[0019] In practice, the hardware equipment for performing the inspection task is first prepared and configured. In this embodiment, the pipeline robot is equipped with a forward-looking high-definition camera, and its forward-looking gimbal has defogging and laser ranging measurement functions. To adapt to different pipe diameters, the robot adopts a modular and lightweight design and is equipped with a ring-shaped high-brightness LED array as a built-in light source, supporting stepless brightness adjustment. In addition, the robot integrates an odometer and an inertial measurement unit (IMU) and is equipped with a 4G communication module to realize remote data transmission.
[0020] Before entering the pipeline for inspection, the robot's inspection route must be planned in advance. To ensure the accuracy of subsequent illumination calculations and radiometric corrections, the camera's response curve must be radiometrically calibrated in advance to ensure that the grayscale value of the final acquired image has a strictly linear relationship with the incident radiance of the pipe wall.
[0021] During data acquisition, the pipeline robot is controlled to move at a constant speed within the water supply network, and motion blur is avoided by matching the travel speed with the camera exposure time. While moving and continuously photographing the inner wall of the pipeline, the control system synchronously collects and records the following multimodal data based on a unified timestamp: (1) Pipe inner wall image sequence: real-time visual images of the pipe wall captured by a front-view camera; (2) Light source parameters: including the preset light source spectral power distribution and the read real-time drive current of the light source (used to dynamically calculate the real-time emitted light intensity of the light source at the algorithm end). (3) Pose information: the distance traveled by the odometer and the three-axis spatial attitude data of the robot measured synchronously by the IMU.
[0022] The acquisition frequency of the aforementioned multimodal data is determined based on the robot's uniform travel speed and the preset overlap rate of the image stitching. The acquisition frame rate of the image sequence is set to 20 to 30 Hz, and the sampling frequency of the light source parameters and pose information is greater than or equal to the acquisition frame rate of the image sequence, with interpolation alignment performed using timestamps.
[0023] In one specific embodiment, the pipeline robot is controlled to travel at a constant speed of 0.5 m / s, and the frame rate of the image sequence is set to 25 Hz to ensure an inter-frame overlap rate greater than 60%. Simultaneously, the sampling frequency of the real-time driving current of the light source is set to 50 Hz, and the sampling frequency of the IMU pose information is set to 100 Hz. During the data synchronization phase, using the timestamp of each frame of the image sequence as a reference, two adjacent IMU pose data points and light source current data points before and after that timestamp are selected. Linear interpolation is then used to calculate the precise pose and light source current at the exposure center of that image frame, achieving strict alignment of multimodal data.
[0024] After the multimodal data is collected, it is packaged and uploaded to the data processing terminal via a 4G communication module to complete the collection and preparation of basic data required for pipeline defect detection.
[0025] Step S002: Extract image features from the image sequence of the inner wall of the pipe, and determine the material identification result of the inner wall of the pipe by combining the pose information; according to the material identification result, call the corresponding optical reflection model from the pre-established material characteristic parameter library, and establish a light propagation model by combining the light source parameters to calculate the light distribution field of the current pipe.
[0026] During the offline preparation phase, the spectral reflectance, bidirectional reflectance distribution function (BRDF), and optical roughness parameters of common pipe wall materials in water supply networks, such as cement mortar, PVC, PE, cast iron, and epoxy / asphalt coatings, are collected and measured in advance to construct a standardized material property parameter library. Specifically: (1) Spectral reflectance: obtained by consulting the standard table of reflectance of each material in the visible light band; in another embodiment, physical samples can also be taken and measured using a hyperspectral imager. (2) Bidirectional reflectance distribution function (BRDF): used to measure the scattering directionality caused by the optical roughness of the pipe wall surface. In a darkroom environment, the reflected energy distribution of each material sample was measured at multiple incident and exit angles. Based on the measurement results, the Lambert reflection model was used to extract the albedo parameters for rough materials (e.g., cement mortar, rough PE); the Phong reflection model was used to extract the ambient light coefficient, diffuse reflectance coefficient, specular reflectance coefficient, and specular index for smooth materials (e.g., smooth PVC, cast iron, epoxy / asphalt coating). (3) Optical roughness parameters: The microscopic optical roughness parameters of the surfaces of each material are measured using a surface roughness meter. It should be noted that this embodiment specifically refers to the micro-surface roughness that determines diffuse reflection characteristics, rather than the hydraulic roughness used to calculate water flow resistance.
[0027] After data processing, a material property parameter library is established, indexed by material type. Each record field contains the corresponding spectral reflectance, BRDF model parameters, and optical roughness parameters for subsequent online calculations.
[0028] During the online detection phase, based on the material identification results obtained in the previous steps, the BRDF parameters and optical roughness parameters corresponding to the current material are extracted from a pre-established material characteristic parameter library to determine the corresponding optical reflection model. Simultaneously, based on the principles of physical optics, a light propagation model covering the complete process of "light source emission - pipe inner wall reflection - camera reception" is constructed. Specific modeling elements include: (1) Light source modeling: The ring LED array of the pipeline robot is modeled as a near-field extended surface light source. The light distribution curve of the light source is obtained by fitting the angle-relative light intensity distribution by measuring the irradiance at different distances and azimuth angles in a dark room using a spectral photometer; the spectral power distribution of the light source is normalized by measuring the irradiance in the visible light band (380nm-780nm) using a spectroradiometer. (2) Geometric modeling: The inner surface geometry of the pipe is described using the parametric equations of the cylindrical surface; (3) Reflection modeling: The reflection process is described by the general BRDF formula, that is, the total reflection energy is equal to the sum of the diffuse reflection component and the specular reflection component.
[0029] For diffuse reflection, either the Lambert model or the Oren-Nayar model considering microscopic optical roughness can be used; for specular reflection, either the Phong model or the Cook-Torrance model can be used. The specific model combination used is adaptively determined by the currently used material type. After modeling, the spectral power distribution is multiplied by the spectral response function of each color channel of the camera and integrated to obtain the effective emitted radiative flux of each channel. This flux serves as the energy input benchmark for the light propagation model, providing the computational basis for subsequently tracking the reflected and scattered energy of light rays within the channel and generating a pixel-by-pixel illumination distribution field.
[0030] Furthermore, by extracting visual features from the acquired images and combining them with the prior probabilities of the robot's pose information, automatic identification of the pipe wall material is achieved, specifically including: From each frame of pipe inner wall image transmitted in real time by the pipeline robot, the pixel mean of each channel in the HSV color space is calculated as a color feature vector; the contrast and correlation of the gray-level co-occurrence matrix are extracted as texture feature vectors; a two-dimensional discrete Fourier transform is performed on the image grayscale to filter out low-frequency components within a set radius, and the remaining high-frequency region is divided into multiple (e.g., 3) annular sub-bands according to different frequency radii. The sum of squared amplitudes of the high-frequency components in each annular sub-band is calculated and combined as a multi-dimensional roughness feature vector. After L2 normalization to eliminate dimensional differences, the above three feature vectors are concatenated and spliced in dimensionality to construct a one-dimensional input feature vector as a visual feature. This visual feature is input into a pre-trained classification model, Support Vector Machine (SVM), for fast classification, outputting the visual prediction probability distribution of the current pipe inner wall belonging to each candidate material (e.g., cement mortar, PVC, PE, cast iron, and epoxy / asphalt coating). In this embodiment, the set radius for filtering out low-frequency components is 30 pixels. Implementers can choose other classification models, such as the lightweight convolutional neural network MobileNetV3.
[0031] Secondly, based on the pose information of the pipeline robot (specifically, the location data recorded by the odometer), the GIS system or design data of the water supply network are queried, and the design material found is assigned a preset high confidence benchmark value (e.g., 0.8) as its prior probability. The remaining probability (0.2) is evenly distributed among other candidate materials to construct a complete prior probability distribution sequence.
[0032] Finally, using Bayesian rules, the visual prediction probabilities output by the classification model are fused with the prior probabilities obtained from the query to obtain the comprehensive posterior probability of each candidate material. Specifically, the prior probability of each candidate material is multiplied by the corresponding visual prediction probability output by the classification model to obtain the joint probability score of each candidate material. Then, the joint probability score of a target material is divided by the sum of the joint probability scores of all candidate materials to calculate the comprehensive posterior probability of that target material.
[0033] The maximum value in the comprehensive posterior probability is extracted. If the maximum value is greater than or equal to a preset threshold (0.9 in this embodiment), the candidate material corresponding to the maximum value is determined as the current material identification result. If the maximum value is less than the preset threshold, which usually occurs in areas with severe rust, low illumination, or mixed materials at pipe interfaces, a robust fallback strategy is triggered, and a preset benchmark rough material is determined as the current material identification result. Specifically, the mud and mortar material in the material characteristic parameter library is selected as the identification result by default. By incorporating prior information and a threshold fallback, misjudgments under extreme conditions due to purely visual judgment are effectively avoided.
[0034] Based on the material identification results determined above, the corresponding bidirectional reflectance distribution function (BRDF) and optical roughness parameters of the material are adaptively extracted from the established material property parameter library to dynamically determine and load an accurate optical reflection model. Specifically: if the identification result is mortar (belonging to rough surfaces), the Oren-Nayar diffuse reflection model is called; if the identification result is PVC or PE (belonging to smooth surfaces), a model combining diffuse reflection and Phong specular reflection is called; if the identification result is epoxy / asphalt coating, the Lambert diffuse reflection model or a weak Phong model is adaptively selected according to its surface optical roughness value in the parameter library; if the identification result is severely corroded cast iron, the high-roughness Oren-Nayar model is called; if a robust fallback strategy is triggered during material identification, the Oren-Nayar diffuse reflection model corresponding to mortar in the material property parameter library is forcibly called as the reference parameter set for loading.
[0035] After completing the above call, the selected optical reflection model parameters are updated into the established illumination propagation model to determine the material reflection function used in subsequent illumination distribution field calculations.
[0036] However, the computational cost of tracing reflection paths using light propagation simulation algorithms is enormous, making it impossible to execute in real-time during pipeline robot inspections. To meet the real-time requirements of terminal computing, this application employs a combined mechanism of "full offline pre-calculation + online dynamic retrieval" for acquiring the illumination distribution field. Specifically, in the offline pre-calculation stage: firstly, based on the acquired light source spectral power distribution and the spectral response functions of each color channel (red, green, blue) of the camera, multiplication is performed and integrated along the visible light wavelength domain to calculate the effective radiative flux of each color channel. This effective radiative flux is used as the total energy input for photons emitted by the light source. For each typical material, standard pipe diameter, and light source configuration, a Monte Carlo path tracing algorithm is used to independently emit photons for the corresponding color channel. During the tracing process, the pipeline geometric model described by the cylindrical surface parametric equations and the determined optical reflection model are combined to simulate the multiple reflections, scattering, and absorption processes of each photon on the inner wall of the pipeline. After tracking is completed, the effective radiation energy of photons at various spatial coordinates when they finally reach the inner wall of the pipe is recorded and accumulated. This energy is then mapped to the two-dimensional pixel coordinate system of the camera to generate a distribution map containing absolute irradiance values of multiple color channels. This map is then stored in the database as a reference illumination distribution field for each material.
[0037] Secondly, when the robot performs inspection, based on the current material recognition result and the robot's relative pose, the pre-calculated data of the nearest pose is directly retrieved from the database, or spatial interpolation is performed based on the data of adjacent pose nodes to calculate a multi-channel irradiance distribution map that is completely consistent with the resolution of the currently acquired image, which is then used as the input basis for subsequent radiation correction.
[0038] The aforementioned retrieval mechanism ensures single-frame correction accuracy when pipe material properties are consistent. Furthermore, since urban long-distance water supply networks are not made of a single material throughout, to address sudden environmental changes caused by joints, diameter variations, or pipe material replacements in actual networks, a dynamic mapping relationship between model parameters and robot pose needs to be established during the continuous movement of the pipeline robot to ensure the dynamic adaptability of the illumination propagation model. In specific implementation, the aforementioned material determination steps are executed cyclically at preset time intervals. Once a change in the material properties of the current pipe is detected, an optical reflection model switching action is immediately triggered, and the corresponding illumination distribution field is recalculated. As a preferred embodiment, a "parameter-position mapping table" can also be pre-established: the target water supply network is divided into several independent pipe segments according to mileage, and known design material and pipe diameter parameters are bound to each segment in the mapping table. When the pipeline robot's odometer data indicates that it has crossed the pipe segment boundary and entered a new detection segment, it can automatically switch to the corresponding pipe segment's optical reflection model and illumination distribution field according to the mapping table without waiting for the visual determination calculation results, thereby achieving a seamless dynamic transition of parameters. In this embodiment, the preset time interval is set to 2 seconds.
[0039] Step S003: Separate and extract the diffuse reflection image component from the image sequence of the inner wall of the pipe, and perform pixel-by-pixel radiometric correction on the diffuse reflection image component using the illumination distribution field to obtain the corrected image sequence.
[0040] After obtaining the accurate reference illumination distribution field for the current pipe section, it needs to be applied to the brightness correction of the actual acquired images. However, the original acquired images contain specular highlights generated by the light source directly hitting the smooth pipe wall, which violates the physical assumption of diffuse reflection in the reference illumination field. Therefore, before performing full-image illuminance compensation, the pure diffuse reflection image component must be separated.
[0041] Therefore, based on the chromaticity distribution characteristics of pixels, specular highlight areas in the image sequence of the pipe's inner wall are detected pixel by pixel. Specifically, the original acquired image is converted from the RGB color space to a normalized RGB chromaticity space, and the mean chromaticity of the entire image is calculated, along with the covariance matrix. To avoid the covariance matrix becoming a singular matrix and causing the inversion operation to crash when the image chromaticity is too uniform (e.g., a pure black pipe section), a preset minimum positive number (e.g., 1e-5) is added to the main diagonal elements of the covariance matrix for regularization. Subsequently, the Mahalanobis distance from the chromaticity value of each pixel to the mean is calculated, and pixels whose Mahalanobis distance exceeds a set threshold (e.g., the 95th quantile of the chi-square distribution) are identified as highlight pixels. For the center pixel identified as a highlight, a 5×5 pixel window is selected centered on it. All non-highlight pixels within the window are filtered out. If no non-highlight pixels exist within the window, the center pixel is marked as a severe highlight and the compensation process is skipped. If they exist, the reciprocal of the spatial Euclidean distance from the non-highlight pixel to the center pixel is used as the weighting factor to calculate the weighted average of the original pixel values of all non-highlight pixels within the window. This weighted average is then used to replace the original highlight pixel as the pure diffuse reflection image component of that pixel. The diffuse reflection image components of the non-highlight pixels retain their original pixel values to avoid being misled by directly reflected light spots in subsequent defect detection.
[0042] The generated illumination distribution field is subjected to extreme value normalization. Specifically, the maximum absolute irradiance value of the entire illumination distribution field is extracted, and the absolute irradiance of each pixel in the entire image is divided by this maximum value to obtain a normalized irradiance field with values ranging from [0,1]. The normalized irradiance field characterizes the relative intensity of light received by each pixel on the inner wall of the pipe. Simultaneously, the global statistical value of the normalized irradiance field is extracted; in this embodiment, it is the global median, which is defined as the reference irradiance and serves as the unified target benchmark for subsequent full-image brightness correction.
[0043] First, the initial grayscale value of the diffuse image component is divided by 255 to convert it into a normalized floating-point value. Then, combined with the light source intensity factor transmitted across frames, the converted diffuse image component is used to perform pixel-by-pixel illuminance compensation calculation with the normalized irradiance field, and the result is mapped to the target grayscale range using a reference irradiance. The following correction formula is applied independently to each color channel: ;in, The corrected grayscale value of the target pixel; The gray value of the diffuse image component; This corresponds to the normalized irradiance; This is the light source intensity factor (set to 1.0 in the initial frame). To prevent division by zero constant (with a value of 0.01); Use the reference irradiance. Multiply the end of the above formula by 255 to recover the grayscale dimensions of the 8-bit image; after calculation, ... Forcefully truncate to the effective grayscale range of [0, 255] to generate the corrected image sequence.
[0044] After this correction step, the overexposed areas near the light source are reduced, while the shadowed areas at the far end are raised. If a pixel is determined to be a severe highlight and the diffuse component cannot be reliably recovered, it is temporarily skipped in this step and filled in by the subsequent neighborhood compensation step.
[0045] However, due to power supply fluctuations or aging, the intensity of the LED light source in the pipeline robot can drift during operation, necessitating dynamic adjustment of the light source intensity factor to reflect actual operating conditions. Specifically, the global pixel grayscale mean of the corrected image in the current frame (divided by 255) is calculated, and its brightness deviation ratio compared to the reference irradiance of the target benchmark is determined. This ratio is the ratio of the global pixel grayscale mean of the corrected image in the current frame to the reference irradiance. The current light source intensity factor *s* is multiplied by this brightness deviation ratio to obtain the updated light source intensity factor. To avoid terminal computing power exhaustion and timing deadlock caused by single-frame loop iteration, pixel-by-pixel illuminance compensation calculations are prohibited from being re-executed within the current frame. Instead, the updated light source intensity factor calculated in the current frame is directly passed to the next frame image as the light source intensity factor for the target pixel grayscale value correction step in the next frame image. Through cross-frame transmission, smooth adaptation of the light source intensity is achieved, ensuring uniform and stable overall brightness in the continuous video sequence.
[0046] Step S004: The image after preliminary radiometric correction is sequentially subjected to adaptive neighborhood weighted compensation, adaptive local contrast enhancement, and texture enhancement with soft threshold.
[0047] To eliminate residual highlight / shadow dead zones and highlight minor defects in the pipeline (such as fine lines and corrosion pits), the images after preliminary radiometric correction are sequentially subjected to adaptive neighborhood weighted compensation, adaptive local contrast enhancement, and texture enhancement with soft thresholding.
[0048] For underexposed or overexposed pixels still existing in the corrected image (including pixels that were skipped due to severe highlights and out-of-bounds pixels with gray values less than 5 or greater than 250 after correction), an adaptive neighborhood weighting method is used for filling. A window of initial size K×K (K=7 in this embodiment) is selected centered on the target pixel. Normal pixels within the window with gray values between 5 and 250 that are not marked as severe highlights are marked as valid pixels. The weighted average of the valid neighboring pixels within the window is calculated as the filled gray value for the target pixel. The calculation formula is as follows: ;in, For target pixels The final effective grayscale value obtained after interpolation and filling The central target pixel that needs to be filled due to over-boundary movement or severe highlights. This is the index of the valid neighboring pixels within the current window that meet the judgment criteria. To comprehensively consider the bilateral filter weights based on spatial distance and grayscale differences, For the first The grayscale value of each effective neighboring pixel after radiometric correction.
[0049] To address the extreme case where the target pixel is located in a large, continuous high-brightness blind zone, resulting in zero effective pixels in the initial window (i.e., the summation term in the denominator is zero), an adaptive fallback logic is introduced: if there are no effective neighboring pixels in the current window, the window size K is dynamically expanded by a preset step size (e.g., +2) until the window contains at least one effective neighboring pixel for interpolation. The bilateral filter weights... The calculation formula is: In the formula, exp[] is an exponential function with the natural constant as the base. For target pixels Its first Two-dimensional spatial Euclidean distance between effective neighboring pixels; The standard deviation of the Gaussian kernel in the defined spatial domain determines the attenuation magnitude of the spatial distance weights. For target pixels The initial grayscale value before filling. For the first The initial grayscale value of each effective neighboring pixel. The standard deviation of the Gaussian kernel in the grayscale domain determines the attenuation magnitude of the grayscale difference weights. Through bilateral weighting, the edge sharpness of pipe wall defects is effectively preserved while filling in missing pixels. In one specific embodiment, considering the texture characteristics of the pipe image, the standard deviation of the Gaussian kernel in the spatial domain... Dynamically set to one-quarter of the current window size, i.e. This allows the spatial weight distribution to adaptively scale with the window; the standard deviation of the Gaussian kernel in the grayscale domain... The value is fixed as a preset constant that characterizes the effective grayscale fluctuation tolerance of the pipe surface. For example, the value is 25 in 8-bit images to balance the effects of smoothing and noise reduction and edge preservation.
[0050] According to the set basic sub-block size ( The filled image (e.g., 8×8 pixels) is spatially uniformly gridded into multiple non-overlapping rectangular image sub-blocks. Constrained Contrast Adaptive Histogram Equalization (CLAHE) is used to further enhance the local contrast of shadow and highlight areas. To prevent excessive amplification of noise in the uniform region of the straight section of the pipe, the algorithm adaptively adjusts the equalization intensity based on the previously obtained normalized irradiance field. Specifically, the local irradiance gradient magnitude corresponding to each image sub-block is calculated. And the median gradient magnitude of the entire graph Based on this, the contrast cropping threshold for each image sub-block is... The size of the sub-blocks is dynamically adjusted, and the specific expression is as follows: In the formula, The base clipping threshold is set to 2.0 by default. This represents the local irradiance gradient magnitude of the current image sub-block, measuring the severity of illumination changes in that area (higher value at bends, lower value in straight sections). is the median baseline value of the local irradiance gradient magnitude of all image sub-blocks in the entire image, max[] is the maximum value function, and min() is the minimum value function; In the formula, The adjusted sub-block size is defined by `max{}`, which is the function to retrieve the maximum value. The base sub-block size is defined, and round[] is the rounding function. The set size adjustment coefficient determines the sensitivity of the size to changes with the gradient. In this embodiment... .
[0051] The above method adaptively balances contrast enhancement and noise suppression based on changes in illumination gradient, using the median gradient magnitude across the entire image. As a baseline, when an image sub-block is located in an area of drastic lighting changes ( When the sub-block size is relatively large, its contrast clipping threshold is increased and the sub-block size is reduced to shrink the local receptive field and increase the stretching limit, thereby finely extracting subtle defects under light and shadow occlusion; when the sub-block is in a region of gentle lighting ( When the size is relatively small, the clipping threshold is reduced and the sub-block size is increased. By increasing the sample statistics and limiting the stretching amplitude, the background noise in flat areas is effectively prevented from being excessively amplified. In addition, the minimum values set in the formula (e.g., 0.5 and 4) provide a safety net to limit the lower bound of the parameters, avoiding computational crashes caused by extreme gradient ratios.
[0052] Finally, the CLAHE output image is processed using the unsharp masking method. Texture feature enhancement is performed. First, a smooth image is obtained using a Gaussian low-pass filter. Then, the smooth image is subtracted from the original image to obtain a high-frequency detail image containing cracks and erosion boundaries. The final output enhanced image for: ,in, To control the degree of detail sharpening stacking by setting an enhancement intensity coefficient, in this embodiment... To prevent sensor noise in flat areas from being amplified during this process, a soft threshold control is applied to the absolute value of the high-frequency detail map: if This indicates that the current high-frequency fluctuation is most likely random noise. In this case, the enhancement intensity coefficient of the corresponding pixel should be adjusted. Reduced proportionally to This step significantly improves the contrast of high-frequency defect features and effectively suppresses noise visibility in uniform regions. Specifically, This represents the high-frequency detail map at the pixel coordinates (x, y). The absolute value of a pixel represents, in a physical sense, the magnitude of grayscale fluctuation of the current pixel point from the surrounding local smooth background, and is used to measure whether the point belongs to a real edge or random background noise. This represents the preset noise tolerance threshold, used to define the boundary between the edge of a real defect and random background noise in a high-frequency signal. In a conventional 8-bit quantized (grayscale value 0-255) image sensor, the basic shot noise caused by dark current and readout noise typically fluctuates randomly between ±1 and ±2 grayscale values. In this embodiment... Setting it to 3 effectively filters out the tiny random fluctuations caused by the sensor's physical characteristics, ensuring that only the edges of real structures (such as cracks and corrosion pits) with a grayscale jump amplitude greater than or equal to 3 are given full sharpening enhancement.
[0053] Step S005: Based on the pose information of the pipeline robot, the relative pose of the camera with respect to the geometric center axis of the pipeline is calculated. Using this relative pose as a reference, the texture-enhanced image sequence is back-projected, unfolded, and stitched together to generate a panoramic unfolded image of the inner wall of the pipeline.
[0054] Through the aforementioned adaptive illumination compensation and texture enhancement processing, high-quality single-frame images of the pipe wall with uniform illumination and clear details have been generated. However, due to the cylindrical shape of the pipe wall, significant perspective and radial distortions exist at the edges of the single-frame images. To eliminate these geometric distortions and ensure that subsequent defect localization and dimensional assessment are performed on the correct physical spatial reference, panoramic geometric unfolding and stitching of the texture-enhanced image sequence are required. Specifically: First, using pre-calibrated camera intrinsic parameter matrices and radial / tangential distortion coefficients, distortion correction is performed on the texture-enhanced image sequence to restore the true linear geometry. Since underground pipelines often have natural slopes, the absolute horizontal attitude measured by the robot's IMU cannot be directly used for cylinder unfolding. Therefore, pipe wall profile offset data measured by the robot's forward-looking gimbal laser ranging function is acquired. Combined with inertial measurement data output by the IMU and odometer data output by the odometer, the relative yaw and pitch angles of the camera's optical axis relative to the current geometric center axis of the pipeline are calculated as the camera's relative pose at that moment.
[0055] In a specific embodiment, the robot's forward-facing gimbal is controlled to rotate in a preset angle sequence (e.g., sequentially facing four orthogonal directions: directly up, directly down, directly left, and directly right), and distance data from multiple reference points on the pipe wall is acquired sequentially using laser ranging measurement. Considering the displacement of the vehicle during the measurement process, before processing, the subsequent measuring points are translated and compensated to the initial normal cross-section of the first measuring point along the pipe axis in the reverse direction based on the time difference recorded synchronously by the odometer. Based on the distance data after the cross-section alignment is completed, the geometric center of the cross-section is fitted in the robot's body coordinate system, and the actual fitted radius of the pipe wall at that cross-section is calculated simultaneously. Combining the coordinates of multiple cross-section centers during continuous movement, the direction vector of a segment of the pipe's local geometric center axis is fitted. The coordinate system of adjacent frames is smoothed using Kalman filtering with the attitude data output by the IMU and the displacement data from the odometer to eliminate high-frequency noise caused by motion vibration. Finally, the spatial angle between the camera optical axis vector and the smoothed pipe center axis direction vector is calculated, and this angle is decomposed into the horizontal and vertical planes to obtain the relative yaw angle and relative pitch angle.
[0056] Using this precise relative pose and actual fitting radius as geometric unfolding parameters, the annular pipe wall region in the distortion-corrected image is unfolded into a distortion-free rectangular image by back-projection using a cylindrical model. Subsequently, using mileage data and feature point matching, consecutive frames of rectangular images are precisely stitched together to generate a seamless panoramic unfolded image of the pipe's inner wall.
[0057] Step S006: Input the panoramic unfolded image of the inner wall of the pipeline into the pre-trained defect recognition model to obtain the detection results of structural defects in the pipeline network.
[0058] Furthermore, the panoramic view of the inner wall of the pipeline is input into the defect identification model pre-deployed on the terminal. In this embodiment, a lightweight target detection network based on YOLOv8n is preferably used to infer the structural defect information of the pipeline network in real time.
[0059] In the offline training phase, defect images under various materials and lighting conditions are collected. Annotation tools are used to accurately draw the true bounding boxes surrounding the defect areas in the images, and categories such as cracks, corrosion, deformation, leakage, and delamination are mapped to preset discrete numerical labels (e.g., 0 to 4). This constructs a structured training sample set with a one-to-one correspondence between image features and target locations and categories. Data augmentation is performed through random rotation, brightness perturbation, and the addition of Gaussian noise. In this embodiment, the structured training sample set is set to contain more than 5000 image samples. When inputting the sample set into the target detection network for training, necessary training hyperparameters are set: the SGD optimizer is used, the initial learning rate is set to 0.01, the batch size is set to 16, and the total number of epochs is set to 200 epochs, until the network loss function stably converges. The optimal weight parameter file is then saved and deployed on the terminal. Internally, the model uses a Feature Pyramid Network (FPN) structure to fuse multi-scale feature maps to handle both fine cracks and large-area global corrosion detection.
[0060] During online inference, the object detection network outputs the category label, confidence score, and a two-dimensional bounding box (composed of the center point pixel coordinates, width, and height) of the defect region.
[0061] Based on the output two-dimensional detection results, namely the category and the bounding box area, the severity of defects is classified according to the procedures, providing a quantitative basis for subsequent cleaning and repair decisions. Specifically, the area of the bounding box (i.e., geometric dimensional features) is extracted and multiplied by a preset hazard factor corresponding to the category label. This product is used as the quantitative assessment value of the current defect. The preset hazard factor is a weighted coefficient pre-set according to the degree of threat posed by each defect type to the safety of the pipeline structure in the pipeline maintenance procedures. For example, for severe defects that directly affect structural strength (such as cracks, deformation, and leakage), the hazard factor is set to a higher range (e.g., 1.5 to 2.0); for surface defects that do not immediately affect structural safety (such as mild corrosion), the hazard factor is set to a lower range (e.g., 0.5 to 1.0).
[0062] Based on the real-labeled data in the aforementioned training sample set, a clustering grading benchmark is pre-constructed: the product of the true bounding box area of each defect and its corresponding hazard factor is extracted from the training sample set to construct a benchmark feature set; the benchmark feature set is divided into three clusters using the K-means clustering algorithm, and the center values of each cluster are sequentially defined as Level 1 (minor), Level 2 (moderate), and Level 3 (severe) benchmarks in ascending order. During online inference, the quantitative assessment value of the current defect is calculated with respect to the center values of the three clusters, and the defect is assigned to the cluster with the smallest absolute difference. The level corresponding to this cluster is then determined as the final severity level of the current defect.
[0063] After completing the defect extraction and classification, the pixel coordinates of the two-dimensional bounding box are inversely converted into the actual physical location of the defect in the pipeline network (including pipe segment number, axial mileage distance, and circumferential azimuth angle) by combining the feature point mapping relationship during panoramic image generation and the mileage acquisition location and time information recorded synchronously by the robot. This completes the precise coordinate positioning in the real physical world. Finally, a structured inspection report is generated and output in the terminal's built-in reporting software. The visualization results not only cover the absolute position information of the pipeline, the acquired original image and the panoramic unfolded image after texture enhancement and stitching, but also intuitively output the defect type identified by the target detection network, the two-dimensional bounding box of the defect location, and the severity level determined based on the clustering algorithm.
Claims
1. A method for detecting structural defects in pipeline networks using a pipeline robot, characterized in that, The method includes the following steps: Acquire the sequence of images of the inner wall of the pipe collected by the pipe robot, as well as the pose information and light source parameters of the pipe robot; Extract image features from the sequence of images of the inner wall of the pipe, and combine them with the pose information to determine the material identification result of the current inner wall of the pipe; based on the material identification result, call the corresponding optical reflection model from the pre-established material characteristic parameter library, and combine it with the light source parameters to establish a light propagation model to calculate the light distribution field of the current pipe. The diffuse reflection image component is separated and extracted from the image sequence of the inner wall of the pipe, and the diffuse reflection image component is radiometrically corrected pixel by pixel using the illumination distribution field to obtain the corrected image sequence. Based on the pose information, the relative pose of the camera with respect to the geometric center axis of the pipe is calculated. Using this relative pose as a reference, the corrected image sequence is unfolded and stitched together by back projection to generate a panoramic unfolded image of the inner wall of the pipe. By inputting a panoramic view of the inner wall of the pipeline into a pre-trained defect recognition model, the detection results of structural defects in the pipeline network can be obtained.
2. The method for detecting structural defects in a pipeline network using a pipeline robot as described in claim 1, characterized in that, The determination of the material identification result of the current inner wall of the pipe includes: Visual features of the pipeline inner wall image sequence are extracted, and the visual prediction probability of the current pipeline inner wall belonging to various candidate materials is output through a preset classification model. Based on the position data in the pose information, the prior probability of each candidate material corresponding to the current position of the pipe is determined. The visual prediction probability and the prior probability are fused together to make a decision, and the comprehensive posterior probability of each candidate material is obtained. The material of the current pipe inner wall is identified using the comprehensive posterior probability.
3. The method for detecting structural defects in pipeline networks using a pipeline robot as described in claim 2, characterized in that, If the maximum value in the comprehensive posterior probability is greater than or equal to a preset threshold, then the candidate material corresponding to the maximum value is determined as the material identification result; otherwise, the preset benchmark roughness material is determined as the material identification result.
4. The method for detecting structural defects in pipeline networks using a pipeline robot as described in claim 2, characterized in that, The extraction of visual features from the sequence of images of the inner wall of the pipe includes: Color features, texture features, and roughness features are extracted from the image sequence of the inner wall of the pipe. The color features, texture features, and roughness features are combined to construct a feature vector as the visual features.
5. The method for detecting structural defects in pipeline networks using a pipeline robot as described in claim 1, characterized in that, The calculation yields the current illumination distribution field of the pipeline, including: Based on the light intensity distribution and spectral power distribution in the light source parameters, combined with the geometric model of the pipe and the determined optical reflection model, the light propagation simulation algorithm is used to track the reflection and scattering path of the light emitted by the light source in the pipe, and accumulate the light energy reaching each pixel position on the inner wall of the pipe to generate the corresponding irradiance distribution map as the illumination distribution field.
6. The method for detecting structural defects in a pipeline network using a pipeline robot as described in claim 1, characterized in that, The extraction process of the diffuse reflection image components is as follows: The specular highlight region in the pipeline inner wall image sequence is detected based on the pixel chromaticity distribution features. The specular highlight region is then replaced by spatial weighted interpolation using neighboring non-highlight pixels to extract the diffuse reflection image component.
7. The method for detecting structural defects in a pipeline network using a pipeline robot as described in claim 1, characterized in that, The obtained corrected image sequence includes: The light distribution field is subjected to extreme value normalization processing to obtain a normalized irradiance field, and the global statistical value of the normalized irradiance field is extracted as a reference irradiance. By combining the light source intensity factor transmitted across frames, the diffuse image component and the normalized irradiance field are used to perform pixel-by-pixel illuminance compensation calculation, and the compensation result is mapped to the target grayscale range using the reference irradiance to generate the corrected image sequence.
8. The method for detecting structural defects in a pipeline network using a pipeline robot as described in claim 7, characterized in that, The brightness deviation ratio is calculated based on the grayscale mean of the corrected current frame image and the reference irradiance. The light source intensity factor is updated based on the brightness deviation ratio, and the updated light source intensity factor is applied to the radiometric correction of the next frame image.
9. A method for detecting structural defects in a pipeline network using a pipeline robot as described in claim 1, characterized in that, The generated panoramic view of the inner wall of the pipe includes: Obtain the contour offset measurement data of the pipe wall, and combine it with the inertial measurement data and odometer data in the pose information to calculate the relative yaw angle and relative pitch angle of the camera optical axis relative to the current geometric center axis of the pipe, which are used as the relative pose. The corrected image is then subjected to adaptive neighborhood weighted compensation, adaptive local contrast enhancement, and texture enhancement with soft thresholding in sequence. Using the relative pose as the geometric unfolding reference, the annular pipe wall region in the texture-enhanced image is back-projected into a rectangular image according to the cylindrical model. Based on the mileage data, the rectangular images of consecutive frames are feature-matched and stitched together to generate the panoramic unfolded image of the inner wall of the pipe.
10. A method for detecting structural defects in a pipeline network using a pipeline robot as described in claim 1, characterized in that, The detection results of obtaining structural defects in the pipeline network include: The defect identification model is used to identify the category information and geometric size characteristics of the defect area in the panoramic unfolding image. Based on the preset hazard factors corresponding to the geometric size characteristics and the category information, the defect quantitative assessment value is calculated. The severity level of the current defect is determined by matching the quantitative assessment value of the defect with a clustering grading benchmark pre-built based on historical defect data. The detection result is generated by combining the category information, the severity level, and the corresponding collection location information.
