A cable image defect detection method and system

CN122948803APending Publication Date: 2026-10-20WUXI HUAHAO ELECTRIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611118438.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0005]鉴于以上现有技术的不足,本发明实施例的目的在于提供一种线缆图像缺陷检测方法,能够解决传统的线缆缺陷检测方法主要对成像条件和缺陷外观依赖较强,在光照不均、背景复杂或纹理干扰情况下,极易出现漏检或误检,且缺乏对线缆表面形貌的三维建模与深度特征提取,无法有效利用不同光源下的多视图图像信息,导致对微小缺陷或曲面异常的识别能力有限的技术问题

Benefits of technology

在本发明实施例中,通过结合对数域变换算法和本征图像分解算法,建立基于原始表面图像中的线缆区域的二维表面重建图像,结合光度立体算法和Frankot-Chellappa算法,建立基于各张光照表面图像中的线缆区域的三维表面重建图像,降低了对成像条件和缺陷外观依赖,在光照不均、背景复杂或纹理干扰情况下,不易出现漏检或误检,通过小波变换融合算法,对伽马校正图像和曲率图像进行图像融合,得到融合图像,通过改进型YOLOv8模型,对融合图像进行缺陷检测,输出待检测线缆的表面缺陷检测结果,具备对线缆表面形貌的三维建模与深度特征提取,能够有效利用不同光源下的多视图图像信息,提升了对微小缺陷或曲面异常的识别能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure REF-OBJ-1785139626659-000002
    Figure REF-OBJ-1785139626659-000002
  • Figure REF-OBJ-1785139626659-000003
    Figure REF-OBJ-1785139626659-000003
  • Figure REF-OBJ-1785139626659-000005
    Figure REF-OBJ-1785139626659-000005
Patent Text Reader

Abstract

This invention provides a method and system for detecting cable image defects, relating to the field of image defect detection technology. The method includes: acquiring an original surface image of the cable to be detected and multiple illuminated surface images under the same light source depression angle but different light source azimuth angles; segmenting the cable region in the original surface image and each illuminated surface image; establishing a two-dimensional surface reconstruction image based on the cable region in the original surface image; establishing a three-dimensional surface reconstruction image based on the cable region in each illuminated surface image; performing gamma correction on the two-dimensional surface reconstruction image to obtain a gamma-corrected image; calculating the curvature of the three-dimensional surface reconstruction image to obtain a curvature image; fusing the gamma-corrected image and the curvature image using a wavelet transform fusion algorithm to obtain a fused image; and performing defect detection on the fused image using an improved YOLOv8 model to output the surface defect detection result of the cable to be detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image defect detection technology, and in particular to a method and system for detecting cable image defects. Background Technology

[0002] As a key component in power transmission and control systems, the manufacturing quality and surface integrity of cables play a crucial role in the stability and safety of the entire system. During actual production and maintenance, cable surfaces often develop defects such as micro-cracks, dents, and scratches due to factors like compression, scratches, and aging. If these defects are not detected and addressed in a timely manner, they can easily lead to electrical short circuits, signal interference, and even safety accidents, seriously threatening the safe operation of industrial systems.

[0003] In existing technologies, traditional cable defect detection methods mainly rely on edge detection, grayscale threshold segmentation, or structured light projection image analysis. These methods are highly dependent on imaging conditions and defect appearance, and are prone to missed or false detections under conditions of uneven lighting, complex backgrounds, or texture interference.

[0004] In addition, traditional cable defect detection methods lack three-dimensional modeling and depth feature extraction of cable surface morphology, and cannot effectively utilize multi-view image information under different light sources, resulting in limited ability to identify minute defects or surface anomalies. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide a cable image defect detection method that can solve the technical problems of traditional cable defect detection methods, which are mainly dependent on imaging conditions and defect appearance. Under conditions of uneven lighting, complex background or texture interference, they are prone to missed detection or false detection. Furthermore, they lack three-dimensional modeling and depth feature extraction of cable surface morphology and cannot effectively utilize multi-view image information under different light sources, resulting in limited ability to identify small defects or surface anomalies.

[0006] A first aspect of this invention provides a method for detecting defects in cable images, comprising: S1: Acquire the original surface image of the cable to be inspected and multiple illuminated surface images under the same light source depression angle but different light source azimuth angles; S2: Segment the cable regions in the original surface image and each illuminated surface image; S3: Combining the logarithmic domain transformation algorithm and the intrinsic image decomposition algorithm, a two-dimensional surface reconstruction image based on the cable region in the original surface image is established; S4: Combine the photometric stereo algorithm and the Frankot-Chellappa algorithm to establish a three-dimensional surface reconstruction image of the cable region based on each illuminated surface image; S5: Perform gamma correction on the two-dimensional surface reconstruction image to obtain a gamma-corrected image; S6: Calculate the curvature of the reconstructed 3D surface image to obtain a curvature image; S7: The gamma-corrected image and the curvature image are fused using a wavelet transform fusion algorithm to obtain a fused image; S8: Using the improved YOLOv8 model, defects are detected in the fused image, and the surface defect detection results of the cable under test are output.

[0007] A second aspect of the present invention provides a cable image defect detection system, comprising: a processor and a memory; The memory stores programs or instructions that can run on the processor, which, when executed by the processor, implement the steps of the cable image defect detection method as described in the first aspect.

[0008] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this embodiment of the invention, a two-dimensional surface reconstruction image of the cable region in the original surface image is established by combining the logarithmic domain transformation algorithm and the intrinsic image decomposition algorithm. A three-dimensional surface reconstruction image of the cable region in each illuminated surface image is established by combining the photometric stereo algorithm and the Frankot-Chellappa algorithm. This reduces the dependence on imaging conditions and defect appearance. Under conditions of uneven illumination, complex background or texture interference, it is less likely to miss or falsely detect defects. The gamma-corrected image and curvature image are fused by the wavelet transform fusion algorithm to obtain a fused image. The fused image is then used to perform defect detection by the improved YOLOv8 model, and the surface defect detection result of the cable to be detected is output. It has the ability to perform three-dimensional modeling and depth feature extraction of cable surface morphology, and can effectively utilize multi-view image information under different light sources, thereby improving the ability to identify small defects or surface anomalies. Attached Figure Description

