A Visual-Based Method for Detecting the Appearance Quality of Gas Pipelines
Through axial and radial X-ray image acquisition and processing, the depression and crack areas of the gas pipeline are generated, and the quality evaluation index is calculated, which solves the problem of inaccurate detection from a single perspective, and realizes the accurate detection and maintenance basis for the appearance quality of the gas pipeline.
Patent Information
- Application Number
- CN202411414906.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2044-10-11
AI Technical Summary
The existing gas pipeline appearance quality detection methods are unable to fully display the location and morphological characteristics of the crack structure due to the limitations caused by a single viewing angle or a specific angle, resulting in inaccurate detection results.
Axial and radial X-ray image acquisition is adopted to generate the first and second identification images, mark the depression and crack division points, generate the depression and crack areas, collect comprehensive quality data, calculate the quality evaluation index, and formulate a detection report.
It realizes a comprehensive three-dimensional display of the crack structure of the gas pipeline, avoids visual blind spots, improves detection accuracy, and provides an accurate basis for quality evaluation and maintenance.
Smart Images

Figure CN119338775B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and more specifically, to a vision-based method for detecting the appearance quality of gas pipelines. Background Art
[0002] The quality of gas pipelines often affects the safety of energy transportation. Therefore, it is crucial to detect the quality of gas pipelines. Cracks are a relatively common defect in gas pipelines. When the length and depth of the cracks are relatively deep and the area is relatively large, these cracks will cause the firmness and airtightness of the gas pipelines to decay, resulting in a reduction in safety. In order to timely detect the cracks in gas pipelines and perform subsequent maintenance on the gas pipelines, it is necessary to accurately detect the cracks on the gas pipelines.
[0003] The patent application with the publication number CN117830300A discloses a vision-based method for detecting the appearance quality of gas pipelines, which realizes the enhancement of the target surface image, solves the technical problem of poor accuracy in crack defect quality detection due to poor image enhancement effect, and improves the image enhancement effect and the accuracy of crack defect quality detection.
[0004] The existing technology has the following deficiencies:
[0005] When detecting the appearance quality of existing gas pipelines, images of the gas pipelines are taken from a certain perspective or angle, and image processing technology is combined to identify the areas where cracks are located in the images, so as to judge the degree of influence of the size and shape of the cracks on the gas pipelines. Since the gas pipelines are tubular structures, the images of the gas pipelines taken from a single perspective or a specific angle have limitations and cannot comprehensively and stereoscopically display the crack structure positions and morphological characteristics on the gas pipelines, resulting in easy occurrence of dead angle phenomena during subsequent crack data collection, further causing inaccurate calculation results and reducing the accuracy of the appearance quality detection and evaluation of gas pipelines.
[0006] In view of this, the present invention proposes a vision-based method for detecting the appearance quality of gas pipelines to solve the above problems. Summary of the Invention
[0007] In order to overcome the above defects of the existing technology and to achieve the above object, the present invention provides the following technical solution: A vision-based method for detecting the appearance quality of gas pipelines, including:
[0008] Obtain the first X-ray image of the gas pipeline, and after superimposing the first X-ray images, generate a first recognition image;
[0009] Mark the depression demarcation points in the first recognition image, and after connecting the depression demarcation points, generate a depression area;
[0010] Obtain the second X-ray image of the gas pipeline. After splicing the second X-ray images, generate a second recognition image;
[0011] Mark the crack demarcation points in the second recognition image. After connecting the crack demarcation points, generate a crack area;
[0012] Collect the comprehensive quality data of the depression area and the crack area, and generate a quality assessment index based on the comprehensive quality data. The comprehensive quality data includes the safety spacing value, the crack area ratio, and the span ratio;
[0013] Based on the quality assessment index, mark the dangerous cracks, and formulate a quality inspection report for the gas pipeline according to the dangerous cracks. The quality inspection report includes the repairable state and the non-repairable state.
[0014] Furthermore, the method for obtaining the first X-ray image includes:
[0015] Scan the gas pipeline from the axial position on any side through an X-ray device to obtain a scanned image;
[0016] Identify the outer contour of the gas pipeline in the scanned image through computer vision technology, and draw a line along the outer contour to obtain the outer boundary of the gas pipeline;
[0017] Query the outer diameter of the gas pipeline through a technical parameter table, and draw two auxiliary lines on the scanned image whose endpoints are both located on the outer boundary of the gas pipeline and whose lengths are the same as the outer diameter of the gas pipeline, and mark the intersection point of the two auxiliary lines as the center point;
[0018] Continuously adjust the horizontal position of the gas pipeline until the center point coincides with the scanning midpoint of the X-ray device and then stop adjusting;
[0019] Mark i scanning positions equidistantly along the axis of the gas pipeline with a preset step amplitude as the standard;
[0020] Set the tube voltage of the X-ray device, and control the X-ray device to scan the i scanning positions in sequence to obtain i first X-ray images;
[0021] The method for generating the first recognition image includes:
[0022] Scan and identify the shadow areas and blank areas in the i first X-ray images;
[0023] Convert the shadow areas in the i first X-ray images into transparent areas through image processing technology, and render the blank areas into rendered areas to obtain i rendered images;
[0024] Align the center points of the i rendered images in sequence according to the chronological order of scanning time;
[0025] Take the rendered image in the first position as the still image, and simultaneously move the remaining i - 1 rendered images towards the still image, forcing the rendering areas to be sequentially superimposed and extended onto the transparent area;
[0026] Denote the i superimposed rendered images as the first recognition image.
[0027] Furthermore, the marking method for the concave area includes:
[0028] Take the upper boundary of the first recognition image as the effective boundary, and sequentially measure the distance values from p rendering areas to the effective boundary to obtain p boundary distance values;
[0029] Take the rendering area corresponding to the minimum value of the boundary distance values as the base point, and sequentially number the p rendering areas in ascending order in the clockwise direction;
[0030] In the order of increasing numbers, sequentially mark k demarcation points at equal intervals on the p rendering areas;
[0031] Continuously adjust the positions of the k demarcation points until all k demarcation points reach the critical positions, and then denote the k demarcation points as k concave demarcation points;
[0032] After sequentially connecting the k concave demarcation points of the p rendering areas, form p area closed lines;
[0033] Through image processing technology, sequentially draw closed lines matching the outer boundary of the gas pipeline at the openings of the p area closed lines to obtain p closed lines;
[0034] Connect the two ends of the p area closed lines to the two ends of the p closed lines respectively for enclosure, and denote the enclosed area as the concave area to obtain p concave areas.
[0035] Furthermore, the method for obtaining the second X - ray image includes:
[0036] Taking a preset angle value as the standard, rotate the gas pipeline clockwise and mark s shooting angles;
[0037] Use the X - ray device to sequentially take pictures at the s shooting angles to obtain s angular images;
[0038] In the order of the shooting time, sequentially number the s angular images in ascending order to obtain s second X - ray images;
[0039] The method for generating the second recognition image includes:
[0040] Sequentially mark the head splicing edge and the tail splicing edge of the s second X - ray images, and mark the head splicing point and the tail splicing point on the head splicing edge and the tail splicing edge;
[0041] Align and splice the first splicing edge of the s-th second X-ray image with the last splicing edge of the (s - 1)-th second X-ray image in ascending order of numbers to obtain a spliced recognition image with a splicing area;
[0042] In the spliced recognition image, align the first splicing point of the s-th second X-ray image with the last splicing point of the (s - 1)-th second X-ray image to obtain a spliced recognition image with a splicing area and splicing points;
[0043] After performing edge smoothing processing on the splicing area through image processing technology and hiding the splicing points, a second recognition image is obtained.
[0044] Further, the method for generating the crack area includes:
[0045] Scan and mark all pixel points in the second recognition image, and record the pixel values of all pixel points one by one;
[0046] Mark the pixel points with pixel values greater than the preset pixel threshold as target pixel points, and mark the area where the target pixel points are located as the target area to obtain p target areas;
[0047] Draw lines along the edges of the p target areas to obtain the target area boundary lines, and mark w target pixel points on the target area boundary lines respectively;
[0048] Continuously adjust the distance between two adjacent target pixel points until the distance between two adjacent target pixel points is the same as the preset boundary distance and then stop adjusting;
[0049] Mark the adjusted target pixel points as crack boundary points to obtain w crack boundary points. After connecting the w crack boundary points of the p target areas in sequence, p crack areas are obtained.
[0050] Further, the method for obtaining the safety distance value includes:
[0051] Identify the inner contour of the gas pipeline in the first recognition image through computer vision technology, and draw a line along the inner contour to obtain the inner boundary of the gas pipeline;
[0052] Starting from the center point of the first recognition image, draw distance lines passing through the depression area respectively to obtain m distance lines;
[0053] Mark the intersection points of the distance lines and the inner boundary of the gas pipeline as inner points, and mark the intersection points of the distance lines and the boundary of the depression area as outer points;
[0054] Measure the distances from the inner points to the outer points on the m distance lines in the p depression areas in sequence to obtain m sub-safety values;
[0055] Compare the magnitudes of the m sub - safety values one by one, and record the minimum value of the sub - safety values as the safety spacing value, obtaining p safety spacing values.
[0056] Furthermore, the method for obtaining the ratio of the crack area includes:
[0057] Count the number of target pixel points in each of the p crack regions one by one, obtaining p target quantity values;
[0058] Count the total number of all pixel points in the second recognition image, obtaining the total pixel point value;
[0059] Compare the p target quantity values with the total pixel point value one by one, obtaining p ratios of the crack area;
[0060] The expression for the ratio of the crack area is:
[0061]
[0062] In the formula, MJ zbp is the p - th ratio of the crack area, SL mbp is the p - th target quantity value, ZL xs is the total pixel point value.
[0063] Furthermore, the method for obtaining the ratio of the span includes:
[0064] Taking the long side of the second recognition image as the division direction and the preset division length as the division width, equally divide the second recognition image into v sub - regions at equal intervals;
[0065] Mark the sub - regions that the crack regions completely span as the first regions, and count the number of the first regions, obtaining p first - region values;
[0066] Mark the sub - regions that the crack regions do not completely span as the second regions, obtaining x second regions, and mark the target pixel points within the second regions;
[0067] Measure the distance values between any two target pixel points within the x second regions in sequence, and record the maximum value of the distance values as the effective distance value, obtaining x effective distance values;
[0068] Compare the x effective distance values with the width of the sub - regions in sequence, obtaining x sub - span values;
[0069] The expression for the sub - span value is:
[0070]
[0071] In the formula, KD zpx is the x - th sub - span value of the p - th crack region, JL yxpx is the x - th effective distance value of the p - th crack region, JLkd is the width of the sub-region;
[0072] Record the sub-span value greater than the standard span value as the target span value, and count the number of sub-regions corresponding to the target span value to obtain p second region values;
[0073] After adding the p first region values and the p second region values, compare them with the number of sub-regions in turn to obtain p span occupancy ratios;
[0074] The expression of the span occupancy ratio is:
[0075]
[0076] In the formula, KD zbp is the p-th span occupancy ratio, QY 1p is the p-th first region value, QY 2p is the p-th second region value, SL qy is the number of sub-regions.
[0077] Furthermore, the expression of the quality evaluation index is:
[0078]
[0079] In the formula, ZL zsp is the p-th quality evaluation index, AQ jjp is the p-th safety spacing value, and α1, α2, α3 are weight factors, and α1, α2, α3 are all greater than 0;
[0080] The marking method of dangerous cracks includes:
[0081] Compare the p quality evaluation indexes ZL zsp with the preset quality evaluation threshold ZL yz in turn;
[0082] When ZL zsp is greater than or equal to ZL yz , the p-th crack is not marked as a dangerous crack;
[0083] When ZL zsp is less than ZL yz , the p-th crack is marked as a dangerous crack, and z dangerous cracks are obtained.
[0084] Furthermore, the formulation methods of the overhaulable state and the non-overhaulable state include:
[0085] Respectively record the safety spacing values less than the preset distance lower limit value as abnormal data, the crack area occupancy ratios greater than the preset area occupancy ratio upper limit value as abnormal data, and the span occupancy ratios greater than the preset span occupancy ratio upper limit value as abnormal data;
[0086] Count the number of abnormal data in z dangerous fissures one by one, and mark the dangerous fissures with the number of abnormal states greater than or equal to 2 as irreparable fissures;
[0087] Count the number of irreparable fissures, record it as the irreparable value, and compare the irreparable value with the preset irreparable threshold;
[0088] When the irreparable value is greater than or equal to the preset irreparable threshold, formulate an irreparable maintenance state;
[0089] When the irreparable value is less than the preset irreparable threshold, formulate a repairable maintenance state.
[0090] The technical effects and advantages of a visual-based method for detecting the appearance quality of gas pipelines according to the present invention:
[0091] In the present invention, by obtaining the first X-ray image of the gas pipeline, after superimposing the first X-ray images, a first recognition image is generated. The depression demarcation points are marked in the first recognition image, and after connecting the depression demarcation points, a depression area is generated. The second X-ray image of the gas pipeline is obtained, after splicing the second X-ray images, a second recognition image is generated. The fissure demarcation points are marked in the second recognition image, and after connecting the fissure demarcation points, a fissure area is generated. The comprehensive quality data of the depression area and the fissure area are collected, and based on the comprehensive quality data, a quality evaluation index is generated. Based on the quality evaluation index, dangerous fissures are marked, and according to the dangerous fissures, a quality inspection report of the gas pipeline is formulated. Compared with the prior art, by collecting X-ray images of the gas pipeline from the axial view and the top view, the position and morphological characteristics of the fissure structure inside the gas pipeline can be comprehensively represented, and combined with the depression area and the fissure area, the fissures can be three-dimensionally displayed, avoiding the limitations caused by visual images in a single view or a specific range in showing the fissure structure, effectively avoiding the situation of visual dead angles, so that the comprehensive quality data can be accurately collected, the quality evaluation index can be calculated, and then a detection and evaluation report can be formulated for the gas pipeline, providing a basis for the subsequent maintenance of the gas pipeline, and greatly improving the accuracy of the visual inspection of the appearance quality of the gas pipeline. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] Figure 1 It is a schematic flow chart of a visual-based method for detecting the appearance quality of gas pipelines provided in Embodiment 1 of the present invention;
[0093] Figure 2 It is a schematic module diagram of a visual-based system for detecting the appearance quality of gas pipelines provided in Embodiment 2 of the present invention;
[0094] Figure 3 It is a schematic diagram of splicing the second X-ray images provided in Embodiment 1 of the present invention. Detailed implementation mode
[0095] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0096] Embodiment 1: Please refer to Figure 1 and Figure 3 As shown, a method for detecting the appearance quality of a gas pipeline based on vision in this embodiment includes:
[0097] Obtain the first X-ray image of the gas pipeline, and after superimposing the first X-ray images, generate a first recognition image;
[0098] The first X-ray image refers to an image obtained by scanning the gas pipeline at different depth positions along the axial direction of the gas pipeline through an X-ray device, that is, the image acquisition of different depth positions of the gas pipeline can be realized from the axial direction, and the image recognition effect of the full axial position of the gas pipeline is achieved.
[0099] The method for obtaining the first X-ray image includes:
[0100] Scan the gas pipeline from the axial position on any side through an X-ray device to obtain a scanned image;
[0101] Identify the outer contour of the gas pipeline in the scanned image through computer vision technology, and draw a line along the outer contour to obtain the outer boundary of the gas pipeline;
[0102] Query the outer diameter of the gas pipeline through the technical parameter table, draw two auxiliary lines on the scanned image with both endpoints located on the outer boundary of the gas pipeline and the length being the same as the outer diameter of the gas pipeline, and mark the intersection point of the two auxiliary lines as the center point; the center point is on the same straight line as the central axis of the gas pipeline and serves as the basic point for subsequent image shooting and processing;
[0103] Continuously adjust the horizontal position of the gas pipeline until the center point coincides with the scanning midpoint of the X-ray device and stop adjusting; by marking the center point and adjusting it to coincide, it can not only provide an accurate acquisition standard point for the acquisition of the first X-ray image, ensure the accuracy of the acquisition position of the first X-ray image, but also provide an adjustment reference point for the generation of the subsequent first recognition image to avoid the phenomenon of offset and tilt when the first recognition image is generated;
[0104] Taking a preset step amplitude as a standard, i scanning positions are marked at equal intervals along the axial direction of the gas pipeline; the preset step amplitude is the minimum unit limit for moving along the axial direction of the gas pipeline and taking pictures at a distance, so as to ensure that a sufficient amount of images can be taken from the axial perspective of the gas pipeline, so as to ensure that the depth of the crack can be intuitively and accurately represented at each scanning position;
[0105] Set the tube voltage of the X-ray device, and control the X-ray device to scan the i scanning positions in sequence to obtain i first X-ray images.
[0106] The first recognition image refers to the image formed by overlapping and superimposing the i first X-ray images, which can maximize the axial perspective of the cracks in the gas pipeline, that is, the cracks existing in the gas pipeline can be intuitively and clearly represented axially;
[0107] The generation method of the first recognition image includes:
[0108] Scan and identify the shadow areas and blank areas in the i first X-ray images; the shadow areas are used to represent the structural positions in the gas pipeline where there are no cracks, and the blank areas are used to represent the structural positions in the gas pipeline where there are cracks, that is, the cracks and non-cracks in the gas pipeline can be effectively distinguished;
[0109] Through image processing technology, the shadow areas in the i first X-ray images are converted into transparent areas, and the blank areas are rendered and colored into rendering areas to obtain i rendering images; through the methods of transparent conversion and rendering and coloring, not only can the cracks and non-cracks be distinguished clearly, but also the color of the rendering area after rendering and coloring is heavier. When the subsequent images are superimposed, the areas corresponding to the crack positions can be intuitively and clearly represented, and then the cracks are presented in an axial perspective by superimposition, so as to be able to restore the real image of the cracks as much as possible;
[0110] Align the center points of the i rendering images in sequence according to the order of scanning time;
[0111] Taking the first rendering image as a static image, move the remaining i - 1 rendering images to the static image at the same time, forcing the rendering areas to be superimposed and extended onto the transparent areas in sequence;
[0112] Record the superimposed i rendering images as the first recognition image;
[0113] It should be noted that when the rendering areas of i - 1 rendering images are successively superimposed on the transparent area, there will be an occlusion area between the rendering area and the transparent area. At this time, the occlusion area will be affected by the rendering area and be rendered with color. That is, the rendering areas on the next rendering image can be successively superimposed on the transparent areas of the previous rendering image, so as to ensure that the cracks in the i first X - ray images can all be superimposed on the same image and finally form the first recognition image.
[0114] Mark the depression demarcation points in the first recognition image. After connecting the depression demarcation points, a depression area is generated.
[0115] The depression area refers to the area that can correspond to the cracks on the gas pipeline and serves as the target for data acquisition providing an axial view for the subsequent quality inspection of the gas pipeline. Since the number of cracks on the gas pipeline is not unique, the number of depression areas is also not unique.
[0116] The marking method of the depression area includes:
[0117] Record the upper boundary of the first recognition image as the effective boundary, and successively measure the distance values from p rendering areas to the effective boundary to obtain p boundary distance values.
[0118] Take the rendering area corresponding to the minimum value of the boundary distance values as the base point, and sequentially number the p rendering areas in ascending order in the clockwise direction.
[0119] In the order of increasing numbers, k demarcation points are successively marked at equal intervals on the p rendering areas.
[0120] Continuously adjust the positions of the k demarcation points until all k demarcation points reach the critical position. Then, record the k demarcation points as k depression demarcation points. The depression demarcation point is a point used to represent the boundary of the depression area, which can provide effective marking points for drawing the outer boundary of the depression area and facilitate the generation operation of the depression area. The critical position refers to the position corresponding to the rendering area and the non - rendering area, so as to ensure that the depression demarcation point can accurately locate the depression area.
[0121] Connect the k depression demarcation points of the p rendering areas in sequence to form p region closed lines.
[0122] Through image processing technology, closed lines matching the outer boundary of the gas pipeline are successively drawn at the openings of the p region closed lines to obtain p closed lines. The closed line is a line that matches the outer boundary of the gas pipeline. By drawing the closed line, the region closed line with an opening can be completely closed, so that the depression area can form a complete closed structure.
[0123] Connect the two ends of the closed lines of p regions to the two ends of the p closed lines respectively to form an enclosure, and denote the region inside the enclosure as the sunken region, obtaining p sunken regions;
[0124] It should be noted that the enclosed region between the region closed lines is a closed region, making the sunken region also a closed region. When p sunken regions are obtained, these p sunken regions can be used to represent the images of p fissures from the axial perspective.
[0125] Obtain the second X-ray image of the gas pipeline. After splicing the second X-ray images, generate the second recognition image;
[0126] The second X-ray image refers to the image obtained by scanning and photographing different angular positions along the radial direction of the gas pipeline with an X-ray device, which can represent the images of different angular positions of the gas pipeline from the radial direction, achieving the image recognition effect of the full radial angle of the gas pipeline;
[0127] The method for obtaining the second X-ray image includes:
[0128] Taking a preset angle value as the standard, rotate the gas pipeline clockwise and mark s shooting angles; the preset angle value is a numerical limit for the rotation angle when photographing the gas pipeline radially to ensure that the annular gas pipeline can be photographed at multiple angles; the preset angle value is usually set according to actual shooting requirements. Exemplarily, the preset angle value is 15 degrees, 30 degrees, 45 degrees, etc.;
[0129] Use the X-ray device to sequentially photograph s shooting angles to obtain s angular images;
[0130] According to the chronological order of shooting, sequentially number the s angular images in ascending order to obtain s second X-ray images.
[0131] The second recognition image refers to the top-down tiled image that can comprehensively represent the fissures in the gas pipeline after edge splicing of s second X-ray images, which can provide an intuitive and clear top-down tiled representation of the fissures existing in the gas pipeline;
[0132] The method for generating the second recognition image includes:
[0133] Mark the leading splicing edge and the trailing splicing edge of the s second X-ray images one by one, and mark the leading splicing point and the trailing splicing point on the leading splicing edge and the trailing splicing edge; the leading splicing edge and the trailing splicing edge refer to the boundaries on the second X-ray image that are close to the boundary of the previous image and the boundary of the next image respectively, so that the leading splicing edge and the trailing splicing edge can be used as the positions for splicing with the front and back images to ensure the orderliness and accuracy of image splicing; the leading splicing point and the trailing splicing point refer to the respective midpoints of the leading splicing edge and the trailing splicing edge respectively, and are used as the reference points for whether the subsequent leading splicing edge and the trailing splicing edge are aligned;
[0134] Align and splice the leading splicing edge of the s-th second X-ray image with the trailing splicing edge of the (s - 1)-th second X-ray image in ascending order of the numbers to obtain a spliced recognition image with a splicing area;
[0135] In the spliced recognition image, align the leading splicing point of the s-th second X-ray image with the trailing splicing point of the (s - 1)-th second X-ray image to obtain a spliced recognition image with a splicing area and splicing points;
[0136] Perform edge smoothing processing on the splicing area through image processing technology, and after hiding the splicing points, obtain a second recognition image; after edge smoothing processing, ensure that the splicing between adjacent two images is smooth without wrinkles, which will not affect the recognition and acquisition of subsequent data, and the way of hiding the splicing points can avoid the interference brought by the splicing points to the subsequent data recognition and acquisition;
[0137] Exemplarily, as Figure 3 shown in the figure, in the figure, S1 is the s-th second X-ray image, S2 is the (s + 1)-th second X-ray image, A is the leading splicing point, B is the trailing splicing point, L1 is the leading splicing edge, and L2 is the trailing splicing edge;
[0138] When the second recognition image is obtained, the surface images of the gas pipeline ring collected are spliced into a top-down view image in a tiled state. At this time, the relevant data of the cracks on the gas pipeline will be equivalently converted onto the second recognition image, so that the second recognition image can intuitively represent the cracks on the gas pipeline, facilitating the subsequent collection and calculation operations of crack data.
[0139] Mark the crack demarcation points in the second recognition image, and after connecting the crack demarcation points, generate a crack area;
[0140] The crack area refers to the area in the second recognition image that can represent the size of parameters such as the length, width, and area of the crack, so as to represent the crack from a top-down perspective. Since both the crack area and the depression area are generated by the cracks on the gas pipeline, the crack area can match the number and position of the depression area in the first recognition image, so that the number of the crack area is consistent with the number and position of the depression area;
[0141] The method for generating the crack area includes:
[0142] Scan and mark all the pixel points in the second recognition image, and record the pixel values of all the pixel points one by one;
[0143] Mark the pixel points with pixel values greater than the preset pixel threshold as target pixel points, and mark the area where the target pixel points are located as the target area, obtaining p target areas; The preset pixel threshold is used to limit the minimum value of the pixel values corresponding to the target pixel points, so that the area corresponding to the preset pixel threshold is the location of the crack, thus realizing the accurate distinction between cracks and non-cracks; The preset pixel threshold is obtained by collecting the minimum values of the pixel points corresponding to a large number of historical crack positions and then calculating their average value;
[0144] Draw lines along the edges of the p target areas to obtain the target area boundary lines, and mark w target pixel points on the target area boundary lines respectively;
[0145] Continuously adjust the distance between two adjacent target pixel points until the distance between two adjacent target pixel points is the same as the preset demarcation distance and then stop adjusting; The preset demarcation distance is used to numerically represent the distance between two adjacent crack demarcation points, so as to ensure that a sufficient number of crack demarcation points can be marked on the crack area, and through the connection of a large number of crack demarcation points, the formed crack area can be closer to the true shape of the crack;
[0146] Mark the adjusted target pixel points as crack demarcation points, obtaining w crack demarcation points. After connecting the w crack demarcation points of the p target areas in sequence, p crack areas are obtained;
[0147] It should be noted that the p crack areas and the p concave areas are used to represent the same crack on the gas pipeline, so that the positions of the p crack areas and the p concave areas correspond one by one, thus enabling a diverse representation effect of the p cracks on the gas pipeline from multiple perspectives.
[0148] Collect the comprehensive quality data of the concave area and the crack area, and generate a quality evaluation index based on the comprehensive quality data;
[0149] The comprehensive quality data is used to represent the data related to the crack parameters on the concave area and the crack area, that is, it can comprehensively represent the data such as the size, depth, and length of the crack on the gas pipeline, so as to represent the severity of the crack existing on the gas pipeline and serve as the data basis for subsequent judgment of the appearance quality of the gas pipeline;
[0150] The comprehensive quality data includes the safety spacing value, the crack area occupancy ratio, and the span occupancy ratio;
[0151] The safety distance value refers to the distance between the sunken area and the inner boundary of the gas pipeline, which can represent the depth of the crack on the gas pipeline from the side. When the safety distance value is larger, it indicates that the distance between the sunken area and the inner boundary of the gas pipeline is larger, then the depth of the crack on the gas pipeline is smaller, the appearance quality of the gas pipeline is better, and the quality evaluation index is larger;
[0152] The methods for obtaining the safety distance value include:
[0153] Identify the inner contour of the gas pipeline in the first recognition image through computer vision technology, and draw a line along the inner contour to obtain the inner boundary of the gas pipeline;
[0154] Taking the center point of the first recognition image as the starting point, draw distance lines passing through the sunken area respectively to obtain m distance lines;
[0155] Record the intersection points of the distance lines and the inner boundary of the gas pipeline as inner points, and record the intersection points of the distance lines and the boundary of the sunken area as outer points;
[0156] Measure the distances from the inner points to the outer points on the m distance lines in the p sunken areas in sequence to obtain m sub-safety values;
[0157] Compare the magnitudes of the m sub-safety values one by one, and record the minimum value of the sub-safety values as the safety distance value to obtain p safety distance values;
[0158] It should be noted that the p safety distance values are used to accurately represent the distances between the p sunken areas and the inner boundary of the gas pipeline. When the crack on the gas pipeline is completely penetrated, the safety distance value of the sunken area at this time is 0. However, in actual situations, the crack on the gas pipeline will not be completely penetrated and will only be greater than 0.
[0159] The crack area ratio refers to the ratio of the area occupied by the crack area in the second recognition image to the total area of the second recognition image. When the crack area ratio is larger, it indicates that the area occupied by the crack on the gas pipeline is larger, then the appearance quality of the gas pipeline is worse, and the quality evaluation index is smaller;
[0160] The methods for obtaining the crack area ratio include:
[0161] Count the number of target pixel points in the p crack areas one by one to obtain p target quantity values;
[0162] Count the number of all pixel points in the second recognition image to obtain the total pixel point value;
[0163] Compare the p target quantity values with the total pixel point value one by one to obtain p crack area ratios;
[0164] The expression of the crack area ratio is:
[0165]
[0166] In the formula, MJ zbp is the ratio of the p-th fracture area, SL mbp is the p-th target quantity value, ZL xs is the total quantity value of pixel points.
[0167] The span ratio refers to the ratio between the number of fracture regions spanning sub-regions in the second recognition map and the total number of sub-regions, which can represent the number of fracture regions spanning sub-regions. When the span ratio is larger, it indicates that the number of fracture regions spanning sub-regions is more, and the appearance quality of the gas pipeline is worse, and the quality evaluation index is smaller;
[0168] The method for obtaining the span ratio includes:
[0169] Taking the long side of the second recognition image as the division direction and the preset segmentation length as the division width, equally dividing the second recognition image into v sub-regions; the preset segmentation length is used to represent the division width of the sub-regions to ensure that a sufficient number of sub-regions can be divided from the second recognition image and meet the subsequent calculation of the span ratio; the preset segmentation length is specifically set according to actual needs. Exemplarily, the preset segmentation length is one-fifteenth of the length of the second recognition image;
[0170] Denote the sub-regions completely spanned by the fracture region as the first region, and count the number of the first region to obtain p first region values; completely spanning means that the fracture region is in a continuous and unbroken state within the sub-region without any break points;
[0171] Denote the sub-regions not completely spanned by the fracture region as the second region, obtain x second regions, and mark the target pixel points within the second region; not completely spanning means that the fracture region is in an intermittent state within the sub-region with break points;
[0172] Successively measure the distance values between any two target pixel points within the x second regions, and denote the maximum value of the distance values as the effective distance value to obtain x effective distance values;
[0173] Compare the x effective distance values with the width of the sub-region successively to obtain x sub-span values;
[0174] The expression of the sub-span value is:
[0175]
[0176] In the formula, KD zpx is the x-th sub-span value of the p-th fracture region, JL yxpx is the x-th effective distance value of the p-th fracture region, JLkd is the width of the sub-region;
[0177] Record the sub-span value greater than the standard span value as the target span value, and count the number of sub-regions corresponding to the target span value to obtain p second region values; the standard span value is a numerical representation of the negative impact of the crack span on the appearance quality of the gas pipeline. On the one hand, it can eliminate the burden on the calculation caused by a large number of data with extremely small sub-span values. On the other hand, it also improves the calculation standard of the span occupancy ratio, thereby eliminating the possible interference effects caused by the natural cracking of the rust protection layer on the gas pipeline and effectively improving the calculation accuracy of the quality assessment index;
[0178] After adding the p first region values and the p second region values, compare them with the number of sub-regions in turn to obtain p span occupancy ratios;
[0179] The expression of the span occupancy ratio is:
[0180]
[0181] In the formula, KD zbp is the p-th span occupancy ratio, QY 1p is the p-th first region value, QY 2p is the p-th second region value, SL qy is the number of sub-regions.
[0182] After obtaining the safety distance value, the crack area occupancy ratio, and the span occupancy ratio, the quality assessment index can be calculated according to the safety distance value, the crack area occupancy ratio, and the span occupancy ratio, so that the quality assessment index can clearly represent the quality level and hazard degree of the cracks on the gas pipeline numerically, thereby reflecting the level of the appearance quality of the gas pipeline;
[0183] The expression of the quality assessment index is:
[0184]
[0185] In the formula, ZL zsp is the p-th quality assessment index, AQ ijp is the p-th safety distance value, and α1, α2, α3 are weight factors, and α1, α2, α3 are all greater than 0.
[0186] Based on the quality assessment index, mark the dangerous cracks, and formulate a quality inspection report for the gas pipeline according to the dangerous cracks;
[0187] The dangerous crack refers to the crack corresponding to the sunken area and the crack area in the first recognition image and the second recognition image whose danger level exceeds the preset danger level, which can clearly represent the cracks with poor appearance quality and high danger level on the gas pipeline, so as to visually represent the appearance quality of the gas pipeline;
[0188] The marking method of the dangerous crack includes:
[0189] Compare p quality evaluation indexes ZL zsp with the preset quality evaluation threshold ZL yz in turn; the preset quality evaluation threshold is used to represent the maximum value of the quality evaluation index corresponding to when the crack is marked as a dangerous crack, that is, the crack can be distinguished into a dangerous crack and a non-dangerous crack; the preset quality evaluation index is obtained by collecting the maximum value of the quality evaluation indexes of a large number of historical cracks marked as dangerous cracks and then calculating their average value;
[0190] When ZL zsp is greater than or equal to ZL yz , it indicates that the quality evaluation index of the p-th crack is greater than or equal to the preset quality evaluation threshold. At this time, the appearance quality of the p-th crack is good and the hazard degree is low, so the p-th crack is not marked as a dangerous crack;
[0191] When ZL zsp is less than ZL yz , it indicates that the quality evaluation index of the p-th crack is less than the preset quality evaluation threshold. At this time, the appearance quality of the p-th crack is poor and the hazard degree is high, so the p-th crack is marked as a dangerous crack, and z dangerous cracks are obtained.
[0192] After marking the dangerous cracks, it is necessary to count the number of dangerous cracks and formulate a quality inspection report for the gas pipeline, which can truly and accurately detect and evaluate the appearance quality of the gas pipeline;
[0193] The quality inspection report includes a repairable state and a non-repairable state; the repairable state means that the harm caused by the crack on the gas pipeline is within a controllable range and the crack can be repaired, and the non-repairable state means that the harm caused by the crack on the gas pipeline is not within a controllable range and the crack cannot be repaired;
[0194] The formulation methods of the repairable state and the non-repairable state include:
[0195] Safety spacing values less than the preset lower limit of the distance are respectively recorded as abnormal data, the ratio of the crack area greater than the preset upper limit of the area ratio is recorded as abnormal data, and the ratio of the span greater than the preset upper limit of the span ratio is recorded as abnormal data; the preset lower limit of the distance refers to the minimum value of the safety spacing value when the gas pipeline can be repaired, so that the safety spacing value can be effectively distinguished between abnormal data and non-abnormal data; at the same time, the preset upper limit of the area ratio and the preset upper limit of the span ratio are used to limit the maximum value of the ratio of the crack area and the ratio of the span, so as to distinguish between abnormal data and non-abnormal data;
[0196] Count the number of abnormal data in z dangerous cracks one by one, and record the dangerous cracks with the number of abnormal states greater than or equal to 2 as irreparable cracks;
[0197] Count the number of irreparable cracks, record it as the irreparable value, and compare the irreparable value with the preset irreparable threshold;
[0198] When the irreparable value is greater than or equal to the preset irreparable threshold, it means that there are many irreparable cracks in the gas pipeline. At this time, the quality of the gas pipeline is extremely poor, and an uninspectable state is formulated;
[0199] When the irreparable value is less than the preset irreparable threshold, it means that there are few irreparable cracks in the gas pipeline. At this time, the quality of the gas pipeline is poor, and an inspectable state is formulated.
[0200] It should be noted that when the uninspectable state or the inspectable state is formulated, the appearance quality of the gas pipeline can be effectively and accurately classified, and a basis for judgment is provided for the subsequent maintenance personnel to inspect or replace the appearance of the gas pipeline, ensuring that the gas pipeline with potential safety hazards can be correctly and timely inspected or replaced.
[0201] In this embodiment, by obtaining the first X-ray image of the gas pipeline, after superimposing the first X-ray images, a first recognition image is generated. The depression demarcation points are marked in the first recognition image, and after connecting the depression demarcation points, a depression area is generated. The second X-ray image of the gas pipeline is obtained, and after splicing the second X-ray images, a second recognition image is generated. The crack demarcation points are marked in the second recognition image, and after connecting the crack demarcation points, a crack area is generated. The comprehensive quality data of the depression area and the crack area are collected, and based on the comprehensive quality data, a quality evaluation index is generated. Based on the quality evaluation index, dangerous cracks are marked, and according to the dangerous cracks, a quality inspection report of the gas pipeline is formulated. Compared with the prior art, by collecting X-ray images of the gas pipeline from the axial view and the top view, the position and morphological characteristics of the crack structure inside the gas pipeline can be comprehensively represented, and combined with the depression area and the crack area, the cracks can be three-dimensionally displayed, avoiding the limitations caused by the visual images in a single view or a specific range in showing the crack structure, effectively avoiding the situation of visual dead angles, so that the comprehensive quality data can be accurately collected, and the quality evaluation index can be calculated, and then a detection and evaluation report for the gas pipeline can be formulated, providing a basis for the subsequent maintenance of the gas pipeline, greatly improving the accuracy of the visual inspection of the appearance quality of the gas pipeline.
[0202] Embodiment 2: Please refer to Figure 2 As shown, for the parts not described in detail in this embodiment, refer to the description content of Embodiment 1. A visual-based gas pipeline appearance quality detection system is provided for implementing a visual-based gas pipeline appearance quality detection method, including a first image generation module, a depression area generation module, a second image generation module, a crack area generation module, a quality evaluation calculation module, and a quality inspection report module. Among them, each module is connected by a wired or wireless network method;
[0203] The first image generation module is used to obtain the first X-ray image of the gas pipeline and generate a first recognition image after superimposing the first X-ray images;
[0204] The depression area generation module is used to mark the depression demarcation points in the first recognition image and generate a depression area after connecting the depression demarcation points;
[0205] The second image generation module is used to obtain the second X-ray image of the gas pipeline and generate a second recognition image after splicing the second X-ray images;
[0206] The crack area generation module is used to mark the crack demarcation points in the second recognition image and generate a crack area after connecting the crack demarcation points;
[0207] A quality assessment calculation module, configured to collect comprehensive quality data of the sunken area and the fissure area, and generate a quality assessment index based on the comprehensive quality data;
[0208] A quality inspection report module, configured to mark dangerous fissures based on the quality assessment index, and formulate a quality inspection report for the gas pipeline according to the dangerous fissures.
[0209] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should be covered within the protection scope of the present invention.
Claims
1. A vision-based method for detecting the appearance quality of gas pipelines, characterized in that, Including: Obtain the first X-ray image of the gas pipeline, and after superimposing the first X-ray images, generate a first recognition image; Mark the depression demarcation points in the first recognition image, and after connecting the depression demarcation points, generate a depression area; The marking method of the depression area includes: Denote the upper boundary of the first recognition image as the effective boundary, and sequentially measure the distance values from p rendering areas to the effective boundary to obtain p boundary distance values; Take the rendering area corresponding to the minimum value of the boundary distance values as the base point, and sequentially number the p rendering areas in ascending order in the clockwise direction; Mark k demarcation points at equal intervals on the p rendering areas in the order from smallest to largest number; Continuously adjust the positions of the k demarcation points until all k demarcation points reach the critical positions, and denote the k demarcation points as k depression demarcation points; After sequentially connecting the k depression demarcation points of the p rendering areas, form p area closed lines; By using image processing technology, sequentially draw closed lines matching the outer boundary of the gas pipeline at the openings of the p area closed lines to obtain p closed lines; Connect the two ends of the p area closed lines to the two ends of the p closed lines respectively for enclosure, and denote the area within the enclosure as the depression area to obtain p depression areas; Obtain the second X-ray image of the gas pipeline, and after splicing the second X-ray images, generate a second recognition image; Mark the crack demarcation points in the second recognition image, and after connecting the crack demarcation points, generate a crack area; The generation method of the crack area includes: Scan and mark all pixel points in the second recognition image, and record the pixel values of all pixel points one by one; Denote the pixel points with pixel values greater than the preset pixel threshold as target pixel points, and denote the area where the target pixel points are located as the target area to obtain p target areas; Draw lines along the edges of the p target areas to obtain target area boundary lines, and mark w target pixel points on the target area boundary lines respectively; Continuously adjust the distance between adjacent two target pixel points until the distance between adjacent two target pixel points is the same as the preset demarcation distance and then stop the adjustment; Denote the adjusted target pixel points as crack demarcation points to obtain w crack demarcation points, and after sequentially connecting the w crack demarcation points of the p target areas, obtain p crack areas; Collect the comprehensive quality data of the depression area and the crack area, and based on the comprehensive quality data, generate a quality assessment index. The comprehensive quality data includes safety spacing values, crack area ratio and span ratio; Based on the quality assessment index, mark the dangerous cracks, and formulate a quality inspection report for the gas pipeline according to the dangerous cracks. The quality inspection report includes the repairable state and the non-repairable state.
2. The method for visually inspecting the appearance quality of a gas pipeline according to claim 1, characterized in that The method for obtaining the first X-ray image includes: Scan the gas pipeline from the axial position on any side through an X-ray device to obtain a scanned image; Identify the outer contour of the gas pipeline in the scanned image through computer vision technology, and draw a line along the outer contour to obtain the outer boundary of the gas pipeline; Query the outer diameter of the gas pipeline through the technical parameter table, and respectively draw two auxiliary lines on the scanned image with both endpoints located on the outer boundary of the gas pipeline and the length being the same as the outer diameter of the gas pipeline, and mark the intersection point of the two auxiliary lines as the center point; Continuously adjust the horizontal position of the gas pipeline until the adjustment stops when the center point coincides with the scanning midpoint of the X-ray device; Taking a preset step amplitude as the standard, equidistantly mark i scanning positions on the gas pipeline along the axial direction; Set the tube voltage of the X-ray device, and control the X-ray device to sequentially scan the i scanning positions to obtain i first X-ray images; The generation method of the first recognition image includes: Scan and identify the shadow areas and blank areas in the i first X-ray images; Convert the shadow areas in the i first X-ray images into transparent areas through image processing technology, and render and color the blank areas into rendering areas to obtain i rendering images; Align the center points of the i rendering images in the order of scanning time; Taking the rendering image in the first position as the static image, move the remaining i - 1 rendering images simultaneously towards the static image, forcing the rendering areas to be sequentially stacked and extended onto the transparent areas; Record the i stacked rendering images as the first recognition image.
3. The visual-based gas pipeline appearance quality detection method according to claim 2, characterized in that The acquisition method of the second X-ray image includes: Taking a preset angle value as the standard, rotate the gas pipeline clockwise and mark s shooting angles; Sequentially shoot the s shooting angles through the X-ray device to obtain s angular images; Number the s angular images in ascending order in the order of shooting time to obtain s second X-ray images; The generation method of the second recognition image includes: Mark the head splicing edge and the tail splicing edge of the s second X-ray images one by one, and mark the head splicing point and the tail splicing point on the head splicing edge and the tail splicing edge; Align and splice the head splicing edge of the s-th second X-ray image with the tail splicing edge of the (s - 1)-th second X-ray image in the order of number from small to large to obtain a spliced recognition image with a splicing area; In the spliced recognition image, align the head splicing point of the s-th second X-ray image with the tail splicing point of the (s - 1)-th second X-ray image to obtain a spliced recognition image with a splicing area and splicing points; Perform edge smoothing processing on the splicing area through image processing technology and hide the splicing points to obtain the second recognition image.
4. The visual-based method for detecting the appearance quality of gas pipelines according to claim 3, wherein, The acquisition method of the safety spacing value includes: Identify the inner contour of the gas pipeline in the first recognition image through computer vision technology, and draw a line along the inner contour to obtain the inner boundary of the gas pipeline; Taking the center point of the first recognition image as the starting point, respectively draw distance lines passing through the concave areas to obtain m distance lines; Mark the intersection points of the distance lines and the inner boundary of the gas pipeline as inner points, and mark the intersection points of the distance lines and the boundary of the concave areas as outer points; Sequentially measure the distances from the inner points to the outer points on the m distance lines in the p concave areas to obtain m sub-safety values; Compare the magnitudes of the m sub-safety values one by one, and record the minimum value of the sub-safety values as the safety spacing value to obtain p safety spacing values.
5. The visual-based method for detecting the appearance quality of gas pipelines according to claim 4, characterized in that The acquisition method of the crack area ratio includes: Count the number of target pixels in each of the p fracture regions one by one to obtain p target quantity values; Count the number of all pixels in the second recognition image to obtain the total pixel quantity value; Compare the p target quantity values with the total pixel quantity value one by one to obtain p fracture area occupancy ratios; The expression of the fracture area occupancy ratio is: Wherein, MJ zbp is the ratio of the p-th fracture area, SL mbp is the p-th target quantity value, ZL xs is the total pixel value.
6. The visual-based gas pipeline appearance quality detection method according to claim 5, wherein The method for obtaining the span occupancy ratio includes: Taking the long side of the second recognition image as the division direction and the preset segmentation length as the division width, equally divide the second recognition image into v sub-regions; Mark the sub-regions completely spanned by the fracture regions as the first regions, and count the number of the first regions to obtain p first region values; Mark the sub-regions not completely spanned by the fracture regions as the second regions, obtain x second regions, and mark the target pixels in the second regions; Measure the distance values between any two target pixels in the x second regions in sequence, and record the maximum value of the distance values as the effective distance value to obtain x effective distance values; Compare the x effective distance values with the width of the sub-regions in sequence to obtain X sub-span values; The expression of the sub-span value is: where, KD zpx is the x-th sub-span value of the p-th fracture area, JL yxpx is the x-th effective distance value of the p-th fracture area, JL kd is the width of the sub-region; Mark the sub-span values greater than the standard span value as the target span values, and count the number of the sub-regions corresponding to the target span values to obtain p second region values; After adding the p first region values and the p second region values, compare them with the number of sub-regions in sequence to obtain p span occupancy ratios; The expression of the span occupancy ratio is: where, KD zbp is the occupancy ratio of the p-th span, QY 1p is the value of the p-th first region, QY 2p is the value of the p-th second region, SL qy is the number of sub-regions.
7. The visual-based appearance quality inspection method for gas pipelines according to claim 6, characterized in that, The expression of the quality assessment index is: where ZL zsp is the p-th quality evaluation index, AQ jjp is the p-th safety distance value, and α1, α2, α3 are weighting factors, and α1, α2, α3 are all greater than 0; The method for marking dangerous fractures includes: Compare the p quality assessment indices ZL zsp sequentially with the preset quality assessment threshold ZL yz ; When ZL zsp is greater than or equal to ZL yz , the p-th crack is not marked as a dangerous crack; When ZL zsp is less than ZL yz , the p-th crack is marked as a dangerous crack, and z dangerous cracks are obtained.
8. A vision-based method for detecting the appearance quality of gas pipelines according to claim 7, characterized in that, The method for formulating the repairable state and the non-repairable state includes: Respectively mark the safety spacing values less than the preset distance lower limit value as abnormal data, the fracture area occupancy ratios greater than the preset area occupancy ratio upper limit value as abnormal data, and the span occupancy ratios greater than the preset span occupancy ratio upper limit value as abnormal data; Count the number of abnormal data in each of the z dangerous fractures one by one, and mark the dangerous fractures with the number of abnormal states greater than or equal to 2 as non-repairable fractures; Count the number of non-repairable fractures, record it as the non-repairable value, and compare the non-repairable value with the preset non-repairable threshold; When the non-repairable value is greater than or equal to the preset non-repairable threshold, formulate the non-repairable state; when the non-repairable value is less than the preset non-repairable threshold, formulate the repairable state.
Citation Information
Patent Citations
Vision-based gas pipeline appearance quality detection method
CN117830300A
Detection method of pipeline television detection system
CN107483835A
Intelligent diagnosis and analysis method for operation faults of intelligent furniture fresh air system and cloud analysis platform
CN113484054A