Vision-based gas pipeline appearance quality detection method
By acquiring and processing X-ray images of gas pipelines, generating identification images and marking crack boundary points, the problem of inaccurate detection results in the existing technology is solved, and a comprehensive representation of the crack structure and high-precision quality assessment are achieved.
Patent Information
- Application Number
- CN202411414906.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-11
AI Technical Summary
The existing gas pipeline appearance quality detection methods cannot fully display the location and morphological characteristics of the crack structure due to image acquisition at a single perspective or specific angle, resulting in inaccurate detection results.
By obtaining the first X -ray image and the second X -ray image of the gas pipeline, the first identification image and the second recognition image are generated, the marking and connecting the depression boundary and the cracking division point point to form the depression area and the crack area. Quality data and generate quality assessment index.
A comprehensive representation and three -dimensional display of the fissure structure of the inner pipeline of the gas pipeline, avoiding visual dead corners, and improving the accuracy and accuracy of the detection results.
Smart Images

Figure CN119338775A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and more specifically, to a method for detecting the appearance quality of a gas pipeline based on vision. Background Art
[0002] The quality of gas pipelines often affects the safety of energy transportation, so it is very important to carry out quality inspection of gas pipelines. Cracks are a relatively common defect in gas pipelines. When the length, depth and area of the cracks are deep, these cracks will cause the firmness and airtightness of the gas pipelines to decay, thereby reducing safety. In order to detect cracks in gas pipelines in time and carry out subsequent inspection and maintenance of gas pipelines, it is necessary to accurately detect the cracks on the gas pipelines.
[0003] The patent application with reference publication number CN117830300A discloses a method for visually inspecting the appearance quality of a gas pipeline, which realizes the enhancement of the target surface image, solves the technical problem of poor accuracy of crack defect quality inspection due to poor image enhancement effect, and improves the image enhancement effect and the accuracy of crack defect quality inspection;
[0004] The prior art has the following deficiencies:
[0005] The existing gas pipeline appearance quality inspection is carried out by taking an image of the gas pipeline at a certain viewing angle or angle, and combining image processing technology to identify the area where the cracks are located in the image, so as to judge the impact of the size and shape of the cracks on the gas pipeline. Since the gas pipeline is a tubular structure, the image of the gas pipeline taken at a single viewing angle or a specific angle will have limitations, and it is impossible to fully display the structural position and morphological characteristics of the cracks on the gas pipeline in a three-dimensional manner, which leads to blind spots in the subsequent collection of crack data, resulting in inaccurate calculation results, reducing the accuracy of the gas pipeline appearance quality inspection and evaluation.
[0006] In view of this, the present invention proposes a vision-based gas pipeline appearance quality detection method to solve the above problems. Summary of the invention
[0007] In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned purpose, the present invention provides the following technical solution: a method for visually inspecting the appearance quality of a gas pipeline, comprising:
[0008] Acquire a first X-ray image of the gas pipeline, and generate a first identification image after superimposing the first X-ray image;
[0009] Marking the concave demarcation points in the first recognition image, and connecting the concave demarcation points to generate a concave area;
[0010] Acquire a second X-ray image of the gas pipeline, and generate a second identification image after splicing the second X-ray image;
[0011] Marking the crack demarcation points in the second recognition image, and connecting the crack demarcation points to generate a crack area;
[0012] Collect comprehensive quality data of the sunken 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 value and the span ratio value;
[0013] Based on the quality assessment index, dangerous cracks are marked, and based on the dangerous cracks, a quality inspection report for the gas pipeline is drawn up. The quality inspection report includes the repairable status and the non-repairable status.
[0014] Furthermore, the method for acquiring the first X-ray image includes:
[0015] Scan the gas pipeline from an axial position on any side using an X-ray device to obtain a scan image;
[0016] The outer contour of the gas pipeline in the scanned image is identified by computer vision technology, and a line is drawn along the outer contour to obtain the outer boundary of the gas pipeline;
[0017] The outer diameter of the gas pipeline is queried through the technical parameter table, and two auxiliary lines are drawn on the scanned image, both of which have their endpoints located on the outer boundary of the gas pipeline and have the same length as the outer diameter of the gas pipeline, and the intersection of the two auxiliary lines is recorded as the center point;
[0018] Keep adjusting the horizontal position of the gas pipeline until the center point coincides with the scanning midpoint of the X-ray equipment;
[0019] Based on a preset step amplitude, i scanning positions are marked equidistantly on the gas pipeline along the axial direction;
[0020] Setting a tube voltage of the X-ray device, controlling the X-ray device to scan i scanning positions in sequence, and obtaining i first X-ray images;
[0021] The method for generating the first recognition image includes:
[0022] Scanning and identifying shadow areas and blank areas in i first X-ray images;
[0023] Convert shadow areas in the i first X-ray images into transparent areas by image processing technology, and render and color the blank areas into rendering areas, thereby obtaining i rendering images;
[0024] Align the center points of i rendered images in sequence according to the order of scanning time;
[0025] The first rendered image is used as the still image, and the remaining i-1 rendered images are simultaneously moved toward the still image, forcing the rendered areas to overlap in sequence and extend onto the transparent area;
[0026] The superimposed i rendered images are recorded as the first recognition images.
[0027] Further, the marking method of the recessed area includes:
[0028] The upper boundary of the first recognition image is recorded as the effective boundary, and the distance values from the p rendering areas to the effective boundary are measured in sequence to obtain p boundary distance values;
[0029] Taking the rendering area corresponding to the minimum boundary distance value as the base point, the p rendering areas are numbered in ascending order one by one in a clockwise direction;
[0030] Mark k dividing points equidistantly on the p rendering areas in ascending order;
[0031] The positions of the k dividing points are continuously adjusted until all the k dividing points reach the critical position, and the k dividing points are recorded as k concave dividing points;
[0032] After connecting the k concave boundary points of the p rendering areas in sequence, p area closed lines are formed;
[0033] By using image processing technology, closed lines matching the outer boundaries of the gas pipeline are drawn in sequence at the open positions of the p regional closed lines to obtain p closed lines;
[0034] The two ends of the p area closed lines are respectively connected to the two ends of the p closing lines to enclose them, and the enclosed area is recorded as a concave area, so as to obtain p concave areas.
[0035] Furthermore, the method for acquiring the second X-ray image includes:
[0036] Using a preset angle value as a standard, rotate the gas pipeline clockwise to mark s shooting angles;
[0037] S shooting angles are photographed in sequence by an X-ray device to obtain images at s angles;
[0038] According to the sequence of shooting time, the s angle images are numbered in ascending order to obtain s second X-ray images;
[0039] The method for generating the second recognition image includes:
[0040] Mark the first splicing edges and the last splicing edges of the s second X-ray images one by one, and mark the first splicing point and the last splicing point on the first splicing edge and the last splicing edge;
[0041] Align and stitch the first stitching edge of the sth second X-ray image with the last stitching edge of the s+1th second X-ray image in ascending order to obtain a stitching recognition image with a stitching area;
[0042] In the spliced identification image, align the first splicing point of the sth second X-ray image with the last splicing point of the s+1th second X-ray image to obtain a spliced identification image with a splicing area and splicing points;
[0043] The second recognition image is obtained by performing edge smoothing on the splicing area through image processing technology and hiding the splicing points.
[0044] Furthermore, the method for generating the crack region 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] The pixel points whose pixel values are greater than the preset pixel threshold are recorded as target pixel points, and the area where the target pixel points are located is recorded as the target area, and p target areas are obtained;
[0047] Draw lines along the edges of the p target regions to obtain the target region boundary lines, and mark w target pixel points on the target region boundary lines respectively;
[0048] The distance between two adjacent target pixels is continuously adjusted until the distance between the two adjacent target pixels is consistent with the preset boundary distance, and then the adjustment is stopped;
[0049] The adjusted target pixel point is recorded as a crack demarcation point to obtain w crack demarcation points, and the w crack demarcation points of p target areas are connected in sequence to obtain p crack areas.
[0050] Furthermore, the method for obtaining the safety distance value includes:
[0051] Recognize the inner contour of the gas pipeline in the first recognition image by using computer vision technology, and draw a line along the inner contour to obtain the inner boundary of the gas pipeline;
[0052] Taking the center point of the first recognition image as a starting point, respectively draw distance lines passing through the concave area to obtain m distance lines;
[0053] The intersection point of the distance line and the inner boundary of the gas pipeline is recorded as an inner point, and the intersection point of the distance line and the boundary of the concave area is recorded as an outer point;
[0054] Sequentially measure the distances from the inner point to the outer point on the m distance lines in the p concave areas to obtain m sub-safety values;
[0055] The m sub-safety values are compared one by one, and the minimum value of the sub-safety value is recorded as the safety interval value, so as to obtain p safety interval values.
[0056] Furthermore, the method for obtaining the crack area ratio value includes:
[0057] Count the number of target pixels in p crack areas one by one to obtain p target quantity values;
[0058] Counting the number of all pixels in the second recognition image to obtain a total pixel value;
[0059] Compare the p target quantity values with the total pixel value one by one to obtain p crack area ratio values;
[0060] The expression of crack area ratio is:
[0061]
[0062] In the formula, MJ zbp is the percentage of the pth crack area, SL mbp is the pth target quantity value, ZL xs is the total value of pixels.
[0063] Furthermore, the method for obtaining the span ratio value includes:
[0064] Taking the long side of the second recognition image as the division direction and the preset segmentation length as the division width, the second recognition image is equally spaced into v sub-areas;
[0065] The sub-regions completely spanned by the crack region are recorded as first regions, and the number of first regions is counted to obtain p first region values;
[0066] The sub-region that is not completely crossed by the crack region is recorded as the second region, X second regions are obtained, and the target pixel points in the second region are marked;
[0067] Sequentially measure the distance values between any two target pixel points in the X second regions, and record the maximum value of the distance values as the effective distance value, to obtain X effective distance values;
[0068] Compare the X valid distance values with the width of the sub-region in turn to obtain X sub-span values;
[0069] The expression for the subspan value is:
[0070]
[0071] Where KD zpx is the xth subspan value of the pth crack region, JL yxpx is the xth effective distance value of the pth crack area, JLkd is the width of the sub-region;
[0072] Record the subspan value greater than the standard span value as the target span value, and count the number of subregions 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, the sum is compared with the number of sub-regions in turn to obtain p span proportion values;
[0074] The expression of span ratio is:
[0075]
[0076] Where KD zbp is the pth span proportion, QY 1p is the pth first region value, QY 2p is the pth 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 pth quality assessment index, AQ jjp is the pth safety distance value, α1, α2, α3 are weight factors, and α1, α2, α3 are all greater than 0;
[0080] Methods for marking dangerous crevices include:
[0081] The p quality evaluation indexes ZL zsp Sequentially compared with the preset quality assessment threshold ZL yz Compare;
[0082] When ZL zsp Greater than or equal to ZL yz When , the pth crack is not marked as a dangerous crack;
[0083] When ZL zsp Less than ZL yz When , the pth crack is marked as a dangerous crack, and z dangerous cracks are obtained.
[0084] Furthermore, the method for establishing the repairable state and the non-repairable state includes:
[0085] The safety spacing value less than the preset distance lower limit is recorded as abnormal data, the crack area ratio value greater than the preset area ratio upper limit is recorded as abnormal data, and the span ratio value greater than the preset span ratio upper limit is recorded as abnormal data;
[0086] Count the number of abnormal data in the z dangerous cracks one by one, and record the dangerous cracks with the number of abnormal states greater than or equal to 2 as unrepairable cracks;
[0087] Counting the number of irreparable cracks, recording the number as an irreparable value, and comparing the irreparable value with a preset irreparable threshold;
[0088] When the unrepairable value is greater than or equal to the preset unrepairable threshold, an unrepairable state is formulated;
[0089] When the unrepairable value is less than the preset unrepairable threshold, a repairable state is established.
[0090] The technical effects and advantages of the visual-based gas pipeline appearance quality detection method of the present invention are as follows:
[0091] The present invention acquires a first X-ray image of the gas pipeline, superimposes the first X-ray image to generate a first identification image, marks a depression demarcation point in the first identification image, connects the depression demarcation points to generate a depression area, acquires a second X-ray image of the gas pipeline, splices the second X-ray image to generate a second identification image, marks a crack demarcation point in the second identification image, connects the crack demarcation points to generate a crack area, collects comprehensive quality data of the depression area and the crack area, generates a quality assessment index based on the comprehensive quality data, marks dangerous cracks based on the quality assessment index, and formulates a quality inspection method for the gas pipeline according to the dangerous cracks. Test report; Compared with the existing technology, by collecting X-ray images of the gas pipeline in axial and top view, the position and morphological characteristics of the crack structure in the gas pipeline can be fully represented, and the cracks can be displayed in three dimensions in combination with the recessed area and the crack area, avoiding the limitations of the crack structure display caused by visual images under a single perspective or a specific range, and effectively avoiding the visual blind spot, so that the comprehensive quality data can be accurately collected and the quality evaluation index can be calculated, thereby formulating an inspection and evaluation report for the gas pipeline, and providing a basis for the subsequent inspection and maintenance of the gas pipeline, which greatly improves the accuracy of visual inspection of the appearance quality of the gas pipeline. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] Figure 1 A schematic flow chart of a method for visually inspecting the appearance quality of a gas pipeline provided in Example 1 of the present invention;
[0093] Figure 2 A schematic diagram of a module of a gas pipeline appearance quality inspection system based on vision provided in Example 2 of the present invention;
[0094] Figure 3 A schematic diagram of stitching a second X-ray image provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0095] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0096] Example 1: Please refer to Figure 1 and Figure 3 As shown, the visual-based gas pipeline appearance quality detection method described in this embodiment includes:
[0097] Acquire a first X-ray image of the gas pipeline, and generate a first identification image after superimposing the first X-ray image;
[0098] The first X-ray image refers to the image obtained by scanning and photographing different depth positions of the gas pipeline along the axial direction of the gas pipeline by an X-ray device, that is, image acquisition can be performed on different depth positions of the gas pipeline from the axial direction, thereby realizing the image recognition effect of all axial positions of the gas pipeline.
[0099] The method for acquiring the first X-ray image includes:
[0100] Scan the gas pipeline from an axial position on any side using an X-ray device to obtain a scan image;
[0101] The outer contour of the gas pipeline in the scanned image is identified by computer vision technology, and a line is drawn along the outer contour to obtain the outer boundary of the gas pipeline;
[0102] The outer diameter of the gas pipeline is queried through the technical parameter table, and two auxiliary lines are drawn on the scanned image, both of which have their endpoints located on the outer boundary of the gas pipeline and have a length consistent with the outer diameter of the gas pipeline. The intersection of the two auxiliary lines is recorded 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] The horizontal position of the gas pipeline is continuously adjusted until the center point coincides with the scanning midpoint of the X-ray device, and the adjustment is stopped; by marking the center point and adjusting it to coincide, an accurate acquisition standard point can be provided for the acquisition of the first X-ray image to ensure the accuracy of the acquisition position of the first X-ray image, and an adjustment reference point can also be provided for the subsequent generation of the first recognition image to avoid the first recognition image from being offset or tilted when being generated;
[0104] With a preset step amplitude as a standard, i scanning positions are marked equidistantly along the axial direction on the gas pipeline; the preset step amplitude is used to limit the minimum unit of axial movement and shooting distance of the gas pipeline, so as to ensure that sufficient images can be captured of the gas pipeline in the axial viewing angle, so as to ensure that each scanning position can intuitively and accurately represent the depth of the crack;
[0105] The tube voltage of the X-ray device is set, and the X-ray device is controlled to scan i scanning positions in sequence to obtain i first X-ray images.
[0106] The first identification image refers to an image formed by overlapping and superimposing i first X-ray images, which can maximize the axial viewing angle of the cracks in the gas pipeline, and can intuitively and clearly represent the cracks in the gas pipeline in the axial direction;
[0107] The method for generating 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 indicate the structural positions where no cracks appear in the gas pipeline, and the blank areas are used to indicate the structural positions where cracks appear in the gas pipeline, so that cracks in the gas pipeline can be effectively distinguished from non-cracks;
[0109] The shadow areas in the i first X-ray images are converted into transparent areas by image processing technology, and the blank areas are rendered and colored into rendering areas, so as to obtain i rendering images; through the transparent conversion and rendering and coloring, the cracks and non-cracks can be clearly identified, and the color of the rendered areas after rendering and coloring is darker, so that when subsequent images are superimposed, the areas corresponding to the crack positions can be intuitively and clearly represented, and the cracks can be superimposed and presented from an axial perspective, so that the cracks can be restored to their true image as much as possible;
[0110] Align the center points of i rendered images in sequence according to the order of scanning time;
[0111] The first rendered image is used as the still image, and the remaining i-1 rendered images are simultaneously moved toward the still image, forcing the rendered areas to overlap in sequence and extend to the transparent area;
[0112] The i superimposed rendering images are recorded as the first recognition images;
[0113] It should be noted that when the rendering areas of i-1 rendered images are superimposed on the transparent area in sequence, there will be an occluded area between the rendered area and the transparent area. At this time, the occluded area will be affected by the rendered area and rendered and colored. The rendering area on the next rendered image can be superimposed on the transparent area of the previous rendered image in sequence, thereby ensuring that the cracks in the i first X-ray images can all be superimposed on the same image, and finally forming a first identification image.
[0114] Marking the concave demarcation points in the first recognition image, and connecting the concave demarcation points to generate a concave area;
[0115] The concave area refers to the cracks on the gas pipeline, and serves as the target of data collection that can correspond to the cracks on the gas pipeline and provide an axial perspective for subsequent quality inspection of the gas pipeline. Since the number of cracks on the gas pipeline is not unique, the number of concave areas is also not unique;
[0116] Methods for marking recessed areas include:
[0117] The upper boundary of the first recognition image is recorded as the effective boundary, and the distance values from the p rendering areas to the effective boundary are measured in sequence to obtain p boundary distance values;
[0118] Taking the rendering area corresponding to the minimum boundary distance value as the base point, the p rendering areas are numbered in ascending order one by one in a clockwise direction;
[0119] Mark k dividing points equidistantly on the p rendering areas in ascending order;
[0120] The positions of the k dividing points are continuously adjusted until all the k dividing points reach the critical position, and the k dividing points are recorded as k concave dividing points; the concave dividing point is a point used to represent the boundary of the concave area, which can provide an effective marking point for drawing the outer boundary of the concave area, facilitating the generation operation of the concave area; the critical position refers to the position corresponding to the rendering area and the non-rendering area, so as to ensure that the concave dividing point can accurately locate the concave area;
[0121] After connecting the k concave boundary points of the p rendering areas in sequence, p area closed lines are formed;
[0122] By using image processing technology, closed lines matching the outer boundary of the gas pipeline are drawn in sequence at the open positions of the p regional closed lines to obtain p closed lines; the closed line refers to a line matching the outer boundary of the gas pipeline. By drawing the closed line, the closed line of the region with the open position can be completely closed, so that the concave region can form a complete closed structure;
[0123] Connect the two ends of the p area closed lines to the two ends of the p closing lines respectively, record the enclosed area as a concave area, and obtain p concave areas;
[0124] It should be noted that the enclosed area between the regional closed lines is a closed area, so that the concave area is also a closed area. When p concave areas are obtained, the p concave areas at this time can represent the image of the p cracks from an axial perspective.
[0125] Acquire a second X-ray image of the gas pipeline, and generate a second identification image after splicing the second X-ray image;
[0126] The second X-ray image refers to an image obtained by scanning and photographing different angles along the radial direction of the gas pipeline by an X-ray device, that is, different angles of the gas pipeline can be represented in the radial direction, thus achieving the radial full-angle image recognition effect of the gas pipeline;
[0127] The method for acquiring the second X-ray image includes:
[0128] With a preset angle value as the standard, the gas pipeline is rotated clockwise to mark s shooting angles; the preset angle value is used to limit the numerical value of the rotation angle when the gas pipeline is radially photographed, so as to ensure that the annular gas pipeline can be photographed at multiple angles; the preset angle value is usually set according to the actual shooting requirements, and for example, the preset angle value is 15 degrees, 30 degrees, 45 degrees, etc.;
[0129] S shooting angles are photographed in sequence by an X-ray device to obtain images at s angles;
[0130] The s angle images are numbered in ascending order according to the sequence of shooting time to obtain s second X-ray images.
[0131] The second identification image refers to a top-view tiled image formed by edge splicing of s second X-ray images, which can fully represent the cracks in the gas pipeline, that is, a top-view intuitive and clear tiled representation of the cracks in the gas pipeline;
[0132] The method for generating the second recognition image includes:
[0133] Mark the first stitching edges and the last stitching edges of the s second X-ray images one by one, and mark the first stitching point and the last stitching point on the first stitching edge and the last stitching edge; the first stitching edge and the last stitching edge refer to the boundary of the second X-ray image close to the previous image and the boundary of the next image, respectively, so that the first stitching edge and the last stitching edge can be used as the position of stitching with the previous and next two images to ensure the orderliness and accuracy of image stitching; the first stitching point and the last stitching point refer to the midpoints of the first stitching edge and the last stitching edge, respectively, and serve as reference points for whether the subsequent first stitching edge and the last stitching edge are aligned;
[0134] Align and stitch the first stitching edge of the sth second X-ray image with the last stitching edge of the s+1th second X-ray image in ascending order to obtain a stitching recognition image with a stitching area;
[0135] In the spliced identification image, align the first splicing point of the sth second X-ray image with the last splicing point of the s+1th second X-ray image to obtain a spliced identification image with a splicing area and splicing points;
[0136] The second recognition image is obtained by performing edge smoothing on the splicing area through image processing technology and hiding the splicing points. After the edge smoothing, it is ensured that the splicing between two adjacent images is smooth and wrinkle-free, and will not affect the recognition and collection of subsequent data. Hiding the splicing points can avoid the interference of the splicing points on the recognition and collection of subsequent data.
[0137] For example, Figure 3 As shown, 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 first splicing point, B is the last splicing point, L1 is the first splicing edge, and L2 is the last splicing edge;
[0138] After the second recognition image is obtained, the collected annular surface image of the gas pipeline is spliced into a tiled overhead image. At this time, the relevant data of the cracks on the gas pipeline will be equivalently converted to 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 of crack data.
[0139] Marking the crack demarcation points in the second recognition image, and connecting the crack demarcation points to generate a crack area;
[0140] The crack region refers to the region in the second recognition image where the length, width, area and other parameters of the crack can be expressed in size, so that the crack can be expressed from a bird's-eye view. Since both the crack region and the concave region are generated by the cracks on the gas pipeline, the crack region can match the number and position of the concave region in the first recognition image, so that the number of the crack region is consistent with the number and position of the concave region;
[0141] The methods for generating fracture regions include:
[0142] Scan and mark all pixel points in the second recognition image, and record the pixel values of all pixel points one by one;
[0143] The pixel points whose pixel values are greater than the preset pixel threshold are recorded as target pixel points, and the area where the target pixel points are located is recorded as the target area, and p target areas are obtained; the preset pixel threshold is used to limit the minimum value of the pixel value corresponding to the target pixel point, that is, the area corresponding to the preset pixel threshold is the location of the crack, thereby achieving 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 calculating their average value;
[0144] Draw lines along the edges of the p target regions to obtain the target region boundary lines, and mark w target pixel points on the target region boundary lines respectively;
[0145] The distance between two adjacent target pixel points is continuously adjusted until the distance between the two adjacent target pixel points is consistent with the preset boundary distance, and then the adjustment is stopped; the preset boundary distance is used to numerically represent the distance between two adjacent crack boundary points, so as to ensure that a sufficient number of crack boundary points can be marked on the crack area, and through the connection of a large number of crack boundary points, the formed crack area can be closer to the actual shape of the crack;
[0146] The adjusted target pixel point is recorded as a crack demarcation point, and w crack demarcation points are obtained. After the w crack demarcation points of p target areas are connected in sequence, p crack areas are obtained;
[0147] It should be noted that the p crack areas and the p recessed areas are used to represent the same crack on the gas pipeline, so that the positions of the p crack areas and the p recessed areas correspond one to one, thereby enabling a multi-perspective diversified representation effect for the p cracks on the gas pipeline.
[0148] Collect comprehensive quality data of the depression area and the crack area, and generate a quality assessment index based on the comprehensive quality data;
[0149] Comprehensive quality data is used to represent the data of crack-related parameters in the concave area and crack area, that is, to comprehensively represent the size, depth, length and other data of cracks on the gas pipeline, so as to represent the severity of cracks on the gas pipeline and serve as the data basis for subsequent judgment of the appearance quality of the gas pipeline;
[0150] Comprehensive quality data include safety spacing value, crack area ratio value and span ratio value;
[0151] The safety distance value refers to the distance between the concave area and the inner boundary of the gas pipeline, which can be used to indicate the depth of the crack on the gas pipeline. The larger the safety distance value, the larger the distance between the concave area and the inner boundary of the gas pipeline, the smaller the depth of the crack on the gas pipeline, the better the appearance quality of the gas pipeline, and the larger the quality assessment index;
[0152] Methods for obtaining the safety distance value include:
[0153] Recognize the inner contour of the gas pipeline in the first recognition image by using 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 a starting point, respectively draw distance lines passing through the concave area to obtain m distance lines;
[0155] The intersection point of the distance line and the inner boundary of the gas pipeline is recorded as an inner point, and the intersection point of the distance line and the boundary of the concave area is recorded as an outer point;
[0156] Sequentially measure the distances from the inner point to the outer point on the m distance lines in the p concave areas to obtain m sub-safety values;
[0157] Compare the m sub-safety values one by one, and record the minimum value of the sub-safety value as the safety spacing value, and obtain p safety spacing values;
[0158] It should be noted that the p safety spacing values are used to accurately represent the distances between the p recessed areas and the inner boundary of the gas pipeline. When the cracks on the gas pipeline are completely connected, the safety spacing value of the recessed area is 0. However, in actual situations, the cracks on the gas pipeline will not be completely connected and will only be greater than 0.
[0159] The crack area ratio refers to the ratio of the area occupied by the crack region in the second recognition image to the total area of the second recognition image. When the crack area ratio is larger, it means that the crack area on the gas pipeline is larger, the appearance quality of the gas pipeline is worse, and the quality assessment index is smaller;
[0160] Methods for obtaining the fracture area ratio include:
[0161] Count the number of target pixels in p crack areas one by one to obtain p target quantity values;
[0162] Counting the number of all pixels in the second recognition image to obtain a total pixel value;
[0163] Compare the p target quantity values with the total pixel value one by one to obtain p crack area ratio values;
[0164] The expression of crack area ratio is:
[0165]
[0166] In the formula, MJ zbp is the percentage of the pth crack area, SL mbp is the pth target quantity value, ZL xs is the total value of pixels.
[0167] The span ratio value refers to the ratio of the number of sub-regions spanned by the crack area in the second identification diagram to the total number of sub-regions, which can be used to indicate how many sub-regions the crack area spans. The larger the span ratio value, the more sub-regions the crack area spans, the worse the appearance quality of the gas pipeline, and the smaller the quality assessment index;
[0168] Methods for obtaining span ratio values include:
[0169] The second recognition image is divided into v sub-regions with equal spacing, taking the long side of the second recognition image as the division direction and the preset division length as the division width; the preset division length is used to represent the width of the sub-region division, so as to ensure that the second recognition image can be divided into a sufficient number of sub-regions and meet the calculation of the subsequent span ratio value; the preset division length is specifically set according to actual needs, and illustratively, the preset division length is one-fifteenth of the length of the second recognition image;
[0170] The sub-regions completely spanned by the crack region are recorded as first regions, and the number of first regions is counted to obtain p first region values; completely spanning means that the crack region is in a continuous and uninterrupted state within the sub-region without any breakpoints;
[0171] The sub-region that the crack region does not completely cross is recorded as the second region, X second regions are obtained, and the target pixel points in the second region are marked; not completely crossing means that the crack region is in a discontinuous state in the sub-region, and a break point appears;
[0172] Sequentially measure the distance values between any two target pixel points in the X second regions, and record the maximum value of the distance values as the effective distance value, to obtain X effective distance values;
[0173] Compare the X valid distance values with the width of the sub-region in turn to obtain X sub-span values;
[0174] The expression for the subspan value is:
[0175]
[0176] Where KD zpx is the xth subspan value of the pth crack region, JL yxpx is the xth effective distance value of the pth crack area, JLkd is the width of the sub-region;
[0177] The sub-span value greater than the standard span value is recorded as the target span value, and the number of sub-regions corresponding to the target span value is counted 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 of a large number of data with extremely small sub-span values on the calculation, and on the other hand, it also improves the calculation standard of the span ratio value, thereby eliminating the interference that may be caused by the natural cracking of the anti-rust protective layer on the gas pipeline, and effectively improves the calculation accuracy of the quality evaluation index;
[0178] After adding the p first region values and the p second region values, the sum is compared with the number of sub-regions in turn to obtain p span proportion values;
[0179] The expression of span ratio is:
[0180]
[0181] Where KD zbp is the pth span proportion, QY 1p is the pth first region value, QY 2p is the pth second region value, SL qy is the number of sub-regions.
[0182] After obtaining the safety spacing value, crack area ratio value and span ratio value, the quality assessment index can be calculated according to the safety spacing value, crack area ratio value and span ratio value, so that the quality assessment index can clearly indicate the quality and degree of harm of the cracks on the gas pipeline in numerical terms, thereby reflecting the appearance quality of the gas pipeline;
[0183] The expression of quality assessment index is:
[0184]
[0185] In the formula, ZL zsp is the pth quality assessment index, AQ jjp is the pth safety distance value, α1, α2, α3 are weight factors, and α1, α2, α3 are all greater than 0.
[0186] Based on the quality assessment index, dangerous cracks are marked and a quality inspection report for the gas pipeline is prepared based on the dangerous cracks;
[0187] Dangerous cracks refer to cracks corresponding to the concave areas and crack areas in the first recognition image and the second recognition image whose danger levels exceed the preset danger levels, which can clearly indicate cracks on the gas pipeline with poor appearance quality and high danger levels, thereby being able to intuitively indicate the appearance quality of the gas pipeline;
[0188] Methods for marking dangerous crevices include:
[0189] The p quality evaluation indexes ZL zsp Sequentially compared with the preset quality assessment threshold ZL yz Comparison; The preset quality assessment threshold is used to represent the maximum value of the quality assessment index corresponding to when the crack is marked as a dangerous crack, that is, the crack can be distinguished as a dangerous crack and a non-dangerous crack; The preset quality assessment index is obtained by collecting a large number of maximum values of the quality assessment indexes marked as dangerous cracks in history and calculating their average value;
[0190] When ZL zsp Greater than or equal to ZL yz When , it means that the quality assessment index of the p-th crack is greater than or equal to the preset quality assessment threshold. At this time, the appearance quality of the p-th crack is good and the degree of harm is low, so the p-th crack is not marked as a dangerous crack;
[0191] When ZL zsp Less than ZL yz When , it means that the quality assessment index of the p-th crack is less than the preset quality assessment threshold. At this time, the appearance quality of the p-th crack is poor and the degree of harm is high. The p-th crack is marked as a dangerous crack, and z dangerous cracks are obtained.
[0192] After the dangerous cracks are marked, it is necessary to count the number of dangerous cracks and prepare a quality inspection report for the gas pipeline, which can conduct a true and accurate inspection and evaluation of the appearance quality of the gas pipeline;
[0193] The quality inspection report includes the repairable state and the non-repairable state; the repairable state means that the damage caused by the cracks on the gas pipeline to the gas pipeline is within the controllable range, and the cracks can be repaired; the non-repairable state means that the damage caused by the cracks on the gas pipeline to the gas pipeline is not within the controllable range, and the cracks cannot be repaired;
[0194] The methods for establishing the repairable state and the non-repairable state include:
[0195] The safety distance value less than the preset lower limit of the distance is recorded as abnormal data, the crack area ratio value greater than the preset upper limit of the area ratio is recorded as abnormal data, and the span ratio value 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 distance value when the gas pipeline can be repaired, so that the safety distance value can be effectively distinguished from 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 values of the crack area ratio and the span ratio, so as to distinguish abnormal data from non-abnormal data;
[0196] Count the number of abnormal data in the z dangerous cracks one by one, and record the dangerous cracks with the number of abnormal states greater than or equal to 2 as unrepairable cracks;
[0197] Counting the number of irreparable cracks, recording the number as an irreparable value, and comparing the irreparable value with a preset irreparable threshold;
[0198] When the unrepairable value is greater than or equal to the preset unrepairable threshold, it means that there are a large number of unrepairable cracks in the gas pipeline. At this time, the quality of the gas pipeline is extremely poor, and an unrepairable state is formulated;
[0199] When the unrepairable value is less than the preset unrepairable threshold, it means that the number of unrepairable cracks in the gas pipeline is small. At this time, the quality of the gas pipeline is poor, and a repairable state is formulated.
[0200] It should be noted that when the non-maintainable state or the maintainable state is determined, the appearance quality of the gas pipeline can be effectively and accurately classified, and a basis for subsequent maintenance personnel to judge the appearance of the gas pipeline for maintenance or replacement is provided, ensuring that gas pipelines with safety hazards can be correctly and promptly repaired or replaced.
[0201] In this embodiment, a first X-ray image of the gas pipeline is acquired, the first X-ray images are superimposed to generate a first identification image, depression demarcation points are marked in the first identification image, the depression demarcation points are connected to generate a depression area, a second X-ray image of the gas pipeline is acquired, the second X-ray images are spliced to generate a second identification image, crack demarcation points are marked in the second identification image, the crack demarcation points are connected to generate a crack area, comprehensive quality data of the depression area and the crack area are collected, and a quality assessment index is generated based on the comprehensive quality data, dangerous cracks are marked based on the quality assessment index, and a quality assessment plan for the gas pipeline is formulated based on the dangerous cracks. Quality inspection report; Compared with the existing technology, by collecting X-ray images of the gas pipeline in axial and top-down perspectives, the position and morphological characteristics of the crack structure in the gas pipeline can be fully represented, and the cracks can be displayed in three dimensions in combination with the recessed area and the crack area, avoiding the limitations of the crack structure display caused by visual images under a single perspective or a specific range, and effectively avoiding the visual blind spot, so that the comprehensive quality data can be accurately collected and the quality evaluation index can be calculated, thereby formulating an inspection and evaluation report for the gas pipeline, and providing a basis for the subsequent inspection and maintenance of the gas pipeline, greatly improving the accuracy of visual inspection of the appearance quality of the gas pipeline.
[0202] Example 2: Please refer to Figure 2 As shown, the part not described in detail in this embodiment is described in Example 1, and a gas pipeline appearance quality detection system based on vision is provided, which is used to implement a gas pipeline appearance quality detection method based on vision, including a first image generation module, a concave area generation module, a second image generation module, a crack area generation module, a quality assessment calculation module and a quality detection report module, wherein each module is connected through a wired or wireless network;
[0203] A first image generation module, used for acquiring a first X-ray image of the gas pipeline, and generating a first recognition image after superimposing the first X-ray image;
[0204] A concave region generating module, used for marking concave demarcation points in the first recognition image, and generating a concave region after connecting the concave demarcation points;
[0205] A second image generation module, used for acquiring a second X-ray image of the gas pipeline, and generating a second recognition image after splicing the second X-ray image;
[0206] A crack region generating module is used to mark crack demarcation points in the second recognition image and generate a crack region after connecting the crack demarcation points;
[0207] A quality assessment calculation module is used to collect comprehensive quality data of the depression area and the crack area, and generate a quality assessment index based on the comprehensive quality data;
[0208] The quality inspection report module is used to mark dangerous cracks based on the quality assessment index and to formulate a quality inspection report for the gas pipeline based on the dangerous cracks.
[0209] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for detecting the appearance quality of a gas pipeline based on vision, characterized in that: include: Acquire a first X-ray image of the gas pipeline, and generate a first identification image after superimposing the first X-ray image; Marking the concave demarcation points in the first recognition image, and connecting the concave demarcation points to generate a concave area; Acquire a second X-ray image of the gas pipeline, and generate a second identification image after splicing the second X-ray image; Marking the crack demarcation points in the second recognition image, and connecting the crack demarcation points to generate a crack area; Collect comprehensive quality data of the sunken 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 value and the span ratio value; Based on the quality assessment index, dangerous cracks are marked, and based on the dangerous cracks, a quality inspection report for the gas pipeline is drawn up. The quality inspection report includes the repairable status and the non-repairable status.
2. A visual-based gas pipeline appearance quality inspection method according to claim 1, characterized in that: The method for acquiring the first X-ray image comprises: Scan the gas pipeline from an axial position on any side using an X-ray device to obtain a scan image; The outer contour of the gas pipeline in the scanned image is identified by computer vision technology, and a line is drawn along the outer contour to obtain the outer boundary of the gas pipeline; The outer diameter of the gas pipeline is queried through the technical parameter table, and two auxiliary lines are drawn on the scanned image, both of which have their endpoints located on the outer boundary of the gas pipeline and have the same length as the outer diameter of the gas pipeline, and the intersection of the two auxiliary lines is recorded as the center point; Keep adjusting the horizontal position of the gas pipeline until the center point coincides with the scanning midpoint of the X-ray equipment; Based on a preset step amplitude, i scanning positions are marked equidistantly on the gas pipeline along the axial direction; Setting a tube voltage of the X-ray device, controlling the X-ray device to scan i scanning positions in sequence, and obtaining i first X-ray images; The method for generating the first recognition image includes: Scanning and identifying shadow areas and blank areas in i first X-ray images; Convert shadow areas in the i first X-ray images into transparent areas by image processing technology, and render and color the blank areas into rendering areas, thereby obtaining i rendering images; Align the center points of i rendered images in sequence according to the order of scanning time; The first rendered image is used as the still image, and the remaining i-1 rendered images are simultaneously moved toward the still image, forcing the rendered areas to overlap in sequence and extend to the transparent area; The superimposed i rendered images are recorded as the first recognition images.
3. A visual-based gas pipeline appearance quality inspection method according to claim 2, characterized in that: The marking method of the recessed area comprises: The upper boundary of the first recognition image is recorded as the effective boundary, and the distance values from the p rendering areas to the effective boundary are measured in sequence to obtain p boundary distance values; Taking the rendering area corresponding to the minimum boundary distance value as the base point, the p rendering areas are numbered in ascending order one by one in a clockwise direction; Mark k dividing points equidistantly on the p rendering areas in order of numbering from small to large; The positions of the k dividing points are continuously adjusted until all the k dividing points reach the critical position, and the k dividing points are recorded as k concave dividing points; After connecting the k concave boundary points of the p rendering areas in sequence, p area closed lines are formed; By using image processing technology, closed lines matching the outer boundaries of the gas pipeline are drawn in sequence at the open positions of the p regional closed lines to obtain P closed lines; The two ends of the p area closed lines are respectively connected to the two ends of the p closed lines to enclose them, and the enclosed area is recorded as a concave area, so as to obtain p concave areas.
4. A visual-based gas pipeline appearance quality inspection method according to claim 3, characterized in that: The method for acquiring the second X-ray image comprises: Using a preset angle value as a standard, rotate the gas pipeline clockwise to mark s shooting angles; S shooting angles are photographed in sequence by an X-ray device to obtain images at s angles; According to the sequence of shooting time, the s angle images are numbered in ascending order to obtain s second X-ray images; The method for generating the second recognition image includes: Mark the first splicing edges and the last splicing edges of the s second X-ray images one by one, and mark the first splicing point and the last splicing point on the first splicing edge and the last splicing edge; Align and stitch the first stitching edge of the sth second X-ray image with the last stitching edge of the s+1th second X-ray image in ascending order to obtain a stitching recognition image with a stitching area; In the spliced identification image, align the first splicing point of the sth second X-ray image with the last splicing point of the s+1th second X-ray image to obtain a spliced identification image with a splicing area and splicing points; The second recognition image is obtained by performing edge smoothing on the splicing area through image processing technology and hiding the splicing points.
5. A visual-based gas pipeline appearance quality inspection method according to claim 4, characterized in that: The method for generating the crack region comprises: Scan and mark all pixel points in the second recognition image, and record the pixel values of all pixel points one by one; The pixel points whose pixel values are greater than the preset pixel threshold are recorded as target pixel points, and the area where the target pixel points are located is recorded as the target area, and p target areas are obtained; Draw lines along the edges of the p target regions to obtain the target region boundary lines, and mark w target pixel points on the target region boundary lines respectively; The distance between two adjacent target pixels is continuously adjusted until the distance between the two adjacent target pixels is consistent with the preset boundary distance, and then the adjustment is stopped; The adjusted target pixel point is recorded as a crack demarcation point to obtain w crack demarcation points, and the w crack demarcation points of p target areas are connected in sequence to obtain p crack areas.
6. A visual-based gas pipeline appearance quality inspection method according to claim 5, characterized in that: The method for obtaining the safety distance value includes: Recognize the inner contour of the gas pipeline in the first recognition image by using 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 a starting point, respectively draw distance lines passing through the concave area to obtain m distance lines; The intersection point of the distance line and the inner boundary of the gas pipeline is recorded as an inner point, and the intersection point of the distance line and the boundary of the concave area is recorded as an outer point; Sequentially measure the distances from the inner point to the outer point on the m distance lines in the p concave areas to obtain m sub-safety values; The m sub-safety values are compared one by one, and the minimum value of the sub-safety value is recorded as the safety interval value, so as to obtain p safety interval values.
7. A visual-based gas pipeline appearance quality inspection method according to claim 6, characterized in that: The method for obtaining the crack area ratio value includes: Count the number of target pixels in p crack areas one by one to obtain p target quantity values; Counting the number of all pixels in the second recognition image to obtain a total pixel value; Compare the p target quantity values with the total pixel value one by one to obtain p crack area ratio values; The expression of crack area ratio is: In the formula, MJ zbp is the percentage of the pth crack area, SL mbp is the pth target quantity value, ZL XS is the total value of pixels.
8. A visual-based gas pipeline appearance quality inspection method according to claim 7, characterized in that: The method for obtaining the span ratio value includes: Taking the long side of the second recognition image as the division direction and the preset segmentation length as the division width, the second recognition image is equally spaced into v sub-areas; The sub-regions completely spanned by the crack region are recorded as first regions, and the number of first regions is counted to obtain p first region values; The sub-region that is not completely crossed by the crack region is recorded as the second region, X second regions are obtained, and the target pixel points in the second region are marked; Sequentially measure the distance values between any two target pixel points in the x second regions, and record the maximum value of the distance values as the effective distance value, to obtain x effective distance values; Compare the X valid distance values with the width of the sub-region in turn to obtain X sub-span values; The expression for the subspan value is: Where KD zpx is the xth subspan value of the pth crack region, JL yxpx is the xth effective distance value of the pth crack area, JL kd is the width of the sub-region; Record the subspan value greater than the standard span value as the target span value, and count the number of subregions corresponding to the target span value to obtain p second region values; After adding the p first region values and the p second region values, the sum is compared with the number of sub-regions in turn to obtain p span proportion values; The expression of span ratio is: Where KD zbp is the pth span proportion, QY 1p is the pth first region value, QY 2p is the pth second region value, SL qy is the number of sub-regions.
9. A visual-based gas pipeline appearance quality inspection method according to claim 8, characterized in that: The expression of the quality assessment index is: In the formula, ZL zsp is the pth quality assessment index, AQ jjp is the pth safety distance value, α1, α2, α3 are weight factors, and α1, α2, α3 are all greater than 0; Methods for marking dangerous crevices include: The p quality evaluation indexes ZL zsp Sequentially compared with the preset quality assessment threshold ZL yz Compare; When ZL zsp Greater than or equal to ZL yz When , the pth crack is not marked as a dangerous crack; When ZL zsp Less than ZL yz When , the pth crack is marked as a dangerous crack, and z dangerous cracks are obtained.
10. A visual-based gas pipeline appearance quality inspection method according to claim 9, characterized in that: The method for formulating the repairable state and the non-repairable state includes: The safety spacing value less than the preset distance lower limit is recorded as abnormal data, the crack area ratio value greater than the preset area ratio upper limit is recorded as abnormal data, and the span ratio value greater than the preset span ratio upper limit is recorded as abnormal data; Count the number of abnormal data in the z dangerous cracks one by one, and record the dangerous cracks with the number of abnormal states greater than or equal to 2 as unrepairable cracks; Counting the number of irreparable cracks, recording the number as an irreparable value, and comparing the irreparable value with a preset irreparable threshold; When the unrepairable value is greater than or equal to the preset unrepairable threshold, an unrepairable state is formulated; When the unrepairable value is less than the preset unrepairable threshold, a repairable state is established.
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
Oil and gas pipeline circumferential weld quality analysis method
CN115308384A
PE pipe crack defect detection method and system
CN117593300A
Cited By
Detection system and method for diversion bipolar plate of hydrogen fuel cell
CN120084400A
Detection System and Method for Hydrogen Fuel Cell Flow Guide Bipolar Plate
CN120084400B
Pipeline X-ray flaw detection method and system based on multi-view self-adaption
CN120651879A