A cable prolapse detection method based on Hough line detection and curve fitting

Through the Hough linear detection and curve fitting methods, the misjudgment problem of cable status detection by the inspection robot under poor lighting conditions is solved, accurate automatic judgment of cable status is achieved, and the level of automation of detection is improved.

CN114663402BActive Publication Date: 2025-07-18SHENZHEN ENERGY STORAGE POWER GENERATION CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210298709.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2025-07-18
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

In complex indoor environments, inspection robots find it difficult to accurately and quickly detect the cable status under poor lighting conditions, which is prone to misjudgment.

Method used

The Hough linear detection and curve fitting method is used to collect cable images by inspecting robots for grayscale, binarization and mean filtering, edge detection is used by Canny operator, edge point set calculation is performed by combining Hough linear detection and Roberts operator, and finally the cable state is judged through polynomial fitting.

Benefits of technology

It improves the accuracy and automation level of cable status detection, reduces the waste of human resources, and achieves accurate detection under poor lighting conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114663402B_ABST
    Figure CN114663402B_ABST
Patent Text Reader

Abstract

The present invention discloses a cable prolapse detection method based on Hough line detection and curve fitting, which includes the following steps: First, a cable image is collected by an inspection robot, and then preprocessing such as grayscale conversion, binarization, and mean filtering is performed on the image; the inspection image to be detected is input, and a Gaussian smoothing filter is used to smooth the image to remove noise; the magnitude and direction of the pixel gradient are calculated; the Canny operator is introduced to perform edge detection on the above gradient image to obtain the edges of the image; Hough line detection is used to judge the state of the cable. If all cables are straight lines, it is judged that there is no prolapse; the Roberts operator is used to perform edge detection on the preprocessed inspection image to obtain a set of edge points. This cable prolapse detection method based on Hough line detection and curve fitting uses image recognition technology to automatically judge the state of the cable. If prolapse is found, feedback processing is made in time, improving the automation and digital level of the image and reducing the waste of human resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of optimizing the recognition algorithm of inspection robots in complex indoor environments, and particularly relates to a cable prolapse detection method based on Hough line detection and curve fitting. Background Art

[0002] An inspection robot in a complex indoor environment is equipped with a high-definition camera to capture images of devices such as cables and instruments, and perform intelligent processing on the collected images. Among them, the cable state is a basic element for monitoring complex indoor environments, and accurately and quickly detecting cables is one of the target tasks of inspection robots.

[0003] Currently, a variety of cable detection technologies have been applied to inspection robots, and the algorithms are constantly being updated. However, there are still certain difficulties in actual applications, and it is easy to make misjudgments in poor lighting conditions. Summary of the Invention

[0004] The purpose of the present invention is to provide a cable prolapse detection method based on Hough line detection and curve fitting to solve the problems raised in the above background art.

[0005] To achieve the above purpose, the present invention provides the following technical solution: A cable prolapse detection method based on Hough line detection and curve fitting, including the following steps:

[0006] S1. First, collect pictures of cables through the inspection robot, and then perform preprocessing such as grayscale conversion, binarization, and mean filtering on the images;

[0007] S2. Input the inspection image to be detected, and use a Gaussian smoothing filter to smooth the image to remove noise;

[0008] S3. Calculate the magnitude and direction of the pixel gradient;

[0009] S4. Introduce the Canny operator to perform edge detection on the above gradient image to obtain the edges of the image;

[0010] S5. Use Hough line detection to judge the state of the cable. If all cables appear as straight lines, it is judged that there is no prolapse;

[0011] S6. Perform edge detection on the preprocessed inspection image to be inspected using the Roberts operator to obtain a set of edge points;

[0012] S7. Substitute the edge points into the opencv solver to calculate the coefficients of the polynomial and obtain the fitting cable curve expression If it indicates that the cable is approximately a straight line and there is no prolapse of the cable; otherwise, the cable is a curve, indicating that the cable has prolapsed.

[0013] Preferably, in S2, using a Gaussian smoothing filter to smooth the image to remove noise includes the following steps:

[0014] S201, the principle of Gaussian filtering is as follows. Step 1 is: The image after Gaussian smoothing. Step 2 is:

[0015] In the formula, is the parameter for controlling the filtering degree, is the original image, is the smoothed image after denoising;

[0016] S202: Calculate the magnitude and direction of the pixel gradient, and operate according to the steps of the Sobel filter. The convolution for detecting the information in the x and y directions of the image is as follows:

[0017] Step 3,

[0018] Step 4,

[0019] Use the following formula to calculate the pixel magnitude M and direction Get the edge set:

[0020] Step 5,

[0021] Step 6,

[0022] S203, perform non-maximum suppression on the gradient magnitude;

[0023] S204, use the double-threshold algorithm to detect and connect edges.

[0024] Preferably, in S3, when calculating the magnitude and direction of the pixel gradient, first use the formula in step 3 of S2 and the formula in step 4 of S2 to detect the gradients in the x and y directions of the image respectively, traverse all the pixel points on the image to be detected, calculate the gradients of any pixel point in the x and y directions, and then use the formula in step 5 of S2 and the formula in step 6 of S2 to calculate the combined gradient and gradient direction of the pixel point (x, y) respectively.

[0025] Preferably, in S6, the specific steps for edge detection using the Roberts operator are: First, determine any point (x, y) on the inspection image as follows:

[0026] Step 7,

[0027] In, x and y are the coordinates of the pixel point, , , ,

[0028] are respectively the 4-neighborhoods of the image, is the Roberts operator of the pixel (x, y).

[0029] Preferably, in S7, the calculation steps of the polynomial are as follows:

[0030] S701, first set the polynomial as where are the coefficients of the polynomial and also the curve parameters to be estimated. x is the abscissa of the pixel, y is the ordinate of the pixel, k is the order of the specified polynomial, and the order of the polynomial is 3;

[0031] S702, calculate the deviation of the edge points in the image from the curve, and the sum of squared deviations is:

[0032]

[0033] where n is the number of detected boundary points, is the abscissa of the detected pixel, is the ordinate of the detected pixel, is the sum of squared fitting errors;

[0034] S703, solve this curve fitting problem by the least squares method, and use cv::solve() in the opencv library to obtain the fitted cable curve expression

[0035] The technical effects and advantages of the present invention: This cable prolapse detection method based on Hough line detection and curve fitting determines whether the cable prolapses by using the settings of Hough line detection and curve fitting technologies. In the Hough line detection, the Canny algorithm is used to extract the edge image first, and the straight line support area is searched on the edge image, which improves the algorithm efficiency. At the same time, it can effectively protect the image detail information, making the effect of Hough line detection more obvious. Then, combined with the curve fitting technology for double detection, it realizes the automatic judgment of the cable state using image recognition technology. If prolapse is found, feedback processing is made in time, improving the automation and digital level of the image and reducing the waste of human resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is the overall detection flow chart of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0037] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0038] The present invention provides a Figure 1 cable prolapse detection method based on Hough line detection and curve fitting as shown below, including the following steps:

[0039] S1. First, collect pictures of the cable through the inspection robot, and then perform preprocessing such as grayscale conversion, binarization, and mean filtering on the image. After processing, the RGB values of the image are the same, which is convenient for subsequent reprocessing;

[0040] S2. Input the inspection image to be detected, and use a Gaussian smoothing filter to smooth the image to remove noise;

[0041] S3. Calculate the magnitude and direction of the pixel gradient;

[0042] S4. Introduce the Canny operator to perform edge detection on the above gradient image to obtain the edges of the image. The Canny operator is a multi-stage optimized operator with filtering, enhancement, and detection. Before performing the Hough line detection process, first use the Canny operator to perform edge detection on the image;

[0043] S5. Use Hough line detection to judge the state of the cable. If all cables show a straight line, it is judged that there is no prolapse;

[0044] S6. Perform edge detection on the preprocessed inspection image to be inspected using the Roberts operator to obtain a set of edge points. The Roberts operator is an operator that uses a local difference operator to find edges. The edge is detected by approximating the gradient magnitude with the difference between two adjacent pixels in the diagonal direction;

[0045] S7. Substitute the edge points into the opencv solver to calculate the coefficients of the polynomial and obtain the fitted cable curve expression If it indicates that the cable is approximately a straight line and the cable has no prolapse; otherwise, the cable is a curve, indicating that the cable has prolapsed.

[0046] In S2, using a Gaussian smoothing filter to smooth the image to remove noise includes the following steps:

[0047] S201. The principle of Gaussian filtering is as follows. Step 1 is:

[0048] The second step of the Gaussian-smoothed image is as follows: ;

[0049] In the formula, is the parameter for controlling the filtering degree, is the original image, is the smoothed image after denoising;

[0050] S202: Calculate the magnitude and direction of the pixel gradient, and operate according to the steps of the Sobel filter. The Sobel operator is a discrete differential operator that combines Gaussian smoothing and differential derivation to calculate the approximate gradient of the image grayscale function. Its common application and physical meaning are edge detection. The convolutions for detecting the information in the x and y directions of the image are as follows:

[0051] Step 3, ;

[0052] Step 4, ;

[0053] Use the following formula to calculate the pixel magnitude M and direction Obtain the edge set:

[0054] Step 5, ;

[0055] Step 6,

[0056] S203, perform non-maximum suppression on the gradient magnitude;

[0057] S204, detect and connect edges using the double-threshold algorithm. The Canny algorithm has certain requirements for the selection of the two thresholds. For the lower threshold, it should include all edge pixels that are considered to belong to the obvious image contours, and the role of the higher threshold should be to define the edges that belong to all important contours, and it should exclude all outliers.

[0058] In S3, when calculating the magnitude and direction of the pixel gradient, first use the formula in Step 3 of S2 and the formula in Step 4 of S2 to detect the gradients in the x and y directions of the image respectively. Traverse all pixel points on the image to be detected, calculate the gradients of any pixel point in the x and y directions, and then use the formula in Step 5 of S2 and the formula in Step 6 of S2 to calculate the combined gradient and gradient direction of the pixel point (x, y) respectively.

