A method and system for positioning a robot within a pipeline
By establishing a positioning coordinate system and video image processing algorithm inside the pipeline, and combining gyroscope and encoder to obtain robot motion information, the problem of inaccurate robot positioning inside the pipeline was solved, and efficient pipeline weld inspection was achieved.
Patent Information
- Application Number
- CN202211151994.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2042-09-21
AI Technical Summary
During pipeline inspection, the robot cannot intuitively determine its position, resulting in inaccurate matching between inspection data and position, which affects the smooth completion of weld inspection.
By establishing a robot positioning coordinate system and combining coordinate transformation and video image processing algorithms, the robot is positioned using improved grayscale equalization, three-frame difference method, Otsu's method and invariant moment algorithm. The robot motion information is obtained using gyroscopes and encoders, and the position is calibrated by combining pipeline welding process data.
This improved the robot's positioning accuracy and automation level within the pipeline, reduced computational load, and enhanced the reliability and efficiency of inspection.
Smart Images

Figure CN115511964B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of pipeline robot technology, specifically relating to a method and system for robot positioning inside a pipeline. Background Technology
[0002] Power plants and chemical plants typically operate under high temperatures and pressures, which can lead to corrosion of the inner walls or cracks in the welds. These critical pipelines are usually insulated with a protective coating and are typically installed either suspended at height or buried underground. Inspecting their internal structures, especially the internal welds, is a labor-intensive process, requiring scaffolding for high-altitude work or ground excavation.
[0003] Using robots for inspection can solve this problem well. However, since pipelines are usually long, it is not possible to intuitively determine the robot's position when inspecting inside the pipeline. Whether the data obtained from the inspection can be accurately matched with the robot's position has become one of the key factors for successfully completing the inspection of welds inside the pipeline. Summary of the Invention
[0004] To address the shortcomings of the existing technology, the present invention aims to provide a method and system for locating robots inside pipelines, which has a high degree of automation and can accurately locate robots inside pipelines, thus providing favorable conditions for automated pipeline inspection.
[0005] This invention is achieved through the following technical solution:
[0006] A method for robot positioning in a pipeline, comprising:
[0007] S1: Based on the diameter and length of the pipe to be measured, establish the robot's positioning coordinate system, determine the coordinate range and origin of the positioning coordinate system, and give the robot's initial position and initial posture.
[0008] S2: The robot's motion at the preset sampling frequency is approximated as linear motion. The displacement of the robot in the positioning coordinate system established in S1 is calculated by coordinate transformation to obtain the robot's motion coordinate points. The coordinate values corresponding to the motion coordinate points are recorded and accumulated. The motion coordinate points are connected by straight line segments to obtain the robot's travel trajectory curve.
[0009] S3: Collect video images of the robot's movement process, calibrate the robot's trajectory curve obtained in S2, and realize the robot's positioning inside the pipeline.
[0010] Preferably, in S2, the preset sampling frequency is equal to the current speed of the pipeline robot divided by the unit displacement.
[0011] Preferably, in S2, the displacement of the robot in the positioning coordinate system established in S1 is obtained by the following method:
[0012] Let the robot's coordinates at any given time be (x, y, z). old The coordinates of the next sampling time are (x, y, z). new After coordinate transformation, we get:
[0013]
[0014] Where Δx, Δy, and Δz represent displacements in the x, y, and z directions of the positioning coordinate system, respectively, R is the coordinate rotation matrix, and k is the scale factor, which is set to k = 1.
[0015] More preferably, when the robot moves forward or backward, the rotation angles α, β, and γ of the three axes of the gyroscope are used to project the displacement of the two driving wheels onto x, y, and z, and the values of Δx, Δy, and Δz are calculated using trigonometric functions. When the robot turns, the turning angle is calculated based on the displacement difference and width of the two driving wheels and the difference is taken with the rotation angles α, β, and γ of the three axes of the gyroscope. The displacement of the two driving wheels is then projected onto x, y, and z, and the values of Δx, Δy, and Δz are calculated using trigonometric functions.
[0016] Preferably, in S3, the robot trajectory curve obtained in S2 is calibrated, specifically as follows:
[0017] Based on the position of the inner ring weld of the pipeline to be tested, determined in the pipeline welding process, and projected onto the positioning coordinate system established in S1, when the inner ring weld of the pipeline to be tested appears in the video image of the robot's movement, the robot's displacement obtained in S2 is compared with the position of the inner ring weld of the pipeline to be tested, determined in the pipeline welding process, and calibration is performed.
[0018] Preferably, in S3, the robot trajectory curve obtained in S2 is calibrated, specifically including:
[0019] Step 1: Perform grayscale equalization on the acquired video images;
[0020] Step 2: The image after grayscale equalization in Step 1 is processed using the three-frame difference method and Otsu's method to obtain a binarized video image;
[0021] Step 3: Use the invariant moment algorithm to determine image similarity, and then determine whether the robot is slipping.
[0022] More preferably, step 1 specifically includes:
[0023] Step 1.1: Calculate the mean gray value M corresponding to the i-th row of pixels in a video image with M×N pixels. i The grayscale mean M corresponding to the j-th column pixel j :
[0024]
[0025]
[0026] In the formula, H(i,j) is the gray value of the pixel at coordinate (i,j) in the image;
[0027] Step 1.2: Establish a grayscale equalization model:
[0028]
[0029]
[0030] Step 1.3: Perform grayscale value correction, and compare the grayscale values H(i,j) of all pixels in the i-th row with G. i Compare the results and make corrections according to the following formula:
[0031]
[0032]
[0033] In the formula, G im G represents the average grayscale value under sufficient lighting conditions in the i-th row. jm The average grayscale value in column j under sufficient lighting conditions;
[0034] Step 1.4: Obtain the corrected grayscale value
[0035]
[0036] In the formula, w1 and w2 are weighting coefficients.
[0037] More preferably, step 2 specifically includes:
[0038] Step 2.1: Select three adjacent frames from the video. The corresponding pixel grayscale values are then processed using the grayscale mean value from step 1. Perform a difference operation on two adjacent frames to obtain d k+1,k (i,j),d k,k-1 (i,j):
[0039]
[0040]
[0041] Step 2.2: For d k+1,k (i,j),d k,k-1 Perform a logical AND operation on (i,j) to obtain d.k (i,j):
[0042] d k (i,j)=d k+1,k (i,j)∩d k,k-1 (i,j)
[0043] Step 2.3: Use Otsu's method to determine the threshold T and perform binarization.
[0044] More preferably, step 3 specifically includes:
[0045] Step 3.1: Calculate the 7 two-dimensional invariant moments of image b(i,j);
[0046] Step 3.2: Normalize the seven two-dimensional invariant moments;
[0047] Step 3.3: Continue with image grayscale equalization processing to obtain the image. The binarization method obtained by the three-frame difference method and Otsu's method is used to obtain the image b''(i,j); the seven two-dimensional invariant moments of b''(i,j) are calculated.
[0048] Step 3.4: Use the Euclidean distance algorithm to calculate the similarity distance between b''(i,j) and b(i,j). If the similarity distance is less than ε, the images are similar. The value of ε is determined by computer simulation and manual measurement in the laboratory.
[0049] The present invention discloses a pipeline robot positioning system, including an industrial control computer and a network switch, a network camera, a pan-tilt unit, a controllable light source, an encoder, a gyroscope, and a power supply mounted on the pipeline robot; the network switch is connected to the industrial control computer, the network camera, the pan-tilt unit, the encoder, the gyroscope, and the controllable light source respectively, and the network camera is mounted on the pan-tilt unit; the pipeline robot is powered by the power supply.
[0050] Compared with the prior art, the present invention has the following beneficial technical effects:
[0051] The pipeline robot localization method disclosed in this invention utilizes improved grayscale equalization, a three-frame difference method combined with an improved Otsu's method, and an image similarity judgment algorithm based on invariant moments and Euclidean distance in image processing algorithms. This reduces computational load and improves computational efficiency. Specifically, the grayscale equalization algorithm employs two weighting coefficients to effectively equalize the grayscale variations of rows and columns in the image. When using the three-frame difference method combined with the improved Otsu's method to identify moving targets, the Otsu's method is improved by refining the method for maximizing variance, thereby reducing computational load.
[0052] Furthermore, by combining robot coordinate transformation with pipeline "fingerprint" position calibration, the robot's positioning accuracy was improved. Attached Figure Description
[0053] Figure 1 This is a schematic flowchart of the method of the present invention;
[0054] Figure 2 This is a schematic diagram illustrating the intelligent anti-slip process implemented using video image processing algorithms according to the present invention;
[0055] Figure 3 This is a schematic diagram of the pipeline robot used in the embodiment. Detailed Implementation
[0056] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. These descriptions are intended to explain the invention and not to limit it.
[0057] like Figure 3 This embodiment of the pipeline robot positioning system includes an industrial control computer, a network switch, a network camera, a pan-tilt unit, a controllable light source, and a power supply. The pipeline robot in this embodiment consists of a front body, a rear body, and connecting hinges. The front body comprises a front drive wheel, a front body frame, and a front gyroscope; the rear body comprises a rear driven wheel, a rear body frame, and a rear gyroscope. The front drive wheel is equipped with an encoder. The industrial control computer is connected to the network switch and implements intelligent anti-slip and positioning algorithms for the pipeline robot, displaying its position within the pipeline. The network switch connects to the network camera, pan-tilt unit, controllable light source, and the pipeline robot. The network camera and pan-tilt unit are mounted on the front body frame of the pipeline robot. The pan-tilt unit controls the network camera, adjusting the shooting angle, etc. The controllable light source is mounted on the front body frame of the pipeline robot to provide illumination for the camera. The entire positioning system and the pipeline robot are powered by the power supply.
[0058] like Figure 1 The pipeline robot positioning method of the present invention includes the following steps:
[0059] The first step is to establish the robot's positioning coordinate system. Based on the diameter and length of the pipeline being inspected, the coordinate range of the xyz coordinate system is determined, and the origin position is established. Given the robot's initial position and orientation, the position is defined using coordinates x, y, and z, and the orientation using α, β, and γ. The pipeline robot's position and orientation can be represented by (x, y, z, α, β, γ), where α, β, and γ are the rotation angles output from the front gyroscope.
[0060] The second step is to determine the robot's displacement and orientation. A coordinate transformation is performed, assigning the robot's coordinates at any given time as (x, y, z). old The coordinates of the next sampling time are (x, y, z). newThen, the relationship between the coordinates at two time points can be expressed by formula (1), where Δx, Δy, and Δz represent the displacements in the x, y, and z directions, R is the coordinate rotation matrix, and k is the scale factor, which is taken as k = 1.
[0061]
[0062] The rotation matrix of the R-axis is obtained by merging the rotation matrix around the x-axis, the rotation matrix around the y-axis, and the rotation matrix around the z-axis.
[0063] The numerical calculations of Δx, Δy, and Δz are performed separately for each case. Specifically, based on the speed and direction of the two drive wheels of the robot, two cases are distinguished: forward / backward and left / right turn. The values of Δx, Δy, and Δz are calculated separately for each case. For forward / backward movement, the speeds of the two drive wheels are equal in magnitude and in the same direction. In this case, the rotation angles α, β, and γ of the three axes of the gyroscope are used to project the displacement of the two wheels onto x, y, and z, respectively, and the values of Δx, Δy, and Δz can be calculated using trigonometric functions. For left / right turn, the speeds of the two drive wheels are unequal in magnitude and can be either the same or different in direction. In this case, the angle of left / right turn can be calculated using the displacement difference of the two wheels and the width of the two wheels. The direction of the angle is related to the sign of the displacement difference. The difference between this angle and the rotation angles α, β, and γ of the three axes of the gyroscope are then calculated, and the displacement of the two wheels is projected onto x, y, and z, and the values of Δx, Δy, and Δz can be calculated using trigonometric functions.
[0064] By continuously sampling and calculating coordinates at short time intervals, recording and accumulating the coordinate values, and connecting the calculated coordinate points with straight line segments, the trajectory curve of the robot in the established coordinate system is obtained.
[0065] Displacement calculation is performed using photoelectric encoders. Given a sampling frequency and a given method, the rotational speed of the robot's drive wheel is proportional to the rotational speed, which increases the accuracy of displacement calculation and positioning.
[0066] The third step is robot position calibration. To avoid positional errors caused by wheel slippage or the algorithm's assumption that the robot's movement is approximately linear due to small time interval sampling, calibration is performed using intelligent anti-slip algorithms based on video images or the "fingerprint" position of the pipeline.
[0067] The intelligent anti-slip algorithm based on video image processing uses an improved grayscale equalization method, a three-frame difference method, an improved Otsu method, and an invariant moment to form a comprehensive algorithm that intelligently identifies and judges whether the robot is slipping.
[0068] Among them, such as Figure 2 The specific steps for intelligent anti-slip based on video images are as follows:
[0069] The first step is image grayscale equalization.
[0070] S1-1, calculate the mean gray value M corresponding to the i-th row of pixels in the image (M×N pixels). i The grayscale mean M corresponding to the j-th column pixel j
[0071]
[0072]
[0073] In the formula, H(i,j) is the gray value of the pixel at coordinates (i,j) in the image.
[0074] S1-2, Establish a grayscale equalization model.
[0075]
[0076]
[0077] S1-3, Gray value correction. The gray values H(i,j) of all pixels in the i-th row are compared with G... i Compare the results and make corrections according to the following formula.
[0078]
[0079]
[0080] In the formula, G im G represents the average grayscale value under sufficient lighting conditions in the i-th row. jm is the average grayscale value in column j under sufficient lighting conditions.
[0081] S1-4, Obtain the corrected grayscale value
[0082]
[0083] In the formula, w1 and w2 are weighting coefficients.
[0084] The second step is to obtain a binarized image using the three-frame difference method combined with the improved Otsu method.
[0085] S2-1, Select three adjacent frames from the video. The grayscale values of the corresponding pixels are then processed using the grayscale mean value from step one. Perform a difference operation on two adjacent frames to obtain d k+1,k (i,j),d k,k-1 (i,j).
[0086]
[0087]
[0088] S2-2, for d k+1,k (i,j),d k,k-1 Perform a logical AND operation on (i,j) to obtain d. k (i,j).
[0089] d k (i,j)=d k+1,k (i,j)∩d k,k-1 (i,j) (11)
[0090] S2-3, use Otsu's method to determine the threshold T and perform binarization.
[0091] S2-3-1, for image d k (i,j) sets the initial threshold for foreground and background segmentation.
[0092] S2-3-2, set the foreground pixel ratio wq0 and the background pixel ratio wb1, calculate the foreground average gray level μq0 and the background average gray level μb1, and calculate the total average gray level of the image μt=wq0*μq0+wb1*μb1.
[0093] S2-3-3, Calculate the variance Q = wq0 * (μq0 - μt). 2 +wb1*(μb1-μt) 2 The three-dimensional grid search method is used to traverse the entire pixel ratio and grayscale range to obtain the maximum variance value and determine the threshold T1.
[0094] Binarization is performed using T1.
[0095]
[0096] The third step is to use the invariant moment algorithm to determine image similarity, and then to determine whether slippage exists.
[0097] S3-1, calculate the 7 two-dimensional invariant moments of the image b(i,j).
[0098] S3-2, normalizes the 7 invariant moments.
[0099] S3-3, Continue with image grayscale equalization processing to obtain the image. The binarization method obtained by the three-frame difference method and Otsu's method is used to obtain the image b''(i,j); using S3-1 and S3-2, the seven invariant moments of b''(i,j) are calculated.
[0100] S3-4 uses the Euclidean distance algorithm to calculate the similarity distance between b''(i,j) and b(i,j). If the similarity distance is less than ε, the images are considered similar. The value of ε is determined through computer simulation and manual measurement in the laboratory.
[0101] The steps of the three-dimensional mesh search method are as follows.
[0102] S2-3-3-1: Calculate the range of wq0, μq0, and μb1 values based on known conditions, perform mesh scaling, and define the size of the three-dimensional mesh.
[0103] S2-3-3-2, the variance solution model is established as Q=wq0*wb1(μq0-μb1). 2 Calculate the maximum value and determine the grid.
[0104] S2-3-3-3: Based on the grid determined by the maximum variance, perform secondary grid division on the determined grid, and solve for the threshold T1 corresponding to the maximum variance.
[0105] Intelligent anti-slip functionality is achieved through video image processing algorithms during robot movement. A grayscale equalization algorithm effectively addresses image differences caused by significant brightness variations within the pipe. A three-frame difference method combined with Otsu's method enables target line recognition during robot movement. Invariant moment and Euclidean distance algorithms assess the similarity of adjacent images to determine if slippage exists.
[0106] The "fingerprint" position calibration of the pipeline involves first defining the pipeline's "fingerprint" position, then using image recognition to identify this position, and finally performing position calibration. The position of the inner circumferential weld seam is defined as the pipeline's "fingerprint" position. The pipeline welding process data details the positions of the inner and outer weld seams. The position of the inner weld seam is defined according to the coordinates established in the first step of the pipeline robot's positioning method within the pipeline. When the circumferential weld seam appears in the video, the displacement obtained by accumulating encoder and gyroscope data in the second step of the pipeline robot's positioning method within the pipeline is compared with the pipeline weld seam position data given in the pipeline welding process data to perform position calibration.
[0107] It should be noted that the above description is only a part of the embodiments of the present invention, and all equivalent changes made to the system described in this invention are included within the protection scope of this invention. Those skilled in the art can make similar substitutions to the specific examples described, as long as they do not deviate from the structure of the invention or exceed the scope defined in these claims, all of which fall within the protection scope of this invention.
Claims
1. A method for robot positioning in a pipeline, characterized in that, include: S1: Based on the diameter and length of the pipe to be measured, establish the robot's positioning coordinate system, determine the coordinate range and origin of the positioning coordinate system, and give the robot's initial position and initial posture. S2: The robot's motion at the preset sampling frequency is approximated as linear motion. The displacement of the robot in the positioning coordinate system established in S1 is calculated by coordinate transformation to obtain the robot's motion coordinate points. The coordinate values corresponding to the motion coordinate points are recorded and accumulated. The motion coordinate points are connected by straight line segments to obtain the robot's travel trajectory curve. S3: Collect video images of the robot during its movement, calibrate the robot's trajectory curve obtained in S2, and realize the robot's positioning inside the pipeline; In S3, the robot's trajectory curve obtained in S2 is calibrated, specifically as follows: Based on the location of the inner circumferential weld seam of the pipeline under test, determined in the pipeline welding process, and projected onto the positioning coordinate system established in S1, when the inner circumferential weld seam appears in the video images acquired during the robot's movement, the robot's displacement obtained in S2 is compared with the location of the inner circumferential weld seam of the pipeline under test determined in the pipeline welding process for calibration; specifically including: Step 1: Perform grayscale equalization on the acquired video images; Step 2: The image after grayscale equalization in Step 1 is processed using the three-frame difference method and Otsu's method to obtain a binarized video image; Step 3: Use the invariant moment algorithm to determine image similarity, and then determine whether the robot is slipping.
2. The pipeline robot positioning method as described in claim 1, characterized in that, In S2, the preset sampling frequency is equal to the current speed of the pipeline robot divided by the unit displacement.
3. The method for robot positioning in a pipeline as described in claim 1, characterized in that, In S2, the robot's displacement in the positioning coordinate system established in S1 is obtained by the following method: Let the robot's coordinates at any given time be (x, y, z). old The coordinates of the next sampling time are (x, y, z). new After coordinate transformation, we get: in x、 y、 z represents the displacement in the x, y, and z directions of the positioning coordinate system, R is the coordinate rotation matrix, and k is the scale factor, which is set to k=1.
4. The pipeline robot positioning method as described in claim 3, characterized in that, When the robot moves forward or backward, the rotation angles α, β, and γ of the three axes of the gyroscope are used to project the displacement of the two drive wheels onto the x, y, and z axes, and then the result is calculated using trigonometric functions. x、 y、 The value of z; when the robot turns, the turning angle is calculated based on the displacement difference and width of the two driving wheels, and then the difference is taken with the rotation angles α, β, and γ of the three axes of the gyroscope. The displacement of the two driving wheels is then projected onto x, y, and z, and the result is calculated using trigonometric functions. x、 y、 The value of z.
5. The robot positioning method in a pipeline as described in claim 1, characterized in that, Step 1 specifically includes: Step 1.1: Solve for the pixel value. The average gray level of the i-th row of pixels in the video image The average gray value corresponding to the j-th column pixel : In the formula, The coordinates in the image are The grayscale value corresponding to the pixel at that location; Step 1.2: Establish a grayscale equalization model: Step 1.3: Perform grayscale value correction, adjusting the grayscale values of all pixels in the i-th row. and Compare the results and make corrections according to the following formula: In the formula, Let be the average grayscale value of the i-th row under sufficient lighting conditions. The average grayscale value in column j under sufficient lighting conditions; Step 1.4: Obtain the corrected grayscale value : In the formula, and These are weighting coefficients. , .
6. The method for robot positioning in a pipeline as described in claim 5, characterized in that, Step 2 specifically includes: Step 2.1: Select three adjacent frames from the video. The corresponding pixel grayscale values are then processed using the grayscale mean value from step 1. , , Perform a difference operation on two adjacent frames to obtain... , : ; Step 2.2: For , Perform a logical AND operation to obtain : Step 2.3: Determine the threshold using Otsu's method T Then perform binarization.
7. The pipeline robot positioning method as described in claim 6, characterized in that, Step 3 specifically includes: Step 3.1: Calculate the image The 7 two-dimensional invariant moments; Step 3.2: Normalize the seven two-dimensional invariant moments; Step 3.3: Continue with image grayscale equalization processing to obtain the image. , , The image is obtained by combining the three-frame difference method with Otsu's method for binarization. ;Calculation obtained The 7 two-dimensional invariant moments; Step 3.4: Calculate using the Euclidean distance algorithm. and The similarity distance between them, if the similarity distance is less than If the images are similar, then they are similar. The values are determined through computer simulation and manual measurement in the laboratory.
8. A robot positioning system for pipelines, characterized in that, The method for positioning a robot inside a pipeline as described in any one of claims 1 to 7 includes an industrial control computer and a network switch, a network camera, a pan-tilt unit, a controllable light source, an encoder, a gyroscope, and a power supply mounted on the pipeline robot. The network switch is connected to the industrial control computer, the network camera, the pan-tilt unit, the encoder, the gyroscope, and the controllable light source, respectively. The network camera is mounted on the pan-tilt unit. The pipeline robot is powered by the power supply.
Citation Information
Patent Citations
Robot curved surface motion positioning method and system
CN109648558A
Pipeline panoramic scanning method based on pipeline robot
CN111192198A