The present disclosure relates to a method for eliminating scratches in a cross-sectional image of a cable, and in particular to a method for eliminating scratches in a cross-sectional image of a cable based on an improved total variation (TV) algorithm.
As a main carrier for power transmission, the cable is an important part of the power distribution system. It is of great significance to ensure the production quality of cable. The cable typically consists of a conductor, an insulating layer, a shielding layer, and a protective layer. The quality of the cable is generally evaluated by detecting a length of the cable, a thickness of the insulating layer, and a number of conductors. The number of conductors in the cable is one of the most important indexes to determine the quality of the cable. At present, the machine vision is effective to detect the number of conductors in a cross-sectional image of the cable. However, in sample cutting process of the cable, many scratches will be generated to seriously affect the accuracy of detection on the number of conductors. Hence, to improve the accuracy of detection, a method capable of effectively eliminating the scratches in the cross-sectional image is desired.
The present disclosure takes the scratches generated in the cutting process of the cable as noises in the cross-sectional image of the cable, and eliminates the scratches by denoising. There are many image denoising algorithms, mainly including deep learning-based image denoising algorithms and conventional image denoising algorithms.
With the advent of convolutional neural networks (CNNs), and particularly the ImageNet 2012 Challenge, the defect detection algorithm based on the deep learning and the denoising algorithm based on the deep learning have become popular in the field of denoising. Compared with previous algorithms, these methods can achieve desirable performance, but require a large amount of data for model training. Due to an expensive cost of the high-voltage cable, limited sampled data, and disordered scratch-type defects in the cutting process, the requirement on the data amount for model training cannot be met.
The conventional denoising algorithms mainly include spatial-domain denoising, transform-domain denoising, and model-based denoising. The spatial-domain denoising is mainly realized by filters based on the correlation between pixels of the image in the spatial domain. In the classical filter denoising methods, the median filter, mean filter, Wiener filter, and Gaussian filter, such as the vector median filter (VMF), bilateral filter, and tri-state median (TSM) nonlinear filter, can keep the edge and details of the image well, without considering global features. The transform-domain denoising is realized by separating image information from noises through some operations, performing denoising according to characteristics of the noises, and performing inverse transformation to obtain the original image. The common transform-domain denoising algorithms are based on the Fourier transform (FT), the discrete cosine transform (DCT), the wavelet transform (WT), etc. However, this method is defective for the large amount of computation and the dependency on a threshold. The model-based denoising is to model a distribution of noises in the image, and take the distribution as a priori to obtain the clear image and an optimized algorithm. For example, the TV algorithm proposed by Rudin et al. is a universal model used for image denoising with partial differential equations. This model is mainly intended to reduce a sum of gradient integrals in the pixel domain of the image. Although sharp discontinuous points are allowed in the image, the model is susceptible to a staircase effect to cause the texture loss and the image blurring.
The present disclosure provides a method for eliminating scratches in a cross-sectional image of a cable based on an improved TV algorithm, to overcome the defects and shortages of the prior art.
The present disclosure adopts the following technical solutions:
The present disclosure provides a method for eliminating scratches in a cross-sectional image of a cable, including:
Preferably, the original image of the cross-section of the cable is acquired by an industrial camera.
The scratches are generated by sample cutting in a quality detection process of the cable.
Preferably, a dataset for cross-sectional images of cables is established; the dataset includes cross-sectional images of high-voltage cables of multiple standard sizes; and there are 1000 images in total, with 200 images for each size.
Preferably, there are five standard sizes, including 240 mm, 300 mm, 400 mm, 800 mm, and 1000 mm.
The present disclosure has the following beneficial effects:
The present disclosure provides the novel improved TV algorithm. By introducing multimodal features, the present disclosure relieves the loss of image information caused by the staircase effect in the conventional TV algorithm. While eliminating the scratches, the present disclosure can keep the information of the original image as much as possible, and can significantly improve the accuracy of detection on actual quality of the cable.
Technical solutions of the present disclosure are further described below in detail with embodiments. These embodiments are intended to describe the present disclosure, rather than limit the present disclosure. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
As shown in
In step S1, an original image for a cross-section of the cable is acquired. The original image has a first modality.
In step S2, a processor performs dilation and erosion on the original image to obtain a processed image. The processed image has a second modality.
In step S3, the processor fuses the original image and the processed image to obtain a fused image.
In step S4, the processor processes the fused image to obtain a scratch eliminated image. The fused image is taken as an input. A TV algorithm is configured in the processor. The TV algorithm is executed by the processor to eliminate the scratches.
In step S5, the scratch eliminated image instead of the original image is applied in actual quality detection of the cable to improve accuracy of the quality detection.
Each source or form of the image can be referred to as a modality. In different modalities, due to different representations and different image information, some information are crossed and complemented. Features of the image can be enriched by fusing information from multiple modalities.
In order to better keep the edge information of the image, a special multimodal fusion method is provided by the present disclosure. The method is mainly intended to perform different operations on the same image, such as sparsification, filtering and morphological processing, to generate different modalities. With analysis and comparison on these operations, the morphological processing is selected by the present disclosure.
The morphological processing includes dilation on the image, and erosion on a dilated image. Similar to the close operation in morphology, it eliminates small gaps between objects and fills up breaks in contour lines. Nevertheless, different structural elements are used herein, and defined as follows:
In the foregoing equation, IA is the input original image for the cross-section of the cable, IB is an image obtained by the morphological processing, S1 and S2 are respectively a structural element in the dilation and a structural element in the erosion; and (IA) is a result obtained after the dilation and the erosion on the input image.
Images of two modalities are fused to obtain a fused image Iin:
In the foregoing equation, α and β are two modal weights, 0≤α≤1, 0≤β≤1, and α+β=1.
The present disclosure provides the improved TV algorithm. With redundancy and complementarity of the multimodal fusion, the present disclosure enriches the information of the image, weakens the staircase effect, and keeps the edge information of the image better.
The present disclosure takes the image fused with the two modalities as the input of the TV algorithm, and then processes the TV algorithm, thereby eliminating the scratches in the cross-sectional image of the cable.
According to the algorithm, the fused image Iin is obtained with Eq. (1) and Eq. (2). The Iin is taken as an input of Eq. (3). An initial output image I1 is set as an original image Iin. Iterative update is performed to obtain an output image I* with the scratch-type defects eliminated:
In the foregoing equation, Ω represents a pixel domain of the entire image, λ represents a regularization parameter,
is a fidelity term, λ∫∫Ω|∇I(x, y)|dxdy is a multimodality fused TV regularization term, x and y respectively represent a horizontal pixel coordinate and a vertical pixel coordinate of the image, dx and dy respectively represent a horizontal gradient and a vertical gradient, and I(x,y) and ∇I(x, y) respectively represent a grayscale and a gradient of a coordinate (x,y).
Assuming that
a loss function F is defined as:
In the foregoing equation, F is a simplified form of
To find a minimum of the function F, Eq. (7) of the function F is obtained with Eq. (6):
An optimized output image Ik+1 from a kth iteration is thus obtained:
In the foregoing equation, Ik and ∇Ik respectively represent a grayscale and a gradient of the image in the kth iteration.
Referring to
With the experimental platform, a dataset for the cross-sectional images of the cables is acquired and established. The dataset includes cross-sectional images of cables of five standard sizes, including 240 mm, 300 mm, 400 mm, 800 mm, and 1000 mm. There are 1000 images in total, with 200 images for each size. Some images in the dataset are shown in
In the following experiments, with the above dataset, the improved TV algorithm (Method A) provided by the present disclosure is compared to the improved frequency domain filtering method (Method B) in the literature (Beiping, H.; Xiaogang, Z.; Wen, Z.; Tianliang, C.; Lingchao, C. Research on Texture Temoval of the Cable Core Image based on Frequency Domain Filtering. Chinese Journal of Scientific Instrument 2021, 42.) and the conventional TV algorithm (Method C) for analysis. For all experiments, the hardware has Intel® Core™ i5-8250U CPU@1.60 GHz, and the memory of 8.00 GB, and the software environment is MATLAB R2020a.
In order to verify performance of the method (Method A) provided by the present disclosure, comparison is made between Method A and Method B based on the dataset. The average elimination rate is used as an evaluation index for each size in the experiment, and is defined as follows:
In the foregoing equation, vp represents an average elimination rate for scratches of a high-voltage cable of a pth size, np represents a number of images for the cable of the pth size, Mp,i represents a total number of scratches in an ith image of the cable of the pth size, mp,i represents a number of scratches eliminated from the ith image of the cable of the pth size, and Np is a total number of cables in each size, and p represents a total number of sizes of cables.
In the experiment, P=5, N1,2 . . . , P=200.
In order to further analyze the elimination effect for the scratches, the elimination rate of each sample is counted. For different cables, elimination rates of Method A and Method B for the scratch-type defects are shown in Table 1.
As can be seen from Table 1, Method B has the elimination rate of about 50% only for some cables, while Method A provided by the present disclosure has the elimination rate of 90% or more for all cables. Compared with Method B, Method A provided by the present disclosure can eliminate almost all of the scratches in some samples. Through intuitive analysis and data analysis on the images, the method provided by the present disclosure is more remarkable to eliminate the scratch-type defects.
In order to verify the higher accuracy of detection on the number of conductors in the cable through the scratch-eliminated cross-sectional image of the cable in Method A, a Hough circle detection algorithm is used to detect the number of conductors based on the dataset. Specifically: 1. The original image is processed with Method A, and the Hough circle detection is performed on the output image. 2. The original image is processed with Method B, and the Hough circle detection is performed on the output image. 3. The Hough circle detection is directly performed on the original image (direct detection). The average detection rate on the number of conductors is used as an evaluation index in the experiment, and is defined as follows:
In the foregoing equation, vp,k represents an average detection rate on the number of conductors for a cable of a pth size, Np is a total number of cables in each size, Dp,i represents a total number of conductors in an ith image of the cable of the pth size, and dp,i represents a number of conductors detected in the ith image of the cable of the pth size.
In the experiment, P=5, N1,2 . . . , p=200.
The average detection rates of different methods on the number of conductors are shown in Table 2:
As can be seen from Table 2, the method (Method A) provided by the present disclosure significantly improves the accuracy of detection on the number of conductors. Specifically, the average detection rate is improved by about 30%. The average detection rate of the method provided by the present disclosure is 1.5 times the average detection rate of Method B.
In order to further describe the effect of the present disclosure, the conventional TV algorithm (Method C) is selected for comparison, and the image quality evaluation indexes and the operating time are taken as evaluation standards for scratch elimination. The image quality evaluation indexes mainly include a peak signal-to-noise ratio (PSNR) and a structural similarity index measure (SSIM). The specific elimination effects, namely image analysis on the elimination effects for the scratches in the cross-sectional image of the cable, are shown in
Comparative data of the two methods for eliminating the scratch-type defects are shown in Table 3.
As can be seen from Table 3, the PSNR and the SSIM of Method A are significantly better than those of Method C. The PSNR of Method A is 0.75 or more basically, which indicates that Method A keeps useful information of the image well, while eliminating the scratch-type defects. Compared with Method C, the overall operating time of Method A is not prolonged nearly for the multimodal operation, Therefore, the present disclosure can significantly improve the performance of the algorithm.
According to the present disclosure, cross-sectional images of cables of different sizes are acquired to establish the dataset, and the cross-sectional images have different numbers and types of scratches. According to the experimental results, the present disclosure can eliminate different types of scratches in the cross-sectional image of the cable effectively, and significantly improve the accuracy of detection on the number of conductors.
Since many scratches remain on the cross-section of the cable in the cutting process to affect the detection on the number of conductors, the present disclosure provides the improved TV algorithm to eliminate the scratches. By performing morphological processing on an input image to obtain a new modality, computing a fused image from two modalities, and taking the fused image as an input for a TV algorithm, the present disclosure eliminates the scratches of the cable. It can be found in the experimental results that the method provided by the present disclosure not only has the elimination rate of 90% or more for the scratches, but also improves the average detection rate on the number of conductors by 30%. Moreover, by introducing the multimodal features, the present disclosure can eliminate scratches uneliminated by the traditional TV algorithm. With the desirable PSNR and the desirable SSIM, the present disclosure relieves the loss of image information caused by the staircase effect in the traditional TV algorithm.
Therefore, the method provided by the present disclosure can significantly improve the accuracy of detection on the number of conductors, thereby monitoring the quality of the cable more effectively in production.
Finally, it should be noted that the foregoing embodiments are merely used to explain the technical solutions of the present application, but are not intended to limit the present application. Although the present application is described in detail with reference to the foregoing embodiments, the person of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions on some or all technical features therein. These modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Number | Date | Country | Kind |
---|---|---|---|
202410236604.X | Mar 2024 | CN | national |
This application is a continuation of International Patent Application No. PCT/CN2024/105175 with a filing date of Jul. 12, 2024, designating the United States, now pending, and further claims priority to Chinese Patent Application No. 202410236604. X with a filing date of Mar. 1, 2024. The content of the aforementioned applications, including any intervening amendments thereto, is incorporated herein by reference
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2024/105175 | Jul 2024 | WO |
Child | 19023340 | US |