[0009] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0010] Figure 1 This is a schematic flowchart of a cable image defect detection method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of an improved YOLOv8 model provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a dynamic core selection module provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a dynamic convolutional kernel attention module provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a gradient fusion module provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the cable surface defect detection results provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of a cable image defect detection system provided in an embodiment of the present invention. Detailed Implementation

[0011] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0012] The cable image defect detection method provided by the present invention will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0013] Reference manual attached Figure 1 The diagram shows a flowchart of a cable image defect detection method provided by an embodiment of the present invention.

[0014] This invention provides a method for detecting defects in cable images, which may include the following steps: S1: Acquire the original surface image of the cable to be inspected and multiple illuminated surface images under the same light source depression angle but different light source azimuth angles.

[0015] It should be noted that the light source depression angle refers to the angle between the light source and the vertical direction (such as the z-axis). The light source azimuth angle refers to the rotation angle of the light source about the vertical axis. Optionally, the light source azimuth angle includes 0°. ° 90 ° 180 ° and 270 ° .

[0016] In this embodiment of the invention, the method of acquiring cable images under the same light source depression angle but different light source azimuth angles helps to enhance the contrast and contour features of the defect area, improve the three-dimensionality of the surface morphology, and provide multi-view input for photometric stereoscopic and three-dimensional reconstruction, thereby enhancing the accuracy and robustness of defect identification.

[0017] S2: Segment the cable regions in the original surface image and each illuminated surface image.

[0018] In one possible implementation, the segmentation of the cable area specifically includes sub-steps S201 to S204: S201: Perform grayscale processing on the surface image to obtain a grayscale surface image.

[0019] S202: Enhance the grayscale surface image by using a local grayscale contrast enhancement algorithm to obtain a grayscale enhanced surface image.

[0020] It should be noted that the local grayscale contrast enhancement algorithm is an image enhancement method based on sliding windows. By setting a local window of a certain size and step size on the image, calculating the grayscale mean of pixels in each window, and applying different grayscale adjustment strategies to dark and bright areas respectively, the local contrast is improved, the fine texture and edge information are enhanced, and the interference of bright background areas is suppressed, making the surface defect features of the cable more prominent.

[0021] In one possible implementation, S202 specifically includes sub-steps S2021 to S2025: S2021: Set local window parameters, including local window size and local window step size.

[0022] Optionally, the size of a local window includes its height and width.

[0023] It should be noted that those skilled in the art can adjust the size of the local window parameters according to actual needs, and this invention does not limit this.

[0024] S2022: Slide the local window on the grayscale surface image according to the local window size and local window step size.

[0025] S2023: Calculate the average grayscale value of the pixels in the current local window.

[0026] S024: Enhance the grayscale values ​​of all pixels in the current local window based on the average grayscale value.

[0027]

[0028] Among them, ci (x,y) represents the grayscale value of the i-th pixel located at coordinates (x,y) in the current local window after enhancement processing, f i (x,y) represents the grayscale value of the i-th pixel located at coordinates (x,y) in the current local window, μ W The value represents the average grayscale value of the pixels in the current local window, W represents the current local window, w represents the width of the current local window, and h represents the height of the current local window.

[0029] It should be noted that when f i (x,y)<μ W When it is determined that the surface image is likely a foreground dark area, the pixel grayscale value of the foreground dark area is set to... It can enhance the contrast between dark areas of the foreground and bright areas of the background. When f i (x,y)≥μ W When it is determined that the surface image is likely to be a bright area of ​​the background, setting the pixel grayscale value of the bright area of ​​the background to 0 can suppress interference from the bright area of ​​the background.

[0030] S2025: Repeat S2022 to S2024 to enhance the grayscale values ​​of all pixels in the grayscale surface image to obtain a grayscale enhanced surface image.

[0031] In this embodiment of the invention, steps S2021 to S2025 employ a local grayscale contrast enhancement algorithm to perform sliding window processing on the grayscale image. Based on the local grayscale mean, dark pixels are enhanced while bright pixels are suppressed, thereby effectively improving the local contrast between the defective area on the cable surface and the background. This method exhibits good illumination adaptability, enhancing subtle textures and defect edges while suppressing background highlight interference, significantly improving the accuracy and stability of subsequent image segmentation and defect detection.

[0032] S203: Normalize the grayscale enhanced surface image to obtain a normalized grayscale enhanced surface image.

[0033] S204: The normalized grayscale enhanced surface image is segmented using the maximum correlation threshold segmentation algorithm to obtain the cable region.

[0034] It should be noted that the maximum correlation threshold segmentation algorithm is an adaptive image segmentation method based on the principles of probability statistics and information entropy. By traversing candidate thresholds, the image pixel grayscale is divided into foreground and background, and the correlation or information coupling degree between the two is calculated. The threshold at which the weighted objective function is maximized is taken as the optimal segmentation point, thereby achieving high-precision differentiation between cable areas and background under complex lighting or uneven contrast conditions.

[0035] In this embodiment of the invention, steps S201 to S204 construct a highly robust cable region extraction method through grayscale processing, local grayscale contrast enhancement, normalization, and maximum correlation threshold segmentation. This method can effectively highlight cable region features under complex lighting and low-contrast backgrounds, enhance defect edge information, suppress background interference, and avoid the problems of missed detections and false detections that are common in traditional global segmentation. It provides an accurate and stable target region foundation for subsequent two-dimensional and three-dimensional surface reconstruction and defect identification.

[0036] In one possible implementation, S204 specifically includes sub-steps S2041 to S2047: S2041: Traverse all pixels in the normalized grayscale enhanced surface image, determine the occurrence frequency of each grayscale level, and calculate the occurrence probability of each grayscale level based on the occurrence frequency.

[0037] S2042: Integrate the occurrence probabilities of each gray level to construct a probability set:

[0038]

[0039] Where, p G Represents a set of probabilities. Indicates the first The probability of each gray level appearing. Indicates the first The frequency of occurrence of each gray level H represents the width of the normalized grayscale enhanced surface image, H represents the height of the normalized grayscale enhanced surface image, and c represents the height of the normalized grayscale enhanced surface image. m Let m represent the set of gray levels in the normalized gray-enhanced surface image, where m represents the maximum gray level in the normalized gray-enhanced surface image.

[0040] S2043: Set the range of candidate segmentation threshold values, and divide the probability set according to the candidate segmentation threshold to obtain a foreground-related subset and a background-related subset:

[0041]

[0042]

