CN115234845B - Projection model-based oil and gas pipeline inner wall defect image visualization detection method - Google Patents

Projection model-based oil and gas pipeline inner wall defect image visualization detection method Download PDF

Info

Publication number
CN115234845B
CN115234845B CN202210886992.7A CN202210886992A CN115234845B CN 115234845 B CN115234845 B CN 115234845B CN 202210886992 A CN202210886992 A CN 202210886992A CN 115234845 B CN115234845 B CN 115234845B
Authority
CN
China
Prior art keywords
image
pipeline
area
radius
projection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210886992.7A
Other languages
Chinese (zh)
Other versions
CN115234845A (en
Inventor
张家田
张志威
耿傲婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian Shiyou University
Original Assignee
Xian Shiyou University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xian Shiyou University filed Critical Xian Shiyou University
Priority to CN202210886992.7A priority Critical patent/CN115234845B/en
Publication of CN115234845A publication Critical patent/CN115234845A/en
Application granted granted Critical
Publication of CN115234845B publication Critical patent/CN115234845B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F17STORING OR DISTRIBUTING GASES OR LIQUIDS
    • F17DPIPE-LINE SYSTEMS; PIPE-LINES
    • F17D5/00Protection or supervision of installations
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8806Specially adapted optical and illumination features
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Pathology (AREA)
  • Immunology (AREA)
  • Analytical Chemistry (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Signal Processing (AREA)
  • Mechanical Engineering (AREA)
  • General Engineering & Computer Science (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

A visual detection method of defect image of inner wall of oil gas pipeline based on projection model, for common oil gas pipeline damage, adopt CCTV pipeline to peep the detection system and feed back the defect image information, for the pipeline panoramic image with defect characteristic, through Otsu and regional marking algorithm, position the centre of pipeline image automatically, derive the projection function through the proportion relation before imaging and after, set up the three-dimensional pipeline projection model, match and expand the panoramic image, can dispel the nonlinear distortion influence, clear and restore the pipeline defect characteristic area, improve the reliability of the quantitative analysis of small defect, offer the theoretical basis for the visual analysis of the subsequent pipeline defect, the operation process of the invention is simple, make the non-professional personnel can realize succinct, swift defect pipeline characteristic area analysis too, have certain practicality and popularization meaning.

Description

Projection model-based oil and gas pipeline inner wall defect image visualization detection method
Technical Field
The invention relates to the technical field of pipeline defect detection, in particular to an oil and gas pipeline inner wall defect image visualization detection method based on a projection model.
Background
Petroleum is an important industrial resource and a national strategic resource, and greatly influences the development status of the national industrial field. At present, oil pipes and casings are damaged and various underground accidents are caused due to the influence of various factors in the oil gas transportation process at home and abroad, wherein the conditions of casing damage, casing deformation, underground fish, lost circulation, scaling, corrosion and the like are more common. These conditions not only affect the oil recovery work, but may also cause environmental pollution of the formation in which the oil and gas transportation pipeline is located. In order to ensure efficient transportation of petroleum resources and stratum environment protection, timely overhauling of oil and gas pipeline faults is very important. The defect analysis of the oil and gas pipeline is an important means for fault detection and exploration and development of the oil and gas transportation pipeline, and the problems and the degree of the oil well are judged by corresponding measuring means before the pipeline is maintained so as to provide a corresponding engineering operation scheme.
The most common problem with oil well tubing is casing failure, where the location and extent of failure can be determined by image detection to facilitate the repair process. Distributed optical fiber is an effective method of detecting and locating pipe leaks by monitoring pipe pressure or temperature differences. Fiber optic systems have proven useful for monitoring deep well tubing leaks, such as oilfield production wells. However, oil and gas transportation consists of gravity pipelines rather than pressure pipelines, so that the optical fiber is not suitable for detecting the damage of an underground oil and gas transportation system. At present, closed Circuit Television (CCTV) is the most popular oil and gas pipeline inspection equipment because it is lower cost than lower scanner evaluation technology (set) cameras, ground Penetrating Radar (GPR), sonar, and thermal infrared imager. However, due to the large number of images that need to be detected, human fatigue and subjectivity, as well as time consumption by engineers, can be an obstacle to detecting and analyzing pipe defects by closed-circuit television images. But as image processing and artificial intelligence technology are used as diagnostic systems, the efficiency of detecting defects of underground oil and gas pipelines in the interpretation and inspection images of engineers is effectively improved.
In image processing technology, image segmentation based on mathematical morphology has been widely used in pattern recognition research. Erosion and dilation are two basic operations of morphological segmentation, typically tandem operations, for image enhancement of an object of interest. However, when the moving speed of the environmental noise or the closed circuit television in the pipeline is too high, nonlinear distortion is often caused to the image acquired by the camera, so that the detailed information of the defect area in the pipeline cannot be accurately acquired by naked eyes. For new pipeline inspection systems, local expansion of a particular identified image is required to reduce or eliminate distortion effects. In the panoramic image unfolding process, the traditional unfolding algorithm is often based on direct mapping of images, the definition of the images is reduced after the algorithm is restored, and the influence of nonlinear distortion cannot be avoided when a camera is deviated from the center.
The traditional detection technology has relatively lagged discovery and repair of the oil and gas pipeline defects, the actual condition of the pipeline defects is not clear and definite enough, and the subjectivity and blindness of the judging process exist, which may lead to various cost of later detection and repair.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention aims to provide a visual detection method for the defect image of the inner wall of the oil and gas pipeline based on a projection model, which uses Closed Circuit Television (CCTV) to feed back the defect image information and automatically positions the center of the pipeline image through Otsu and a region marking algorithm; deducing a projection function through a proportional relation before and after imaging by a pinhole camera, and establishing a three-dimensional pipeline linear projection model; fusing the unfolded images through a SIFT feature point matching algorithm to reconstruct an undistorted pipeline inner wall surface image; the unfolded defect image has high definition, eliminates nonlinear distortion influence, effectively and accurately analyzes the defect area of the oil gas pipeline, and provides a theoretical basis for the subsequent visual analysis of the oil gas pipeline.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
The visual detection method of the defect image of the inner wall of the oil and gas pipeline based on the projection model specifically comprises the following steps:
step 1, obtaining a pipeline defect image; acquiring pipeline images through a CCTV pipeline endoscopic detection system, detecting conditions including scaling, corrosion, perforation and crack in the pipeline, observing and storing video data in real time, and transmitting video to the ground;
step 2, segmenting a pipeline image area; setting a threshold value to divide the pipeline defect image area, dividing and marking each roundness area, comparing the roundness sizes, and determining a target area by sequencing and screening the largest roundness one by one;
Step 3, positioning an image center point and matching a three-dimensional projection model; taking the maximum roundness area as an area to which an image center belongs, calculating the centroid of the area as the center coordinate of a defect pipeline image, presetting the radius of the inner circle and the radius of the outer circle of a fixed value, and determining an effective unfolding area with the same size of each image;
Step 4, region unfolding mapping is carried out, a predetermined effective region is stored, a MATLAB (matrix laboratory) is used for simulating the imaging process of a camera, a three-dimensional pipeline represented by a physical unit is converted into a two-dimensional linear fitting circle through a projection function, a three-dimensional projection model is established, and the three-dimensional projection model is used as a linear imaging model of an actual camera to be matched with the effective region, so that the influence of nonlinear distortion is eliminated;
And 5, converting Cartesian coordinates I (x (r, theta), y (r, theta)) of the annular region into polar coordinates I (r, theta) by using the coordinates of the central point of the image determined in the step 3 as a polar coordinate origin, and dynamically expanding the annular effective region into a rectangular image by taking the difference between the outer circumference of the projection model and the projection radius as the length and the width.
Step 2, enhancing a central black area by intercepting a single-frame pipeline image with defect characteristics and utilizing gray level transformation; through comprehensive mathematical morphology edge detection, automatically segmenting a pipe wall image by adopting an Otsu algorithm, and removing invalid connected areas through setting a threshold value; in the residual areas, the central area is closest to the circle, the residual areas are marked with different colors by using an area marking algorithm, and the roundness of each area is calculated;
the roundness definition formula of the region in the step 2 is as follows:
Where a is the number of region pixels, p is the region boundary length, and e is the similarity of the region and the circle.
The step 3 specifically comprises the following steps: and (3) setting a threshold range for the communication area marked in the step (2), eliminating the interference of the characteristic area lower than the maximum circularity value, extracting a central area, and calculating the centroid of the central area as the central point coordinate of the pipeline image.
The threshold value range in the step 3 is 1.2-1.5.
Step 4, establishing a linear imaging model of an object plane and an image plane according to the three-dimensional space object projection relation: the model assumes that s is the pipeline projection imaging size, unit pix; d is the physical size of the space object, and the unit is mm; b is the distance between the image plane and the lens, and the unit is mm; a is the distance between the object plane and the lens, namely a=nf, and the unit is mm; then, assuming that the pixel dx=dy of a camera of the CCTV pipeline endoscope detection system and the side length is p, the unit is mm/pix, and according to the object linear projection relation, a projection function relation can be obtained:
I.e.
Wherein k=b/p is a camera constant, the unit is pix, the size of an object image is proportional to the size of the object, and the size of the object image is inversely proportional to the distance between the object and the plane of the lens; since the distance o between the image plane and the object plane is unknown, the p size cannot be determined, and therefore the k size needs to be obtained through camera calibration;
according to the projection function relation, assuming that the depth of field of a pipeline in the effective visual angle range of a camera is L, the distance between the pipeline and a plane where a camera lens of a CCTV pipeline endoscope detection system is located is DL, a camera constant is k, the pipe diameter is OD, the distance a from an image plane to an object plane is known, and according to the parameters, determining that the sizes of the projection outer circle radius r 1 and the inner circle radius r 2 of the pipeline are:
Because the projection radius of the pipeline is a fixed value, each frame of image of the same video has the same model structure, and the projection radius wrapping area with the outer circle radius r 1 and the inner circle radius r 2 is used as the effective area of the pipeline image to generate a rectangular image; the effective area is regarded as a two-dimensional image with a depth architecture, the camera lens position is taken as a starting point, and the retracting process of the outer circle radius r 1 and the inner circle radius r 2 is adopted to embody the imaging process of a camera of the CCTV pipeline endoscopic detection system from near to far; the dynamic change trend of the projection radius r of the effective area along with the distance from DL to DL+L is as follows:
Locating the single-layer annular active region with the radius value r i for the pipe z=z i; the area is equivalent to a fitted circular curve, the pipeline is scanned for one circle, points on a continuous area within a 360-degree range are calculated, and the pixel coordinates of the pipeline projection model corresponding to the current radius value are as follows:
x=ri×cos(2πθ/360°)+x0+ox
y=ri×sin(2πθ/360°)+y0+oy
Wherein θ∈ (0, 360 °), (x 0,y0) is the center point coordinates of the automatic positioning, and (ox, oy) is the compensation parameter.
In the step 5, in the front view image, O (x 0,y0) is the center coordinate of a camera of the CCTV pipeline endoscope detection system, r 1 is the outer circle radius, r 2 is the inner circle radius, and r 3 is the center circle radius; p c(xc,yc) is a point on the annular effective area of the image, the corresponding point in the unfolded image is Q (u, v), the coordinate of the P point is calculated by using the coordinate of the Q point, the pixel coordinate of the P point is assigned to the Q point, and the direct mapping relationship between two points in space is:
xc=x0+(r+v)sinθ
yc=y0+(r+v)cosθ
θ=u/R
Wherein θ is the extremum angle of the pipeline image, (x 0,y0) is the positioning center point coordinate of the image, (x c,yc) is the P-point pixel coordinate, and (u, v) is the pixel point coordinate of the Q-point;
Matching a linear camera projection model with a pipeline image, registering an eccentric image through a reference model, and defining an effective unfolding area; establishing a one-to-one correspondence between coordinate points in the pipeline image and the rectangular image through the coordinate mapping; the outer circle radius r 1 of the effective area and the minimum outer circle radius r 2 are as follows:
r1=OD/DL×k
r2=OD/(DL+L)
According to the calculation of the outer circle radius r 1 and the inner circle radius r 2 of the projection model, the width w of the unfolded image is 2 pi r 1, and the height h is L/DL multiplied by k; the pixel points in the effective area of the pipeline image can be regarded as pixel coordinates on a fitting circle with the radius of the projection model changed, and the pixel points corresponding to all different radiuses in the effective area are sequentially scanned and arranged on a rectangular image through the radius change of r 1 to r 2, and the inverse dynamic expansion formula is as follows:
u=ri cos(2π(w1→w2)/w)+x0+ox
v=ri sin(2π(w1→w2)/w)+y0+oy
Wherein w 1=2πr1 is the outer circle radius fitting circumference, w 2=2πr2 Is that is the inner circle radius fitting circumference, r i is the projection radius, and (u, v) is the pixel coordinates in the annular effective area.
Compared with the prior art, the invention has the following advantages:
The invention relates to a visual analysis method for a pipeline defect image based on three-dimensional projection, which can preliminarily judge whether a detected pipeline has defects according to a pipeline image obtained by CCTV endoscopic detection. For a pipeline panoramic image with defect characteristics, automatically positioning the center of the pipeline image through Otsu and a region marking algorithm, deducing a projection function through a proportional relation before and after imaging of a pinhole camera, establishing a three-dimensional pipeline projection model, matching and expanding the panoramic image. The design can eliminate nonlinear distortion influence, clearly restore the pipeline defect characteristic region, improve the reliability of quantitative analysis of small defects, provide theoretical basis for visual analysis of the follow-up pipeline defects, have innovative significance and have wide application prospect. The method has simple operation process, so that non-professional staff can realize simple and quick analysis of the characteristic region of the defect pipeline, and has certain practicability and popularization significance.
Drawings
FIG. 1 is a flow chart of the system of the present invention.
Fig. 2 is a block diagram of the operation of the closed circuit television monitoring system.
FIG. 3 is a schematic illustration of the center of a pipeline image and the geometric center of the image.
FIG. 4 is a pipeline defect image center point positioning result.
Fig. 5 is a graph showing the roundness calculation result of the pipeline defect image.
Fig. 6 is a three-dimensional projection schematic of a pipeline.
FIG. 7 is a schematic diagram of the result of matching the reference model with the pipeline image, wherein the pipeline center image of FIG. 7A and the pipeline eccentricity image of FIG. 7B are shown.
Fig. 8 is a schematic diagram of a defect part development result, wherein fig. 8a is a development diagram of an outer circle to a center circle effective area in fig. 7A, fig. 8B is a development diagram of a center circle to an inner ring effective area in fig. 7A, fig. 8c is a development diagram of an outer circle to a center circle effective area in fig. 7B, and fig. 8d is a development diagram of a center circle to an inner ring effective area in fig. 7B.
Fig. 9 is a view of a panoramic image in a view of a camera of the CCTV pipeline endoscope detection system, wherein fig. 9a is a schematic view of the effective area fusion of fig. 7A, and fig. 9B is a schematic view of the effective area fusion of fig. 7B.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
The visual detection method of the defect image of the inner wall of the oil and gas pipeline based on the projection model specifically comprises the following steps:
step 1, obtaining a pipeline defect image; acquiring pipeline images through a CCTV pipeline endoscopic detection system, detecting conditions including scaling, corrosion, perforation and crack in the pipeline, observing and storing video data in real time, and transmitting video to the ground;
step 2, segmenting a pipeline image area; setting a threshold value to divide the pipeline defect image area, dividing and marking each roundness area, comparing the roundness sizes, and determining a target area by sequencing and screening the largest roundness one by one;
Step 3, positioning an image center point and matching a three-dimensional projection model; taking the maximum roundness area as an area to which an image center belongs, calculating the centroid of the area as the center coordinate of a defect pipeline image, presetting the radius of the inner circle and the radius of the outer circle of a fixed value, and determining an effective unfolding area with the same size of each image;
step 4, region unfolding mapping is carried out, a predetermined effective region is stored, a camera imaging process of a CCTV pipeline endoscopic detection system is simulated through MATLAB, a three-dimensional pipeline expressed by a physical unit is converted into a two-dimensional linear fitting circle through a projection function, a three-dimensional projection model is established, the three-dimensional projection model is used as a linear imaging model of an actual camera to be matched with the effective region, and the influence of nonlinear distortion is eliminated;
And 5, converting Cartesian coordinates I (x (r, theta), y (r, theta)) of the annular region into polar coordinates I (r, theta) by using the coordinates of the central point of the image determined in the step 3 as a polar coordinate origin, and dynamically expanding the annular effective region into a rectangular image by taking the difference between the outer circumference of the projection model and the projection radius as the length and the width.
Step 2, enhancing a central black area by intercepting a single-frame pipeline image with defect characteristics and utilizing gray level transformation; through comprehensive mathematical morphology edge detection, automatically segmenting a pipe wall image by adopting an Otsu algorithm, and removing invalid connected areas through setting a threshold value; in the residual areas, the central area is closest to the circle, the residual areas are marked with different colors by using an area marking algorithm, and the roundness of each area is calculated;
the roundness definition formula of the region in the step 2 is as follows:
Where a is the number of region pixels, p is the region boundary length, and e is the similarity of the region and the circle.
And step 3, specifically, setting a threshold range for the communication area marked in the step 2, eliminating the interference of the characteristic area lower than the maximum circularity value, extracting a central area, and calculating the centroid of the central area as the central point coordinate of the pipeline image. Because the center of the pipeline is near the center of the image, the roundness of the non-center area is obviously smaller than that of the center area, and the purpose of extracting the center area can be effectively achieved through the setting of a threshold value; the video camera of the CCTV pipeline endoscope detection system moves in an offset mode, the effective area also generates integral offset, and the effective area of each frame of pipeline image is not affected by the offset by locating the center point of the image.
Step 3) the threshold value is in the range of about 1.2 to about 1.5.
Step 4, establishing a linear imaging model of an object plane and an image plane according to the three-dimensional space object projection relation: the model assumes that s is the pipeline projection imaging size, unit pix; d is the physical size of the space object, and the unit is mm; b is the distance between the image plane and the lens, and the unit is mm; a is the distance between the object plane and the lens, namely a=nf, and the unit is mm; then, assuming that the pixel dx=dy of a camera of the CCTV pipeline endoscope detection system and the side length is p, the unit is mm/pix, and according to the object linear projection relation, a projection function relation can be obtained:
I.e.
Wherein k=b/p is a camera constant, the unit is pix, the size of an object image is proportional to the size of the object, and the size of the object image is inversely proportional to the distance between the object and the plane of the lens; since the distance o between the image plane and the object plane is unknown, the size p cannot be determined, and therefore the size k is required to be obtained through the camera calibration of the CCTV pipeline endoscopic detection system;
According to the projection function relation, the sizes of the outer circle radius r 1 and the inner circle radius r 2 of the pipeline projection are determined according to the parameters, wherein the depth of field of the pipeline in the effective visual angle range of the video camera of the CCTV pipeline endoscopic detection system is L, the distance between the pipeline and the plane where the video camera lens of the CCTV pipeline endoscopic detection system is located is DL, the video camera constant is k, the pipe diameter is OD, and the distance a from the image plane to the object plane is known:
Because the projection radius of the pipeline is a fixed value, each frame of image of the same video has the same model structure, and the projection radius wrapping area with the outer circle radius r 1 and the inner circle radius r 2 is used as the effective area of the pipeline image to generate a rectangular image; the effective area is regarded as a two-dimensional image with a depth architecture, the camera lens position is taken as a starting point, and the retracting process of the outer circle radius r 1 and the inner circle radius r 2 reflects the imaging process of the camera from near to far; the dynamic change trend of the projection radius r of the effective area along with the distance from DL to DL+L is as follows:
Locating the single-layer annular active region with the radius value r i for the pipe z=z i; the area is equivalent to a fitted circular curve, the pipeline is scanned for one circle, points on a continuous area within a 360-degree range are calculated, and the pixel coordinates of the pipeline projection model corresponding to the current radius value are as follows:
x=ri×cos(2πθ/360°)+x0+ox
y=ri×sin(2πθ/360°)+y0+oy
Wherein θ∈ (0, 360 °), (x 0,y0) is the center point coordinates of the automatic positioning, and (ox, oy) is the compensation parameter.
In the step 5, in the front view image, O (x 0,y0) is the center coordinate of a camera of the CCTV pipeline endoscope detection system, r 1 is the outer circle radius, r 2 is the inner circle radius, and r 3 is the center circle radius; p c(xc,yc) is a point on the annular effective area of the image, the corresponding point in the unfolded image is Q (u, v), the coordinate of the P point is calculated by using the coordinate of the Q point, the pixel coordinate of the P point is assigned to the Q point, and the direct mapping relationship between two points in space is:
xc=x0+(r+v)sinθ
yc=y0+(r+v)cosθ
θ=u/R
Wherein θ is the extremum angle of the pipeline image, (x 0,y0) is the positioning center point coordinate of the image, (x c,yc) is the P-point pixel coordinate, and (u, v) is the pixel point coordinate of the Q-point;
Matching a linear camera projection model with a pipeline image, registering an eccentric image through a reference model, and defining an effective unfolding area; establishing a one-to-one correspondence between coordinate points in the pipeline image and the rectangular image through the coordinate mapping; the outer circle radius r 1 of the effective area and the minimum outer circle radius r 2 are as follows:
r1=OD/DL×k
r2=OD/(DL+L)
According to the calculation of the outer circle radius r 1 and the inner circle radius r 2 of the projection model, the width w of the unfolded image is 2 pi r 1, and the height h is L/DL multiplied by k; the pixel points in the effective area of the pipeline image can be regarded as pixel coordinates on a fitting circle with the radius of the projection model changed, and the pixel points corresponding to all different radiuses in the effective area are sequentially scanned and arranged on a rectangular image through the radius change of r 1 to r 2, and the inverse dynamic expansion formula is as follows:
u=ri cos(2π(w1→w2)/w)+x0+ox
v=ri sin(2π(w1→w2)/w)+y0+oy
Wherein w 1=2πr1 is the outer circle radius fitting circumference, w 2=2πr2 is the inner circle radius fitting circumference, r i is the projection radius, and (u, v) is the pixel coordinates in the annular effective area.
Referring to fig. 1, the design system of the present invention is divided into a defect image acquisition part, an image center point positioning part and a characteristic region unfolding part, and the closed-loop television monitoring system is used for acquiring pipeline image information in real time and recording the picture of each frame. The image segmentation is to divide areas with different colors for the pipeline image with defects. The value of the roundness is an estimate of the approximate circles of the different regions. And the center positioning is to calculate the coordinates of the center point of the panoramic pipeline image. The three-dimensional projection model is a reference model established by utilizing actual pipeline information according to a projection function. The model matching shown is the process of correcting distorted images. The region expansion is to rearrange the pixel coordinate points of the defect region according to the coordinate mapping.
Referring to fig. 2, the defect identification of the present invention adopts a CCTV pipeline endoscope detection system, wherein the CCTV pipeline endoscope detection system in step 1 comprises a main controller, a cable rack and a robot with a camera; the main controller controls the advancing speed and the advancing direction of the robot in the pipeline, and the camera is controlled to transmit video images in the pipeline to the main controller display screen through the cable, so that the internal condition of the pipeline can be detected, and meanwhile, the original image record is stored.
Referring to fig. 3, the resolution of the image of the defect pipeline randomly intercepted in the monitoring device is 640×480 pixels. And intercepting three frames of images with defects, marking the geometric center of the images as blue points, and marking the pipeline center as red points. In this embodiment, statistics are performed on coordinate points of the pipeline center and the geometric center of the three-frame image in fig. 3, and the results are shown in table 1. The data indicate that the pipe centers of different frames are offset in either the vertical or horizontal direction, while the geometric center of the pipe remains unchanged. When the center of the pipeline is used as the circle center and the same inner and outer circle radius is preset, the effective area of each frame of image is also shifted wholly.
TABLE 1 pipeline center and image geometry center coordinates
Referring to fig. 4-5, the center point of each frame of acquired pipeline image is taken as the center of a circle by the proposed automatic positioning algorithm, and the radius of the inner circle and the outer circle of a fixed value is preset, so that the effective expansion area with the same size of each image can be determined. The gray level transformation can be utilized to enhance the image of the tube wall according to the imaging characteristics of the tube wall, and the central black area is highlighted. And then automatically dividing the pipe wall image by adopting an Otsu algorithm, wherein the image after threshold segmentation contains an invalid noise region. And then removing ineffective small connected areas by setting a proper threshold value, wherein the central area is closest to a circle in the remaining connected areas, marking the remaining areas with different colors by using an area marking method, and calculating the roundness of each area. Because the center of the pipeline is positioned near the center of the image, the roundness of the non-central area is obviously smaller than that of the central area, the interference of the non-central area is eliminated by setting a proper threshold range, and the centroid of the central area is calculated to be used as the center point coordinate of the forward-looking pipeline image.
Referring to fig. 6-7, a model building and matching process after center coordinates are determined is shown, and it is assumed that the depth of field of the pipeline in the effective view angle range of the camera is L, the distance between the pipeline and the plane of the camera lens is DL, and the camera constant is k according to the projection relation. When the camera is centered in the pipeline (the central axis of the camera coincides with the central axis of the pipeline), the image of the target pipeline (a section of cylinder with the height h on the pipeline) in the camera is concentric circular rings. The circle center corresponds to the central axis of the camera to project an image point. The stationary point coordinates (oox, ooy) coincide with the center (ox, oy) of the pipeline, and the image of the section of the pipeline parallel to the plane of the camera lens with the distance d=l+dl-z (0.ltoreq.z.ltoreq.h) is a circle with the center (ox, oy) and the radius r 0/d according to the imaging principle. And according to the pipeline projection pixel points, fitting the quasi-forward imaging image as a reference model of the pipeline undistorted image through the change of the radius. The forward-looking image and the model are imaged by a camera belonging to the same illumination area, and the center point positioning coordinate is used as a reference model center position and a matched image, so that an effective area is standardized, and the nonlinear distortion influence of the image is eliminated.
Referring to fig. 8, a result of expanding a defect image after model matching is shown, and a pipeline linear projection model is constructed through projection function relations of formulas (6) and (7). Three fitting curves are used as region datum lines, blue represents the maximum effective region radius, green represents the median depth in the depth of field of the forward-looking pipeline image, and red represents the minimum effective region radius. And taking the automatic center point positioning result as a model center, and matching with a reference model. In this embodiment, the camera is calibrated to obtain a camera constant k of 200, the length of the illumination effective area L is assumed to be 120mm, the distance DL from the camera lens to the effective area is assumed to be 40mm, the radius OD of the pipe is known to be 50mm, and an unfolding experiment is performed on the image 7A and the image 7B matched with the reference model. The influence of nonlinear distortion is eliminated from the unfolded image, the length and width of the unfolded image are kept consistent, and the image characteristics are basically reserved.
Referring to fig. 9, which is a view of a panoramic image in a view of a camera, the effective areas from the outer circle to the inner circle of fig. 7A and 7B are registered and fused by a SIFT algorithm. And obtaining a fusion image in a 360-degree area of the forward-looking shaft. The length and width of the fused image are basically kept unchanged, the image transition after each row of pixels are accumulated is smooth, gaps are obviously eliminated before and after image splicing, other data of the image are basically kept complete except for the pixel part in the deeper region, and the expected effect is consistent. Meanwhile, a favorable reference value is provided for the characteristic evaluation and quantitative analysis statistics of the subsequent global image, and the generation of unnecessary statistical errors is avoided.

Claims (5)

1. The visual detection method of the defect image of the inner wall of the oil and gas pipeline based on the projection model is characterized by comprising the following steps of: the method specifically comprises the following steps:
step 1, obtaining a pipeline defect image; acquiring pipeline images through a CCTV pipeline endoscopic detection system, detecting conditions including scaling, corrosion, perforation and crack in the pipeline, observing and storing video data in real time, and transmitting video to the ground;
step 2, segmenting a pipeline image area; setting a threshold value to divide the pipeline defect image area, dividing and marking each roundness area, comparing the roundness sizes, and determining a target area by sequencing and screening the largest roundness one by one;
Step 3, positioning an image center point and matching a three-dimensional projection model; taking the maximum roundness area as an area to which an image center belongs, calculating the centroid of the area as the center coordinate of a defect pipeline image, presetting the radius of the inner circle and the radius of the outer circle of a fixed value, and determining an effective unfolding area with the same size of each image;
Step 4, region unfolding mapping is carried out, a predetermined effective region is stored, a MATLAB (matrix laboratory) is used for simulating the imaging process of a camera, a three-dimensional pipeline represented by a physical unit is converted into a two-dimensional linear fitting circle through a projection function, a three-dimensional projection model is established, and the three-dimensional projection model is used as a linear imaging model of an actual camera to be matched with the effective region, so that the influence of nonlinear distortion is eliminated;
Step 4, establishing a linear imaging model of an object plane and an image plane according to the three-dimensional space object projection relation: the model assumes that s is the pipeline projection imaging size, unit pix; d is the physical size of the space object, and the unit is mm; b is the distance between the image plane and the lens, and the unit is mm; a is the distance between the object plane and the lens, namely a=nf, and the unit is mm; then assuming that the pixel dx=dy of the camera and the side length is p, the unit is mm/pix, and according to the object linear projection relation, a projection function relation can be obtained:
I.e.
Wherein k=b/p is a camera constant, the unit is pix, the size of an object image is proportional to the size of the object, and the size of the object image is inversely proportional to the distance between the object and the plane of the lens; since the distance o between the image plane and the object plane is unknown, the p size cannot be determined, and therefore the k size needs to be obtained through camera calibration;
According to the projection function relation, assuming that the depth of field of a pipeline in the effective visual angle range of a camera is L, the distance between the pipeline and a plane where a camera lens is located is DL, the camera constant is k, the pipe diameter is OD, and the distance a from an image plane to an object plane is known, determining that the sizes of the projected outer circle radius r 1 and the projected inner circle radius r 2 of the pipeline are:
Because the projection radius of the pipeline is a fixed value, each frame of image of the same video has the same model structure, and the projection radius wrapping area with the outer circle radius r 1 and the inner circle radius r 2 is used as the effective area of the pipeline image to generate a rectangular image; the effective area is regarded as a two-dimensional image with a depth architecture, the camera lens position is taken as a starting point, and the retracting process of the outer circle radius r 1 and the inner circle radius r 2 reflects the imaging process of the camera from near to far; the dynamic change trend of the projection radius r of the effective area along with the distance from DL to DL+L is as follows:
Locating the single-layer annular active region with the radius value r i for the pipe z=z i; the area is equivalent to a fitted circular curve, the pipeline is scanned for one circle, points on a continuous area within a 360-degree range are calculated, and the pixel coordinates of the pipeline projection model corresponding to the current radius value are as follows:
x=ri×cos(2πθ/360°)+x0+ox
y=ri×sin(2πθ/360°)+y0+oy
Wherein, θ∈ (0, 360 °), (x 0,y0) is the center point coordinate of automatic positioning, and (ox, oy) is the compensation parameter;
Step 5, using the coordinates of the central point of the image determined in the step 3 as a polar coordinate origin, converting Cartesian coordinates I (x (r, theta), y (r, theta)) of the annular region into polar coordinates I (r, theta), and dynamically expanding the annular effective region into a rectangular image by taking the difference between the outer circumference of the projection model and the projection radius as the length and the width;
In the step 5, in the front view image, O (x 0,y0) is the center coordinate of the camera, r 1 is the outer circle radius, r 2 is the inner circle radius, and r 3 is the center circle radius; p c(xc,yc) is a point on the annular effective area of the image, the corresponding point in the unfolded image is Q (u, v), the coordinate of the P point is calculated by using the coordinate of the Q point, the pixel coordinate of the P point is assigned to the Q point, and the direct mapping relationship between two points in space is:
xc=x0+(r+v)sinθ
yc=y0+(r+v)cosθ
θ=u/R
wherein θ is the extremum angle of the pipeline image, (x 0,y0) is the positioning center point coordinate of the image, (x c,yc) is the P-point pixel coordinate, and (u, v) is the pixel point coordinate of the Q-point;
Matching a linear camera projection model with a pipeline image, registering an eccentric image through a reference model, and defining an effective unfolding area; establishing a one-to-one correspondence between coordinate points in the pipeline image and the rectangular image through the coordinate mapping; the outer circle radius r 1 of the effective area and the minimum outer circle radius r 2 are as follows:
r1=OD/DL×k
r2=OD/(DL+L)
According to the calculation of the outer circle radius r 1 and the inner circle radius r 2 of the projection model, the width w of the unfolded image is 2 pi r 1, and the height h is L/DL multiplied by k; the pixel points in the effective area of the pipeline image are regarded as pixel coordinates on a fitting circle with the radius of the projection model changed, and the pixel points corresponding to all different radiuses in the effective area are scanned in sequence and arranged on a rectangular image through the radius change of r 1 to r 2, and the inverse dynamic expansion formula is as follows:
u=ricos(2π(w1→w2)/w)+x0+ox
v=risin(2π(w1→w2)/w)+y0+oy
Wherein w 1=2πr1 is the fitted circumference of the outer circle radius r 1, w 2=2πr2 is the fitted circumference of the inner circle radius r 2, r i is the projected radius, and (u, v) is the pixel coordinates in the annular effective area.
2. The projection model-based visual detection method for the defect image of the inner wall of the oil and gas pipeline is characterized in that: step 2, enhancing a central black area by intercepting a single-frame pipeline image with defect characteristics and utilizing gray level transformation; automatically segmenting a pipe wall image by adopting an Otsu algorithm through comprehensive mathematical morphology edge detection, and removing invalid small communication areas by setting a proper threshold; and in the remaining areas, the central area is closest to a circle, the remaining areas are marked with different colors by using an area marking algorithm, and the roundness of each area is calculated.
3. The projection model-based visual detection method for the defect image of the inner wall of the oil and gas pipeline, which is characterized in that: the roundness definition formula of the region in the step 2 is as follows:
Where a is the number of region pixels, p is the region boundary length, and e is the similarity of the region and the circle.
4. The projection model-based visual detection method for the defect image of the inner wall of the oil and gas pipeline is characterized in that: the step 3 specifically comprises the following steps: and (3) setting a threshold range for the communication area marked in the step (2), eliminating the interference of the characteristic area lower than the maximum circularity value, extracting a central area, and calculating the centroid of the central area as the central point coordinate of the pipeline image.
5. The projection model-based visual detection method for the defect image of the inner wall of the oil and gas pipeline is characterized in that: the threshold value range in the step 3 is 1.2-1.5.
CN202210886992.7A 2022-07-26 2022-07-26 Projection model-based oil and gas pipeline inner wall defect image visualization detection method Active CN115234845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210886992.7A CN115234845B (en) 2022-07-26 2022-07-26 Projection model-based oil and gas pipeline inner wall defect image visualization detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210886992.7A CN115234845B (en) 2022-07-26 2022-07-26 Projection model-based oil and gas pipeline inner wall defect image visualization detection method

Publications (2)

Publication Number Publication Date
CN115234845A CN115234845A (en) 2022-10-25
CN115234845B true CN115234845B (en) 2024-07-23

Family

ID=83674937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210886992.7A Active CN115234845B (en) 2022-07-26 2022-07-26 Projection model-based oil and gas pipeline inner wall defect image visualization detection method

Country Status (1)

Country Link
CN (1) CN115234845B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117309903B (en) * 2023-10-10 2024-05-07 青岛峻海物联科技有限公司 Method and device for positioning defects in tunnel

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114742797A (en) * 2022-04-12 2022-07-12 清华大学 Defect detection method for drainage pipeline inner wall panoramic image and image acquisition robot

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7162073B1 (en) * 2001-11-30 2007-01-09 Cognex Technology And Investment Corporation Methods and apparatuses for detecting classifying and measuring spot defects in an image of an object
CN102135236B (en) * 2011-01-05 2013-05-01 北京航空航天大学 Automatic non-destructive testing method for internal wall of binocular vision pipeline
US11029283B2 (en) * 2013-10-03 2021-06-08 Schlumberger Technology Corporation Pipe damage assessment system and method
CN110390649B (en) * 2019-07-16 2023-03-24 西安石油大学 Method for reducing noise of oil and gas pipeline weld image
EP4001735B1 (en) * 2020-11-18 2024-04-10 Georg Fischer Rohrleitungssysteme AG Monitoring of pipe systems

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114742797A (en) * 2022-04-12 2022-07-12 清华大学 Defect detection method for drainage pipeline inner wall panoramic image and image acquisition robot

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于主动式全景视觉的管道形貌缺陷检测系统;汤一平;鲁少辉;吴挺;韩国栋;;红外与激光工程;20161125(第11期);1117005-1-1117005-7 *
基于图像处理技术的管道裂缝检测方法研究;董晴晴;王宏涛;李灏;;应用科技;20170428(01);96-100 *

Also Published As

Publication number Publication date
CN115234845A (en) 2022-10-25

Similar Documents

Publication Publication Date Title
Attard et al. Tunnel inspection using photogrammetric techniques and image processing: A review
CN109544679B (en) Three-dimensional reconstruction method for inner wall of pipeline
JP6289564B2 (en) Method, apparatus and computer readable medium for detecting changes to structures
CN102135236B (en) Automatic non-destructive testing method for internal wall of binocular vision pipeline
CN111047568B (en) Method and system for detecting and identifying steam leakage defect
CN101109715B (en) Optical method for detecting defect on inner wall of holes
CN102927448A (en) Undamaged detection method for pipeline
CA3027904C (en) Quantitative surface measurements by combining image and height profile data
CN106996748A (en) Wheel diameter measuring method based on binocular vision
Kunzel et al. Automatic analysis of sewer pipes based on unrolled monocular fisheye images
CN110378884B (en) Method for carrying out eccentricity correction and expansion transformation on in-tube visual detection video
CN115234845B (en) Projection model-based oil and gas pipeline inner wall defect image visualization detection method
CN115841449B (en) Monocular distance measurement method for longitudinal positioning of structural defect of drainage pipeline and storage medium
CN116804359A (en) Virtual rock core imaging equipment and method based on forward-looking panoramic drilling shooting
Wu et al. An in-pipe internal defects inspection system based on the active stereo omnidirectional vision sensor
CN105023270A (en) Proactive 3D stereoscopic panorama visual sensor for monitoring underground infrastructure structure
CN114941807A (en) Unmanned aerial vehicle-based rapid monitoring and positioning method for leakage of thermal pipeline
CN117214172A (en) Method and device for detecting defects of inner wall of long barrel cylinder and storage medium
CN112102395A (en) Autonomous inspection method based on machine vision
Shang et al. Single-pass inline pipeline 3D reconstruction using depth camera array
JP2009052907A (en) Foreign matter detecting system
WO2023159180A1 (en) Single-pass 3d reconstruction of internal surface of pipelines using depth camera array
CN113506208B (en) Annular image plane unfolding method of forward-looking drilling visual observer
CN113358659B (en) Camera array type imaging method for automatic detection of high-speed rail box girder crack
CN115409691A (en) Bimodal learning slope risk detection method integrating laser ranging and monitoring image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant