A cable flaw detection method, medium and system
The cable surface is three-dimensionally reconstructed and defect feature extraction through the monocular depth estimation model, which solves the false alarm and missed alarm problems in the existing cable detection technology, and achieves high-precision, contactless cable flaw detection detection.
Patent Information
- Application Number
- CN202411687088.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-25
AI Technical Summary
The existing cable detection technology has problems of false alarms and missed reports. The traditional ultrasonic detection methods are not effective. The x-ray flaw detection equipment is large in size, cumbersome in operation and radiation hazards.
The monocular depth estimation model is used to reconstruct the cable surface three-dimensionally to generate a three-dimensional point cloud, and fuse the Gaussian curvature information of each point in the point cloud and the normal vector of local concave and convex position points. The defect values of each position point are obtained through convolutional calculation to determine whether there are defects.
It improves the recognition accuracy of cable surface defect recognition, reduces error detection, and realizes contactless and unlimited site cable flaw detection detection.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the technical field of cable detection, and in particular to a cable flaw detection method, medium and system. Background Art
[0002] Cables are an indispensable part of modern power systems. They are used to transmit and distribute electrical energy and connect various devices and electronic systems. During long-term use, cables will be affected by various factors, such as mechanical damage, environmental corrosion, insulation aging, animal gnawing, etc., which will lead to defects and failures. If these problems are not discovered and solved in time, they will have an adverse effect on the stability and safety of the power system. The surface defects of cables mainly refer to abnormal appearance, such as bulges, depressions, holes, and damage on the surface of the cable. Regular inspection of cables can detect defects and failures in time, and take timely measures to repair them to avoid potential safety hazards.
[0003] At present, traditional ultrasonic detection methods, such as ultrasonic and visual detection, have poor detection effects and are prone to false alarms and missed reports. X-ray flaw detection equipment has the disadvantages of being large in size, cumbersome to operate, inconvenient to move, limited in use, and having certain radiation hazards to the human body. Summary of the invention
[0004] In view of the technical problems existing in the prior art, the present invention provides a cable flaw detection method, medium and system with high identification accuracy.
[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0006] A cable flaw detection method comprises the following steps:
[0007] Acquire cable images and generate 3D point clouds;
[0008] The Gaussian curvature K of the point cloud is obtained by surface fitting; N local concave and convex position points are obtained according to the point cloud, and the neighboring points of each position point are found, and the coordinates of each neighboring point are fitted into a plane to obtain the plane normal vector P;
[0009] Fuse the Gaussian curvature K and the normal vector P to obtain the fused eigenvalue ; Then the fusion feature value Perform convolution operation to obtain the defect value of each position point;
[0010] The defect value of each position point is compared with the preset threshold; if the defect value is greater than the preset threshold, the position point is judged as a preliminary defect point, otherwise it is a normal point.
[0011] Preferably, N groups of results are obtained by looping through all local concave-convex position points;
[0012] Calculate the probability that the same position point on the point cloud is recorded as a defect point multiple times , where w is the number of times it is determined to be a defect point; if the probability If it is greater than the preset probability threshold, it will continue to be a defective point, otherwise it will be corrected to a normal point;
[0013] Finally, the presence of defects and the location of the defective points on the surface of the cable are determined based on the marked status of each position point.
[0014] Preferably, the specific process of obtaining the plane normal vector P is:
[0015] Obtain N local concave-convex position points in space through local convex connection of the point cloud;
[0016] Use the kd tree to check the 20-40 points near each position point and record them as neighboring points;
[0017] The coordinates of the nearest points are fitted into a plane using the least squares method, and the plane normal vector P is obtained.
[0018] Preferably, after generating the three-dimensional point cloud, the point cloud data is subjected to denoising and filtering according to different scenarios, specifically: for ordered point cloud data, a smoothing filtering denoising method is adopted; for scattered point cloud data, Laplace denoising, mean curvature flow method or bilateral filtering method is adopted.
[0019] Preferably, the specific process of acquiring the cable image and generating the three-dimensional point cloud is:
[0020] Transform the cable image to standard camera space;
[0021] The transformed image is pushed into a pre-trained depth estimation model to produce a predicted depth in standard camera space. ; Then perform the inverse operation of the standard camera space, convert back to the depth of the original image space, and output the point cloud.
[0022] Preferably, the training process of the depth estimation model is:
[0023] Accurately calibrate the camera to obtain the accurate focal length parameters of the camera ;
[0024] Collect cable images and true depth information;
[0025] Focus the camera , image data, and depth information are transformed into standard camera space and then sent to the ConvNext backbone network to extract features;
[0026] The collected real depth information supervises the depth predicted by the network;
[0027] Calculate the loss function;
[0028] The loss function performs gradient reverse update on the model parameters;
[0029] Ultimately, the backbone network can accurately infer the depth information of the monocular image.
[0030] Preferably, the loss function for:
[0031] in, refers to the pairwise normal regression loss function; It refers to the plane virtual normal loss function; Refers to the depth estimation loss function of the foreground and background areas; is the loss function of depth estimation, specifically:
[0032]
[0033] in, refers to the true depth, d refers to the predicted depth, Represents the median operation of the depth in the intercepted area, and M represents the total number of blocks; refers to the serial number of the area block, and j refers to the serial number of the local concave-convex position point; and They respectively refer to the true depth and predicted depth of the unit pixel of the selected area.
[0034] Preferably, the Gaussian curvature K and the normal vector P are fused to obtain the fused eigenvalue The specific formula is: .
[0035] The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described above are executed.
[0036] The present invention further discloses a cable flaw detection system, comprising a memory and a processor connected to each other, wherein a computer program is stored in the memory, and when the computer program is run by the processor, the steps of the method described above are executed.
[0037] Compared with the prior art, the advantages of the present invention are:
[0038] The flaw detection method of the present invention uses a monocular depth estimation model to perform three-dimensional reconstruction of the cable surface to obtain a three-dimensional point cloud, and then obtains N local concave and convex position points according to the point cloud through the Gaussian curvature information of each point in the point cloud, and searches for the neighboring points of each position point, and fits the coordinates of each neighboring point to a plane to obtain a plane normal vector P; the fusion feature value is obtained by fusing the Gaussian curvature K and the normal vector P. , and then fuse the eigenvalues A convolution operation is performed to obtain the defect value of each position point, and then the defect value is used to determine whether each point has a defect; further, through multiple result overlap checks, the defect points are further screened multiple times, which effectively reduces false detection and improves recognition accuracy.
[0039] The present invention solves the problem that different camera algorithm models cannot be universal through the standard transformation space of the monocular depth estimation model, and uses any camera (camera) to realize the point cloud image of monocular three-dimensional reconstruction to identify damage on the cable surface, thereby improving the applicability and practicality of the method. The present invention as a whole has the advantages of simple hardware equipment, low installation requirements, contactless identification, and no restrictions on the site, which is of great significance to the promotion and application of cable flaw detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 The present invention is a flow chart of a cable flaw detection method in an embodiment.
[0041] Figure 2 A flow chart for generating a three-dimensional point cloud according to the present invention.
[0042] Figure 3 This is a three-dimensional point cloud rendering generated in the present invention. DETAILED DESCRIPTION
[0043] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0044] like Figure 1 As shown, the cable flaw detection method provided by the embodiment of the present invention specifically includes the steps of:
[0045] S1, using a monocular camera to collect images of cables to be inspected in real time;
[0046] S2. Use the monocular depth estimation model to infer the cable image collected by the monocular camera to generate a three-dimensional point cloud; depth estimation refers to the use of computer vision algorithms to infer the distance information of each object in the scene, which can be achieved by learning the mapping relationship between monocular images and depth images. Specifically, the monocular depth estimation model adopts the Unet network structure and uses ConvNext as the backbone network;
[0047] All training data is then aligned to the standard camera space before being fed into the network. In this space, the processed images are uniformly considered to be captured by the same camera. The standard camera transformation allows mixing data from various cameras for training, effectively improving the generalization ability of the network. This allows the monocular depth estimation model to be applied to monocular images taken by any camera, thus being unaffected by the differences in photos taken by different monocular cameras. To achieve this transformation, the image appearance is transformed to simulate a standard camera.
[0048] In order to enable the network to effectively utilize data from multiple sources, we first need to assume a virtual camera parameter. The parameters of the original camera are: ,in Respectively represent the focal length in two directions (usually the two are equal) and the pixel size, and the physical unit is micron; represents the position coordinates of the pixel, where Indicates the position in the row direction. Indicates the position in the column direction. In the camera, there is a parameter called the size of the imaging sensor, which affects the size of the image. In the imaging principle of a monocular camera, the focal length ,depth The relationship with the image size is:
[0049] =
[0050] in, Standard focal length is the actual focal length of the camera, Represents the real-world size of the object and the pixel size respectively, so the depth of the object is only proportional to the focal length and the size of the object in pixels. Yes. This will result in a focal length expressed in pixels of equal proportion , but due to different The resolution displayed on the image is also different. After the proportional offset, the factors The effect of is eliminated, and the only effect left is the focal length This variable.
[0051] So we can set a ratio , calculate the actual focal length of the camera currently capturing the image and standard focal length The ratio of , multiplying the depth space scale of the real image by Transform to the standard space (i.e. standard camera space) and multiply the standard space by It is transformed back to the real depth space. According to the following two transformation relationships, the network can be trained on a uniform scale:
[0052] 1) Depth alignment, determine the focal length ratio between the current image capturing camera and the desired camera , there is no need to transform the image here, just generate a new depth ,in represents the original depth image, Represents the new depth image after the transformation. After the prediction result is obtained, the depth can be restored to the depth represented by the real image by an inverse transformation.
[0053] 2) Image alignment, determine the focal length ratio between the current image capturing camera and the desired camera ,Use this ratio to determine the image scaling ratio, while keeping the image size unchanged, and the scaled image will be pasted at the location of the optical center.
[0054] Graphics after standard camera space transformation is pushed into the depth estimation model, producing a predicted depth in canonical space (i.e. standard camera space) During training, By Depth The depth is also transformed into the canonical space for supervision. During inference, the depth generated in the canonical space is Finally, the depth can be converted back to the original image space by performing an inverse operation in the canonical space.
[0055] like Figure 2 As shown, the training process of the monocular depth estimation model is:
[0056] First, calibrate the camera accurately to obtain the camera's accurate focal length. ;
[0057] Use cameras and lidar to collect images and depth information of cable data;
[0058] The actual focal length of the camera , image data, and depth information are transformed into standard camera space and then sent to the ConvNext backbone network to extract features;
[0059] The real depth information collected by the LiDAR supervises the depth predicted by the network;
[0060] Calculating the loss function ;
[0061] The loss function performs gradient reverse update on the algorithm model parameters;
[0062] Ultimately, the backbone network can accurately infer the depth information of the monocular image.
[0063] The above loss function Described as:
[0064]
[0065] in, Refers to paired normal regression loss to improve the performance of local geometric feature learning; It refers to the plane virtual normal loss. The virtual normal loss can not only improve the performance of learning absolute depth, but also enrich the scale information to improve the robustness of the affine invariant depth generated in different scenes. Refers to the depth estimation loss function of the foreground and background areas, which is used to evaluate the depth difference between the foreground and background; is the loss function for depth estimation.
[0066] The above loss function refers to the design of the loss function for depth estimation of the image intercepted area block with reference to scale-invariable. The square root is taken at the outermost layer of the original loss function and then summed to improve the accuracy of subtle depth differences, which is conducive to generating a denser and more accurate 3D point cloud. Specifically, the improved depth estimation loss function for:
[0067]
[0068] in, refers to the true depth, d refers to the predicted depth, Represents the depth within the intercepted area, taking the median operation; where M refers to the number of area blocks, N refers to the number of local concave and convex position points, refers to the serial number of the regional block, j refers to the serial number of the local concave-convex position point; M=32 takes the total number of blocks, and the size of the block is set as the image size ratio, and the value range is ; and They respectively refer to the true depth and predicted depth of the unit pixel of the selected area.
[0069] S3, generate a three-dimensional point cloud (such as Figure 3 After that, according to the differences in the shooting environment and scene, different denoising and filtering processes are performed on the point cloud data to obtain a stable and clear point cloud data. Specifically:
[0070] 1) Based on the ordered point cloud data, the smoothing filter denoising method is used. Currently, the data smoothing filter mainly adopts Gaussian filtering, mean filtering and median filtering;
[0071] 2) Commonly used methods for denoising scattered point cloud data are Laplace denoising, mean curvature flow method, and bilateral filtering algorithm.
[0072] In addition, the point cloud sparse method can be used to take the sparse point cloud as point cloud input to further speed up the detection speed.
[0073] S4. Compared with the method of using point cloud template matching to identify whether there are surface defects, the present invention uses a point cloud feature extraction method to achieve cable flaw detection and identification, solving the problems of low template matching accuracy and very strict shooting requirements.
[0074] In terms of feature extraction, considering that Gaussian curvature is the product of the principal curvature, the structural features of the point cloud image and the sharper edge features can be well preserved by Gaussian curvature. For image features with smaller gradient modulus values, other gradient-based algorithms cannot hold these features well. At the same time, noise has a large Gaussian curvature value, and the noise can be effectively filtered by Gaussian curvature. Therefore, the present invention uses Gaussian curvature to analyze the damage of the cable surface, specifically by fitting the quadratic surface to obtain the Gaussian curvature of the point cloud, and the specific steps are as follows:
[0075] First, take a data point in the scattered point cloud , and then As the center, evenly select i points in the point cloud, and these i points should cover the entire point cloud as much as possible. Through these i points, use the least squares method to fit the quadratic surface z , after solving the coefficients, the Gaussian curvature and mean curvature of the data points are calculated according to the properties of the space surface curve; where a, b, c are the equation coefficients, and x and y are the horizontal and vertical coordinates of the surface equation.
[0076] For the m-domain of any data point in the measurement point cloud (the m-domain is the first m data points closest to the selected data point, called the m-domain), the minimum distance value Q is obtained by the following formula according to the principle of least squares method;
[0077]
[0078] In the formula, is a point in the domain. Differentiate the coefficients of the above formula to make them 0, and we get the following formula:
[0079]
[0080] From this, solve for the quadratic surface coefficients.
[0081] Write the curve equation in the form of a surface parametric equation:
[0082]
[0083] If there is a curve r on the surface, the expression of the curve r is:
[0084]
[0085] If s represents the arc length of the curve r, the arc length differential formula can be obtained from the composite function derivative formula:
[0086]
[0087] in and Respectively represent the radius change rate of the curve in the x direction and the y direction, dx and dy are the length changes in the x and y directions:
[0088] From the first basic formula of the surface we can get:
[0089]
[0090] Among them, E, F and G are the first basic quantities of the surface, E and G represent the measurements of the surface in the x and y directions respectively, and F represents the mixed measurement in the x and y directions; I refers to the first basic formula of the surface.
[0091] Assume that p is a point on the curve r, and use t and n to represent the unit tangent vector and unit normal vector of point P respectively, then the curvature vector can be decomposed into:
[0092]
[0093] k is the curvature of the curve, is the curvature in the shear direction, It refers to the curvature in the direction of the normal vector.
[0094] The unit normal vector n of the curve is expressed as:
[0095]
[0096] The second basic formula of the surface is obtained :
[0097]
[0098] in, , are fundamental quantities of the second fundamental form of a surface, representing the partial derivatives of the surface in the x-direction and the y-direction respectively; they describe the degree of curvature of the surface in a particular direction.
[0099] The curvature can be expressed as: in:
[0100] Processing variables available The two roots , so according to the curvature characteristics we can get:
[0101] Gaussian curvature .
[0102] S5. After obtaining the point cloud data, the point cloud is subjected to the LCCP algorithm (local convex connection) to obtain N local concave and convex position points in the space; these local concave and convex points are further analyzed, and the 20-40 points near the search point are recorded as neighboring points using the kd tree, and then a plane is fitted to the coordinates of the neighboring points according to the least squares method, that is, the plane normal vector P is obtained;
[0103] S6. Gaussian curvature and normal vector P are used as feature points and fused to obtain the fused feature value ;
[0104] S7, fusion feature value of each point Perform convolution operation and record the absolute value of the calculation result as the defect value of each point; if the defect value of a point is greater than the threshold T, then the point is recorded as a defect point, otherwise it is recorded as a normal point;
[0105] S8, loop through all local concave and convex position points to obtain N groups of results;
[0106] S9. Calculate the probability that the same point on the point cloud is recorded as a defect point multiple times , where w is the number of times it is determined to be a defect point; if the probability If it is greater than the preset probability threshold, it will continue to be a defective point, otherwise it will be corrected to a normal point;
[0107] S10. Finally, according to the marked status of each point, it is accurately determined whether there is a defect at the concave and convex position point on the cable surface and the position of the defect point.
[0108] The flaw detection method of the present invention uses a monocular depth estimation model to perform three-dimensional reconstruction of the cable surface to obtain a three-dimensional point cloud, and then obtains N local concave and convex position points according to the point cloud through the Gaussian curvature information of each point in the point cloud, and searches for the neighboring points of each position point, and fits the coordinates of each neighboring point to a plane to obtain a plane normal vector P; the fusion feature value is obtained by fusing the Gaussian curvature K and the normal vector P. , and then fuse the eigenvalues A convolution operation is performed to obtain the defect value of each position point, and then the defect value is used to determine whether each point has a defect; further, through multiple result overlap checks, the defect points are further screened multiple times, which effectively reduces false detection and improves recognition accuracy.
[0109] The present invention solves the problem that different camera algorithm models cannot be universal through the standard transformation space of the monocular depth estimation model, and uses any camera (camera) to realize the point cloud image of monocular three-dimensional reconstruction to identify damage on the cable surface, thereby improving the applicability and practicality of the method. The present invention as a whole has the advantages of simple hardware equipment, low installation requirements, contactless identification, and no restrictions on the site, which is of great significance to the promotion and application of cable flaw detection.
[0110] The present invention also discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed. The present invention further discloses a cable flaw detection system, including a memory and a processor connected to each other, on which a computer program is stored, and when the computer program is executed by the processor, the steps of the above method are executed. The medium and system of the present invention correspond to the above method and also have the advantages described in the above method.
[0111] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiment can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media include: any entity or device that can carry computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. The memory is used to store computer programs and / or modules. The processor implements various functions by running or executing computer programs and / or modules stored in the memory, and calling data stored in the memory. The memory may include a high-speed random access memory and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0112] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A cable flaw detection method, characterized in that: Includes steps: Acquire cable images through a monocular camera and generate a three-dimensional point cloud; The Gaussian curvature K of the point cloud is obtained by surface fitting; N local concave and convex position points are obtained according to the point cloud, and the neighboring points of each position point are found, and the coordinates of each neighboring point are fitted into a plane to obtain the plane normal vector P; Fuse the Gaussian curvature K and the normal vector P to obtain the fused eigenvalue ; Then fusion feature value Perform convolution operation to obtain the defect value of each position point; Compare the defect value of each position point with the preset threshold; if the defect value is greater than the preset threshold, the position point is judged as a preliminary defect point, otherwise it is a normal point; The Gaussian curvature of the point cloud is obtained by fitting the quadratic surface, specifically: Gaussian curvature ; Among them, E, F and G are the first basic quantities of the surface, E and G represent the measurements of the surface in the x and y directions respectively, and F represents the mixed measurement in the x and y directions; in ; in , are the basic quantities of the second fundamental form of the surface, representing the partial derivatives of the surface in the x-direction and the y-direction respectively; is the unit normal vector of the curve; The specific process of acquiring cable images and generating 3D point clouds through a monocular camera is as follows: Transform the cable image acquired by the monocular camera into the standard camera space; The transformed image is pushed into a pre-trained monocular depth estimation model to produce a predicted depth in standard camera space. ; Then perform the inverse operation of the standard camera space, convert back to the depth of the original image space, and output the point cloud; The monocular depth estimation model adopts the Unet network structure and uses ConvNext as the backbone network.
2. The cable flaw detection method according to claim 1, characterized in that: By looping through all the local concave and convex position points, N groups of results are obtained; Calculate the probability that the same position point on the point cloud is recorded as a defect point multiple times , where w is the number of times it is judged as a defect point; If the probability If it is greater than the preset probability threshold, it will continue to be a defective point, otherwise it will be corrected to a normal point; Finally, the presence of defects and the location of the defective points on the surface of the cable are determined based on the marked status of each position point.
3. The cable flaw detection method according to claim 1, characterized in that: The specific process of obtaining the plane normal vector P is: Obtain N local concave-convex position points in space through local convex connection of the point cloud; Use the kd tree to check the 20-40 points near each location point and record them as neighboring points; The coordinates of the nearest points are fitted into a plane using the least squares method, and the plane normal vector P is obtained.
4. The cable flaw detection method according to claim 1, 2 or 3, characterized in that: After generating the three-dimensional point cloud, the point cloud data is subjected to denoising and filtering according to different scenarios. Specifically, for ordered point cloud data, a smoothing filtering denoising method is used; for scattered point cloud data, Laplace denoising, mean curvature flow method or bilateral filtering method is used.
5. The cable flaw detection method according to claim 1, characterized in that: The training process of the depth estimation model is: Accurately calibrate the camera to obtain the accurate focal length parameters of the camera ; Collect cable images and true depth information; Set the camera focal length , image data, and depth information are transformed into standard camera space and then sent to the ConvNext backbone network to extract features; The collected real depth information supervises the depth predicted by the network; Calculate the loss function; The loss function performs gradient reverse update on the model parameters; Ultimately, the backbone network can accurately infer the depth information of the monocular image.
6. The cable flaw detection method according to claim 5, characterized in that: Loss Function for: in, refers to the pairwise normal regression loss function; It refers to the plane virtual normal loss function; Refers to the depth estimation loss function of the foreground and background areas; is the loss function of depth estimation, specifically: in, refers to the true depth, d refers to the predicted depth, Represents the median operation of the depth in the intercepted area, and M represents the total number of blocks; refers to the serial number of the area block, and j refers to the serial number of the local concave-convex position point; and They respectively refer to the true depth and predicted depth of the unit pixel of the selected area.
7. The cable flaw detection method according to claim 1, 2 or 3, characterized in that: Fuse the Gaussian curvature K and the normal vector P to obtain the fused eigenvalue The specific formula is: .
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program performs the steps of the method according to any one of claims 1 to 7.
9. A cable flaw detection system, comprising a memory and a processor connected to each other, wherein a computer program is stored in the memory, characterized in that: When the computer program is executed by a processor, the computer program performs the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Defect detection method based on point cloud information
CN111311576A