[0043] Where A represents the foreground-related subset, P() represents the total probability of the foreground-related subset, and T s denoted as the candidate segmentation threshold, and B represents the background-related subset.

[0044] It should be noted that those skilled in the art can set the range of candidate segmentation thresholds according to actual needs, and this invention does not limit such ranges.

[0045] S2044: Calculate the foreground correlation function value based on the foreground correlation subset.

[0046] S2045: Weight the foreground correlation function values ​​to obtain the weighted objective function value:

[0047]

[0048] in, This represents the weighted objective function value, ω represents the weight coefficient, α represents the cable area proportion parameter, and C... A represents the foreground correlation function value, and ln represents the natural logarithm function.

[0049] S2046: Traverse the candidate segmentation thresholds within the range of values, and determine the candidate segmentation threshold corresponding to the maximum weighted objective function value as the optimal segmentation threshold.

[0050] S2047: In the normalized grayscale enhanced surface image, the pixel region with a pixel grayscale value less than the optimal segmentation threshold is segmented into a cable region, and the pixel region with a pixel grayscale value greater than or equal to the optimal segmentation threshold in the normalized grayscale enhanced surface image is segmented into a background region.

[0051] In this embodiment of the invention, steps S2041 to S2047 involve constructing a grayscale probability distribution of a normalized grayscale image, traversing candidate thresholds to divide the foreground and background subsets, calculating a weighted objective function value based on the information entropy principle, and selecting the threshold corresponding to the maximum value as the optimal segmentation point to achieve accurate extraction of the cable region. This method exhibits good adaptability and robustness, accurately distinguishing cables from the background under uneven lighting or complex background conditions, significantly improving the accuracy and stability of subsequent reconstruction and detection.

[0052] S3: Combining the logarithmic domain transformation algorithm and the intrinsic image decomposition algorithm, a two-dimensional surface reconstruction image based on the cable region in the original surface image is established.

[0053] It should be noted that the logarithmic domain transformation algorithm is an image preprocessing method based on human vision and lighting models. By taking the logarithm of the image pixel grayscale, it transforms the multiplicative relationship between illumination and reflection components into a separable additive form, thereby reducing the impact of illumination changes on image brightness and facilitating the subsequent extraction of realistic surface reflection features. The intrinsic image decomposition algorithm is an image decomposition method that separates image brightness information into illumination and reflection components. Based on Retinex theory, it extracts low-frequency illumination components through smoothing filtering while preserving high-frequency reflection details, thus obtaining a reflection image that maintains structural stability under illumination changes, achieving a realistic restoration of surface features.

[0054] In one possible implementation, S3 specifically includes sub-steps S301 to S304: S301: Perform a logarithmic domain transformation on the cable region in the original surface image to obtain a logarithmic domain cable region image.

[0055] S302: Using a two-dimensional Gaussian kernel function, convolution processing is performed on the logarithmic domain cable region image to obtain the estimated illumination components of the logarithmic domain cable region image.

[0056]

[0057] in, This represents the coordinates of the logarithmic field cable region image. Estimated values ​​of illumination components at the location, This represents the coordinates of the logarithmic field cable region image. The two-dimensional Gaussian kernel function at that location, This indicates convolution processing. This represents the coordinates of the logarithmic field cable region image. The pixel grayscale value at that location, log() represents the logarithmic function. This indicates the coordinates of the cable region in the original surface image. The pixel grayscale value at that location, This indicates the coordinates of the cable region in the original surface image. Low-frequency light components at the location, This indicates the coordinates of the cable region in the original surface image. The high-frequency reflection component at that location.

[0058] S303: Determine the estimated value of the reflection component based on the estimated value of the illumination component.

[0059] S304: Based on the estimated reflection components, a two-dimensional surface reconstruction image is established through exponential operations.

[0060]

[0061] in, Represents the coordinates of a two-dimensional surface reconstruction image. The pixel grayscale value at that location, exp() represents the natural exponential function, Represents the coordinates of a two-dimensional surface reconstruction image. The estimated value of the reflection component at that location.

[0062] In this embodiment of the invention, steps S301 to S304 decouple the illumination and reflection components of the image through logarithmic domain transformation, extract the low-frequency illumination component by combining Gaussian kernel filtering, obtain the high-frequency reflection details through differential operation, and finally restore the image grayscale through exponential operation to construct a two-dimensional surface reconstruction image with strong illumination robustness and clear texture, effectively improving the identifiability and detection accuracy of cable defect areas under different illumination conditions.

[0063] S4: Combining the photometric stereo algorithm and the Frankot-Chellappa algorithm, a three-dimensional surface reconstruction image of the cable region is established based on each illuminated surface image.

[0064] It should be noted that the photometric stereo algorithm is a 3D reconstruction method based on images illuminated by multiple light sources. By analyzing the brightness variations of the same object under different lighting orientations, it solves for the surface gradient or normal vector of each pixel, thereby recovering the object's surface morphology and achieving the conversion from 2D brightness information to 3D structural information. The Frankot-Chellappa algorithm is a gradient integration algorithm used to convert discontinuous or non-integral consistent gradient fields into a consistent height field. This algorithm constrains the integrability of gradients in the frequency domain and uses Fourier transform or sine transform to solve the Poisson equation, thus smoothly reconstructing the surface height.

[0065] In one possible implementation, S4 specifically includes sub-steps S401 to S403: S401: Based on the cable region in each illuminated surface image, calculate the surface gradient of the cable region using a photometric stereo algorithm.

[0066] In one possible implementation, S401 specifically includes sub-steps S4011 to S4016: S4011: Establish the Lambert diffuse reflection model:

[0067]

[0068]

[0069]

[0070] in, ρ represents the pixel grayscale value of the image, E represents the irradiance of the light source, ρ represents the reflectance of the image surface, and cos represents the cosine function. This represents the angle between the unit light source vector and the unit normal vector. This represents the surface gradient of the gradient cable region along the x-direction. This represents the partial differential operator. Let φ represent the surface gradient of the cable region along the y-direction, φ represent the azimuth angle of the light source, sin represents the sine function, and θ represent the depression angle of the light source. Represents the unit normal vector. This represents the vector dot product operation. This represents the unit light source vector.

[0071] It should be noted that the Lambert diffuse reflection model is a model that describes the illumination law of an ideal diffuse reflective surface. It assumes that the intensity of the reflected light from the surface is proportional to the cosine of the incident angle and is independent of the viewing direction. It is often used in photometric solids and surface reflection modeling to establish the relationship between brightness, normal vector and light source direction.

