Cable detection method based on picture processing

By using a surface array camera to rotate backlight on the surface of the high-voltage cable, and combining picture processing technology to detect dust and dirt, the detection accuracy problem caused by uneven light and complex cable arc shape is solved, and efficient and accurate dust and dirt detection is achieved.

CN119810052AInactive Publication Date: 2025-04-11江西启丰新材料有限公司

Patent Information

Application Number
CN202411863708.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When detecting dust and dirt on the surface of high-voltage cables, the prior art is susceptible to uneven light, too bright or too dark, which leads to a reduction in detection accuracy, especially the complex arc shape of the cable surface, which increases the occurrence of pseudo defects.

Method used

Using a cable detection method based on picture processing, the cable image is captured by backlighting the surface array camera under 180 degrees rotation, and grayscale conversion, rectangle interception, Gaussian blur, histogram equalization, threshold segmentation, edge detection and contour detection are performed. Finally, the contour area calculation is used to determine whether there is dust and dirt in the cable.

Benefits of technology

It effectively avoids external light interference, improves detection accuracy and accuracy, reduces the impact of the arc-shaped surface of the cable on detection, and improves working efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810052A_ABST
    Figure CN119810052A_ABST
Patent Text Reader

Abstract

The invention discloses a cable detection method based on picture processing, which is used for detecting dust and dirt on the surface of a cable, and comprises the following steps of: acquiring a sequence image of a fixed cable in a box body without external light interference for each section of cable by an area-array camera which rotates by 180 degrees by taking the cable as a central axis, converting a gray image, intercepting a rectangular image, and determining the dust and dirt on the surface of the cable. Gaussian fuzzy filtering, contrast enhancement, threshold segmentation, edge detection, contour detection, calculation of the contour surrounding area of the cable image and judgment of whether dust and dirt exist in the section of the cable are performed. According to the method, whether dust and dirt exist or not is judged through the cable image contour surrounding area, the radian size of the cable arc-shaped surface and details of the arc-shaped surface do not affect judgment, and meanwhile the dust and dirt details of the cable edge can be better highlighted through backlight shooting. The influence of the external environment and the arc-shaped surface of the cable on dust and dirt detection can be greatly reduced, and the detection precision, accuracy and working efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of cable detection, in particular to the field of dust and dirt detection on the surface of high-voltage cables. Background Art

[0002] Warehouses often store some spare high-voltage cables. Over time, dust and dirt often adhere to the surface of the cables. Dust and dirt on the cable surface are closely related to the electrical performance and safe operation of the cables. Dust and dirt will absorb moisture in the air, which may cause flashover or insufficient creepage distance on the surface of the high-voltage cable. Dust and dirt will also cause the local electric field strength on the surface of the high-voltage cable to increase, thereby causing partial discharge. In some specific environments such as chemical plants, dust and dirt may contain corrosive components, chemically corrode the cable sheath, and accelerate the aging process of the cable. Therefore, it is necessary to perform appearance dust and dirt detection on the high-voltage cables stored in the warehouse. Appearance detection is often manual detection with low efficiency. After searching, in the existing similar technologies, the cable surface burrs are detected by grayscale processing of the cable surface image and watershed segmentation method. If this technology is used to detect dust and dirt on the cable surface, it is easy to be affected by uneven lighting, too bright or too dark, resulting in shadows, reflections, etc., which affects the detection accuracy. At the same time, the cable surface is curved, which further exacerbates the appearance of false defects. Summary of the invention

[0003] In order to solve the problems raised in the above background technology, a cable detection method based on image processing is proposed.

[0004] In view of this, the present invention provides the following technical solution: a cable detection method based on image processing, the method comprising the following steps:

[0005] Step A, using an area array camera that rotates 180 degrees with the cable as the central axis to obtain and store a sequence of images of the fixed cable in a box with backlight without external light interference, and the area array camera takes pictures while rotating.

[0006] Step B: convert the image into a grayscale image by weighted averaging method, and obtain a grayscale image pixel sequence.

[0007] Step C, intercepting a rectangular image, wherein the intercepted image has two longitudinal sides perpendicular to the cable and two lateral sides completely including two edges of the cable image. The two edges of the cable image are positions corresponding to the actual two edges of the cable in the grayscale image.

[0008] Step D: The intercepted image is subjected to a Gaussian blur with a Gaussian kernel of 5×5 to filter out noise. The standard deviation of the Gaussian blur is automatically calculated according to the Gaussian kernel size.

[0009] Step E: Use histogram equalization to enhance the image contrast. By changing the gray value distribution of the image, the image contrast is enhanced.

