Gas drainage pipe defect detection method and system based on industrial vision
By using edge detection and multi-scale analysis, the problem of distinguishing between cracks and scratches on the wall of gas drainage pipes has been solved, improving detection accuracy and efficiency, and enabling rapid identification and early warning.
Patent Information
- Application Number
- CN202511631286.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-11-10
AI Technical Summary
Existing methods for detecting defects in gas drainage pipes are ineffective in distinguishing between pipe wall cracks and scratches, leading to misjudgments and missed detections, which affects the accuracy of the detection.
Crack information intensity is obtained through edge detection, edges to be detected are screened, the probability of cracks in closed areas is analyzed, and crack weights are obtained by combining secondary crack characteristics and multi-scale analysis. The saliency detection is then adjusted to improve detection accuracy.
It improves the efficiency and accuracy of gas drainage pipe wall defect detection, enabling rapid identification and early warning, and reducing the possibility of misjudgment and missed judgment.
Smart Images

Figure CN121068612B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a gas drainage pipe defect detection method and system based on industrial vision. BACKGROUND
[0002] The gas drainage pipe is used for transporting high-concentration gas in the coal mine gas drainage system, and its quality and integrity are directly related to the safety of the mine; and pipe rupture can cause underground gas leakage over-limit or air infiltration into the pipe to form explosive gas, causing serious accidents, so it is necessary to quickly detect the defects of the gas drainage pipe through industrial vision for regular and timely detection to reduce the risk of gas leakage.
[0003] In the process of industrial vision defect detection of the gas drainage pipe, there are crack defects on the surface of the pipe wall of the gas drainage pipe, which need to be detected and warned in time, and slight scratches on the pipe wall will show similar significant performance to cracks, which are difficult to distinguish directly under the original CA saliency detection algorithm, thereby affecting the defect detection accuracy of the gas drainage pipe wall, which is easy to cause misjudgment or even omission, resulting in failure to accurately detect and warn the defects of the gas drainage pipe in time. SUMMARY
[0004] The present application provides a gas drainage pipe defect detection method and system based on industrial vision to solve the problem that the existing pipe wall cracks and scratches are easily confused in the identification and detection process, and the technical solution adopted is as follows:
[0005] The present application provides a gas drainage pipe defect detection method and system based on industrial vision to solve the problem that the existing pipe wall cracks and scratches are easily confused in the identification and detection process, and the technical solution adopted is as follows:
[0006] Collecting the surface image of the gas drainage pipe;
[0007] Obtaining a plurality of edges from the surface image of the gas drainage pipe through edge detection, and obtaining a plurality of line segments of each edge based on the distribution of the walking direction of the pixel points; obtaining the crack information intensity of each edge based on the walking direction difference of adjacent line segments and the gray difference of adjacent pixel points, and then screening a plurality of edges to be detected; obtaining the closed area and its corresponding intersection based on the distribution between the edges to be detected; obtaining the crack possibility of the two edges of each closed area according to the angle walking direction difference between the edges to be detected and the intersection and the outer edge of the closed area, and combining the crack information intensity.
[0008] Based on the distribution of the closed region adjacent to other edges, a plurality of extended edges of each closed region are extracted; the change relationship between distances of the extended edges in the same group is analyzed to obtain the secondary crack possibility of the extended edges in the same group, and the crack authenticity of the two edges of each closed region is obtained in combination with the crack possibility of the two edges of each closed region; and based on the change of the crack authenticity of the two edges of each closed region under multiple scales, the crack weight of each closed region is obtained.
[0009] Based on the crack weight of the closed region, the significance detection of the surface image of the gas drainage pipe is adjusted, and crack detection is performed, and the alarm level is set through the area and morphology of the detected crack region.
[0010] Optionally, the plurality of line segments of each edge include the following specific method:
[0011] For any edge, the tangent direction of each pixel point on the edge is obtained, the pixel points with the same continuous tangent direction are constructed into a line segment, a plurality of line segments of the edge are obtained, and the tangent direction of each pixel point in any line segment is taken as the tangent direction of the line segment.
[0012] Optionally, the crack information intensity of each edge includes the following specific method:
[0013] The absolute value of the difference of the gray values of any two adjacent pixel points on any edge is obtained, the absolute value of the difference of the tangent directions of any two adjacent line segments on the edge is obtained, the product of the mean value of the absolute value of the difference of the gray values of all adjacent pixel points and the mean value of the absolute value of the difference of the tangent directions of all adjacent line segments is taken as the crack information intensity of the edge.
[0014] Optionally, the plurality of to-be-detected edges obtained by screening include the following specific method:
[0015] The crack information intensities of all edges are arranged in order from small to large, the difference between the crack information intensities of the two adjacent edges in the order is obtained, the maximum value of the two crack information intensities corresponding to the maximum value of all differences is taken as the crack information threshold, and the edge with a crack information intensity greater than the crack information threshold is taken as the to-be-detected edge.
[0016] Optionally, the closed region and the corresponding intersection point include the following specific method:
[0017] For all to-be-detected edges, a closed region formed by two to-be-detected edges in all to-be-detected edges is obtained, a plurality of closed regions and two intersection points of the closed region are obtained.
[0018] Optionally, the crack possibility of the two edges of each closed region includes the following specific method:
[0019] Taking any one edge to be detected in any one closed region as a target edge, and taking any one intersection in the closed region as a target intersection, a pixel point on any one edge outside the target intersection of the closed region and closest to the target intersection is obtained as a reference edge point; a pixel point on the target edge closest to the target intersection is taken as a target edge point, the angle between the line connecting the target intersection and the target edge point and the angle between the line connecting the target intersection and the reference edge point are obtained respectively, and the absolute value of the difference between the two angles is taken as the difference factor of the target edge at the target intersection and the reference edge point; the difference factors of the target edge at the target intersection and the corresponding edges outside the closed region are obtained, and the edge corresponding to the minimum value of the difference factors is taken as the reference edge of the target edge at the target intersection;
[0020] The average gradient amplitude of all edge pixel points in the target edge is taken as the gradient average of the target edge, and the gradient average of the reference edge is obtained.
[0021] The product of the absolute value of the difference between the gradient average of the target edge and the gradient average of the reference edge and the crack information intensity of the target edge is taken as the crack possibility factor of the target edge and the reference edge.
[0022] The reference edge corresponding to the target edge at another intersection of the closed region is obtained, and the corresponding crack possibility factor is obtained, and the average of the two crack possibility factors is taken as the crack possibility factor of the target edge.
[0023] The crack possibility factors of the two edges corresponding to all closed regions are obtained, and linear normalization is performed on all crack possibility factors, and the obtained result is taken as the crack possibility of each edge of each closed region.
[0024] Optionally, based on the distribution of the closed region adjacent to other edges, a plurality of groups of extended edges of each closed region are extracted; the secondary crack possibility of each group of extended edges is obtained by analyzing the change relationship of the distance between the extended edges in the same group, and the specific method comprises:
[0025] For any one closed region, a plurality of inflection points on the two edges of the closed region are obtained, an edge extended outward from the inflection point and not in the closed region is taken as an extended edge of the closed region; all inflection points and their corresponding extended edges of the closed region are obtained, and the extended edges having intersections are taken as a group of extended edges, and a plurality of groups of extended edges of the closed region are obtained.
[0026] For any set of extended edges, obtain a plurality of shortest distances between pixel points on two extended edges in the set of extended edges, wherein the shortest distances are obtained based on the extended edge with the least number of pixel points, arrange all the obtained shortest distances in ascending order according to the distances between the pixel points in the extended edge with the least number of pixel points and the inflection points, obtain the ratio between the first shortest distance and the second shortest distance between two adjacent shortest distances, and take the average of all the obtained ratios as the possibility of secondary cracks of the set of extended edges.
[0027] Optionally, the crack authenticity of the two edges of each closed region is obtained by the following specific method:
[0028] The possibility of secondary cracks of each set of extended edges of the closed region is obtained, the product of the average of the possibilities of secondary cracks of all sets of extended edges and the average of the crack possibilities of the two edges of the closed region is taken as the crack authenticity of the two edges of the closed region.
[0029] Optionally, the crack weight of each closed region is obtained by the following specific method:
[0030] The surface image of the gas drainage pipe is up-sampled to obtain a plurality of scales of the surface image of the gas drainage pipe, the crack authenticity of the two edges of any closed region in the surface image of the gas drainage pipe at each scale is obtained, the average of the crack authenticities corresponding to all scales is taken as the crack factor of the closed region, and the crack factors of the original surface image of the gas drainage pipe are linearly normalized to obtain the crack weight of each closed region.
[0031] The application further provides a gas drainage pipe defect detection system based on industrial vision, which comprises a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of the above method when executing the computer program.
[0032] The beneficial effects of the present application are: the present application extracts the edges of the surface image of the gas drainage pipe, and preliminarily judges the cracks and scratches based on the edge direction and the gray difference of the pixel points based on the characteristics that the crack edges are irregular and jagged; the crack information intensity is obtained to screen the edges to be detected; further, the edges to be detected constituting the closed area of the crack are analyzed, the edge direction change and the uneven and irregular gradient distribution are considered, the crack possibility of the closed area edge is obtained, so as to reduce the possibility that the edges formed by the scratches are accidentally intersected and misrecognized as cracks; then, the secondary crack analysis of the crack is carried out, the crack authenticity under multiple scales is combined, the crack information misjudgment and influence under the external interference such as light and shooting angle are reduced, the crack weight of the closed area is obtained, the original saliency detection is adjusted through the crack weight, so that the crack information can be more obviously presented, the defect detection efficiency and accuracy of the gas drainage pipe wall are improved, and the alarm level is set accordingly, so as to realize the rapid identification, early warning and monitoring response of the gas drainage pipe wall defect. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0034] Figure 1 The present application provides an industrial vision-based gas drainage pipe defect detection method flowchart. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0036] Please refer to Figure 1 which shows the industrial vision-based gas drainage pipe defect detection method flowchart provided by an embodiment of the present application, and the method comprises the following steps:
[0037] Step S001, collecting the surface image of the gas drainage pipe.
[0038] It should be noted that the cracks in the wall of the gas drainage pipe will cause great harm, and under the multiple disturbances of mine dust, complex lighting and shooting angle, the crack in the wall and the ordinary scratch have similar feature height in the original CA saliency map, which leads to false detection and missed detection.
[0039] The purpose of the embodiment is to increase the difference between cracks and scratches in saliency detection by analyzing the difference in edge performance between crack regions and scratches in the direction and gray scale, making the crack information more salient, and thus improving the accuracy of the wall defect detection of the gas drainage pipe. Therefore, it is necessary to first collect images of the wall of the gas drainage pipe.
[0040] Specifically, the gas drainage pipe placed in the mine is periodically detected, and when the gas drainage pipe is paused, a high-precision industrial camera (resolution ≤ 20 μm) is used to take pictures of the gas drainage pipe and upload them to an industrial visual monitoring system. The gas drainage pipe images obtained by uploading are subjected to grayscale processing as the surface images of the gas drainage pipe; wherein the gas drainage pipe is collected in sections, and the repetition degree between adjacent two sections is set to 10% in this embodiment, i.e. 10% of the surface image of the gas drainage pipe, and the subsequent crack detection and alarm are performed once for each collection.
[0041] It should be noted that the edges of the defects on the surface of the gas drainage pipe are detected, and the edges with crack information are selected by analyzing the shape and gray scale difference of each edge; since a crack is composed of two edges, therefore, one edge belonging to a crack must exist another matching edge, the edge capable of forming a closed region (with two intersection points) is located, and the probability that the edge existing outside the closed region is the same as any edge in the closed region is analyzed; if it is the same edge and there is a gradient difference between the two edges, the possibility of being a crack edge is higher; at the same time, under the influence of the shooting angle in a single scale, there may be feature overlap, information loss, etc. which may cause misjudgment, therefore, through multi-scale analysis of the crack features of the closed region and combining the characteristics of secondary cracks, the authenticity of the detection area belonging to the crack is more accurately analyzed, and then the crack weight is obtained.
[0042] Step S002, a plurality of edges are obtained by edge detection on the surface image of the gas drainage pipe, and a plurality of line segments of each edge are obtained based on the direction distribution of the pixel points; based on the direction difference of adjacent line segments and the gray scale difference of adjacent pixel points, the crack information intensity of each edge is obtained, and then a plurality of detection edges are selected; based on the distribution between the detection edges, a closed region and its corresponding intersection point are obtained, and based on the angle direction difference between the detection edges and the intersection point and the outer edge of the closed region, the crack possibility of the two edges of each closed region is obtained in combination with the crack information intensity.
[0043] It should be noted that there are various defects and inherent structures of the gas drainage pipe, and the edge detection of the pipe can obtain the edges of all substances on the surface of the pipe; according to the characteristics of the cracks, the edges in the form of sheets and blocks can be excluded, the edges of the cracks are irregular and jagged, the edges of the scratches are smooth, have no burrs and are linear; and the edges of the cracks are rough, the reflection intensity of different areas on the edges is different under the influence of light, so that the gray values of the pixels on the edges are different in the image; and the scratches have smooth edges, the light intensity of different areas is consistent, so that the gray values of the pixels on the edges are less different.
[0044] Preferably, in an embodiment of the present application, a plurality of edges are obtained by edge detection on the surface image of the gas drainage pipe, and a plurality of line segments of each edge are obtained based on the distribution of the directions of the pixels; the crack information intensity of each edge is obtained based on the difference between the directions of adjacent line segments and the difference between the gray values of adjacent pixels, and then a plurality of edges to be detected are obtained by screening, including the specific method:
[0045] The edge detection is performed on the surface image of the gas drainage pipe to obtain a plurality of edges of the surface image of the gas drainage pipe; for any one of the edges, the tangent directions of the pixels on the edge are obtained, the tangent is a straight line with two directions, and the tangent directions are obtained in a clockwise direction in this embodiment; the pixels with the same tangent direction are connected to form a line segment, a plurality of line segments of the edge are obtained, and the tangent direction of each pixel in any line segment is taken as the tangent direction of the line segment; the absolute value of the difference between the gray values of any two adjacent pixels on the edge is obtained, the absolute value of the difference between the tangent directions of any two adjacent line segments on the edge is obtained, the product of the mean value of the absolute values of the differences between the gray values of all adjacent pixels and the mean value of the absolute values of the differences between the tangent directions of all adjacent line segments is taken as the crack information intensity of the edge.
[0046] Further, the crack information intensities of the edges in the surface image of the gas drainage pipe are obtained according to the above method, all the crack information intensities of the edges are arranged in order from small to large, the difference between the crack information intensities of the two edges adjacent in order (the latter minus the former, that is, the larger value minus the smaller value) is obtained, the maximum value of the two crack information intensities corresponding to the maximum value of all the differences is taken as the crack information threshold, and the edges with the crack information intensities greater than the crack information threshold are taken as the edges to be detected.
[0047] It should be noted that the edges of the cracks are rough and have no fixed direction, which can cause the direction of the line segments on the edges to change constantly, and the gray values of the pixels also change due to the difference in reflection intensity under the influence of light, so that the crack information intensity is obtained.
[0048] Preferably, in one embodiment of the present application, the closed regions and their corresponding intersection points are obtained based on the distribution between the edges to be detected, and the crack possibility of each edge of the closed region is obtained according to the difference in the angle trend between the edges to be detected and the intersection points and the outer edge of the closed region, in combination with the crack information intensity.
[0049] It should be noted that the crack in the image is a closed space composed of two edges, and the two edges of the crack trunk intersect at two intersection points. Although some scratches have strong crack information due to the irregular trend of the crack and the difference in the gray value caused by the dust covering in the mine environment, there is no other edge that matches the edge in the edge. The closed interval composed of the two edges may have an outward extending edge at the intersection point. The gradient of the scratch is uniform, and the average gradient of the edge inside and outside the intersection point region is close, so the two edges are likely to be scratches. By analyzing each edge extending outward at the intersection point of the closed region, the possibility of the edge of the closed region being a crack can be obtained.
[0050] For all edges to be detected, the closed region composed of two edges to be detected in all edges to be detected is obtained, and then a plurality of closed regions and two intersection points of the closed region are obtained, wherein the intersection point is the intersection point between the two edges to be detected, and the two intersection points and the two edges to be detected constitute the closed region. Any edge to be detected in any closed region is taken as a target edge (the target edge only contains a part of the edge to be detected that is the boundary of the closed region, and the part outside the closed region is not taken as the target edge), and any intersection point in the closed region is taken as a target intersection point. The edge pixel point closest to the target intersection point in any edge outside the closed region is taken as a reference edge point. The edge pixel point closest to the target intersection point in the target edge is taken as a target edge point. The angle (clockwise) between the target intersection point and the target edge point, and the angle (clockwise) between the target intersection point and the reference edge point are obtained respectively. The absolute value of the difference between the two angles is taken as the difference factor of the target edge at the target intersection point and the reference edge point. The difference factors of the target edge at the target intersection point and the corresponding edges outside the closed region are obtained, and the edge corresponding to the minimum difference factor is taken as the reference edge of the target edge at the target intersection point.
[0051] Further, the gradient amplitude mean value of all edge pixels in the target edge is taken as the gradient mean value of the target edge, and the gradient mean value of the reference edge is obtained in the same way; the product of the absolute value of the difference between the gradient mean value of the target edge and the gradient mean value of the reference edge and the crack information intensity of the target edge is taken as the crack possibility factor of the target edge and the reference edge; the reference edge corresponding to the other intersection point of the target edge in the closed area is obtained in the same way, and the corresponding crack possibility factor is obtained; the mean value of the two crack possibility factors is taken as the crack possibility factor of the target edge; the crack possibility factors of the two edges of all closed areas are obtained by the above method, and linear normalization is performed on all crack possibility factors, and the obtained result is taken as the crack possibility of each edge of each closed area.
[0052] It should be noted that the greater the gradient difference between the target edge and the reference edge, the greater the gradient fluctuation difference between the edges inside and outside the closed area, which does not conform to the characteristic that the gradient change of the scratch is small, and is more consistent with the local edge characteristics of the irregular crack. In combination with the crack information intensity of the target edge, the reference edges corresponding to the two intersection points are analyzed and merged to obtain the crack possibility.
[0053] Thus, the crack possibility of each edge of each closed area is obtained.
[0054] Step S003, based on the distribution of the closed area adjacent to other edges, a plurality of groups of extended edges of each closed area are extracted; the change relationship between the distances of the extended edges in the same group is analyzed to obtain the secondary crack possibility of each group of extended edges, and the crack authenticity of the two edges of each closed area is obtained in combination with the crack possibility of the two edges of each closed area; based on the change of the crack authenticity of the two edges of the closed area under multiple scales, the crack weight of each closed area is obtained.
[0055] It should be noted that after the performance analysis of the closed area of the crack, the performance of the secondary crack around the crack needs to be considered, and the distance between the two extended edges will gradually decrease during the continuous extension process from the main stem to the outside. Therefore, the crack authenticity, i.e. the analysis of the secondary crack, is further performed on the basis of the crack possibility.
[0056] Preferably, in an embodiment of the present application, based on the distribution of the closed area adjacent to other edges, a plurality of groups of extended edges of each closed area are extracted, and the specific method comprises:
[0057] For any closed area, a plurality of inflection points on the two edges of the closed area are obtained by using second-order difference, the edge of the inflection point extending outward and not in the closed area is taken as an extended edge of the closed area; all inflection points and their corresponding extended edges of the closed area are obtained, and the extended edges with intersection points are taken as a group of extended edges, and then a plurality of groups of extended edges of the closed area are obtained.
[0058] Preferably, in one embodiment of the present application, the change relationship of the distance between the extension edges in each group is analyzed to obtain the secondary crack possibility of each group of extension edges, and the secondary crack possibility of each group of extension edges is combined with the crack possibility of the two edges of each closed region to obtain the crack authenticity of the two edges of each closed region, including the specific method as follows:
[0059] For any group of extension edges of any closed region, a plurality of shortest distances between the pixel points on the two extension edges in the group of extension edges are obtained, that is, the shortest distance between each pixel point on any one extension edge and the other extension edge, and then a plurality of shortest distances are obtained, wherein the shortest distances are obtained based on the extension edge with the least number of pixel points in the two extension edges, and the number of shortest distances is equal to the number of pixel points in the extension edge with the least number of pixel points (the last shortest distance is 0, that is, corresponding to the intersection point); all the obtained shortest distances are arranged in ascending order according to the distance between the pixel points in the extension edge with the least number of pixel points and the inflection point from small to large, the ratio of the former shortest distance to the latter shortest distance between the adjacent two shortest distances is obtained, and the last shortest distance is not involved in the ratio calculation, and the mean value of all the obtained ratios is taken as the secondary crack possibility of the group of extension edges.
[0060] Further, the secondary crack possibilities of each group of extension edges of the closed region are obtained according to the above method, and the product of the mean value of the secondary crack possibilities of all groups of extension edges and the mean value of the crack possibilities of the two edges of the closed region is taken as the crack authenticity of the two edges of the closed region.
[0061] It should be noted that, on the basis of the greater crack possibility of the closed region, if the distance between each group of extension edges presents the feature of continuously decreasing, it indicates that it conforms to the performance form of the continuously reduced secondary crack of the extension, and accordingly the closed region is more likely to be the main trunk of the crack and generate the secondary crack, and the crack authenticity is greater.
[0062] It should be further noted that the crack possibility obtained under a single scale may have feature overlap, information loss and other problems caused by the influence of the shooting angle, so the crack features of the closed region are combined with the multi-scale analysis to more accurately analyze the authenticity of the crack of the to-be-detected region.
[0063] Preferably, in one embodiment of the present application, the crack weight of each closed region is obtained based on the change of the crack authenticity of the two edges of the closed region under multi-scale, including the specific method as follows:
[0064] The surface image of the gas drainage pipe is up-sampled, and the image pyramid interpolation method is adopted in the embodiment to perform up-sampling five times, and then a plurality of scale surface images of the gas drainage pipe are obtained. The image pyramid up-sampling is a known technology in the art, and will not be described herein. For the surface images of the gas drainage pipe at each scale, the crack authenticity of the two edges of the closed area in the surface image of the gas drainage pipe at each scale is obtained according to the above method, and the average of the crack authenticities corresponding to all scales is taken as the crack factor of the closed area. The crack factors of the original surface image of the gas drainage pipe are linearly normalized, and the obtained result is taken as the crack weight of each closed area.
[0065] It should be noted that through the comprehensive analysis of the crack authenticity at multiple scales, the smaller the change is, that is, the overall crack authenticity is larger, the crack is less affected by the illumination and the shooting angle, and the crack of the corresponding closed area is more obvious. The crack weight is adjusted accordingly.
[0066] Thus, the crack weight of each closed area in the surface image of the gas drainage pipe is obtained.
[0067] Step S004, adjusting the saliency detection of the surface image of the gas drainage pipe based on the crack weight of the closed area, and performing crack detection, and setting the alarm level through the area and morphology of the detected crack area.
[0068] It should be noted that after obtaining the crack weight of the closed area, the saliency value of the pixel point in the closed area is adjusted through the crack weight, so that the saliency of the crack information can be better expressed in the saliency detection process, and the accuracy of the crack detection system for monitoring the crack information is improved.
[0069] The surface image of the gas drainage pipe is subjected to CA saliency detection to obtain the saliency value of each pixel point. The saliency value of the pixel point in each closed area is corrected, and the sum of the saliency value and the crack weight of the closed area is taken as the corrected saliency value of the corresponding pixel point. The saliency value of the pixel point not in the closed area is directly taken as the corrected saliency value. Based on the corrected saliency value of each pixel point and the surface image of the gas drainage pipe, saliency detection is performed again, that is, the gray value of each pixel point is weighted based on the corrected saliency value and is detected again. In combination with the crack detection system, the crack defect extraction and positioning of the surface image of the gas drainage pipe are realized. The saliency detection and the crack detection system adopt the existing technology, and the crack detection system detects by threshold judgment through machine vision. The embodiment will not be described herein.
[0070] Further, a plurality of crack regions are extracted (based on the closed region extraction), the area of the crack region is obtained, and the number of secondary cracks (based on the extended edge extraction) is obtained, and a first area threshold, a second area threshold, a first number threshold and a second number threshold are preset, wherein the first area threshold and the second area threshold are respectively described as 0.1 and 0.3, and the first number threshold and the second number threshold are respectively described as 1 and 3; if the area of any crack region is less than the first area threshold, and the number of secondary cracks is less than or equal to the first number threshold, it is determined as low risk, and a yellow alarm is set; if there is a crack region whose area is greater than or equal to the first area threshold and less than the second area threshold, or the number of secondary cracks is greater than the first number threshold and less than or equal to the second number threshold, it is determined as medium risk, and an orange alarm is set; if there is a crack region whose area is greater than or equal to the second area threshold, or the number of secondary cracks is greater than the second number threshold, it is determined as high risk, and a red alarm is set; thus, the crack defect detection and alarm of the gas drainage pipe wall surface are realized. With the first number threshold and the second number threshold are respectively described as 1 and 3; if the area of any crack region is less than the first area threshold, and the number of secondary cracks is less than or equal to the first number threshold, it is determined as low risk, and a yellow alarm is set; if there is a crack region whose area is greater than or equal to the first area threshold and less than the second area threshold, or the number of secondary cracks is greater than the first number threshold and less than or equal to the second number threshold, it is determined as medium risk, and an orange alarm is set; if there is a crack region whose area is greater than or equal to the second area threshold, or the number of secondary cracks is greater than the second number threshold, it is determined as high risk, and a red alarm is set; thus, the crack defect detection and alarm of the gas drainage pipe wall surface are realized.
[0071] Thus, the embodiment is completed.
[0072] Another embodiment of the present application provides an industrial vision-based gas drainage pipe defect detection system, which comprises a memory, a processor and a computer program stored in the memory and running on the processor, and the processor implements the above method steps S001 to S004 when executing the computer program.
[0073] The above only describes the preferred embodiments of the present application and is not intended to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for detecting defects in gas extraction pipes based on industrial vision, characterized in that, The method includes the following steps: Acquire images of the surface of the gas extraction pipe; Several edges are obtained from the surface image of the gas extraction pipe through edge detection, and several line segments of each edge are obtained based on the direction distribution of the pixels therein. Based on the direction difference of adjacent line segments and the gray value difference of adjacent pixels, the crack information intensity of each edge is obtained, and then several edges to be detected are selected. Based on the distribution between the edges to be detected, closed regions and their corresponding intersections are obtained. Based on the angular direction difference between the edges to be detected and the intersections, as well as the outer edge of the closed region, combined with the crack information intensity, the crack probability of the two edges of each closed region is obtained. Based on the distribution of adjacent edges of a closed region, several sets of extended edges are extracted for each closed region; the relationship between the distance between extended edges in the same set is analyzed to obtain the probability of secondary cracks in each set of extended edges; combined with the crack probability of the two edges of each closed region, the crack authenticity of the two edges of each closed region is obtained; based on the crack authenticity change of the two edges of the closed region at multiple scales, the crack weight of each closed region is obtained. The saliency detection of the gas drainage pipe surface image is adjusted based on the crack weight of the closed region, and crack detection is performed. The alarm level is set according to the area and shape of the detected crack area. The specific method for obtaining the crack intensity information of each edge is as follows: Get the absolute difference between the gray values of any two adjacent pixels on any edge, get the absolute difference between the tangent directions of any two adjacent line segments on the edge, and use the product of the mean of the absolute differences between the gray values of all two adjacent pixels on the edge and the mean of the absolute differences between the tangent directions of all two adjacent line segments as the crack information intensity of the edge. The specific method for obtaining the probability of cracks at the two edges of each closed region is as follows: Take any edge to be detected in any closed region as the target edge, and any intersection point in the closed region as the target intersection point. Obtain the edge pixel point that is closest to the target intersection point among any edges outside the target intersection point in the closed region, and use it as the reference edge point. Take the edge pixel point that is closest to the target intersection point among the target edges as the target edge point. Obtain the angle of the line connecting the target intersection point and the target edge point, and the angle of the line connecting the target intersection point and the reference edge point. Use the absolute value of the difference between the two angles as the difference factor of the target edge at the target intersection point and the reference edge point. Obtain the difference factors of the target edge at the target intersection point and each edge outside the closed region. Use the edge corresponding to the minimum difference factor as the reference edge of the target edge at the target intersection point. The average gradient magnitude of all edge pixels in the target edge is used as the average gradient of the target edge, and the average gradient of the reference edge is obtained. The absolute value of the difference between the mean gradient of the target edge and the mean gradient of the reference edge, and the product of the crack information intensity of the target edge, are used as the crack probability factor between the target edge and the reference edge. Obtain the reference edge corresponding to another intersection point of the target edge in the closed region, and obtain the corresponding crack probability factor. Take the average of the two crack probability factors as the crack probability factor of the target edge. Obtain the crack probability factors for the two edges corresponding to all closed regions, perform linear normalization on all crack probability factors, and use the results as the crack probability of each edge of each closed region. The specific method for verifying the authenticity of the cracks at the two edges of each closed region is as follows: The probability of secondary cracks in each group of extended edges of the closed region is obtained. The product of the mean of the probability of secondary cracks in all groups of extended edges and the mean of the crack probability in the two edges of the closed region is used as the authenticity of the cracks in the two edges of the closed region. The specific method for obtaining the crack weights of each closed region is as follows: Upsample the surface image of the gas drainage pipe to obtain surface images of the gas drainage pipe at multiple scales. Obtain the crack authenticity of the two edges of any closed region in the surface images of the gas drainage pipe at each scale. Use the average crack authenticity of all scales as the crack factor of the closed region. Linearly normalize the crack factor of each closed region in the original gas drainage pipe surface image, and use the result as the crack weight of each closed region.
2. The method for detecting defects in gas extraction pipes based on industrial vision according to claim 1, characterized in that, The specific method for obtaining several line segments of each edge is as follows: For any edge, obtain the tangent direction of each pixel on the edge, form a line segment with consecutive pixels with the same tangent direction, obtain several line segments of the edge, and take the tangent direction of each pixel in any line segment as the tangent direction of the line segment.
3. The method for detecting defects in gas extraction pipes based on industrial vision according to claim 1, characterized in that, The filtering process yields several edges to be detected, including the following specific methods: Arrange the crack information intensity of all edges in ascending order, obtain the difference between the crack information intensity of two sequentially adjacent edges, and take the maximum value of the two crack information intensities corresponding to the maximum value of all differences as the crack information threshold. Edges with crack information intensity greater than the crack information threshold are taken as edges to be detected.
4. The method for detecting defects in gas extraction pipes based on industrial vision according to claim 1, characterized in that, The specific method for obtaining the closed region and its corresponding intersection points is as follows: For all edges to be detected, obtain the closed region formed by two edges to be detected, resulting in several closed regions and two intersection points of the closed regions.
5. The method for detecting defects in gas extraction pipes based on industrial vision according to claim 1, characterized in that, Based on the distribution of adjacent edges of a closed region, several groups of extended edges are extracted from each closed region; the relationship between the distances between extended edges in the same group is analyzed to obtain the probability of secondary cracks in each group of extended edges. The specific methods include: For any closed region, obtain several inflection points on the two edges of the closed region, and take the edge that extends outward from the inflection point and is not within the closed region as an extended edge of the closed region; obtain all the inflection points of the closed region and their corresponding extended edges, and take the extended edges with intersections as a group of extended edges to obtain several groups of extended edges of the closed region. For any set of extended edges, obtain several shortest distances between pixels on two extended edges in the set. The shortest distance is obtained based on the extended edge with the fewest pixels. All the obtained shortest distances are sorted in ascending order according to the distance between the pixel and the inflection point of the extended edge with the fewest pixels. The ratio of the previous shortest distance to the next shortest distance between two adjacent shortest distances is obtained. The mean of all the obtained ratios is used as the probability of secondary cracks in the set of extended edges.
6. A gas extraction pipe defect detection system based on industrial vision, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the gas extraction pipe defect detection method based on industrial vision as described in any one of claims 1-5.
Citation Information
Patent Citations
Method for detecting hidden crack defect of photovoltaic module through three-dimensional image
CN107607548A
Connecting structure for gas pipe combination
CN222026466U