[0072] S4012: Introduces a light source intensity correction coefficient to correct the Lambert diffuse reflection model.

[0073] in, I represents the pixel grayscale value of the corrected image. m =E represents the light intensity correction factor for the light source.

[0074] S4013: Establish the system of equations between the cable region in each illuminated surface image and the modified Lambert diffuse reflection model:

[0075] in, Indicates the azimuth angle of the light source 0. ° The pixel grayscale values ​​of the cable region in the surface image under illumination. Indicates the azimuth angle of the light source is 90°. ° The pixel grayscale values ​​of the cable region in the surface image under illumination. Indicates the azimuth angle of the light source is 180°. ° The pixel grayscale values ​​of the cable region in the surface image under illumination. This indicates the azimuth angle of the light source is 270°. ° The pixel grayscale values ​​of the cable region in the image of the illuminated surface.

[0076] S4014: Based on the equation set, sum the pixel gray values ​​of the cable region in each illuminated surface image to obtain the comprehensive pixel gray value.

[0077] S4015: Calculate the intermediate variable of the surface gradient in the cable area based on the comprehensive pixel grayscale value:

[0078]

[0079] in, This represents an intermediate variable representing the gradient of the cable region's surface in the x-direction. This represents the combined pixel grayscale value, and tan represents the tangent function. This represents an intermediate variable representing the gradient of the cable region surface in the y-direction.

[0080] S4016: Calculate the surface gradient of the cable region based on the intermediate variables of the surface gradient in the cable region: .

[0081] In this embodiment of the invention, steps S4011 to S4016 establish a modified Lambert diffuse reflection model and combine it with multi-directional illumination images to accurately calculate the gradients along the horizontal and vertical axes of the cable surface using a photometric stereo algorithm. This method eliminates the influence of different light source brightness by introducing a light intensity correction coefficient, constructs a symmetrical illumination equation system, and solves for intermediate gradient variables in the form of brightness differences, ultimately obtaining physically consistent and continuous surface gradient values. This step effectively suppresses uneven illumination and noise interference, achieving high-precision reconstruction of minute undulations on the cable surface, providing an accurate geometric basis for subsequent three-dimensional topography reconstruction and defect identification.

[0082] S402: Calculate the surface height of the cable area using the Frankot-Chellappa algorithm based on the surface gradient of the cable area.

[0083] In one possible implementation, S402 specifically includes sub-steps S4021 to S4028: S4021: Blur the surface gradient of the cable region into a symmetrical triangular fuzzy number.

[0084]

[0085] in, The gradient represents the surface gradient of the gradient cable region along the horizontal axis after blurring, and λ represents the scaling factor. This represents the surface gradient of the gradient cable region along the vertical axis after blurring, where k represents the scaling parameter, and σ represents the gradient. n σ represents the normalized standard deviation, σ represents the standard deviation of the surface gradient of the cable region, and max represents the maximum value.

[0086] S4022: Based on the symmetric triangular fuzzy number, establish the fuzzy Poisson equation:

[0087]

[0088] in, This represents the fuzzy height value located at coordinates (u+1, v). This represents fuzzy addition. This represents the fuzzy height value located at coordinates (u-1, v). This represents the fuzzy height value located at coordinates (u, v+1). This represents the fuzzy height value located at coordinates (u, v-1). This represents the generalized Hukuhara difference method. This represents the blur height value at coordinates (u,v), where h represents the distance between adjacent pixels. This represents the gradient divergence at coordinates (u,v). This represents the blurred surface gradient of the gradient cable region located at coordinates (u+1,v) along the horizontal axis. This represents the blurred surface gradient of the gradient cable region located at coordinates (u-1, v) along the horizontal axis. This represents the blurred surface gradient of the gradient cable region located at coordinates (u, v+1) along the vertical axis. This represents the blurred gradient cable region surface gradient along the vertical axis at coordinates (u, v-1).

[0089] S4023: The fuzzy Poisson equation is solved using the discrete sine transform algorithm to obtain the fuzzy height value.

[0090] in, This represents the fuzzy height value at coordinates (k,l) after the discrete sine transform, where π represents pi. represents the width of the 3D surface reconstruction image, and n represents the height of the 3D surface reconstruction image. denoted by , represents the gradient divergence at coordinates (k,l) after discrete sine transformation, and DST() represents the discrete sine transformation algorithm.

[0091] It should be noted that the Discrete Sine Transform (DST) algorithm is an orthogonal transform method that transforms spatial domain signals to the frequency domain. It decomposes the signal using a sinusoidal function basis and is commonly used for the rapid solution of the Poisson equation or image gradient fields, improving computational stability and eliminating boundary artifacts. The Discrete Sine Transform algorithm is existing technology and will not be elaborated upon here.

[0092] S4024: Calculate the upper bound, intermediate value, and lower bound of the fuzzy height value using the inverse discrete sine transform algorithm.

[0093] It should be noted that the Inverse Discrete Sine Transform (IDST) algorithm is the inverse process of the Discrete Sine Transform. By restoring the frequency domain signal to the spatial domain, it reconstructs the height field, surface, or image, ensuring that the reconstructed result is consistent with the original gradient or frequency characteristics. The Inverse Discrete Sine Transform algorithm is existing technology, and will not be described in detail here.

[0094] S4025: Calculate the local diffusivity based on the upper and lower bounds:

[0095]

[0096] Where spread represents local diffusion. This represents the upper bound of the fuzzy height value located at coordinates (u,v). This represents the lower bound of the fuzzy height value at coordinates (u,v), IDST() represents the inverse discrete sine transform algorithm, and z u,v This represents the median value of the fuzzy height at coordinates (u,v).

[0097] S4026: When the local diffusion degree is less than the first preset local diffusion degree, the intermediate value is determined as the surface height of the cable area.

[0098] S4027: When the local diffusion is greater than or equal to the first preset local diffusion and less than the second local diffusion, a weighting coefficient is introduced to weight the upper limit, intermediate value, and lower limit value to obtain the surface height of the cable area.

[0099] Where Z represents the surface height of the cable area, w l w represents the weighting coefficient of the lower bound value. m w represents the weighting factor of the median value. u This represents the weighting coefficient for the upper bound value.