[0010] Step F, separating the target object and the background in the image by threshold segmentation, wherein the threshold is automatically selected by the OTSU binarization method to make the cable image more prominent.

[0011] Step G, using the Canny algorithm to perform edge detection and extract the clear edge of the cable from the image.

[0012] Step H, perform contour detection, and fit the pixel points after the edge detection into a closed contour curve. Since the cable edge image extracted by canny edge detection is not always a coherent closed boundary, it may be broken or incompletely closed. In order to facilitate the subsequent area calculation, contour detection is performed.

[0013] Step I, calculate the area enclosed by the outline, if the cable image outline area of ​​at least one picture among all the pictures taken of the cable segment is larger than the set area threshold, it is marked as a cable segment with dust and dirt.

[0014] Step J, determine whether the entire cable has been inspected. If not, convey the next section of cable with a length equal to the horizontal width of the rectangular image described in step C to the box for inspection, and return to step A. If the inspection is completed, output the inspection result of the entire section of cable that has been marked for dust and dirt.

[0015] Preferably, in step A, the area array camera takes a picture every time it rotates 0.05 degrees around the cable.

[0016] Preferably, the maximum grayscale level of the grayscale image in step B is 256.

[0017] Preferably, in step G, when performing canny edge detection, the low threshold is 52 and the high threshold is 153.

[0018] Preferably, in step I, the area enclosed by the outline is calculated by decomposing the figure enclosed by the outline into multiple triangles and adding up the areas of all the triangles.

[0019] The beneficial effect of the technical solution is: by using a planar array camera that rotates 180 degrees with the cable as the central axis to obtain a sequence of images of the fixed cable in a box without external light interference, the camera can effectively avoid the problem of uneven lighting, too bright or too dark caused by external light interference when taking pictures of the cable. At the same time, after converting the grayscale image, intercepting the rectangular image, Gaussian blur filtering, enhancing contrast, threshold segmentation, edge detection, contour detection, and finally calculating the area surrounded by the cable image contour to determine whether the cable segment has dust and dirt. The technical solution is to determine whether dust and dirt exist by the area surrounded by the cable image contour. The size of the arc of the cable arc surface and the details of the arc surface have no effect on the judgment. At the same time, backlight shooting can better highlight the details of dust and dirt on the edge of the cable. The cable detection method of the present invention greatly reduces the influence of the external environment and the arc surface of the cable itself on the detection of dust and dirt, and improves the detection precision, accuracy and work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flow chart of a cable detection method based on image processing according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0022] See also Figure 1 , the figure shows a flow chart of a cable detection method based on image processing provided by an embodiment of the present invention, the method comprising the following steps:

[0023] Step S01, using an area array camera that rotates 180 degrees with the cable as the central axis to obtain and store a sequence of images of the fixed cable in a box with backlight without external light interference, and the area array camera takes pictures while rotating.

[0024] The array camera faces the cable. The array camera, cable and backlight source should be on the same virtual axis during the shooting process. The relative distance between the three is fixed. The cable is in the middle and fixed during the shooting. The array camera and backlight source rotate 180 degrees around the cable at the same time. The array camera takes a picture every 0.05 degree rotation. After rotating 180 degrees, all the photos taken are stored. After the array camera rotates 180 degrees, it can be restored to the original 0 degree position or not, which will not affect the actual measurement results.

[0025] Step S02: convert the image into a grayscale image by weighted averaging method, and obtain a grayscale image pixel sequence.

[0026] The captured image is a color picture with red, green and blue as the three primary colors. To convert it into a grayscale image, the image needs to be further processed. The process uses the weighted average method:

[0027] I(x,y)=0.299R+0.587G+0.114B

[0028] Among them, I(x,y) is the grayscale value of the pixel with coordinates (x,y), R, G, and B represent the values ​​of the red, green, and blue channels respectively, and the coefficients in front of R, G, and B are weight values.

[0029] Step S03, capturing a rectangular image, wherein the captured image has two longitudinal sides perpendicular to the cable and two lateral sides completely including two edge images of the cable.

[0030] Specifically, the upper left corner coordinates (x 左上 ,y 左上 ), select the lower right corner coordinate as (x 右下 ,y 右下 ), it can be seen that the horizontal axis range (x 左上 , x 右下 ) actually corresponds to the cable length, that is, the horizontal interception range, while the vertical interception range is (y 左上 ,y 右下 ), the vertical range should cover the two cable image edges that actually correspond to the two cable edges, otherwise, the cable edge details will be lost. It should also be noted that the upper left corner coordinates and the lower right corner coordinates are fixed parameters set initially.

