Cable skin damage detection method based on machine vision
In the detection of cable skin break defects, the cable communication domain is screened and the edge smoothness is calculated, and the probability of skin break defect edges is determined by combining the characteristics of spiral patterns and skin break defect edges, which solves the problem of inaccurate measurement of cable breakage in the prior art and improves the accuracy of detection.
Patent Information
- Application Number
- CN202411051280.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-08-01
AI Technical Summary
In the detection of cable skin defects, the degree of cable breakage is measured based on the detected edge length in the cable area, resulting in low accuracy.
By obtaining the cable surface edge image, the cable connection domain is screened out, the edge smoothness of each edge is calculated, and the probability of breaking the skin defect edge of each edge is determined based on the smoothness and parallel characteristics of the spiral pattern edge and the broken skin defect edge, thereby screening out more accurate broken skin defect edges.
The accuracy of cable breaking defect detection is improved, so that when detecting the cable breaking degree, the cable breaking degree can be more accurately identified and evaluated.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image defect recognition, and in particular to a method for detecting cable skin crack defects based on machine vision. Background Art
[0002] Cable is a collection of wires or optical fibers, usually used to transmit electricity, data or signals; in modern society, cables are widely used in various fields such as communications, power transmission, and network connection. When the cable is broken, it will affect the safety of the power system and the stability of transportation, so it is necessary to detect the surface defects of the cable in time. Considering that the efficiency and accuracy of manual detection of cable broken defects are low, machine vision technology is usually used to automatically monitor cable broken defects to improve the efficiency and accuracy of broken defect detection.
[0003] Considering that when the cable is damaged, a relatively clear edge will be formed at the damaged position, the prior art usually performs edge detection on the cable surface image, and measures the degree of cable damage according to the length of the edge detected in the cable area, thereby performing cable damage defect detection according to the degree of cable damage. However, since the spiral pattern of the cable also has relatively obvious edges, the degree of cable damage measured by the length of the edge detected in the cable area is not accurate enough, making the accuracy of cable damage defect detection according to the degree of cable damage low. Summary of the invention
[0004] The present application provides a method for detecting cable skin defects based on machine vision. After obtaining the cable connectivity domain that characterizes the cable area, the method first calculates the edge smoothness of each edge according to the different smoothness characteristics between the spiral pattern edge and the skin defect edge, and then measures the probability of the skin defect edge of each edge based on the parallel regular distribution characteristics of the spiral pattern edge compared to the skin defect edge and the edge smoothness, so as to screen out more accurate skin defect edges according to the skin defect edge probability, so that the cable damage degree measured according to the length of the skin defect edge is more accurate, which solves the problem that the cable damage degree measured according to the detected edge length in the cable area in the prior art is not accurate enough, and makes the accuracy of cable skin defect detection according to the cable damage degree higher.
[0005] The first aspect of the present application provides a method for detecting cable skin damage based on machine vision, comprising:
[0006] Acquire a cable surface edge image; perform image closing operation on the cable surface edge image and filter out all cable connected domains according to the shapes of each connected domain;
[0007] In the cable surface edge image, at least two non-boundary edge lines corresponding to each cable connected domain are determined; and according to the edge rule corresponding to each non-boundary edge line, the edge smoothness of each non-boundary edge line is determined;
[0008] Determine the skin-breaking defect edge probability of each non-boundary edge line in each cable connected domain according to the overall size and relative deviation of the edge smoothness between the non-boundary edge lines in each cable connected domain, and the parallel approximation between the non-boundary edge lines; and select the skin-breaking defect edge lines according to the skin-breaking defect edge probability;
[0009] The cable damage degree of each cable connection area is determined according to the length of all the broken skin defect edge lines corresponding to each cable connection area; and the cable broken skin defect detection is performed according to the cable damage degree.
[0010] In an embodiment of the first aspect of the present application, the method for acquiring the cable connectivity domain includes:
[0011] Determine at least two closed connected domains after performing image closing operation on the cable surface edge image; obtain the minimum circumscribed rectangle of each closed connected domain;
[0012] A closed connected domain whose length-to-width ratio of the corresponding minimum circumscribed rectangle is greater than a preset length-to-width ratio threshold and whose width is less than a preset width threshold is used as a reference connected domain;
[0013] Using each reference connected domain as a mask, a cable connected domain corresponding to each reference connected domain in the cable surface edge image is determined.
[0014] In an embodiment of the first aspect of the present application, the method for obtaining the edge smoothness includes:
[0015] In each cable connected domain, the chain code value corresponding to each edge pixel point on each non-boundary edge line is determined by the eight-neighborhood chain code;
[0016] In the extension direction of each non-boundary edge line, negative correlation mapping is performed according to the difference between the chain code value of each edge pixel and the chain code value of the previous edge pixel to determine the local smoothness of each edge pixel;
[0017] The edge smoothness of each non-boundary edge line is determined according to a normalized value of a mean value of local smoothness of all edge pixels on each non-boundary edge line.
[0018] In an embodiment of the first aspect of the present application, the method for obtaining the edge probability of the skin breaking defect includes:
[0019] In each cable connected domain, each non-boundary edge line is sequentially used as a target edge line, and other non-boundary edge lines outside the target edge line are used as comparison edge lines;
[0020] According to the difference in the number of edge pixels between the target edge line and the comparison edge line and the similarity in the distribution of chain code values, the cable spiral parallel characteristic value between the target edge line and each comparison edge line is determined;
[0021] Determine the cable spiral smoothness characteristic value between the target edge line and each comparison edge line according to the difference in edge smoothness and the overall size between the target edge line and each comparison edge line;
[0022] Determine the cable spiral consistency between the target edge line and each comparison edge line according to the cable spiral parallel characteristic value and the cable spiral smooth characteristic value; the cable spiral parallel characteristic value and the cable spiral smooth characteristic value are both positively correlated with the cable spiral consistency;
[0023] The mean values of all cable spiral consistency between the target edge line and all comparison edge lines are negatively correlated and normalized to determine the edge probability of the target edge line's skin-breaking defect.
[0024] In an embodiment of the first aspect of the present application, the method for obtaining the cable helical parallel characteristic value includes:
[0025] Calculate the chain code value difference between each edge pixel point on the target edge line and each edge pixel point on each comparison edge line; perform negative correlation normalization on the accumulated value of all chain code value differences between all edge pixels on the target edge line and all edge pixels on each comparison edge line to determine the degree of comparison parallelism between the target edge line and each comparison edge line;
[0026] The cable spiral parallel feature value between the target edge line and each comparison edge line is determined according to the product of the negative correlation mapping value of the difference in the number of edge pixels between the target edge line and each comparison edge line and the comparison parallel degree.
[0027] In an embodiment of the first aspect of the present application, the method for obtaining the cable spiral smoothing characteristic value includes:
[0028] The negative correlation mapping value of the difference between the edge smoothness of the target edge line and the edge smoothness of each contrast edge line is used as the edge smoothness proximity between the target edge line and each contrast edge line;
[0029] The product of the edge smoothness of the target edge and the edge smoothness of each comparison edge line is taken as the corresponding overall smoothness;
[0030] The product of the overall smoothness degree and the edge smoothness closeness degree is used to determine the cable spiral smoothness characteristic value between the target edge line and each comparison edge line.
[0031] In an embodiment of the first aspect of the present application, the method for obtaining the cable spiral consistency includes:
[0032] The degree of cable spiral consistency between the target edge line and each comparison edge line is determined according to the product of the cable spiral parallel characteristic value and the cable spiral smooth characteristic value.
[0033] In an embodiment of the first aspect of the present application, the method for obtaining the edge line of the skin-breaking defect includes:
[0034] The non-boundary edge line whose edge probability of skin breaking defect is greater than the preset skin breaking defect threshold is used as the skin breaking defect edge line.
[0035] In an embodiment of the first aspect of the present application, the method for obtaining the degree of cable damage includes:
[0036] The normalized value of the total number of edge pixels of all skin-breaking defect edge lines corresponding to each cable connectivity domain is taken as the cable damage degree of each cable connectivity domain.
[0037] In an embodiment of the first aspect of the present application, the method for detecting cable skin damage defects according to the degree of cable damage includes:
[0038] The cable connectivity area where the cable damage degree is greater than the preset damage threshold is regarded as the cable skin damage defect area.
[0039] In a second aspect, the present application provides a cable skin damage defect detection system based on machine vision, the system comprising:
[0040] The data acquisition preprocessing module is used to acquire the cable surface edge image; after performing image closing operation on the cable surface edge image, all the cable connected domains are screened out according to the shapes of each connected domain;
[0041] A first determination module is used to determine at least two non-boundary edge lines corresponding to each cable connected domain in the cable surface edge image; and determine the edge smoothness of each non-boundary edge line according to the edge rule corresponding to each non-boundary edge line;
[0042] The second determination module is used to determine the edge probability of skin-breaking defects of each non-boundary edge line in each cable connected domain according to the overall size and relative deviation of the edge smoothness between the non-boundary edge lines in each cable connected domain and the parallel approximation between the non-boundary edge lines;
[0043] The cable skin defect detection module is used to determine the cable damage degree of each cable connection domain according to the skin defect edge probability of all non-boundary edge lines corresponding to each cable connection domain; and perform cable skin defect detection according to the cable damage degree.
[0044] In a third aspect, the present application provides a computer device, comprising a memory and a processor. The memory is used to store computer program code, and the processor is used to call and run the computer program code from the memory to execute the method of the first aspect or any embodiment of the first aspect of the present application.
[0045] In a fourth aspect, the present application provides a computer program product, comprising a computer program code, which, when executed, performs the method of the first aspect of the present application or any embodiment of the first aspect.
[0046] In a fifth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed, the method of the first aspect or any embodiment of the first aspect of the present application is performed.
[0047] This application has the following beneficial effects:
[0048] The present application firstly considers the slender characteristics of the cable area, and in order to avoid directly dividing the connected domain of a separate spiral pattern or skin-breaking defect, the cable surface edge image is closed and the cable connected domain representing the cable area is screened out according to the shape of each connected domain after image closing operation is performed on the edge image of the cable. Considering that the edges of the spiral pattern and the skin-breaking defect only appear inside the cable area, all the non-boundary edge lines corresponding to the cable connected domain are first determined. The edge of the skin-breaking defect is irregularly extended, while the edge of the spiral pattern is relatively regular, that is, relatively smoother, so the corresponding edge smoothness is determined according to the edge regularity corresponding to the non-boundary edge line. Further, since the lines between the edges of the spiral pattern are usually parallel, and the edges of the skin-breaking defect are irregular, there is usually no parallel feature with other non-boundary edge lines. Therefore, based on the edge smoothness and the parallel approximation between the non-boundary edge lines, the skin-breaking defect edge probability of the non-boundary edge line is determined, and further, according to the skin-breaking defect edge probability, a more accurate skin-breaking defect edge line is screened out; thus, the cable damage degree determined by the length of all the skin-breaking defect edge lines corresponding to the cable connected domain is more accurate, so that the accuracy of cable skin-breaking defect detection according to the cable damage degree is higher. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A flow chart of a cable skin-breaking defect detection method based on machine vision provided by an embodiment of the present invention;
[0051] Figure 2 A cable surface grayscale image provided by an embodiment of the present invention;
[0052] Figure 3 A cable surface edge image provided by an embodiment of the present invention;
[0053] Figure 4 A flow chart of a method for obtaining the edge probability of a cable skin-breaking defect in a method for detecting a cable skin-breaking defect based on machine vision provided by an embodiment of the present invention;
[0054] Figure 5 A structural diagram of a cable skin-breaking defect detection system based on machine vision provided by an embodiment of the present invention;
[0055] Figure 6 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, characteristics and effects of a cable skin defect detection method based on machine vision proposed by the present invention, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment, and the specific features, structures or characteristics in one or more embodiments may be combined in any suitable form. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0057] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0058] The following is a detailed description of a cable skin damage defect detection method based on machine vision provided by the present invention in conjunction with the accompanying drawings.
[0059] This application embodiment provides a method for detecting cable skin damage based on machine vision. Figure 1 , which shows a flow chart of a cable skin damage defect detection method based on machine vision provided by an embodiment of the present invention, the method comprising:
[0060] Step S101: Acquire the cable surface edge image; perform image closing operation on the cable surface edge image and filter out all the cable connected domains according to the shapes of each connected domain.
[0061] Considering that the length of the edge line of the skin-breaking defect is needed to measure the degree of cable damage in the future, and the cable area usually corresponds to a closed connected domain, the cable surface edge image is obtained for analysis. In order to further eliminate the interference of other non-cable areas such as poles and pole steel frames in the cable surface edge image, according to the slender characteristics of the cable area, and in order to avoid the inability to divide the entire cable connected domain by directly dividing a separate spiral pattern or skin-breaking defect connected domain, the cable surface edge image is closed and all cable connected domains are screened out according to the shape of each connected domain.
[0062] In a specific implementation of the embodiment of the present invention, the cable surface image is captured by a high-precision industrial camera carried by a drone and then grayed to obtain a cable surface gray image; the cable surface gray image is subjected to Sobel bidirectional edge detection to obtain the cable surface edge image required by the embodiment of the present invention. It should be noted that the implementer may also adopt other edge detection methods according to the specific implementation environment, and graying and Sobel bidirectional edge detection are technical means well known to those skilled in the art, which will not be further described here. Please refer to Figure 2 , which shows a cable surface grayscale image provided by an embodiment of the present invention; please refer to Figure 3 , which shows a cable surface edge image provided by an embodiment of the present invention; wherein Figure 3 The edge image of the cable surface is Figure 2 The cable surface grayscale image is obtained by performing Sobel bidirectional edge detection.
[0063] Preferably, in some possible implementations of the embodiments of the present invention, the specific implementation process of the method for obtaining the cable connectivity domain in step S101 includes:
[0064] After performing image closing operation on the cable surface edge image, at least two closed connected domains are determined; the minimum circumscribed rectangle of each closed connected domain is obtained; the closed connected domain whose aspect ratio of the corresponding minimum circumscribed rectangle is greater than the preset aspect ratio threshold and the width of the minimum circumscribed rectangle is less than the preset width threshold is used as a reference connected domain; each reference connected domain is used as a mask to determine the cable connected domain corresponding to each reference connected domain in the cable surface edge image. In a specific implementation of the embodiment of the present invention, the preset aspect ratio threshold is set to 4.4, and the preset width threshold is set to 30, that is, the length of 30 pixels arranged in a straight line, which can be adjusted by the implementer according to the specific implementation environment.
[0065] Since the same cable area may have spiral pattern edges and broken skin defect edges, directly determining the closed connected domain in the cable surface edge image will cause the cable area to be divided into multiple separate local cable areas, making subsequent analysis impossible; so in order to obtain a complete cable area, the cable surface edge image is firstly subjected to image closing operation, thereby avoiding the influence of spiral pattern edges and broken skin defect edges on the division of the connected domain, so as to obtain a complete cable area. Further considering that the width of the cable area is small and relatively slender, the corresponding minimum circumscribed rectangle generally has a large aspect ratio and a small width; therefore, according to this feature, the closed connected domain whose aspect ratio of the corresponding minimum circumscribed rectangle is greater than the preset aspect ratio threshold and whose width is less than the preset width threshold is taken as the required reference connected domain, but since it has been processed by image closing operation, in order to obtain the required more accurate cable connected domain, the reference connected domain is used as a mask to determine the cable connected domain required by the embodiment of the present invention. It should be noted that image closing operation and mask are commonly used technical means by those skilled in the art, and are not further defined or elaborated here.
[0066] Step S102: in the cable surface edge image, determining at least two non-boundary edge lines corresponding to each cable connected domain; and determining the edge smoothness of each non-boundary edge line according to the edge rule corresponding to each non-boundary edge line.
[0067] After obtaining the cable connectivity domains that characterize each cable area, it is further necessary to detect the skin-breaking defects in each cable area. Considering that the edges of the spiral pattern and the edges of the skin-breaking defects in the cable area only appear inside the cable area, in order to avoid the influence of the boundary of the cable connectivity domain, at least two non-boundary edge lines corresponding to each cable connectivity domain are first determined, that is, other edge lines outside the outer boundary of the cable connectivity domain are taken as non-boundary edge lines, and each non-boundary edge line is further analyzed. In terms of edge regularity, the edge of the skin-breaking defect extends irregularly, while the edge of the spiral pattern is relatively regular, that is, relatively smoother. Therefore, the edge smoothness is determined according to the edge regularity corresponding to each non-boundary edge line, so that more accurate skin-breaking defect edge lines can be further screened out based on the edge smoothness.
[0068] It should be noted that since the edges of the spiral pattern usually appear regularly, when there is a spiral pattern in the cable area, it usually corresponds to more than two non-boundary edge lines. Therefore, when there is only one non-boundary edge line in the cable connection domain, the non-boundary edge line must be a skin-breaking defect edge line, and the corresponding cable damage degree is directly determined according to the length of the skin-breaking defect edge line. When there is no non-boundary edge line in the cable connection domain, it means that the cable surface is smooth, and it is considered that there is no skin-breaking defect in the cable connection domain.
[0069] Preferably, in some possible implementations of the embodiments of the present invention, the specific implementation process of the method for obtaining the edge smoothness in step S102 includes:
[0070] In each cable connectivity domain, the chain code value corresponding to each edge pixel on each non-boundary edge line is determined by the eight-neighborhood chain code; in the extension direction of each non-boundary edge line, a negative correlation mapping is performed based on the difference between the chain code value of each edge pixel and the chain code value of the previous edge pixel to determine the local smoothness of each edge pixel; the edge smoothness of each non-boundary edge line is determined based on the normalized value of the mean of the local smoothness of all edge pixels on each non-boundary edge line.
[0071] The more regular the non-boundary edge line is as a whole, that is, the straighter it is as a whole, it means that the non-boundary edge line is more likely not to be an irregularly extended broken skin defect edge, and the corresponding edge smoothness is smaller; and in the dimension of the chain code value, the smaller the difference between adjacent chain code values on the non-boundary edge line, the smoother or straighter the local area of the corresponding edge pixel point, and the greater the local smoothness. Therefore, combined with the local smoothness of all edge pixels on the non-boundary edge line, a more accurate and complete edge smoothness corresponding to each non-boundary edge line is obtained. It should be noted that the eight-neighborhood chain code is a technical means well known to those skilled in the art, and will not be further defined or elaborated here.
[0072] In a specific implementation of the embodiment of the present invention, the method for obtaining the edge smoothness is expressed by the formula: Among them, Z k,h N is the edge smoothness of the hth non-boundary edge line in the kth cable connected domain; k,h is the number of edge pixels on the hth non-boundary edge line in the kth cable connected domain; u k,h,i is the chain code value of the i-th edge pixel on the h-th non-boundary edge line in the k-th cable connected domain; u k,h,(i-1) is the chain code value of the i-1th edge pixel on the hth non-boundary edge line in the kth cable connected domain, that is, the chain code value of the previous edge pixel of the i-th edge pixel; exp(-|u k,h,i -u k,h,(i-1) |) is the local smoothness of the ith edge pixel on the hth non-boundary edge line in the kth cable connectivity domain; exp() is an exponential function with a natural constant as the base, || is the absolute value sign; Norm() is a linear normalization function, and implementers may also adopt other negative correlation mapping methods such as the inverse and other normalization methods according to the specific implementation environment, which will not be further elaborated here.
[0073] Step S103: Determine the probability of a broken skin defect edge for each non-boundary edge line in each cable connectivity domain based on the overall size and relative deviation of the edge smoothness between the non-boundary edge lines in each cable connectivity domain, and the parallel approximation between the non-boundary edge lines; and select the broken skin defect edge lines based on the broken skin defect edge probability.
[0074] Furthermore, since the lines between the edges of the spiral pattern are usually parallel, and the edges of the broken skin defects are irregular and therefore usually do not have this parallel feature with other non-boundary edge lines, the probability of the broken skin defect edge of the non-boundary edge line is determined based on the edge smoothness and the parallel approximation between the non-boundary edge lines, thereby screening out more accurate broken skin defect edge lines based on the probability of the broken skin defect edge.
[0075] Preferably, in some possible implementations of the embodiments of the present invention, the specific implementation process of the method for obtaining the edge probability of skin-breaking defects in step S103 includes: Figure 4 , which shows a flow chart of a method for obtaining the edge probability of a cable skin-breaking defect in a method for detecting a cable skin-breaking defect based on machine vision provided by an embodiment of the present invention, the method comprising:
[0076] In each cable connected domain, each non-boundary edge line is taken as a target edge line in turn, and other non-boundary edge lines outside the target edge line are taken as comparison edge lines. Before analysis, the target edge line to be analyzed is first distinguished from the comparison edge lines outside of it, so that the subsequent analysis process is clearer.
[0077] Step S401: determining the cable spiral parallel feature value between the target edge line and each of the comparison edge lines according to the difference in the number of edge pixels between the target edge line and the comparison edge line and the similarity in the distribution of chain code values.
[0078] The spiral pattern on the cable surface is usually of the same length and extends in the same direction, or the non-boundary edge lines corresponding to the spiral pattern are usually parallel and of equal length, so the number of edge pixels and the chain code value distribution between the non-boundary edge lines corresponding to the spiral pattern are similar; while the skin-breaking defect edge line on the cable surface is irregular, and has certain differences in length and extension direction from other non-boundary edge lines, so each skin-breaking defect edge line usually does not have a non-boundary edge line with similar number of edge pixels and chain code value distribution, or the non-boundary edge line corresponding to the skin-breaking defect usually does not have other non-boundary edge lines that are parallel and of equal length. Therefore, in the dimension of the difference in the number of edge pixels and the similarity in the chain code value distribution, the cable spiral parallel eigenvalue between the target edge line and each comparison edge line is calculated, so as to measure whether it belongs to the skin-breaking defect edge line according to the cable spiral parallel eigenvalue corresponding to each target edge line.
[0079] Preferably, in some possible implementations of the embodiments of the present invention, the specific implementation process of the cable helical parallel eigenvalue acquisition method in step S401 includes:
[0080] Calculate the chain code value difference between each edge pixel point on the target edge line and each edge pixel point on each comparison edge line; perform negative correlation normalization on the cumulative value of all chain code value differences between all edge pixels on the target edge line and all edge pixels on each comparison edge line to determine the degree of comparison parallelism between the target edge line and each comparison edge line. The spiral pattern on the cable surface usually extends in the same direction, so when the target edge line and the comparison edge line are both edge lines corresponding to the spiral pattern, the two edge lines are usually parallel, and the corresponding chain code values are usually highly consistent; so the greater the degree of comparison parallelism, the greater the probability that the target edge line belongs to the edge line of the spiral pattern, and the smaller the probability that it belongs to the edge line of the skin defect.
[0081] According to the product of the negative correlation mapping value of the difference in the number of edge pixels between the target edge line and each comparison edge line and the comparison parallelism, the cable spiral parallelism feature value between the target edge line and each comparison edge line is determined. The spiral pattern on the cable surface is usually of the same length. Therefore, when the target edge line and the comparison edge line are both edge lines corresponding to the spiral pattern, the lengths of the corresponding two edge lines are usually close or equal, and the difference in the number of corresponding edge pixels is usually small; therefore, the smaller the difference in the number of edge pixels, the greater the probability that the target edge line belongs to the edge line of the spiral pattern, and the smaller the probability that it belongs to the broken skin edge line. Therefore, the greater the cable spiral parallelism feature value obtained by the product of the negative correlation mapping value of the difference in the number of edge pixels and the comparison parallelism, the greater the probability that the target edge line and the comparison edge line belong to the non-boundary edge line of the spiral pattern, and the smaller the probability that it belongs to the broken skin defect edge line.
[0082] In a specific implementation of the embodiment of the present invention, a method for obtaining the cable helical parallel eigenvalue is expressed by the formula: in, is the cable spiral parallel eigenvalue between the hth non-boundary edge line and the corresponding rth comparison edge line in the kth cable connected domain; N k,h is the number of edge pixels on the hth non-boundary edge line in the kth cable connected domain; is the number of edge pixels on the rth comparison edge line corresponding to the hth non-boundary edge line in the kth cable connected domain; u k,h,i is the chain code value of the i-th edge pixel on the h-th non-boundary edge line in the k-th cable connected domain; is the chain code value of the dth edge pixel point on the rth comparison edge line corresponding to the hth non-boundary edge line in the kth cable connectivity domain; || is the absolute value symbol; exp() is an exponential function with a natural constant as the base; is the degree of comparison parallelism between the hth non-boundary edge line and the corresponding rth comparison edge line in the kth cable connectivity domain.
[0083] Step S402: determining a cable spiral smoothness characteristic value between the target edge line and each of the comparison edge lines according to the difference in edge smoothness and the overall size between the target edge line and each of the comparison edge lines.
[0084] The non-boundary edge lines corresponding to the spiral pattern on the cable surface have a larger and more similar edge smoothness, while the non-boundary edge lines corresponding to the skin-breaking defect usually have a smaller edge smoothness and usually have a larger difference in edge smoothness with other non-boundary edge lines. Therefore, in terms of the difference in edge smoothness and overall size, the cable spiral smoothness characteristic value is determined based on the difference in edge smoothness and overall size between the target edge line and each comparison edge line.
[0085] Preferably, in some possible implementations of the embodiments of the present invention, the specific implementation process of the cable spiral smoothing characteristic value acquisition method in step S402 includes:
[0086] The negative correlation mapping value of the difference between the edge smoothness of the target edge line and the edge smoothness of each contrasting edge line is used as the edge smoothness proximity between the target edge line and each contrasting edge line; the product between the edge smoothness of the target edge and the edge smoothness of each contrasting edge line is used as the corresponding overall smoothness; the product between the overall smoothness and the edge smoothness proximity is used to determine the cable spiral smoothness characteristic value between the target edge line and each contrasting edge line.
[0087] According to the characteristics that the edge smoothness between the non-boundary edge lines corresponding to the spiral pattern on the cable surface is relatively large and relatively similar, the edge smoothness proximity is obtained by the negative correlation mapping value of the difference between the edge smoothness degrees in the dimension of similar edge smoothness, and the overall smoothness is obtained by the product between the edge smoothness degrees in the dimension where the edge smoothness is relatively large; further, the edge smoothness proximity and the overall smoothness are combined in the form of a product, so that the larger the obtained cable spiral smoothness characteristic value is, the more similar and the larger the overall edge smoothness between the target edge line and the comparison edge line is, the greater the probability that the target edge line and the comparison edge line are both non-boundary edge lines of the spiral pattern, and the smaller the probability that they are edge lines with broken skin defects.
[0088] In a specific implementation of the embodiment of the present invention, the method for obtaining the cable spiral smoothing characteristic value is expressed by the formula: in, is the cable spiral smoothing eigenvalue between the hth non-boundary edge line and the corresponding rth comparison edge line in the kth cable connected domain; Z k,h is the edge smoothness of the hth non-boundary edge line in the kth cable connected domain; is the edge smoothness of the rth comparison edge line corresponding to the hth non-boundary edge line in the kth cable connected domain; is the edge smoothing degree between the hth non-boundary edge line and the corresponding rth comparison edge line in the kth cable connected domain; is the overall smoothness between the hth non-boundary edge line and the corresponding rth comparison edge line in the kth cable connectivity domain. The implementer may also use the sum or mean as the corresponding overall smoothness according to the specific implementation environment; exp() is an exponential function with a natural constant as the base. It should be noted that the implementer may also obtain the overall smoothness, such as the sum, by other methods other than the product according to the overall smoothness and the edge smoothness proximity.
[0089] Step S403: Determine the cable spiral consistency between the target edge line and each comparison edge line according to the cable spiral parallel eigenvalue and the cable spiral smooth eigenvalue.
[0090] Since the larger the cable spiral parallel eigenvalue and the larger the cable spiral smooth eigenvalue, the greater the probability that the corresponding target edge line and the comparison edge line are both edge lines of the spiral pattern, that is, the greater the cable spiral consistency, the cable spiral parallel eigenvalue and the cable spiral smooth eigenvalue are both positively correlated with the cable spiral consistency. In a specific implementation of an embodiment of the present invention, the cable spiral consistency between the target edge line and each comparison edge line is determined based on the product between the corresponding cable spiral parallel eigenvalue and the cable spiral smooth eigenvalue. It should be noted that the implementer can also obtain the cable spiral consistency based on the cable spiral parallel eigenvalue and the cable spiral smooth eigenvalue by other methods, such as using the normalized value of the sum of the cable spiral parallel eigenvalue and the cable spiral smooth eigenvalue as the cable spiral consistency, which will not be further elaborated here.
[0091] Step S404: performing negative correlation normalization processing on the mean values of all cable spiral consistency levels corresponding to the target edge line and all comparison edge lines to determine the edge probability of the skin-breaking defect of the target edge line.
[0092] Since the spiral pattern usually appears regularly and continuously, the greater the overall degree of spiral consistency between the target edge line and all the comparison edge lines, the greater the probability that the target edge line belongs to the non-boundary edge line of the spiral pattern, that is, the smaller the probability of the non-boundary edge line of the cable skin-breaking defect. Therefore, the mean of the spiral consistency of all cables corresponding to the target edge line is negatively correlated and normalized to obtain the edge probability of the target edge line with skin-breaking defect.
[0093] In a specific implementation of the embodiment of the present invention, the method for obtaining the edge probability of the skin-breaking defect is expressed in the formula as follows: Among them, P k,h is the edge probability of the skin-breaking defect of the hth non-boundary edge line in the kth cable connected domain; M k,h is the number of contrast edge lines corresponding to the hth non-boundary edge line in the kth cable connected domain, that is, the total number of non-boundary edge lines in the kth cable connected domain minus the real number one; is the cable spiral parallel eigenvalue between the hth non-boundary edge line and the corresponding mth comparison edge line in the kth cable connected domain; is the cable spiral smoothing eigenvalue between the hth non-boundary edge line and the corresponding mth comparison edge line in the kth cable connected domain; is the cable spiral consistency between the hth non-boundary edge line and the corresponding mth comparison edge line in the kth cable connected domain; Norm() is a linear normalization function.
[0094] Preferably, in some possible implementations of the embodiments of the present invention, the specific implementation process of the method for obtaining the edge line of the skin-breaking defect in step S103 includes:
[0095] The greater the probability of a skin-breaking defect edge, the more likely the corresponding non-boundary edge line is a skin-breaking defect edge line, so the non-boundary edge line with a skin-breaking defect edge probability greater than a preset skin-breaking defect threshold is used as a skin-breaking defect edge line. In a specific implementation of an embodiment of the present invention, the preset skin-breaking defect edge probability threshold is set to 0.9, and the implementer can adjust it according to the specific implementation environment.
[0096] Step S104: determining the cable damage degree of each cable connected area according to the lengths of all the broken skin defect edge lines corresponding to each cable connected area; and performing cable broken skin defect detection according to the cable damage degree.
[0097] Through steps S101 to S103, all the skin-breaking defect edge lines corresponding to each cable connected domain are obtained; the longer the corresponding skin-breaking defect edge line is, the greater the impact of the skin-breaking defect is, and the greater the degree of damage to the cable is. Therefore, the degree of damage to the cable is determined according to the length of all the skin-breaking defect edge lines corresponding to each cable connected domain.
[0098] In a specific implementation of the embodiment of the present invention, the normalized value of the total number of edge pixels of all skin-breaking defect edge lines corresponding to each cable connectivity domain is used as the cable damage degree of each cable connectivity domain. Since the length of the skin-breaking defect edge line directly affects the damage degree of the cable, the cable damage degree is calculated based on the edge pixels that characterize the length of the skin-breaking defect edge line.
[0099] In a specific implementation of the embodiment of the present invention, the method for obtaining the degree of cable damage is expressed in the formula: Among them, G k is the cable damage degree of the kth cable connected domain; B k is the number of skin-breaking defect edge lines in the k-th cable connected domain; L k,b is the number of edge pixels on the edge line of the bth skin-breaking defect in the kth cable connectivity domain.
[0100] Preferably, in some possible implementations of the embodiments of the present invention, the specific implementation process of performing cable skin damage defect detection according to the degree of cable damage in step S104 includes:
[0101] The cable connectivity area where the cable damage degree is greater than the preset damage threshold is regarded as the cable skin-breaking defect area. The greater the cable damage degree, the greater the influence of the skin-breaking defect edge line on the cable connectivity area, and the greater the possibility that it belongs to the cable skin-breaking defect area. In a specific implementation of the embodiment of the present invention, the preset damage threshold is set to 0.3, and the implementer can adjust it according to the specific implementation environment.
[0102] Thus, a more accurate cable skin-breaking defect area required by the embodiment of the present invention is obtained.
[0103] In summary, after obtaining the cable connectivity domain representing the cable area, a cable skin defect detection method based on machine vision first calculates the edge smoothness of each edge according to the different smoothness characteristics between the spiral pattern edge and the skin defect edge, and then measures the skin defect edge probability of each edge based on the parallel regular distribution characteristics of the spiral pattern edge compared to the skin defect edge and the edge smoothness, so as to screen out more accurate skin defect edges according to the skin defect edge probability, so that the cable damage degree measured by the length of the skin defect edge is more accurate, and the accuracy of cable skin defect detection according to the cable damage degree is higher.
[0104] This application also provides a cable skin defect detection system based on machine vision, please refer to Figure 5 , which shows a structural diagram of a cable skin defect detection system based on machine vision provided by an embodiment of the present invention, the system includes: a data acquisition preprocessing module 501, a first determination module 502, a second determination module 503 and a cable skin defect detection module 504.
[0105] The data acquisition preprocessing module 501 is used to acquire the cable surface edge image; after performing image closing operation on the cable surface edge image, all the cable connected domains are screened out according to the shapes of each connected domain;
[0106] The first determination module 502 is used to determine at least two non-boundary edge lines corresponding to each cable connected domain in the cable surface edge image; and determine the edge smoothness of each non-boundary edge line according to the edge rule corresponding to each non-boundary edge line;
[0107] The second determination module 503 is used to determine the edge probability of the skin-breaking defect of each non-boundary edge line in each cable connected domain according to the overall size and relative deviation of the edge smoothness between the non-boundary edge lines in each cable connected domain and the parallel approximation between the non-boundary edge lines;
[0108] The cable skin defect detection module 504 is used to determine the cable damage degree of each cable connected domain according to the skin defect edge probability of all non-boundary edge lines corresponding to each cable connected domain; and perform cable skin defect detection according to the cable damage degree.
[0109] It should be noted that the system provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the cable skin defect detection system based on machine vision and the cable skin defect detection method based on machine vision provided in the above embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0110] The present application also provides a computer device. Figure 6 , which shows a schematic diagram of the structure of a computer device provided by an embodiment of the present invention, the computer device includes a memory 601, a processor 602, and a computer program 603 stored in the memory 601 and running on the processor 602, wherein when the processor 602 executes the computer program 603, the computer device can execute any one of the cable skin defect detection methods based on machine vision introduced above.
[0111] An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer device, the computer device can execute any one of the cable skin damage detection methods based on machine vision described above.
[0112] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer device, the computer device can execute any of the aforementioned machine vision-based cable skin defect detection methods.
[0113] In the embodiments provided in the present application, it should be understood that the provided computer device, computer program product and computer-readable storage medium are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the methods provided above and will not be repeated here.
[0114] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0115] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A cable skin defect detection method based on machine vision, characterized in that: The method comprises: Acquire a cable surface edge image; perform image closing operation on the cable surface edge image and filter out all cable connected domains according to the shapes of each connected domain; In the cable surface edge image, at least two non-boundary edge lines corresponding to each cable connected domain are determined; and according to the edge rule corresponding to each non-boundary edge line, the edge smoothness of each non-boundary edge line is determined; Determine the skin-breaking defect edge probability of each non-boundary edge line in each cable connected domain according to the overall size and relative deviation of the edge smoothness between the non-boundary edge lines in each cable connected domain, and the parallel approximation between the non-boundary edge lines; and select the skin-breaking defect edge lines according to the skin-breaking defect edge probability; Determine the cable damage degree of each cable connection area according to the length of all the broken skin defect edge lines corresponding to each cable connection area; perform cable broken skin defect detection according to the cable damage degree; The method for obtaining the edge smoothness degree includes: In each cable connected domain, the chain code value corresponding to each edge pixel point on each non-boundary edge line is determined by the eight-neighborhood chain code; In the extension direction of each non-boundary edge line, negative correlation mapping is performed according to the difference between the chain code value of each edge pixel and the chain code value of the previous edge pixel to determine the local smoothness of each edge pixel; Determine the edge smoothness of each non-boundary edge line according to the normalized value of the mean value of the local smoothness of all edge pixels on each non-boundary edge line; The method for obtaining the edge probability of the skin breaking defect includes: In each cable connected domain, each non-boundary edge line is sequentially used as a target edge line, and other non-boundary edge lines outside the target edge line are used as comparison edge lines; According to the difference in the number of edge pixels between the target edge line and the comparison edge line and the similarity in the distribution of chain code values, the cable spiral parallel characteristic value between the target edge line and each comparison edge line is determined; Determine the cable spiral smoothness characteristic value between the target edge line and each comparison edge line according to the difference in edge smoothness and the overall size between the target edge line and each comparison edge line; Determine the cable spiral consistency between the target edge line and each comparison edge line according to the cable spiral parallel characteristic value and the cable spiral smooth characteristic value; the cable spiral parallel characteristic value and the cable spiral smooth characteristic value are both positively correlated with the cable spiral consistency; The mean values of all cable spiral consistency between the target edge line and all comparison edge lines are negatively correlated and normalized to determine the edge probability of the target edge line's skin-breaking defect.
2. The cable skin defect detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the cable connectivity domain comprises: Determine at least two closed connected domains after performing image closing operation on the cable surface edge image; obtain the minimum circumscribed rectangle of each closed connected domain; A closed connected domain whose length-to-width ratio of the corresponding minimum circumscribed rectangle is greater than a preset length-to-width ratio threshold and whose width is less than a preset width threshold is used as a reference connected domain; Using each reference connected domain as a mask, a cable connected domain corresponding to each reference connected domain in the cable surface edge image is determined.
3. The cable skin defect detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the cable helical parallel eigenvalue comprises: Calculate the chain code value difference between each edge pixel point on the target edge line and each edge pixel point on each comparison edge line; perform negative correlation normalization on the accumulated value of all chain code value differences between all edge pixels on the target edge line and all edge pixels on each comparison edge line to determine the degree of comparison parallelism between the target edge line and each comparison edge line; The cable spiral parallel feature value between the target edge line and each comparison edge line is determined according to the product of the negative correlation mapping value of the difference in the number of edge pixels between the target edge line and each comparison edge line and the comparison parallel degree.
4. The cable skin defect detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the cable spiral smoothing characteristic value comprises: The negative correlation mapping value of the difference between the edge smoothness of the target edge line and the edge smoothness of each contrast edge line is used as the edge smoothness proximity between the target edge line and each contrast edge line; The product of the edge smoothness of the target edge and the edge smoothness of each comparison edge line is taken as the corresponding overall smoothness; The product of the overall smoothness degree and the edge smoothness closeness degree is used to determine the cable spiral smoothness characteristic value between the target edge line and each comparison edge line.
5. The cable skin defect detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the cable spiral consistency degree comprises: The degree of cable spiral consistency between the target edge line and each comparison edge line is determined according to the product of the cable spiral parallel characteristic value and the cable spiral smooth characteristic value.
6. The cable skin defect detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the edge line of the skin-breaking defect comprises: The non-boundary edge line whose edge probability of skin breaking defect is greater than the preset skin breaking defect threshold is used as the skin breaking defect edge line.
7. The cable skin defect detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the degree of cable damage includes: The normalized value of the total number of edge pixels of all skin-breaking defect edge lines corresponding to each cable connectivity domain is taken as the cable damage degree of each cable connectivity domain.
8. The cable skin defect detection method based on machine vision according to claim 1 is characterized in that: The method for detecting cable skin damage defects according to the degree of cable damage includes: The cable connectivity area where the cable damage degree is greater than the preset damage threshold is regarded as the cable skin damage defect area.
Citation Information
Patent Citations
Defect detection method and device for X-ray image, equipment and medium
CN113781415A
Airport surface safety logic
US5519618A