[0100] S4028: When the local diffusion is greater than or equal to the second local diffusion, adjust the weighting coefficients and perform weighted processing on the upper bound, intermediate value, and lower bound to obtain the surface height of the cable area. .

[0101] Optionally, the first preset local diffusion degree and the second preset local diffusion degree are respectively as follows:

[0102]

[0103] Where T1 represents the first preset local diffusion degree, a1 and a2 both represent the basic preset local diffusion degree (a2>a1), α1 and α2 both represent the noise scaling factor (α2>α1), and T2 represents the second preset local diffusion degree.

[0104] In this embodiment of the invention, steps S4021 to S4028 introduce fuzzy trigonometric numbers to model the surface gradient, construct a fuzzy Poisson equation, and use discrete sine transform and inverse transform to solve for the fuzzy height value. Then, combined with local diffusion partitioning judgment and weighted defuzzification strategy, robust integration of noisy gradient fields is achieved, effectively suppressing abnormal interference and edge artifacts, and improving the accuracy and continuity of the 3D reconstructed height map.

[0105] S403: Create a 3D surface reconstruction image based on the surface height of the cable area.

[0106] Specifically, based on the surface height of the cable area, the height value is mapped to a set of three-dimensional coordinate points using the spatial positional relationship of each pixel coordinate. By interpolating and meshing adjacent height points in the horizontal and vertical directions, a three-dimensional surface model containing vertex information and normal vectors is constructed, thereby forming a complete three-dimensional surface reconstruction image of the cable area to realistically reflect the undulating shape and defect structure characteristics of the cable surface.

[0107] In this embodiment of the invention, steps S401 to S403 combine the photometric stereo algorithm and the Frankot-Chellappa algorithm to first estimate the surface gradient of the cable region based on the difference in image brightness under different light source orientations, and then solve the continuous and consistent surface height through frequency domain integration. Finally, a three-dimensional surface reconstruction image that truly reflects the undulating shape and defect structure characteristics of the cable surface is constructed, thereby improving the spatial expressiveness and geometric recognition accuracy of defect detection.

[0108] S5: Perform gamma correction on the 2D surface reconstruction image to obtain a gamma-corrected image.

[0109] In this embodiment of the invention, by performing gamma correction on the two-dimensional surface reconstruction image, dark details can be enhanced, bright interference can be suppressed, and the overall contrast and structural clarity of the image can be improved, providing better input for subsequent image fusion and defect detection.

[0110] S6: Calculate the curvature of the 3D surface reconstruction image to obtain a curvature image.

[0111] In one possible implementation, S6 specifically includes sub-steps S601 to S604: S601: Calculate the first and second partial derivatives of the 3D surface reconstruction image, respectively:

[0112]

[0113] Where P represents the first-order partial derivative along the horizontal axis, Q represents the first-order partial derivative along the vertical axis, and Z... uu Z represents the second-order partial derivative along the horizontal axis. vv Z represents the second-order partial derivative along the vertical axis. uv This represents the second-order partial derivative along the mixing direction.

[0114] S602: Calculate the Gaussian curvature value and the mean curvature value based on the first and second partial derivatives, respectively:

[0115] Among them, K G H represents the Gaussian curvature value, and H represents the mean curvature value.

[0116] S603: Weight the Gaussian curvature values ​​and the average curvature values ​​to obtain the initial curvature image:

[0117] Where K(u,v) represents the pixel value at coordinates (u,v) in the initial curvature image, and α represents the weighting coefficient of the Gaussian curvature value. K represents taking the absolute value. G (u,v) represents the Gaussian curvature value at coordinates (u,v) in the 3D surface reconstruction image, β represents the weighting coefficient of the average curvature value, and H(u,v) represents the average curvature value at coordinates (u,v) in the 3D surface reconstruction image.

[0118] S604: Perform maximum and minimum value normalization on the initial curvature image to obtain the curvature image.

[0119] In this embodiment of the invention, steps S601 to S604 calculate the first and second partial derivatives of the reconstructed three-dimensional surface image to extract surface gradient change information, thereby obtaining the Gaussian curvature and average curvature. These are then fused in a weighted manner to generate an initial curvature image. Finally, after maximum and minimum value normalization processing, a stable and visually enhanced curvature image is obtained. This method effectively reflects the geometric anomalies such as the unevenness of the cable surface, enhances the response of defect areas, and provides high-precision structural feature support for subsequent image fusion and defect detection.

[0120] S7: The gamma-corrected image and the curvature image are fused using a wavelet transform fusion algorithm to obtain a fused image.

[0121] It should be noted that wavelet transform fusion algorithm is an image fusion method based on multi-scale decomposition. It decomposes the input image into low-frequency approximation components and high-frequency detail components using wavelet decomposition. Then, it fuses these components based on feature saliency, adaptive weights, or energy criteria. Finally, it reconstructs the fused image through inverse wavelet transform, thereby enhancing edge and texture details while maintaining overall brightness consistency, achieving effective complementarity between illumination information and shape features. Wavelet transform fusion algorithm is existing technology, and will not be elaborated upon here.

[0122] In this embodiment of the invention, the gamma-corrected image and the curvature image are fused by the wavelet transform fusion algorithm, which effectively combines illumination reflection and geometric features, improves the expressive ability of defect edges and textures, and provides a more discriminative high-quality input image for subsequent detection.

[0123] Reference manual attached Figure 2 The diagram shows a structural schematic of an improved YOLOv8 model provided in an embodiment of the present invention.

[0124] It should be noted that the instruction manual includes... Figure 2In this context, the CBS module is a basic feature extraction unit composed of convolutional layers (Conv), batch normalization layers (Batch Normalization), and activation functions (SiLU) in sequence. It effectively enhances the nonlinear expressive power of the model and accelerates network convergence. Backbone refers to the backbone network. The Dynamic Kernel Selection (DySK) module is an adaptive convolution mechanism that dynamically selects convolutional kernels of different scales for weighted fusion based on the input feature content, thereby improving structural flexibility and context awareness in multi-scale feature extraction. The Fast Spatial Pyramid Pooling (SPPF) module is a multi-scale context fusion structure that extracts multi-level spatial information through parallel operations of pooling kernels of different sizes, enhancing global feature awareness with lower computational overhead. Neck refers to the neck network. Upsampling is a spatial scale restoration operation that enlarges the feature map size through interpolation or deconvolution to restore high-resolution details and facilitate subsequent feature stitching. The feature concatenation layer (Concat) is used to concatenate feature maps from different levels or channels along the channel dimension to fuse shallow texture information and deep semantic information, thereby improving detection accuracy and contextual representation ability. The Gradient fusion module (GRF) is a feature fusion structure that achieves multi-path propagation of gradient information through a combination of multi-branch convolutions, bottlenecks, and concatenation units, enhancing the model's training stability and fine-grained feature alignment ability. The Head refers to the detection head network. The detection head is the model's output module, used for classification and regression prediction of multi-scale features, outputting target category, confidence score, and bounding box parameters to identify the location and type of cable surface defects. The CBS module, fast spatial pyramid pooling module, upsampling layer, feature concatenation layer, and detection head are all existing network structures, and will not be elaborated upon here.