[0031] Step S04, using Gaussian blur with a Gaussian kernel of 5×5 to filter noise on the captured image, and the standard deviation of the Gaussian blur is automatically calculated according to the size of the Gaussian kernel.

[0032] In this step, we first generate the following Gaussian kernel:

[0033]

[0034] Among them, k is the radius of the Gaussian kernel. Since the size of the 5×5 Gaussian kernel is 5, k = (5-1) ÷ 2 = 2, i and j are the position indexes in the kernel, ranging from 0 to 2k, σ is the standard deviation, e is the base of the natural logarithm, and G(i, j) is the Gaussian kernel, that is, the filter. In order to ensure that the brightness of the image after convolution remains unchanged, the Gaussian kernel needs to be normalized so that the sum of all its elements is 1. The normalized Gaussian kernel is expressed as

[0035]

[0036] Among them, G'(i,j) is the normalized Gaussian kernel, G(i,j) is the Gaussian kernel before normalization, and k is the Gaussian kernel radius.

[0037] After normalization, the following convolution operation is performed:

[0038]

[0039] I(x+i,y+j) is the grayscale value of the input image at position (x,y). I'(x,y) is the grayscale value of the output image at position (x,y) after Gaussian blur. G'(i+k,j+k) is the element in the normalized Gaussian kernel.

[0040] S05, using histogram equalization to enhance the image contrast, by changing the gray value distribution of the image, so that the image contrast is enhanced.

[0041] In this step, the histogram is first calculated by counting the frequency of each gray value in the image using the following formula:

[0042]

[0043] where n I is the number of pixels whose gray value is I, N is the total number of image pixels, I is the gray value statistical object, p(I) is the probability that the gray value is I, and then the cumulative distribution function is calculated by the following formula:

[0044]

[0045] Where F(I) is the proportion of pixels with grayscale values ​​less than or equal to I in the entire image, I is the grayscale value statistical object, k is the grayscale value less than or equal to I, and p is the frequency of occurrence of the corresponding grayscale value. Then contrast mapping (contrast enhancement) is performed using the following formula:

[0046] I 新 =round[(L-1)F(I)]

[0047] Wherein round[] is the rounding function, L is the maximum grayscale value, in this embodiment, L=256, I 新 It is the new gray value after mapping the original gray value I.

[0048] By enhancing the contrast, the contrast between the cable image and the background image is enhanced.

[0049] S06, separating the target object and the background in the image by threshold segmentation, wherein the threshold is automatically selected as the optimal threshold by the OTSU binarization method.

[0050] After OTSU binarization, the optimal threshold T is determined and the following threshold segmentation is performed:

[0051]

[0052] Where T is the optimal threshold, I(x,y) is the new gray value after contrast enhancement, and S(x,y) is the gray value after segmentation. It can be seen that if it is less than T, S(x,y) is the gray value of the background pixel, and if it is greater than or equal to T, S(x,y) is the gray value of the cable pixel.

[0053] After threshold segmentation, the cable image and the background image are separated, making the cable image more prominent.

[0054] S07, using the Canny algorithm for edge detection, extracting the clear edge of the cable from the image.

[0055] In this step, the Sobel operator is used to calculate the gradient of the image, and the local maximum value is retained as the edge through non-maximum suppression. High and low thresholds are used to connect the disconnected edges. The low threshold is 52 and the high threshold is 153. The clear edge of the cable that retains the dust and dirt information is extracted from the image.

[0056] S08, performing contour detection, and fitting the pixel points after the edge detection into a closed contour curve.

[0057] Since the cable edge image extracted by canny edge detection is not always a coherent closed boundary, it may be broken or incompletely closed. In order to facilitate the subsequent area calculation, contour detection is performed. This process considers each edge point (x, y) and checks the edge points in its neighborhood. If there are other edge points in the neighborhood of an edge point (x, y), the two points belong to the same contour. The edge points are tracked recursively until a closed contour is formed.

[0058] S09, calculating the area enclosed by the outline, and if it is larger than a set area threshold, it is marked as a cable segment with dust and dirt.

[0059] This process starts with the first vertex (x0, y0) in the upper left corner of the cable outline in the image, and connects to other vertices in a clockwise manner along the cable image outline. The connection order is from left to the upper right corner, from the upper right corner to the lower right corner, from the lower right corner to the lower left corner, and finally from the lower left corner back to the upper left corner. The last vertex should be (x n-1 ,y n-1 ), where n is the total number of vertices of the cable image outline. When calculating the area enclosed by the cable image outline, the figure enclosed by the outline can be decomposed into multiple triangles. Starting from the first vertex (x0, y0), it can be decomposed into (n-2) triangles, where n is the number of vertices. The areas of all triangles are added together to obtain the area enclosed by the cable image outline as follows:

