BM3D denoising method for X-ray image of cable joint
By constructing crimp deformation feature values and filtering weak texture blocks in X-ray images of cable joints, and optimizing the similarity threshold of the BM3D denoising algorithm, high-quality denoising of X-ray images of cable joints is achieved, solving the problems of edge blurring and loss of detail, and improving image quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-10
AI Technical Summary
Existing BM3D denoising algorithms perform poorly in cable connector X-ray images, easily leading to blurred edges or loss of detail, and are unable to effectively remove noise.
By extracting the edges of X-ray images of cable joints, constructing crimp deformation feature values, locating the crimp joint edge line using the region growing method, filtering weak texture blocks, calculating noise interference values using the symmetry of the cable joints, and optimizing the similarity threshold of the BM3D denoising algorithm, adaptive denoising is achieved.
It effectively solves the problems of edge blurring and loss of detail, significantly improves the quality of the denoised image, and preserves the edge and texture details of key components.
Smart Images

Figure CN121837072A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image denoising, and particularly relates to a BM3D denoising method for a cable joint X-ray image. BACKGROUND
[0002] As a key component for connecting two cable sections, the cable center joint is prone to insulation aging, poor metal core contact, partial discharge and other faults due to long-term operation under high voltage and large current conditions. If not repaired in time, it may cause fire, power failure and other major accidents. Currently, the early defects of the cable joint are usually detected based on the physical phenomena such as electricity, light and heat that occur when the fault occurs, which is a passive treatment after the fault and often causes large-scale and long-time power failure. The X-ray-based non-destructive testing of the cable joint not only does not need to stop power supply, but also can find small hidden dangers in advance, thereby avoiding more serious accidents.
[0003] The BM3D denoising algorithm uses the idea of filtering the global information of the image by using the non-local mean algorithm (NL-Means), divides the X-ray image into multiple small regions in units of blocks, and finds similar blocks in the X-ray image to achieve the purpose of removing noise by averaging these blocks. The internal structure of the cable intermediate joint is complex and the materials are different, resulting in a large amount of detail and edge information in the X-ray image, and the X-ray image noise of the cable intermediate joint has the characteristics of complexity and diversity. The BM3D denoising algorithm has poor matching effect of global similar blocks based on the Euclidean distance, and is prone to edge blurring or detail loss after denoising. SUMMARY
[0004] In order to solve the above technical problems, the present application provides a BM3D denoising method for a cable joint X-ray image to solve the existing problems.
[0005] The BM3D denoising method for a cable joint X-ray image provided by the present application adopts the following technical scheme: One embodiment of the present application provides a BM3D denoising method for a cable joint X-ray image, which comprises the following steps: obtaining an X-ray image of a cable intermediate joint; extracting all edges on the X-ray image, screening out upper and lower edges from all edges based on the length and pixel value distribution of each edge, determining the cable diameter of the cable intermediate joint based on the distance between the upper and lower edges, determining the crimping deformation feature value of each pixel point in the upper edge based on the difference between the distance of each pixel point in the upper edge to the lower edge and the cable diameter and the discrete degree of the gradient direction angle of all adjacent pixel points of each pixel point in the upper edge, and obtaining a crimping joint edge line based on the crimping deformation feature value of all pixel points in the upper edge; and obtaining a reference line based on the coordinates of the head and tail endpoints of the crimping joint edge line; The X-ray image is divided into image blocks, and weak texture blocks are screened out from all the image blocks based on the degree of confusion of pixel values of all pixel points in each image block; pixel error values of each weak texture block are determined based on the difference in pixel values of each weak texture block relative to a weak texture block symmetric about the reference line, and noise interference values of each weak texture block are determined in combination with the difference in texture of each weak texture block relative to the image block symmetric about the reference line. Based on the noise interference values, the BM3D denoising algorithm is optimized to denoise the X-ray image of the cable intermediate joint.
[0006] Preferably, the upper and lower edges are screened out from all edges, comprising: In all edges on the X-ray image of the cable intermediate joint, edges with a total number of pixel points greater than or equal to the length of the X-ray image are recorded as candidate edges; The mean value of the pixel values of all pixel points on each candidate edge is calculated, and the edges corresponding to the first and second values in the ascending order of the mean value are taken as the cable intermediate joint edges. The cable intermediate joint edge with the largest mean value of the longitudinal coordinates of all pixel points in the cable intermediate joint edge is taken as the upper edge, and the remaining cable intermediate joint edge is taken as the lower edge.
[0007] Preferably, the cable diameter of the cable intermediate joint is the mean value of the shortest distances from all pixel points of the upper edge to the lower edge.
[0008] Preferably, the determination method of the crimping deformation feature value of each pixel point in the upper edge is: The difference between the shortest distance of each adjacent pixel point of each pixel point in the upper edge to the lower edge and the cable diameter is calculated, and the result of the difference ratio to the upper cable diameter is recorded as the distance difference value of each adjacent pixel point. The mean value of the distance difference values of all adjacent pixel points of each pixel point in the upper edge is calculated, and the result of the dispersion degree of the gradient direction angle of all adjacent pixel points of each pixel point multiplied by the mean value of the distance difference values is taken as the crimping deformation feature value of each pixel point in the upper edge.
[0009] Preferably, the region growing method is used to obtain the crimping head edge line, comprising: The upper edge is taken as the input of the region growing algorithm, wherein the initial growing point is the pixel point corresponding to the largest crimping deformation feature value in the upper edge, the growing criterion is that the crimping deformation feature value of the pixel point to be grown is greater than the mean value of the crimping deformation feature values of all pixel points in the upper edge, and the continuous edge segment output is taken as the crimping head edge line.
[0010] Preferably, the reference line is obtained, comprising: In the X-ray image of the cable intermediate joint, the line segment connected by all pixel points in the column where the midpoint of the crimping head edge line is located is taken as the reference line.
[0011] Preferably, the screening weak texture blocks from all image blocks comprises: calculating the mean value of the entropy of all directions of the gray level co-occurrence matrix of each image block, denoted as the texture richness of each image block; taking the texture richness of all image blocks on the X-ray image as the input of the threshold segmentation algorithm, outputting the segmentation threshold, and taking the image block with a texture richness less than the segmentation threshold as a weak texture block.
[0012] Preferably, the determination method of the pixel error value of each weak texture block is: In each weak texture block symmetric about the baseline, the symmetric pixel points of each pixel point in each weak texture are obtained, and the mean value of the pixel value difference between all pixel points and their symmetric pixel points is taken as the result of the normalized value, as the pixel error value of each weak texture block.
[0013] Preferably, the noise interference value of each weak texture block is the result of the pixel error value of each weak texture block divided by the difference in texture richness of each weak texture block relative to the weak texture block symmetric about the baseline.
[0014] Preferably, the optimized BM3D denoising algorithm comprises: the similarity threshold of image i in the BM3D denoising algorithm The expression is: ; In the formula, represents the normalized value of the mean value of the noise interference values of all weak texture blocks in the gray level range of image i after the X-ray image of the cable intermediate joint is divided into gray level ranges; represents a preset basic similarity threshold.
[0015] The present application has at least the following beneficial effects: The application fuses the radial size fluctuation and the tangential irregularity of the edge to construct a crimping deformation characteristic value, and combines a region growing algorithm to realize accurate positioning of the edge line of the crimping joint with irregular shape in the X-ray image, and then determine the vertical symmetry reference line of the cable joint, which provides key geometric prior information for subsequent adaptive noise estimation and high-quality denoising using symmetry, and effectively solves the problem of low defect recognition rate caused by edge blur and detail loss in traditional methods; further, the application screens out weak texture blocks with simple structure as pure samples for noise analysis, and uses the symmetry of the cable joint to quantify the noise intensity by calculating the pixel error between the symmetric blocks, and introduces texture difference as a confidence weight to finally obtain a noise interference value reflecting the noise level; finally, the application dynamically correlates the noise interference value constructed in the foregoing with the similarity threshold of the BM3D denoising algorithm to construct an adaptive denoising framework, which can intelligently adjust the matching strictness according to the noise intensity of different regions of the image, so as to effectively suppress complex noise while maximizing the retention of the edge and texture details of the crimping joint and other key components, and significantly improve the quality of the denoised image. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0017] Figure 1 A step flow chart of a cable joint X-ray image BM3D denoising method provided by the present application is provided. Figure 2 A weak texture block screening process flow chart provided by an embodiment of the present application is provided. DETAILED DESCRIPTION
[0018] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the specific implementation, structure, features and effects of the cable joint X-ray image BM3D denoising method according to the present application are described in detail as follows by combining with the drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.
[0020] Specifically, the application provides a cable joint X-ray image BM3D denoising method.
[0021] The application provides a cable joint X-ray image BM3D denoising method, and specifically provides a cable joint X-ray image BM3D denoising method. Figure 1 The method comprises the following steps. Step S1: Obtain an X-ray image of a cable intermediate joint.
[0022] X-rays have strong penetration, and the materials, thicknesses and densities of the internal structures of the cable intermediate joint are different, so that the attenuation degrees of different parts of the X-rays are different, and different images are presented on the imaging plate, which are used to reflect the internal structure of the cable intermediate joint. In this embodiment, the cable intermediate joint is fixed by the clamping mechanism to ensure that the axis of the cable intermediate joint is perpendicular to the X-ray, and the X-ray image of the cable intermediate joint is obtained by using a pulse radiograph, wherein the pulse radiograph is designed to be shielded by lead to inhibit radiation leakage, can emit 15 pulses per second, and has an output dose of 2.6-4.0 R / pulse min at a position 30.5 cm opposite the radiograph.
[0023] In the method, since the cable intermediate joint X-ray nondestructive testing can be performed under electricity, it is necessary to ensure that all detection devices have good insulation properties; in addition, the pixel values of the pixel points involved in the following content are all gray values.
[0024] Step S2: Extract all edges on the X-ray image, filter out upper and lower edges from all edges based on the length and pixel value distribution of each edge, determine the cable diameter of the cable intermediate joint based on the distance between the upper and lower edges, determine the crimping deformation feature value of each pixel point in the upper edge based on the difference between the distance of each pixel point in the upper edge to the lower edge and the cable diameter and the discrete degree of the gradient direction angle of all adjacent pixel points of each pixel point in the upper edge, obtain the crimping joint edge line by using a region growing method based on the crimping deformation feature values of all pixel points in the upper edge, and obtain a reference line based on the coordinates of the start and end points of the crimping joint edge line.
[0025] The cable intermediate joint is a device used for connecting the middle of a cable line, mainly undertakes the functions of conductor connection, insulation recovery and shielding layer protection, and the crimping joint as an important part of the cable intermediate joint is always located at the interruption of the cable conductor. The cable conductor and the outer side of the crimping joint are the cable insulation layer, which has weak attenuation ability to X-rays and has high gray values on the X-ray image; the cable conductor and the crimping joint are usually made of pure copper or copper alloy, which has extremely strong attenuation ability to X-rays and has extremely low gray values on the X-ray image, and the two are generally regarded as a whole on the X-ray image and form a strong contrast with the bright insulation layer.
[0026] The cable conductor can be slightly bent due to gravity, so the number of edge line pixels of the fusion of the cable conductor and the crimping head is higher than the pixel size of the X-ray image in the horizontal direction, and the average gray value of the edge line pixels of the fusion of the cable conductor and the crimping head is low relative to the edge of the insulation layer or the shielding layer.
[0027] Therefore, based on the above analysis, the embodiment first extracts the edges in the X-ray image of the cable intermediate joint by using an edge detection algorithm, and further, based on the length and pixel value distribution of each edge, the upper and lower edges are selected from all edges, that is, in all edges on the X-ray image of the cable intermediate joint, the edge with the total number of pixels greater than or equal to the length of the X-ray image is recorded as a candidate edge; the average value of the pixel values of all pixels on each candidate edge is calculated, and the first and second values in the ascending order arrangement result are used as the edges of the cable intermediate joint. The cable intermediate joint edge with the maximum average value of the longitudinal coordinates of all pixel points in the cable intermediate joint edge is used as the upper edge, and the remaining cable intermediate joint edge is used as the lower edge.
[0028] It should be noted that there are many commonly used edge detection algorithms, and in this example, the Canny edge detection algorithm is used to extract all edges in the X-ray image. In actual application, as other implementation manners, the implementer can also use other methods such as the Sobel edge detection algorithm according to the specific situation. The selection of the edge detection algorithm is not specially limited in this embodiment.
[0029] The Canny edge detection algorithm is a known technology, and the specific process of extracting all edges in the X-ray image will not be described again.
[0030] Further, since the upper and lower edge lines of the cable conductor-crimping head are similar in shape, the embodiment selects the upper edge as the target edge and analyzes based on the characteristics of the upper edge. The appearance of the crimping head is dumbbell-shaped, that is, the middle is slightly thick, and the two ends are slightly thin. In the cable intermediate joint manufacturing process, the crimping head needs to be crimped by a crimping pliers, and the local crimping head metal is extruded and deformed, which is easy to leave a pressure mark, and the geometric shape is irregular compared with the cable conductor.
[0031] Based on the above analysis, the embodiment determines the cable diameter of the cable intermediate joint based on the distance between the upper and lower edges; determines the crimping deformation feature value of each pixel point in the upper edge based on the difference between the distance from each pixel point in the upper edge to the lower edge and the cable diameter, and the discrete degree of the gradient direction angle of all adjacent pixel points of each pixel point in the upper edge. Specifically: In this embodiment, the average value of the shortest distance from all pixel points in the upper edge to the lower edge is used as the cable diameter of the cable intermediate joint.
[0032] Further, the difference between the shortest distance from each of the neighboring pixels of the pixel point in the upper edge to the lower edge and the cable diameter is calculated, and the result of the difference divided by the cable diameter is recorded as the distance difference value of each of the neighboring pixels; The average of the distance difference values of all the neighboring pixels of each of the pixel points in the upper edge is calculated, and the result of the average multiplied by the dispersion degree of the gradient direction angle of all the neighboring pixels of each of the pixel points is taken as the compression deformation characteristic value of each of the pixel points in the upper edge.
[0033] It should be noted that there are many methods for measuring the difference between data. In the embodiment, the absolute difference between the shortest distance from each of the neighboring pixels of the pixel point in the upper edge to the lower edge and the cable diameter is taken as the difference between the shortest distance from each of the neighboring pixels of the pixel point in the upper edge to the lower edge and the cable diameter. In actual application, as an alternative, the implementer can also use the square or ratio of the difference to measure the difference between data. The selection of the method for measuring the difference between data is not particularly limited in the embodiment.
[0034] It should be noted that the standard deviation of the gradient direction angle of all the neighboring pixels of each of the pixel points is taken as the dispersion degree of the gradient direction angle of all the neighboring pixels of each of the pixel points in the embodiment. In actual application, as an alternative, the implementer can also use the variance or dispersion coefficient to measure the dispersion degree of data. The selection of the method for measuring the dispersion degree is not particularly limited in the embodiment.
[0035] It should be further noted that the process of obtaining the neighboring pixels of each of the pixel points in the upper edge in the embodiment is as follows: the distances from each of the pixel points in the upper edge to all the other pixel points in the upper edge are calculated, the pixel points corresponding to the first preset number of distances in the ascending order of the distances are taken as the neighboring pixels of each of the pixel points, and the value of the preset number is artificially set. In the embodiment, the value of the preset number is 9. In actual application, as an alternative, the implementer can also set the value of the preset number according to the specific situation, and the selection of the value of the preset number is not particularly limited in the embodiment.
[0036] The calculation method of the gradient direction angle is a known technology, and the specific calculation process is not described herein.
[0037] According to the crimping deformation characteristic value of each pixel point in the upper edge, it can be understood that the crimping deformation characteristic value fuses the two dimensions of the radial size fluctuation and the tangential irregularity of the edge, and is used to evaluate the possibility of the edge pixel point belonging to the crimping area; the dispersion degree of the gradient direction angle of all adjacent pixel points of each pixel point reflects the consistency of the edge trend in the neighborhood of the pixel point in the upper edge. If the dispersion degree of the gradient direction angle of all adjacent pixel points of the current pixel point is larger, it means that the gradient direction of the edge near the current pixel point changes dramatically, and the edge line is tortuous and uneven. This may correspond to the uneven indentation of the metal being extruded in the crimping process. Therefore, the larger the corresponding crimping deformation characteristic value is, the stronger the geometric irregularity of the current pixel point is, and the higher the possibility of belonging to the crimping deformation area is. The mean value of the distance difference value of all adjacent pixel points of each pixel point reflects the average deviation degree of the cable radial size relative to the cable line diameter in the neighborhood of the pixel point in the upper edge. If the mean value of the distance difference value of all adjacent pixel points of the current pixel point is larger, it means that the difference between the shortest distance from the adjacent pixel point of the current pixel point to the lower edge and the cable line diameter is larger, that is, the diameter of the cable in the neighborhood of the current pixel point changes significantly, which is usually caused by the difference between the crimping joint pipe diameter and the conductor diameter. Therefore, the larger the mean value of the distance difference value of all adjacent pixel points of the current pixel point is, the larger the corresponding crimping deformation characteristic value is, which means that the current pixel point is in the diameter change area, and the higher the possibility of belonging to the crimping joint is. On the contrary, if the dispersion degree of the gradient direction angle of all adjacent pixel points of the current pixel point is smaller, it means that the gradient direction of the edge near the current pixel point changes gently, and the edge line is smooth and straight. This is more consistent with the regular and undeformed cable conductor surface characteristics. Therefore, the smaller the corresponding crimping deformation characteristic value is, the stronger the geometric regularity of the current pixel point is, and the higher the possibility of belonging to the standard cable conductor area is. If the mean value of the distance difference value of all adjacent pixel points of the current pixel point is smaller, it means that the difference between the shortest distance from the adjacent pixel point of the current pixel point to the lower edge and the cable line diameter is smaller, that is, the diameter of the cable in the neighborhood of the current pixel point remains uniform, which usually corresponds to the standard part of the cable conductor. Therefore, the smaller the mean value of the distance difference value of all adjacent pixel points of the current pixel point is, the smaller the corresponding crimping deformation characteristic value is, which means that the current pixel point is in the diameter uniform area, and the higher the possibility of belonging to the cable conductor is.
[0038] The larger the crimping deformation characteristic value of the pixel point in the upper edge is, the more likely the pixel point is to have strong indentation concave-convex and high deformation degree of the crimping indentation, and the more likely the pixel point is to be the edge pixel point of the crimping joint. Therefore, based on the crimping deformation characteristic value of all pixel points in the upper edge, the edge line of the crimping joint is obtained by using the region growing method, specifically: In the embodiment, the mean value of the crimp deformation feature values of all the pixel points in the upper edge is calculated, and for the convenience of description, the mean value of the crimp deformation feature values is denoted as a local deformation threshold value; The upper edge is taken as the input of the region growing algorithm, wherein the initial growing point is the pixel point corresponding to the maximum crimp deformation feature value in the upper edge, the growing criterion is that the crimp deformation feature value of the pixel point to be grown is greater than the local deformation threshold value, and the output continuous edge segment is taken as the crimping head edge line, which is used to represent the actual position and geometric shape of the crimping head on the cable conductor.
[0039] Further, since the crimping head is an important component of the cable intermediate joint and is always located at the disconnected position of the cable conductor, based on the specification requirement of the cable intermediate joint, the structure components of the two ends of the cable are vertically symmetrical about the crimping head. Therefore, in the embodiment, the coordinates of the head and tail end points of the crimping head edge line are taken to obtain the reference line, and specifically: In the X-ray image of the cable intermediate joint, all the pixel points in the column where the midpoint of the crimping head edge line is located are connected to form a line segment, which is taken as the reference line and used to represent the vertical symmetry axis of the cable intermediate joint.
[0040] It is to be further explained that the midpoint of the crimping head edge line is obtained in the following manner: assuming that the coordinates of the head and tail end points of the crimping head edge line are (x1, y1) and (x2, y2) respectively, then based on the coordinates of the head and tail end points, the coordinates of the midpoint of the crimping head edge line are calculated as and the specific expression is as follows: , ; wherein, is the upward rounding function.
[0041] Up to now, in the embodiment, the radial size fluctuation and the irregularity of the tangential trend of the edge are fused to construct the crimp deformation feature value, and the region growing algorithm is combined to realize the accurate positioning of the irregular crimping head edge line in the X-ray image, and then the vertical symmetry reference line of the cable joint is determined, which provides key geometric prior information for the subsequent adaptive noise estimation and high-quality denoising by using the symmetry, and effectively solves the problem of low defect recognition rate caused by edge blurring and detail loss in the traditional method.
[0042] Step S3: performing image block division on the X-ray image, screening weak texture blocks from all the image blocks based on the confusion degree of the pixel values of all the pixel points in each image block, determining the pixel error value of each weak texture block based on the difference in pixel values between each weak texture block and the weak texture block symmetrical about the reference line with respect to the reference line, and the maximum pixel value in each weak texture block and the weak texture block symmetrical about the reference line with respect to the reference line, and determining the noise interference value of each weak texture block based on the difference in texture between each weak texture block and the image block symmetrical about the reference line with respect to the reference line.
[0043] The cable joint is usually composed of metal conductor, polyethylene insulation layer, semiconductor shielding layer, copper shielding net and metal shell, and the attenuation coefficients of various components to X-ray are quite different. Moreover, the detection site environment is complex, the scattered radiation is serious, and the electronic noise and photon statistical noise of the imaging system itself are important reasons for the decline of X-ray imaging quality, and the noise level is proportional to the average intensity of the image.
[0044] In the BM3D denoising algorithm, the image block size needs to be set. In order to balance the integrity of the pattern in the block and the calculation complexity, the X-ray image is divided into image blocks in the embodiment, and the size of each image block is , wherein, in the embodiment, the size of each image block is ; further, the embodiment screens weak texture blocks from all image blocks based on the disorder degree of the pixel values of all pixel points of each image block, and specifically: In the embodiment, the average value of the entropy values of all directions of the gray level co-occurrence matrix of each image block is calculated, which is denoted as the texture richness of each image block, wherein all directions include 0°, 45°, 90° and 135° directions, and the acquisition method of the gray level co-occurrence matrix and the calculation of the entropy value are both known technologies and will not be described in detail.
[0045] , wherein the calculation methods of the gray level co-occurrence matrix and the entropy are both known technologies and will not be described in detail.
[0046] Further, because the noise variance of the flat area changes little, the weak texture blocks extracted from the image are usually used for noise parameter estimation analysis, and the embodiment takes the texture richness of all image blocks on the X-ray image as the input of the threshold segmentation algorithm, outputs the segmentation threshold, and takes the image block with a texture richness less than the segmentation threshold as the weak texture block.
[0047] Preferably, the weak texture block screening process flowchart provided by the embodiment is as shown in Figure 2 .
[0048] , wherein the weak texture block in the embodiment represents the simplest and cleanest structure in the X-ray image, but is not the final target to be analyzed, but a reference for achieving the target. Through accurate identification and use of these areas, the algorithm can obtain reliable noise level estimation, thereby intelligently guiding the BM3D denoising process, achieving effective denoising while perfectly preserving those truly important and defect-representative tiny details.
[0049] It should be noted that there are many commonly used threshold segmentation algorithms, and the maximum inter-class variance algorithm is used to divide the image blocks in the embodiment. In actual application, as other implementation manners, the implementer can also use other threshold segmentation algorithms according to the specific circumstances, and the selection of the threshold segmentation algorithm is not specially limited in the embodiment.
[0050] The maximum inter-class variance algorithm is a known technique, and the specific process of obtaining the segmentation threshold will not be described again.
[0051] Further, the embodiment determines the pixel error value of each weak texture block based on the difference in pixel values between each weak texture block and the weak texture block symmetric about the baseline with respect to the weak texture block, and the maximum pixel value in each weak texture block and the weak texture block symmetric about the baseline with respect to the weak texture block, and determines the noise interference value of each weak texture block in combination with the difference in texture between each weak texture block and the image block symmetric about the baseline with respect to the weak texture block, specifically: In the weak texture block symmetric about the baseline with respect to each weak texture block, the symmetric pixel points of each pixel point in each weak texture are obtained, and the mean value of the pixel value difference between all pixel points and their symmetric pixel points is taken as the result of the normalized value, as the pixel error value of each weak texture block.
[0052] According to the pixel error value of each weak texture block, it can be understood that the pixel error value reflects the average intensity of the gray level inconsistency caused by noise in the weak texture block under the ideal symmetric structure, and is used to represent the level of noise interference on the weak texture block; the greater the pixel value difference between all pixel points in the current weak texture block and their symmetric pixel points, the more serious the noise impact on the region where the current weak texture block is located, causing the brightness of the current weak texture block to deviate from its proper symmetric value, and therefore the greater the corresponding pixel error value; On the contrary, the smaller the pixel value difference between all pixel points in the current weak texture block and their symmetric pixel points, the less serious the noise impact on the region where the current weak texture block is located, and the brightness of the current weak texture block is closer to its proper symmetric value, and therefore the smaller the corresponding pixel error value.
[0053] Further, the embodiment determines the noise interference value of each weak texture block based on the pixel error value of each weak texture block, and in combination with the difference in texture between each weak texture block and the image block symmetric about the baseline with respect to the weak texture block, specifically: In the embodiment, the pixel error value of each weak texture block is multiplied by the difference in texture richness between each weak texture block and the weak texture block symmetric about the baseline with respect to the weak texture block, as the noise interference value of each image block.
[0054] In the embodiment, the absolute difference in texture richness between each weak texture block and the weak texture block symmetric about the baseline with respect to the weak texture block is taken as the difference in texture richness between each weak texture block and the weak texture block symmetric about the baseline with respect to the weak texture block. In actual application, as other implementation manners, the implementer can also adopt other methods for measuring the difference between data, such as the square or ratio of the difference, and the embodiment does not make special limitations.
[0055] According to the noise interference value of each weak texture block, it can be understood that the noise interference value is used to represent the degree of noise interference of the weak texture block, if the pixel error value of the current weak texture block is larger, the corresponding noise interference value is also larger, which means that the current weak texture block is more likely to be interfered by noise; on the contrary, if the pixel error value of the current weak texture block is smaller, the corresponding noise interference value is also smaller, which means that the current weak texture block is less likely to be interfered by noise. If the difference in texture richness between the current weak texture block and the weak texture block symmetric about the reference line is larger, it means that the texture difference between the current weak texture block and the weak texture block symmetric about the reference line is larger, that is, they may correspond to different cable component structures, at this time, the calculated pixel error value may contain the pollution of structural difference, and cannot purely represent noise, therefore, if the difference in texture richness between the current weak texture block and the weak texture block symmetric about the reference line is larger, the corresponding noise interference value is smaller, which means that the confidence of using the pixel error value to represent noise is lower; on the contrary, if the difference in texture richness between the current weak texture block and the weak texture block symmetric about the reference line is smaller, it means that the texture of the current weak texture block is more similar to the weak texture block symmetric about the reference line, that is, they are most likely to correspond to the same cable component structure, at this time, the calculated pixel error value can be almost entirely attributed to noise, therefore, if the difference in texture richness between the current weak texture block and the weak texture block symmetric about the reference line is smaller, the corresponding noise interference value is larger, which means that the confidence of using the pixel error value to represent noise is higher.
[0056] So far, this embodiment selects weak texture blocks with simple structure as pure samples for noise analysis, and uses the symmetry of the cable joint to quantify the noise intensity by calculating the pixel error between the symmetric blocks, while introducing the texture difference as the confidence weight, and finally obtains the noise interference value reflecting the noise level.
[0057] Step S4: based on the noise interference value, optimizing the BM3D denoising algorithm to denoise the X-ray image of the cable intermediate joint.
[0058] This embodiment utilizes the more significant characteristics of noise in weak texture blocks, and excludes the interference of cable component structure difference within the feature block combination by using the texture richness difference, analyzes the gray difference of the feature block combination based on the symmetry characteristics of the cable intermediate joint X-ray image, quantifies and extracts the noise contribution, so as to estimate the noise level under different gray intensity. The noise of the X-ray image may exist Poisson noise, shot noise, and its noise variance is related to the signal intensity, while the block matching three-dimensional filtering BM3D denoising algorithm mainly aims at additive Gaussian white noise, in the block matching stage of BM3D, the selection of similar blocks should be optimized based on the noise level estimation, to reduce the false matching, reduce the influence of scattered radiation and electronic noise, and maintain the edge of the cable intermediate joint component and the texture details, which is convenient for subsequent fault detection analysis.
[0059] The embodiment takes the X-ray image of the cable intermediate joint as the input of the BM3D denoising algorithm, and performs denoising processing on the X-ray image of the cable intermediate joint, wherein, based on the horizontal characteristics of the cable conductor, crimp joint and other components, similar blocks are more concentrated in the horizontal direction, and the symmetry characteristics of the X-ray image of the cable intermediate joint, if there are symmetric pixels, two search windows with a window size of based on the noise interference value, the similarity threshold value in the BM3D denoising algorithm is optimized, and finally the X-ray image of the denoised cable intermediate joint is output.
[0060] The optimization expression of the similarity threshold value is: ; In the formula, The normalized value of the noise interference value mean of all weak texture blocks in the gray level range of the image i after the X-ray image of the cable intermediate joint is divided into a gray level range; The preset basic similarity threshold value.
[0061] It should be noted that the value of the preset basic similarity threshold value is artificially set, and the value of the preset basic similarity threshold value in the embodiment is 0.7. In actual application, as other implementation manners, the implementer can also set it by himself according to the specific situation, and the embodiment does not make special limitation.
[0062] It should be noted that the process of gray level range division is: the original 256 gray levels are divided into 16 ranges, that is, 0~15 is a gray level range, 15~31 is a gray level range, …, 239~255 is a gray level range.
[0063] According to the similarity threshold value optimization expression, it can be understood that the similarity threshold value reflects the strictness of whether two image blocks are similar, which is used to dynamically control the threshold of similar block screening in the BM3D denoising algorithm. The similarity threshold value directly affects the denoising effect. If the similarity threshold value is too large, it may not be able to find enough similar blocks and the denoising is not complete. If the similarity threshold value is too small, it may introduce error matching blocks, resulting in image detail blur. Therefore, when the noise interference value is larger, the BM3D denoising algorithm will automatically improve the matching standard and become more demanding to prevent irrelevant blocks from being incorrectly matched due to noise disturbance, thereby protecting the edges and details from being blurred. Conversely, when the noise interference value is smaller, the similarity threshold value is closer to the preset basic similarity threshold value, and the matching standard is relatively loose, so that more similar blocks can be found for collaborative filtering, thereby obtaining better denoising effect.
[0064] So far, the embodiment constructs an adaptive denoising framework by dynamically associating the noise interference value constructed as described above with the similarity threshold of the BM3D denoising algorithm. The framework can intelligently adjust the matching strictness according to the noise intensity of different regions of the image, thereby effectively suppressing complex noise while maximizing the preservation of the edge and texture details of key components such as the crimping head, and significantly improving the quality of the denoised image.
[0065] It should be noted that the above-mentioned order of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. Moreover, the above-mentioned embodiments of the present application are described. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.
[0066] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments.
[0067] The above-described embodiments are only used to illustrate the technical solutions of the present application, but not limit them; modifying the technical solutions described in the above embodiments, or equivalently replacing some technical features, does not make the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A cable joint X-ray image BM3D denoising method, characterized in that, The method comprises the following steps: X-ray image of cable intermediate joint is acquired; All edges on the X-ray image are extracted, and the upper and lower edges are selected from all the edges based on the length and pixel value distribution of each edge; the cable diameter of the cable intermediate joint is determined based on the distance between the upper and lower edges; the crimping deformation feature value of each pixel point in the upper edge is determined based on the difference between the distance of each pixel point in the upper edge to the lower edge and the cable diameter, and the discrete degree of the gradient direction angle of all adjacent pixel points of each pixel point in the upper edge; the crimping joint edge line is obtained by using region growing method based on the crimping deformation feature value of all pixel points in the upper edge; and the reference line is obtained based on the coordinates of the head and tail endpoints of the crimping joint edge line. The X-ray image is divided into image blocks, and the weak texture block is selected from all the image blocks based on the confusion degree of the pixel value of all pixel points in each image block; the pixel error value of each weak texture block is determined based on the difference in pixel value between each weak texture block and the weak texture block symmetrical to it about the reference line, and the noise interference value of each weak texture block is determined in combination with the difference in texture between each weak texture block and the image block symmetrical to it about the reference line; The BM3D denoising algorithm is optimized based on the noise interference value to denoise the X-ray image of the cable intermediate joint.
2. The BM3D noise reduction method for X-ray images of cable joints as described in claim 1, characterized in that, The upper and lower edges are selected from all the edges, comprising: In all edges on the X-ray image of the cable intermediate joint, the edge with the total number of pixel points greater than or equal to the length of the X-ray image is recorded as a candidate edge; The mean value of the pixel value of all pixel points on each candidate edge is calculated, and the first and second values in the ascending order arrangement result are used as the edges of the cable intermediate joint; the edge with the maximum mean value of the longitudinal coordinates of all pixel points in the cable intermediate joint edge is used as the upper edge, and the remaining one cable intermediate joint edge is used as the lower edge.
3. The method of claim 1, wherein the method is a method of X-ray image denoising of a cable joint, BM3D. The cable diameter of the cable intermediate joint is the mean value of the shortest distance from all pixel points of the upper edge to the lower edge.
4. The BM3D noise reduction method for X-ray images of cable joints as described in claim 1, characterized in that, The method for determining the crimping deformation feature value of each pixel point in the upper edge is as follows: The difference between the shortest distance of each adjacent pixel point of each pixel point in the upper edge to the lower edge and the cable diameter is calculated, and the result of the difference greater than the upper cable diameter is recorded as the distance difference value of each adjacent pixel point; The mean value of the distance difference value of all adjacent pixel points of each pixel point in the upper edge is calculated, and the result of the discrete degree of the gradient direction angle of all adjacent pixel points of each pixel point multiplied by the mean value of the distance difference value is used as the crimping deformation feature value of each pixel point in the upper edge.
5. The BM3D noise reduction method for X-ray images of cable joints as described in claim 1, characterized in that, The crimping joint edge line is obtained by using region growing method, comprising: The upper edge is used as the input of the region growing algorithm, wherein the initial growth point is the pixel point corresponding to the maximum crimping deformation feature value in the upper edge, and the growth criterion is that the crimping deformation feature value of the pixel point to be grown is greater than the mean value of the crimping deformation feature values of all pixel points in the upper edge; the continuous edge segment output by the region growing algorithm is used as the crimping joint edge line.
6. The BM3D noise reduction method for X-ray images of cable joints as described in claim 1, characterized in that, The reference line is obtained, comprising: In the X-ray image of the cable intermediate joint, the line segment formed by connecting all pixel points in the column where the midpoint of the crimping joint edge line is located is used as the reference line.
7. The BM3D noise reduction method for X-ray images of cable joints as described in claim 1, characterized in that, The weak texture block screening from all image blocks comprises: calculating the mean value of the entropy value of each image block in all directions of the gray level co-occurrence matrix, and recording as the texture richness of each image block; taking the texture richness of all image blocks on the X-ray image as the input of the threshold segmentation algorithm, outputting the segmentation threshold, and taking the image block with the texture richness less than the segmentation threshold as the weak texture block.
8. The BM3D noise reduction method for X-ray images of cable joints as described in claim 1, characterized in that, The determination method of the pixel error value of each weak texture block is: In each weak texture block about the baseline symmetrical weak texture block, the symmetrical pixel points of each pixel point in each weak texture block are obtained, and the mean value of the pixel value difference between all pixel points and the symmetrical pixel points is taken as the result of the normalized value, as the pixel error value of each weak texture block.
9. The BM3D noise reduction method for X-ray images of cable joints as described in claim 7, characterized in that, The noise interference value of each weak texture block is the result of the pixel error value of each weak texture block divided by the difference in texture richness of each weak texture block relative to the weak texture block about the baseline symmetry.
10. The BM3D noise reduction method for X-ray images of cable joints as described in claim 1, characterized in that, The optimized BM3D denoising algorithm comprises: Expression of the similarity threshold of the image block i in the BM3D denoising algorithm is: ; in the formula, The normalized value of the average noise interference value of all weak texture blocks in the gray level range where the image block i is located after the X-ray image of the cable intermediate joint is divided into a gray level range; The preset basic similarity threshold.