[0125] S8: Using the improved YOLOv8 model, perform defect detection on the fused image and output the surface defect detection results of the cable to be detected.

[0126] It should be noted that the improved YOLOv8 model is a real-time object detection algorithm based on deep convolutional neural networks. By introducing a dynamic kernel selection module, a dynamic convolutional kernel attention module, and a gradient fusion module into the original YOLOv8 model, it improves the adaptability of feature extraction and the ability to fuse multi-scale information. While maintaining detection speed, this model enhances the accuracy of identifying small targets and subtle defects, possesses stronger feature representation capabilities and robustness, and is suitable for cable surface defect detection tasks under complex lighting and texture conditions.

[0127] In one possible implementation, the improved YOLOv8 model specifically includes: a backbone network, a neck network, and a detection head network; Reference manual attached Figure 3 The diagram shows a structural schematic of a dynamic core selection module provided in an embodiment of the present invention.

[0128] It should be noted that the instruction manual includes... Figure 3 In this architecture, the feature segmentation layer (Split) decomposes the input feature map into multiple sub-feature blocks according to channel or spatial dimensions, enabling independent extraction of local features or selective processing by the subsequent attention module. The Dynamic Convolutional Kernel Attention Module (DyKA) is a feature enhancement unit combining dynamic convolution and attention mechanisms. By adaptively adjusting the convolutional kernel weights and combining spatial and channel attention, it achieves efficient capture of key features and redundancy suppression. The feature segmentation layer is an existing network structure and will not be elaborated upon here.

[0129] The backbone network includes: a first CBS module, a second CBS module, a first dynamic core selection module, a third CBS module, a second dynamic core selection module, a fourth CBS module, a third dynamic core selection module, a fifth CBS module, a fourth dynamic core selection module, and a fast spatial pyramid pooling module, connected in sequence. Reference manual attached Figure 4 The diagram shows a schematic of the structure of a dynamic convolution kernel attention module provided in an embodiment of the present invention.

[0130] It should be noted that the instruction manual includes... Figure 4 In this deep neural network, the convolutional layer (Conv) is the core operational unit. It extracts local receptive field features by sliding the convolutional kernel across the feature map, used to identify edges, textures, and structural information in images. The Large Separable Kernel Attention Module (LSKA) is an attention structure combining a large convolutional kernel and separable convolution. It can achieve wide-domain feature aggregation with lower computational complexity, thereby improving the joint perception of long-range dependencies and detailed features. The feature fusion layer (Add) is used to element-wise weighted or summed the outputs of multiple feature branches, achieving effective integration of features at different scales and channels, and balancing gradient backpropagation. The convolutional layer, the Large Separable Kernel Attention Module, and the feature fusion layer are all existing network structures, and will not be described in detail here.

[0131] Optionally, the dynamic kernel selection module includes: an eighth CBS module, a first feature segmentation layer, multiple dynamic convolutional kernel attention modules, a fifth feature concatenation layer, and a ninth CBS module connected in sequence. The fifth feature concatenation layer is also connected to the first feature segmentation layer and each of the dynamic convolutional kernel attention modules.

[0132] In this embodiment of the invention, the dynamic kernel selection module introduces feature segmentation, multiple dynamic convolutional kernel attention paths, and a multi-branch fusion structure, enabling the network to adaptively select convolutional kernel paths. This module can dynamically adjust the feature extraction strategy based on the local content of the input feature map, enhancing its ability to distinguish small targets, detailed textures, and complex backgrounds. Simultaneously, through the integration and unified compression of multi-path features, it effectively improves the model's feature expression efficiency and anti-interference performance, providing high-quality deep semantic support for subsequent defect detection.

[0133] Furthermore, the dynamic convolutional kernel attention module includes a first convolutional layer, a second convolutional layer, a large separable kernel attention module, and a feature fusion layer connected in sequence, wherein the feature fusion layer is also connected to the second convolutional layer.

[0134] In this embodiment of the invention, the dynamic convolutional kernel attention module significantly enhances the model's ability to focus on salient feature regions by introducing two-stage convolutional feature extraction, a highly separable kernel attention mechanism, and a feature residual fusion structure. This module not only adaptively adjusts the response weights of the convolutional kernel to different spatial regions and channel features, but also effectively suppresses background redundancy while enhancing the expression of detailed features. This design enables the model to possess stronger fine-grained recognition capabilities and anti-interference capabilities when facing cable surface defect detection tasks, making it particularly suitable for defect recognition scenarios with low contrast, small targets, and complex texture backgrounds.

[0135] Reference manual attached Figure 5 The diagram shows a schematic representation of a gradient fusion module provided in an embodiment of the present invention.

[0136] It should be noted that the instruction manual includes... Figure 5 In this paper, the bottleneck module is a lightweight residual structure that uses a combination of 1×1 and 3×3 convolutions to achieve channel compression and feature extraction. This effectively reduces the number of parameters and enhances the network's depth propagation capability while maintaining model accuracy. The bottleneck module is an existing network structure, and will not be described in detail here.

[0137] The neck network comprises: a first upsampling layer, a first feature splicing layer, a first gradient fusion module, a second upsampling layer, a second feature splicing layer, a second gradient fusion module, a sixth CBS module, a third feature splicing layer, a third gradient fusion module, a seventh CBS module, a fourth feature splicing layer, and a fourth gradient fusion module connected in sequence. The first upsampling layer is connected to the fast spatial pyramid pooling module. The first feature splicing layer is also connected to the third dynamic kernel selection module. The second feature splicing layer is also connected to the second dynamic kernel selection module. The third feature splicing layer is also connected to the first gradient fusion module. The fourth feature splicing layer is also connected to the fast spatial pyramid pooling module. Optionally, the gradient fusion module includes: a third convolutional layer, a second feature segmentation layer, a first bottleneck module, a third feature segmentation layer, a second bottleneck module, a sixth feature concatenation layer, and a fourth convolutional layer connected in sequence.