[0060]

[0061] Where n is the number of vertices in the contour, (x i ,y i ) is the coordinate of the ith vertex, Area is the area enclosed by the cable image contour, (x i+1 ,y i+1 ) are the coordinates of i+1 vertices. It should be pointed out that since the cable image has been cut within the coordinate range and Gaussian filtered, the contour images on both sides of the cable should be quite smooth, while the edges on both sides of the horizontal side retain the detailed information of dust and dirt. After calculating the contour enclosed area, an area threshold is set according to the screenshot and the cable diameter. All pictures taken of the cable segment are judged one by one. If there is at least one picture whose extracted cable contour area Area is greater than the area threshold, then the detected cable segment should have dust and dirt; if the cable contour area Area in any picture is less than the area threshold, there may be some interference or noise, and the judgment of this picture can be ignored; if one of the Area is equal to the area, it is considered that the picture has not detected dust and dirt, and other pictures taken of the cable segment should continue to be detected.

[0062] S10, determine whether the entire cable has been inspected. If not, convey the next section of cable with a length equal to the horizontal width of the rectangular image in step S03 to the box for inspection, and return to step A. If the inspection is completed, output the inspection result of the entire section of cable that has been marked for dust and dirt.

[0063] It should be noted that in this step, the electric mechanism is used to transport the cable to the box, and the cable is transported intermittently in sections. The length of each section of the cable is the horizontal width of the rectangular image in step S03, that is, the horizontal coordinate range contained in the pixel array of the rectangular image. Otherwise, missed detection may occur. If it is determined that the entire section of the cable has been detected, the dust and dirt marking result of the entire section of the cable is output to facilitate subsequent processing by personnel.

Claims

1. A cable detection method based on image processing, characterized in that: The following steps are involved: Step A, using a planar array camera that rotates 180 degrees with the cable as the central axis to obtain a sequence of images of the fixed cable in the backlight of a box without external light interference and store them, while rotating and changing the shooting; Step B, converting the image into a grayscale image by weighted averaging method, and obtaining a grayscale image pixel sequence; Step C, intercepting a rectangular image of the grayscale image, the vertical sides of the intercepted image are perpendicular to the cable, and the horizontal sides completely contain the two edges of the cable image; Step D, using a Gaussian blur with a Gaussian kernel of 5×5 to filter noise on the intercepted image, and the standard deviation of the Gaussian blur is automatically calculated according to the size of the Gaussian kernel; Step E, using histogram equalization to enhance image contrast; Step F, using threshold segmentation The target object and the background in the image are separated, and the threshold is automatically selected as the optimal threshold by the OTSU binarization method; step G, edge detection is performed using the canny algorithm; step H, contour detection is performed, and the pixel points after the edge detection are fitted into a closed contour curve; step I, the area surrounded by the contour is calculated, and if the cable image contour area of ​​at least one picture in all the pictures taken of the cable section is greater than the set area threshold, it is marked as a cable section with dust and dirt; step J, it is determined whether the entire cable has been detected. If not, the next section of cable with a length equal to the horizontal width of the rectangular image in step C is conveyed to the box and detected, and the process returns to step A. If the detection is completed, the detection result is output.

2. The cable detection method based on image processing according to claim 1, characterized in that: The area array camera described in step A takes a picture every time it rotates 0.05 degrees around the cable.

3. The cable detection method based on image processing according to claim 1, characterized in that: The maximum grayscale level of the grayscale image in step B is 256.

4. The cable detection method based on image processing according to claim 1, characterized in that: When the canny algorithm is used for edge detection in step G, the low threshold is 52 and the high threshold is 153.

5. The cable detection method based on image processing according to claim 1, characterized in that: The calculation of the area enclosed by the outline in step I is to decompose the figure enclosed by the outline into multiple triangles and add up the areas of all the triangles.

Citation Information

Patent Citations

  • Solar cell panel recognition method based on improved Canny operator and contour area threshold value

    CN107895376A

  • Air conditioner external unit body cleaning platform

    CN110006104A

  • Photovoltaic panel cleaning robot environment adjusting method and system based on self-adaptive state control

    CN117784864A

  • Intelligent inspection method and inspection robot based on photovoltaic power station

    CN118713308A

Cited By

  • Cableway cable aging degree detection system based on image recognition

    CN120147913A