An automatic detection method for cable surface defects based on image processing
Through the segmentation of the cable image, the dynamic adjustment of the filter threshold parameter solves the authenticity problem of the traditional filter algorithm due to a fixed threshold parameter, and achieves more efficient defect detection accuracy.
Patent Information
- Application Number
- CN202411458975.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-18
AI Technical Summary
The traditional BM3D filtering algorithm affects the image authenticity due to the fixed filter threshold parameters, which reduces the accuracy of cable surface defect detection.
By dividing the cable image into multiple blocks of the same size, calculating the pixel level and noise level of each block, dynamically adjusting the filtering threshold parameters, and correcting them according to the content complexity, adaptive filtering is achieved.
It improves the precision of image processing, enhances the accuracy and reliability of defect detection, and can more accurately remove noise and retain image details.
Smart Images

Figure CN119006445B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an automatic detection method for cable surface defects based on image processing. Background Art
[0002] Defects on the cable surface, such as scratches, cracks, corrosion, etc., may cause damage to the insulation layer, and then cause electrical faults such as short circuits and arc discharges. These faults will not only damage the cable itself, but may also cause fires or electric shock accidents, posing a serious threat to personnel and equipment. Therefore, it is of great significance to perform defect detection on the cable surface. Through defect detection, surface defects can be discovered and repaired in a timely manner to prevent further deterioration of the defects, thereby extending the service life of the cable.
[0003] Before detecting cable surface defects, images need to be collected first. When using drones to take photos of cables outdoors, there is a lot of noise in the photos due to weather, light changes or electromagnetic interference, which will affect our recognition speed and accuracy of cable surface defects. Therefore, using image filtering technology to remove noise and interference in the image and retain useful image information is an important prerequisite for ensuring the accuracy of cable surface defect detection.
[0004] The traditional BM3D (three-dimensional block matching) filtering algorithm is a common filtering denoising algorithm. During the filtering process, a global filtering threshold parameter is used to balance image details and noise. For example, the existing Chinese patent application document with publication number CN108171768A discloses a low-dose CBCT image reconstruction method based on BM3D, the purpose of which is to obtain high-quality CT reconstructed images through denoising. The implementation steps include: (1) using a cone-beam CT device to collect low-dose projection data; (2) performing linear transformation on the low-dose projection data; (3) performing BM3D filtering denoising on the transformed low-dose projection data; (4) performing linear inverse transformation on the result of step (3) to obtain denoised projection data; (5) performing FDK reconstruction on the filtered low-dose projection data to obtain a low-dose CBCT image.
[0005] Although the BM3D filtering algorithm used in the above scheme can remove noise from the image, due to the large changes in lighting conditions in outdoor environments, the brightness and contrast of different areas vary significantly. This filtering algorithm usually uses fixed filtering threshold parameters to process the entire image, which can easily cause details in certain areas to be over-smoothed or residual noise, affecting the authenticity of the image and thereby reducing the accuracy of subsequent defect detection. Summary of the invention
[0006] In order to solve the problem that the fixed filtering threshold parameters of the traditional BM3D filtering algorithm affect the image authenticity and reduce the accuracy of defect detection, the present invention proposes an automatic detection method for cable surface defects based on image processing, comprising:
[0007] The collected cable image is divided into multiple blocks of the same size, and the average deviation between the grayscale value of all pixels in each block and the grayscale mean is calculated, and the inverse of the average deviation is used as the pixel level of the block; the pixel level is used to reflect the consistency of the grayscale value of the pixels in the block;
[0008] Determine the similarity between each block and its adjacent blocks according to the size of the area difference between the block and its adjacent blocks, use the inverse of the weighted average of the similarities by using the pixel levels of the adjacent blocks as the noise level of the block, and determine the filtering threshold parameter of the block based on the noise level of each block, wherein the filtering threshold parameter is positively correlated with the noise level;
[0009] The ratio of the number of edge pixels in each block to the block is taken as the edge density of the block. The edge pixels of each block are mapped to the Hough space. The maximum number of votes of these edge pixels in the Hough space is counted. The maximum value is taken as the straight line strength of the block. The square sum of the edge density and the straight line strength of each block is taken as the content complexity of the block.
[0010] The filter threshold parameters of each block are corrected according to the content complexity of the block. The direction of correction is downward, and the degree of correction is positively correlated with the complexity of the content. Adaptive filtering is performed based on the corrected filter threshold parameters of all blocks, and defect detection is performed based on the filtered image to identify defects on the cable surface.
[0011] This technical solution divides the image into blocks, which reflects the local features of the image. The features of each block are processed independently to improve the accuracy of the analysis. The calculated pixel level of each block reflects the consistency of the grayscale values of the pixels in the block. The higher the pixel level, the more consistent the grayscale values of the pixels in the block, and the better the image quality. Conversely, the lower the pixel level, the greater the difference in the grayscale values of the pixels in the block, and there may be more noise or details. The similarity between each block and its adjacent blocks is evaluated by comparing the area difference between them, and the noise level is determined by combining the pixel levels of the adjacent blocks. If the similarity between a block and its adjacent blocks is higher and the pixel level of the adjacent blocks is higher, it means that the noise level of the block is lower, and vice versa. This can more accurately evaluate the noise situation of each block. The higher the noise level, the higher the filter threshold parameter, which can more effectively remove noise; the lower the noise level, the lower the filter threshold parameter, so as to retain more details. This adaptive method can better balance the relationship between denoising and fidelity. By calculating the ratio of the number of edge pixels in each block to the total number of pixels, the edge features of the block are evaluated. The higher the edge density, the more edge features there are in the block, and the more complex the image content is; conversely, the lower the edge density, the fewer edge features there are in the block, and the simpler the image content is. The edge pixels are mapped to the Hough space using the Hough transform, and the maximum number of votes of these edge pixels in the Hough space is counted to evaluate the straight line features in the block. The higher the straight line strength, the more obvious straight line features there are in the block; conversely, the lower the straight line strength, the fewer straight line features there are in the block. The straight line strength can reflect the structural features in the block. Considering the edge density and straight line strength comprehensively, the content complexity of each block is evaluated. The higher the content complexity, the more edge features and straight line features there are in the block, and the more complex the image content is; conversely, the lower the content complexity, the fewer edge features and straight line features there are in the block, and the simpler the image content is. Blocks with high content complexity usually contain more details and structural features, so lower filter threshold parameters are required to retain these details. Blocks with low content complexity can use higher filter threshold parameters to more effectively remove noise. This adaptive adjustment can better balance the relationship between denoising and fidelity. Through adaptive filtering processing, noise can be removed more effectively and image details can be retained, thereby improving the accuracy and reliability of defect detection, and ultimately being able to more accurately identify defects on the cable surface.
[0012] Preferably, the modified filtering threshold parameter satisfies the following relationship:
[0013]
[0014] In the formula, For the The filter threshold parameters after block correction, No. The filtering threshold parameters of each block, is the normalization function, For the The content complexity of each block, and = , For the The edge density of each block, For the This technical solution dynamically adjusts the filter threshold parameters of each block according to the content complexity of the block, so that a lower filter strength is used in complex areas with high edge density and line strength, thereby better preserving image details. The normalization function ensures that the adjusted filter threshold parameters are within a reasonable range, avoiding the problem of over-smoothing or residual noise. This adaptive filtering method improves the fineness of image processing and enhances the accuracy and reliability of defect detection.
[0015] Preferably, the filtering threshold parameter satisfies the following relationship:
[0016]
[0017] In the formula, For the The filtering threshold parameters of each block, For the The noise level of each block, This technical solution constructs a nonlinear mapping relationship between the noise level mapping and the filter threshold parameter, ensuring that a higher filter strength is used in high-noise areas to effectively remove noise, while a lower filter strength is used in low-noise areas to retain more details. This nonlinear mapping can smoothly adjust the filter strength and avoid image distortion caused by mutations.
[0018] Preferably, the adaptive filtering adopts Filtering algorithm.
[0019] Preferably, the noise level satisfies the following relationship:
[0020]
[0021] In the formula, For the The noise level of each block, For the The block and its The similarity of adjacent blocks, For the The pixel level of adjacent blocks, for The reciprocal of For the The average deviation between the grayscale value of all pixels in adjacent blocks and the grayscale mean, is the total number of adjacent blocks, is the sequence number of adjacent blocks, Take all All integers in the range. This technical solution uses the pixel levels of the adjacent blocks of each block as weights, and performs weighted average of the similarities between each block and its adjacent blocks to determine the noise level of each block. This noise level calculation method based on local similarity and pixel level can more accurately reflect the noise distribution in the image.
[0022] Preferably, the calculation formula for the average deviation between the grayscale values of all pixels in each block and the grayscale mean is:
[0023]
[0024] In the formula, For the The average deviation between the grayscale value of all pixels in a block and the grayscale mean, The block is located at Line The grayscale value of the pixel in the column, and y are the number of rows and columns of the block respectively, For the The grayscale mean of all pixels in a block, is the length of the block, This technical solution quantifies the consistency of the grayscale values of pixels in each block by calculating the average deviation between the grayscale values of all pixels in each block and the grayscale mean, thus providing a basis for the evaluation of noise level and image quality.
[0025] Preferably, the method for defect detection based on filtered images is as follows: a large number of labeled cable images are collected in advance, including images of normal cables and images of cables with various defects, and these images are used as training sets; The model is trained. The model establishes a decision boundary by learning the feature differences between normal images and defective images to distinguish between normal images and defective images; the filtered image is input into the trained In the model, The model classifies and identifies the input image and outputs whether the image contains defects. This technical solution combines the advantages of image preprocessing and machine learning, significantly improving the efficiency and reliability of cable surface defect detection.
[0026] Preferably, the method for determining the similarity between each block and its adjacent blocks is as follows: obtain the grayscale histogram of each block and its adjacent blocks, and perform curve fitting on the grayscale histogram to obtain the respective grayscale fitting curves, wherein the horizontal axis of the grayscale fitting curve is different grayscale values, and the vertical axis is the number of pixels contained in each grayscale value; obtain the area enclosed by the grayscale fitting curve of each block and the horizontal axis, and the area enclosed by the grayscale fitting curve of its adjacent blocks and the horizontal axis; and take the inverse of the difference between the two areas as the similarity between the block and its adjacent blocks. This technical solution can effectively quantify the difference in grayscale distribution between two blocks, and a smaller area difference means a higher similarity, thereby more accurately reflecting the consistency of the local area of the image.
[0027] Preferably, defect detection based on the filtered image also includes: if there are defects in the filtered image, triggering an early warning mechanism to remind relevant staff to deal with the defects on the cable surface in a timely manner
[0028] The present invention has the following effects:
[0029] The present invention divides the image into blocks, evaluates the noise level of each block, sets a suitable filter threshold parameter according to the noise level, the higher the noise level, the higher the filter threshold parameter, calculates the edge density and straight line strength of the block, combines the two to obtain the content complexity of the block, and modifies the filter threshold parameter of each block according to the content complexity, thereby optimizing the image quality. The process of filtering and denoising can more accurately remove noise and retain image details through adaptive filtering processing, and defect detection is performed based on the filtered image, thereby improving the accuracy and reliability of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0031] Figure 1 It is a schematic flow chart of the method of the present invention. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0033] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0034] Reference Figure 1 , a cable surface defect automatic detection method based on image processing, including steps S1 to S5, specifically as follows:
[0035] S1: Collect the image of the cable, divide it into multiple blocks of the same size, and evaluate the pixel level of each block.
[0036] Since cables are usually assumed to be high outdoors, drones are used for image acquisition in this step. Before the drone flies, a detailed on-site survey is conducted to understand the direction, distribution and surrounding environment of the cables, and to record factors that may affect the flight of the drone, such as tall buildings, trees, and telephone poles. A detailed flight route is developed using professional drone route planning software, such as Pix4DMapper and DroneDeploy. According to the results of the on-site survey, parameters such as flight altitude, speed, and photo points are set. It is usually recommended that the flight altitude be 50-100 meters to ensure that the cable details can be clearly captured while avoiding being too close to ground obstacles. The data acquisition frequency is set to 1Hz, that is, one image is collected per second. The implementer can adjust the frequency appropriately according to actual needs, and finally multiple cable images are collected. Each cable image corresponds to a cable in a different position. Each cable image needs to be filtered and denoised before performing defect detection to ensure the comprehensiveness of the detection. Therefore, subsequent operations are performed on each cable image.
[0037] The BM3D filtering algorithm is particularly suitable for processing complex textures and edges. When using this filtering algorithm to process cable images, the traditional method is to set a fixed filtering threshold parameter for the entire image. This operation is easily affected by the lighting conditions in the environment. For example, assuming that a section of the cable is under direct sunlight and another section of the cable is in the shadow, the fixed filtering threshold parameter will easily blur the details in the shadow during filtering. In high-brightness areas, noise is easily amplified, and the fixed filtering threshold parameter is not enough to completely remove the noise, resulting in residual noise. These situations will lead to poor filtering effects and affect the authenticity of the image.
[0038] Therefore, in this step, for each cable image, its size is obtained, the length is represented by len, and the width is represented by d, and the image is divided into blocks, which are equally divided into multiple blocks of the same size according to the length and width. The block operation can better capture and retain local details, avoid losing important information during overall processing, and the block operation can also realize parallel processing and improve filtering efficiency.
[0039] Different blocks are subject to different degrees of noise interference, such as uneven lighting, environmental interference, etc. At the same time, different blocks also have different content complexities. For example, some blocks contain cable connectors, some blocks contain cable bends, and some blocks contain cable straight sections. In short, the image features, textures, and brightness distributions of different blocks are different, which requires different processing strategies. The present invention will set a filter threshold parameter for each block separately according to the noise level and content complexity of each block. If the noise level of a block is higher, the filter threshold parameter required for filtering is larger, so as to better smooth the noise. If the content complexity of a block is higher, the filter threshold parameter required for filtering is smaller, so as to better retain image details, thereby realizing adaptive filtering, which can better adapt to the filtering requirements of different blocks and improve the filtering effect and image quality.
[0040] Therefore, the pixel level of each block is evaluated first, and the specific method is as follows:
[0041] Calculate the average deviation between the grayscale values of all pixels in each block and the mean of the grayscale values of all pixels in the block, and take the reciprocal of the average deviation as the pixel level of the block. The calculation formula of the average deviation is:
[0042]
[0043] In the formula, For the The average deviation between the grayscale value of all pixels in a block and the grayscale mean, The block is located at Line The grayscale value of the pixel in the column, and y are the number of rows and columns of the block respectively, For the The grayscale mean of all pixels in a block, is the length of the block, The width of the block.
[0044] The pixel level of each block reflects the consistency of the grayscale values of the pixels in the block. If the pixel level of a block is higher, it means that the grayscale value of the pixels in the block is closer to the grayscale mean, that is, the consistency of the grayscale value is higher, indicating that the grayscale value of the pixels in the block is relatively uniform, and the block has no obvious grayscale changes. This usually means that the block may be a uniform background, or a part with less texture, or a larger area of single color. When filtering, a simple filtering strategy only needs to be formulated.
[0045] Blocks with lower pixel levels usually contain more grayscale changes, which may be caused by noise, indicating that there may be more noise in the block, or it may have complex textures, which may be the edges, defects or parts of the image with more texture details. More stringent strategies need to be formulated during filtering to remove noise and retain important details.
[0046] S2: Evaluate the noise level of each block based on its pixel level and the similarity of each block to its neighboring blocks.
[0047] As a statistic describing the level of noise, the signal-to-noise ratio is often used to reflect the noise level in an image. However, the signal-to-noise ratio is usually a global metric. The blocking operation here will reduce the credibility of the signal-to-noise ratio, so it cannot be used directly. The similarity in grayscale distribution between each block and its adjacent blocks, referred to as the similarity between each block and its adjacent blocks, can also reflect the noise level of the block, because noise often causes fluctuations in local grayscale values, resulting in grayscale differences between blocks. If the grayscale distribution of a block is significantly different from that of its adjacent blocks, that is, the smaller the similarity between a block and its adjacent blocks, the more likely the block is to be affected by noise, and the greater the noise level of the block. Conversely, the greater the similarity between a block and its adjacent blocks, the smaller the noise level of the block. It can be seen that the noise level of a block is negatively correlated with the similarity between the block and its adjacent blocks.
[0048] First, the blocks adjacent to each block in the four directions of top, bottom, left and right are set as the adjacent blocks of the block, and the similarity between each block and its adjacent blocks is determined according to the size of the area difference between each block and its adjacent blocks. The specific operation is as follows:
[0049] Get the grayscale histogram of each block and its adjacent blocks, and perform curve fitting on the grayscale histogram to obtain their respective grayscale fitting curves. The horizontal axis of the grayscale fitting curve is different grayscale values, and the vertical axis is the number of pixels contained in each grayscale value. The grayscale histogram reflects the distribution frequency of each grayscale value in the block.
[0050] Get the area enclosed by the grayscale fitting curve of each block and the horizontal axis, as well as the area enclosed by the grayscale fitting curve of its adjacent block and the horizontal axis. The area here is calculated by integration operation, and the inverse of the difference between the two areas is taken as the similarity between the block and its adjacent block. The smaller the area difference, the more similar the grayscale distribution of the two is, and the greater the similarity.
[0051] Next, the noise level of each block is calculated to satisfy the following relationship:
[0052]
[0053] In the formula, For the The noise level of each block, For the The block and its The difference in similarity between adjacent blocks, For the The pixel level of adjacent blocks, for The reciprocal of For the The average deviation between the grayscale value of all pixels in adjacent blocks and the grayscale mean, is the total number of adjacent blocks, is the sequence number of adjacent blocks, Take all All integers in the range.
[0054] This formula uses the pixel level of each adjacent block to perform a weighted average of the above similarities, and takes the inverse of the weighted average as the noise level of the block, making the evaluation of the noise level more comprehensive and accurate. When the noise level of each block is analyzed, The similarity between a block and its adjacent blocks is calculated. If the similarity between a block and its adjacent blocks is greater and the pixel level of its adjacent blocks is higher, the block is less likely to be affected by noise and the noise level of the block is lower. If the similarity between a block and its adjacent blocks is smaller and the pixel level of its adjacent blocks is lower, the block is more likely to be affected by noise and the noise level of the block is higher.
[0055] This method evaluates the noise level based on the similarity of each block with its neighboring blocks (the similarity of each block in the local range) and the pixel level of the neighboring blocks, which can more accurately reflect the noise distribution in the image.
[0056] S3: Determine a filtering threshold parameter of each block based on the noise level of the block.
[0057] Among them, the filtering threshold parameter of each block satisfies the following relationship:
[0058]
[0059] In the formula, For the The filtering threshold parameters of each block, For the The noise level of each block, is a natural constant. Here, a preliminary filtering threshold parameter is set for each block according to its noise level. The greater the noise level of the block, the larger the filtering threshold parameter, which can significantly remove the noise of the block. The smaller the noise level of the block, the more likely the block contains complex image textures. At this time, the smaller the filtering threshold parameter is, the more likely it is that the block contains complex image textures. At this time, the smaller the filtering threshold parameter is, the more likely it is to prevent detail loss.
[0060] Through nonlinear mapping, this formula can adaptively adjust the filter threshold parameters of each block according to the noise level of the block, which can effectively remove noise in high-noise blocks and retain more details in low-noise blocks, thereby achieving better image processing effects.
[0061] S4: Calculate the content complexity of each block, and modify the filtering threshold parameter of each block according to the content complexity of the block.
[0062] In the image of the cable, in addition to the cable itself, there are also background contents (such as buildings, plants, etc.). These background contents also contain edge features, which increase the complexity of the image. The cables are usually distributed as approximate straight lines in the image. Therefore, the content complexity of the block can be described by the number of edges and the number of straight lines in the block image. Specifically, the more edges in the block, the richer the background content in the block. The more approximate straight lines contained in the block, the more obvious the cables or other linear structures in the block. When a block has a large number of edges and a large number of straight lines, it means that the content of the block is more complex, that is, the content complexity of the block is higher.
[0063] Therefore, this step describes the content complexity by combining the number of edges and the number of lines in the block image, which can more accurately evaluate the image features of each block. The method for obtaining the content complexity of each block is:
[0064] Use Canny edge detection to obtain the edge pixels of each block, count the total number of edge pixels of the block, and the total number of pixels contained in the block, and take the ratio of the total number of edge pixels to the total number of pixels as the edge density of the block. The more edge pixels there are, the greater the edge density is, and the more edge features the block contains.
[0065] Hough transform is a method for detecting straight lines in an image. It maps edge pixels in an image into a parameter space called Hough space. In Hough space, each straight line can be represented by two parameters (slope and intercept). Each edge pixel votes for possible straight line parameters in Hough space. If multiple edge pixels support the same straight line, the number of votes for this line in Hough space will be high.
[0066] The present invention maps the edge pixels of each block into the Hough space, counts the maximum value of the number of votes of these edge pixels in the Hough space, and uses the maximum value as the linear strength of the block. The maximum value of the vote in the Hough transform (i.e., the linear strength) can reflect the existence and strength of the strongest linear feature in the block. Specifically, the maximum value of the vote reflects whether there is an obvious linear feature in the block. If the maximum value of the vote is very high, it means that there are one or more very obvious straight lines in the block, indicating that the block contains the cable itself or other linear structures in the background (such as the edge of a building). If the maximum value of the vote is very low, it means that there is no obvious linear feature in the block, or the linear feature is very weak. Using the maximum value of the vote as part of the content complexity can more comprehensively describe the image features in the block.
[0067] Next, the edge density of each block and the straight line strength of the block are combined, and the square sum of the edge density and straight line strength of each block is taken as the content complexity of the block. The content complexity of each block , For the The edge density of each block, For the Content complexity not only considers the number of edge pixels (edge density), but also whether these edge pixels form significant straight line features, which can better evaluate the complexity and diversity of the image within the block.
[0068] Next, when the content complexity of a block is higher, if a larger filtering threshold parameter is used, important details may be over-smoothed or lost. Therefore, in order to ensure that sufficient image details are retained during the filtering process, a smaller filtering threshold parameter should be used for the block. A smaller threshold parameter can reduce the smoothing of details, thereby better retaining complex edge and straight line features.
[0069] Therefore, the filter threshold parameters of each block are modified according to the following relationship to obtain the modified filter threshold parameters: , where For the The filter threshold parameters after block correction, No. The filtering threshold parameters of each block, is the normalization function, For the The content complexity of each block, and = , For the The edge density of each block, For the The linear strength of each block.
[0070] By combining edge density and straight line strength, this formula can adjust the filter threshold parameter more accurately. For blocks with complex content (i.e., many edges and obvious straight lines), a smaller filter threshold parameter is used to retain more details; for blocks with simple content (i.e., few edges and unclear straight lines), a larger filter threshold parameter can be used to remove more noise.
[0071] S5: Adaptively filter the cable image according to the corrected filter thresholds of all blocks, and perform accurate defect detection based on the filtered image.
[0072] The method for defect detection based on filtered images is:
[0073] Collect images in advance: Take cable images from different environments in advance, including normal cables and cables with various defects (such as scratches, cracks, corrosion, etc.), annotate each image, mark which images are normal and which images are defective, and indicate the type of defect.
[0074] Model training: Select the SVM (support vector machine) model as the classification model, divide the collected images into a training set (80%) and a validation set (20%), and use the training set to train the SVM model. The SVM model learns the feature differences between normal images and defective images through the training set, and gradually adjusts the parameters to establish an effective decision boundary. The SVM model evaluates the performance of the model on the validation set to ensure that the model can accurately distinguish between normal images and defective images.
[0075] Defect detection: The cable image collected in step S1 is adaptively filtered through the operations of steps S1 to S4, and the filtered image is input into the trained SVM model. The SVM model classifies and recognizes the input image and outputs whether the image contains defects (if it contains defects, it also outputs the type of defects).
[0076] Early warning mechanism: If the SVM model detects defects in the image, the early warning mechanism is triggered to remind relevant staff to deal with the defects on the cable surface in a timely manner.
[0077] In summary, this step can achieve efficient cable surface defect detection by pre-collecting a large number of labeled cable images, using these images to train a classification model, and then adaptively filtering the collected cable images. Finally, the filtered images are input into the trained model for defect detection. This method not only improves the accuracy of detection, but also can promptly remind staff to deal with defects, thereby ensuring the safety and reliability of power transmission.
[0078] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0079] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A method for automatic detection of cable surface defects based on image processing, characterized in that: include: The collected cable image is divided into a plurality of blocks of the same size, and the average deviation between the grayscale value of all pixels in each block and the grayscale mean is calculated, and the inverse of the average deviation is used as the pixel level of the block; The pixel level is used to reflect the consistency of the grayscale values of the pixels in the block; Determine the similarity between each block and its adjacent blocks according to the size of the area difference between the block and its adjacent blocks, use the inverse of the weighted average of the similarities by using the pixel levels of the adjacent blocks as the noise level of the block, and determine the filtering threshold parameter of the block based on the noise level of each block, wherein the filtering threshold parameter is positively correlated with the noise level; The ratio of the number of edge pixels in each block to the block is taken as the edge density of the block. The edge pixels of each block are mapped to the Hough space. The maximum number of votes of these edge pixels in the Hough space is counted. The maximum value is taken as the straight line strength of the block. The square sum of the edge density and the straight line strength of each block is taken as the content complexity of the block. According to the content complexity of each block, the filter threshold parameter of the block is corrected in the downward direction. The corrected filter threshold parameter satisfies the following relationship: ; In the formula, For the The filter threshold parameters after block correction, No. The filtering threshold parameters of each block, is the normalization function, For the The content complexity of each block, and = , For the The edge density of each block, For the The linear strength of each block; Adaptive filtering is performed based on the corrected filtering threshold parameters of all blocks, and defect detection is performed based on the filtered image to identify defects on the cable surface.
2. The automatic detection method of cable surface defects based on image processing according to claim 1 is characterized in that: The filtering threshold parameter satisfies the following relationship: ; In the formula, For the The filtering threshold parameters of each block, For the The noise level of each block, is a natural constant.
3. The automatic detection method of cable surface defects based on image processing according to claim 1 is characterized in that: The adaptive filtering adopts Filtering algorithm.
4. The automatic detection method of cable surface defects based on image processing according to claim 2 is characterized in that: The noise level satisfies the following relationship: ; In the formula, For the The noise level of each block, For the The block and its The similarity of adjacent blocks, For the The pixel level of adjacent blocks, for The reciprocal of For the The average deviation between the grayscale value of all pixels in adjacent blocks and the grayscale mean, is the total number of adjacent blocks, is the sequence number of adjacent blocks, Take all All integers in the range.
5. The automatic detection method of cable surface defects based on image processing according to claim 4 is characterized in that: The calculation formula for the average deviation between the grayscale value of all pixels in each block and the grayscale mean is: ; In the formula, For the The average deviation between the grayscale value of all pixels in a block and the grayscale mean, The block is located at Line The grayscale value of the pixel in the column, and y are the number of rows and columns of the block respectively, For the The grayscale mean of all pixels in a block, is the length of the block, The width of the block.
6. The automatic detection method of cable surface defects based on image processing according to claim 3 is characterized in that: The method for defect detection based on filtered images is: Collect a large number of labeled cable images in advance, including normal cable images and cable images with various defects, and use these images as training sets; Use the training set The model is trained. The model establishes a decision boundary by learning the feature differences between normal images and defective images to distinguish between normal images and defective images; Input the filtered image into the trained In the model, The model classifies and identifies the input image and outputs whether the image contains defects.
7. The automatic detection method of cable surface defects based on image processing according to claim 4 is characterized in that: The similarity between each block and its adjacent blocks is determined as follows: Obtain the grayscale histogram of each block and its adjacent blocks, and perform curve fitting on the grayscale histogram to obtain their respective grayscale fitting curves, where the horizontal axis of the grayscale fitting curve is different grayscale values, and the vertical axis is the number of pixels contained in each grayscale value; Obtain the area enclosed by the grayscale fitting curve of each block and the horizontal axis, as well as the area enclosed by the grayscale fitting curve of its adjacent block and the horizontal axis; The reciprocal of the difference between these two areas is taken as the similarity between the block and its adjacent blocks.
8. The automatic detection method of cable surface defects based on image processing according to claim 6 is characterized in that: Defect detection based on the filtered image also includes: if there are defects in the filtered image, an early warning mechanism is triggered to remind relevant staff to deal with the defects on the cable surface in a timely manner.
Citation Information
Patent Citations
BM3D-based low-dose CBCT image reconstruction method
CN108171768A
Image-based power generation equipment part production detection method
CN118552522A