[0138] Furthermore, when the first bottleneck module enables residual connections (Shortcut=True), the output and input of the first bottleneck module are concatenated through the seventh feature concatenation layer, and the concatenation result is input to the third feature segmentation layer. When the first bottleneck module does not enable residual connections (Shortcut=False), the output of the first bottleneck module is directly input to the third feature segmentation layer.

[0139] Furthermore, when the second bottleneck module enables residual connections (Shortcut=True), the output and input of the second bottleneck module are concatenated through the eighth feature concatenation layer, and the concatenation result is input to the sixth feature concatenation layer. When the second bottleneck module does not enable residual connections (Shortcut=False), the output of the second bottleneck module is directly input to the sixth feature concatenation layer.

[0140] It should be noted that when the input and output of the bottleneck module have consistent spatial dimensions and number of channels, residual connections can be enabled to achieve element-wise addition of the input and output, thereby enhancing feature propagation and gradient stability. When the input and output of the bottleneck module do not have consistent spatial dimensions and number of channels, residual connections should not be enabled to avoid dimensionality mismatch or feature interference, ensuring network structure stability and the effectiveness of information fusion.

[0141] Furthermore, the gradient fusion module also includes a third bottleneck module and a fourth bottleneck module. The input of the third bottleneck module is the same as the input of the first bottleneck module, and the input of the fourth bottleneck module is the same as the input of the second bottleneck module. Neither the third bottleneck module nor the fourth bottleneck module has residual connections enabled.

[0142] Furthermore, the sixth feature splicing layer is also connected to the second feature segmentation layer, the third bottleneck module, the third feature segmentation layer, and the fourth bottleneck module, respectively.

[0143] In this embodiment of the invention, the gradient fusion module achieves deep fusion of mid-to-high-level semantic features and detailed structures by introducing a multi-path bottleneck structure, a feature segmentation and splicing mechanism, and a controllable residual connection strategy. Through lightweight feature compression by the bottleneck module and effective information supplementation by the residual paths, the stability and semantic consistency of feature transmission are significantly enhanced. The multi-source splicing structure further improves the model's ability to perceive multi-scale and multi-texture information, resulting in stronger representational capabilities and higher defect detection accuracy in the final fused features, making it particularly suitable for complex detection scenarios such as discontinuous textures and uneven illumination.

[0144] The detection head network includes a first detection head, a second detection head, and a third detection head. The first detection head is connected to the second gradient fusion module, the second detection head is connected to the third gradient fusion module, and the third detection head is connected to the fourth gradient fusion module.

[0145] In this embodiment of the invention, the YOLOv8 target detection model is structurally optimized by introducing a dynamic kernel selection module, a dynamic convolution kernel attention module, and a gradient fusion module. This significantly enhances the flexibility of feature extraction, the ability to fuse multiple scales, and the detection accuracy for small targets. The improved YOLOv8 model can accurately detect small, shallow, and edge-type cable surface defects under complex lighting conditions. While ensuring detection speed, it improves the model's generalization ability and robustness, effectively meeting the high-precision and high-efficiency requirements of industrial cable inspection.

[0146] Reference manual attached Figure 6 The diagram shows a schematic of the cable surface defect detection results provided by an embodiment of the present invention.

[0147] like Figure 6 As shown, Figure 6 (a) shows the detection results of the crack defect. Figure 6 (b) shows the detection results of the scratch defect. Figure 6 (c) shows the detection results of the pitting defect. Figure 6 (d) shows the detection results when cracks, scratches, and pits coexist. The English characters above the detection boxes indicate the corresponding defect types, and the numerical values ​​above the detection boxes indicate the detection confidence of the improved YOLOv8 model for the corresponding defects. Specifically, Crack represents a crack defect, Scratch represents a scratch defect, and Pit represents a pit defect.

[0148] Combining step S8, the fused image is used to extract features, classify defects, and regress their locations using an improved YOLOv8 model, yielding information on the cable surface defect categories, detection confidence, and bounding box locations. For example... Figure 6As shown in (a) to (c), for a single type of defect, the improved YOLOv8 model can determine the corresponding defect region. Figure 6 As shown in (d), when cracks, scratches and pits exist on the same cable surface at the same time, the improved YOLOv8 model can output the detection box, defect category and detection confidence level corresponding to each defect, so as to distinguish and locate the surface defects of multiple types of cables.

[0149] Reference manual attached Figure 7 The diagram shows a structural schematic of a cable image defect detection system provided in an embodiment of the present invention.

[0150] This invention provides a cable image defect detection system 20, including: a processor 201 and a memory 202; The memory 202 stores programs or instructions that can run on the processor 201. When the program or instructions are executed by the processor 201, they implement the steps of the above-described cable image defect detection method and achieve the same technical effect. To avoid repetition, the present invention will not elaborate further.

[0151] It should be understood that the processor 201 in this embodiment of the invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0152] It should also be understood that the memory 202 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting defects in cable images, characterized in that, include: S1: Acquire the original surface image of the cable to be inspected and multiple illuminated surface images under the same light source depression angle but different light source azimuth angles; S2: Segment the cable regions in the original surface image and each of the illuminated surface images; S3: Combining the logarithmic domain transformation algorithm and the intrinsic image decomposition algorithm, a two-dimensional surface reconstruction image based on the cable region in the original surface image is established; S4: Combining the photometric stereo algorithm and the Frankot-Chellappa algorithm, a three-dimensional surface reconstruction image of the cable region is established based on each of the aforementioned illuminated surface images; S5: Perform gamma correction on the reconstructed two-dimensional surface image to obtain a gamma-corrected image; S6: Perform curvature calculation on the three-dimensional surface reconstruction image to obtain a curvature image; S7: The gamma-corrected image and the curvature image are fused using a wavelet transform fusion algorithm to obtain a fused image; S8: Using the improved YOLOv8 model, perform defect detection on the fused image and output the surface defect detection results of the cable to be detected.