[0059] In S6, the Roberts operator is an operator that uses a local difference operator to find edges. It approximates the gradient magnitude by the difference between two adjacent pixels in the diagonal direction to detect edges. It has a better effect in detecting vertical edges than diagonal edges and has a high positioning accuracy. The specific steps for edge detection using the Roberts operator are as follows: First, determine any point (x, y) on the inspection image and there is:

[0060] Step 7, ; where x and y are the coordinates of the pixel points, are the 4-neighborhoods of the image respectively, the Roberts operator of the pixel (x, y).

[0061] Before calculating the operator, the square root of the pixel value needs to be calculated.

[0062] The Roberts operator is a 2×2 template: and ;

[0063] Therefore, to calculate the edges of an image using the Roberts operator, each pixel of the image needs to be convolved with the above two convolution kernels.

[0064] In S7, the calculation steps of the polynomial are as follows:

[0065] S701, first set the polynomial as where are the coefficients of the polynomial and also the curve parameters to be estimated. x is the abscissa of the pixel, y is the ordinate of the pixel, k is the order of the specified polynomial, and the order of the polynomial is 3;

[0066] S702, calculate the deviation from the edge points in the image to the curve, and the sum of the squared deviations is:

[0067] ;

[0068] where n is the number of detected boundary points, is the abscissa of the detected pixel, is the ordinate of the detected pixel, is the sum of the squared fitting errors;

[0069] S703, solve this curve fitting problem by the least squares method. In practical applications, cv::solve() in the opencv library can be used to solve it, and the coefficients of the polynomial of the curve fitting can be obtained, calculate the coefficients of the polynomial, and obtain the expression of the fitted cable curve If it indicates that the cable is approximately a straight line and the cable is not prolapsed; otherwise the cable is a curve, indicating that the cable is prolapsed.

[0070] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A cable prolapse detection method based on Hough line detection and curve fitting, characterized in that: It includes the following steps: S1. First, collect pictures of cables through a patrol robot, and then perform preprocessing on the images including grayscale conversion, binarization, and mean filtering; S2. Input the patrol image to be detected, and use a Gaussian smoothing filter to smooth the image to remove noise; S3. Calculate the magnitude and direction of the pixel gradient; S4. Introduce the Canny operator to perform edge detection on the gradient image to obtain the edges of the image; S5. Use Hough line detection to judge the state of the cables. If all cables are straight lines, it is judged that there is no prolapse; S6. Use the Roberts operator to perform edge detection on the preprocessed patrol image to obtain a set of edge points; S7. Substitute the edge points into the opencv solver to calculate the coefficients of the polynomial and obtain the expression of the fitted cable curve , if it indicates that the cable is approximately a straight line and the cable is not prolapsed; Otherwise, the cable is a curve, indicating that the cable has prolapsed; In S2, using a Gaussian smoothing filter to smooth the image to remove noise includes the following steps: S201, The principle of Gaussian filtering is as follows. Step 1 is: ; The second step of the Gaussian-smoothed image is as follows: ; In the formula, is the parameter for controlling the filtering degree, is the original image, is the smoothed image after denoising; S202: Calculate the magnitude and direction of the pixel gradient, and operate according to the steps of the Sobel filter. The convolution of the x-direction and y-direction information of the image is detected as follows: Step 3, ; Step 4, ; Calculate the pixel amplitude M and direction using the following formula Obtain the edge set: Step 5, ; Step 6, ; S203. Perform non-maximum suppression on the gradient magnitude; S204. Use the double-threshold algorithm to detect and connect edges; In S3, when calculating the magnitude and direction of the pixel gradient, first use the formula in step 3 of S2 and the formula in step 4 of S2 to detect the gradients in the x-direction and y-direction of the image respectively. Traverse all pixel points on the image to be detected, calculate the gradients in the x-direction and y-direction of any pixel point, and then use the formula in step 5 of S2 and the formula in step 6 of S2 to calculate the combined gradient and gradient direction of the pixel point (x, y) respectively; In S6, the specific steps of using the Roberts operator for edge detection are as follows: First, determine any point (x, y) on the patrol image and there is: Step 7, ; where x and y are the coordinates of the pixel points, are the 4-neighborhoods of the image respectively, is the Roberts operator of the pixel (x, y); In S7, the calculation steps of the polynomial are as follows: S701, first, set the polynomial as , where are the coefficients of the polynomial and also the curve parameters to be estimated; x is the abscissa of the pixel, y is the ordinate of the pixel, k is the order of the specified polynomial, and the order of the polynomial is 3; S702. Calculate the deviation of the edge points in the image from the curve. The sum of the squared deviations is: ; where n is the number of detected boundary points, is the abscissa of the detected pixel, is the ordinate of the detected pixel, is the sum of squared errors of fitting; S703, calculate this curve fitting problem by the least squares method, and use cv::solve() in the opencv library to solve it to obtain the expression of the fitted cable curve .

Citation Information

Patent Citations

  • Method for detecting bus lane based on video

    CN105389561A

  • Path display method and device for intelligent equipment

    CN111399493A

  • Cable interface loosening detection method based on deep learning

    CN114155435A