2. The cable image defect detection method according to claim 1, characterized in that, The specific methods for dividing the cable area include: S201: Perform grayscale processing on the surface image to obtain a grayscale surface image; S202: The grayscale surface image is enhanced by a local grayscale contrast enhancement algorithm to obtain a grayscale enhanced surface image; S203: Normalize the grayscale enhanced surface image to obtain a normalized grayscale enhanced surface image; S204: The normalized grayscale enhanced surface image is segmented using the maximum correlation threshold segmentation algorithm to obtain the cable region.

3. The cable image defect detection method according to claim 2, characterized in that, S204 specifically includes: S2041: Traverse all pixels in the normalized grayscale enhanced surface image, determine the occurrence frequency of each grayscale level, and calculate the occurrence probability of each grayscale level based on the occurrence frequency. S2042: Integrate the occurrence probabilities of each gray level to construct a probability set; S2043: Set the range of candidate segmentation threshold values, and divide the probability set according to the candidate segmentation threshold to obtain a foreground-related subset and a background-related subset; S2044: Calculate the foreground correlation function value based on the foreground correlation subset; S2045: The foreground correlation function values ​​are weighted to obtain the weighted objective function values; S2046: Traverse the candidate segmentation thresholds within the range of values, and determine the candidate segmentation threshold corresponding to the maximum weighted objective function value as the optimal segmentation threshold; S2047: Segment the pixel regions in the normalized grayscale enhanced surface image where the pixel grayscale value is less than the optimal segmentation threshold into the cable region, and segment the pixel regions in the normalized grayscale enhanced surface image where the pixel grayscale value is greater than or equal to the optimal segmentation threshold into the background region.

4. The cable image defect detection method according to claim 1, characterized in that, S3 specifically includes: S301: Perform a logarithmic domain transformation on the cable region in the original surface image to obtain a logarithmic domain cable region image; S302: Using a two-dimensional Gaussian kernel function, the logarithmic domain cable region image is convolved to obtain the estimated value of the illumination component of the logarithmic domain cable region image; S303: Determine the estimated value of the reflection component based on the estimated value of the illumination component; S304: Based on the estimated values ​​of the reflection components, the two-dimensional surface reconstruction image is established through exponential operations.

5. The cable image defect detection method according to claim 1, characterized in that, S4 specifically includes: S401: Based on the cable region in each of the aforementioned illuminated surface images, calculate the surface gradient of the cable region using the photometric stereo algorithm; S402: Calculate the surface height of the cable region using the Frankot-Chellappa algorithm based on the surface gradient of the cable region. S403: Based on the surface height of the cable area, establish the three-dimensional surface reconstruction image.

6. The cable image defect detection method according to claim 5, characterized in that, Specifically, S401 includes: S4011: Establish the Lambert diffuse reflection model; S4012: Introduce a light source intensity correction coefficient to correct the Lambert diffuse reflection model; S4013: Establish a set of equations between the cable region in each of the aforementioned illuminated surface images and the modified Lambert diffuse reflection model; S4014: Based on the set of equations, sum the pixel gray values ​​of the cable region in each of the illuminated surface images to obtain a comprehensive pixel gray value; S4015: Calculate the intermediate variable of the surface gradient of the cable area based on the comprehensive pixel grayscale value; S4016: Calculate the surface gradient of the cable region based on the intermediate variable of the surface gradient of the cable region.

7. The cable image defect detection method according to claim 5, characterized in that, Specifically, S402 includes: S4021: Blur the surface gradient of the cable region into a symmetrical triangular fuzzy number; S4022: Based on the aforementioned symmetrical triangular fuzzy number, establish the fuzzy Poisson equation; S4023: Solve the fuzzy Poisson equation using the discrete sine transform algorithm to obtain the fuzzy height value; S4024: Calculate the upper bound, intermediate value, and lower bound of the fuzzy height value using the inverse discrete sine transform algorithm; S4025: Calculate the local diffusion based on the upper and lower bound values; S4026: When the local diffusion degree is less than the first preset local diffusion degree, the intermediate value is determined as the surface height of the cable area; S4027: When the local diffusion is greater than or equal to the first preset local diffusion and less than the second local diffusion, a weighting coefficient is introduced to weight the upper limit value, the middle value and the lower limit value to obtain the surface height of the cable area. S4028: When the local diffusion degree is greater than or equal to the second local diffusion degree, adjust the size of the weighting coefficient, and perform weighted processing on the upper limit value, the middle value and the lower limit value to obtain the surface height of the cable area.

8. The cable image defect detection method according to claim 1, characterized in that, S6 specifically includes: S601: Calculate the first-order partial derivative and the second-order partial derivative of the three-dimensional surface reconstruction image respectively; S602: Calculate the Gaussian curvature value and the mean curvature value based on the first-order partial derivative and the second-order partial derivative, respectively; S603: Weight the Gaussian curvature value and the average curvature value to obtain an initial curvature image; S604: Perform maximum and minimum value normalization processing on the initial curvature image to obtain the curvature image.

9. The cable image defect detection method according to claim 1, characterized in that, The improved YOLOv8 model specifically includes: a backbone network, a neck network, and a detection head network; The backbone network includes: a first CBS module, a second CBS module, a first dynamic core selection module, a third CBS module, a second dynamic core selection module, a fourth CBS module, a third dynamic core selection module, a fifth CBS module, a fourth dynamic core selection module, and a fast spatial pyramid pooling module, connected in sequence. The neck network comprises: a first upsampling layer, a first feature splicing layer, a first gradient fusion module, a second upsampling layer, a second feature splicing layer, a second gradient fusion module, a sixth CBS module, a third feature splicing layer, a third gradient fusion module, a seventh CBS module, a fourth feature splicing layer, and a fourth gradient fusion module connected in sequence. The first upsampling layer is connected to the fast spatial pyramid pooling module. The first feature splicing layer is also connected to the third dynamic kernel selection module. The second feature splicing layer is also connected to the second dynamic kernel selection module. The third feature splicing layer is also connected to the first gradient fusion module. The fourth feature splicing layer is also connected to the fast spatial pyramid pooling module. The detection head network includes a first detection head, a second detection head, and a third detection head. The first detection head is connected to the second gradient fusion module, the second detection head is connected to the third gradient fusion module, and the third detection head is connected to the fourth gradient fusion module.

10. A cable image defect detection system, characterized in that, include: Processor and memory; The memory stores programs or instructions that can run on the processor, which, when executed by the processor, implement the steps of the cable image defect detection method as described in any one of claims 1 to 9.