Pipeline girth weld x-ray weld image enhancement method, device, equipment and medium

By using grayscale histograms and preset visual values, the problem of blurred X-ray circumferential weld images was solved, achieving simple and rapid image enhancement and improving the effect of weld defect detection. This method is suitable for pipeline equipment inspection in the petrochemical industry.

CN116205805BActive Publication Date: 2026-03-27PIPECHINA SOUTH CHINA CO +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-11
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing X-ray images of circumferential welds are blurry and of poor quality, making weld defect detection difficult, and there is a lack of image enhancement techniques that do not require parameter selection.

Method used

By acquiring X-ray weld images of pipe circumferential welds, converting them into grayscale histograms, using the target grayscale value corresponding to the second peak for image enhancement, and stretching them according to preset visual values ​​to obtain a second grayscale image, the grayscale value of the weld area is enhanced.

Benefits of technology

It achieves a simple and fast image enhancement process, improves the real-time performance and recognition effect of weld images, is suitable for parallel processing, enhances the features of the weld area, and is applicable to pipeline equipment inspection in the petrochemical industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116205805B_ABST
    Figure CN116205805B_ABST
Patent Text Reader

Abstract

The present application relates to pipeline girth weld X-ray weld image enhancement method, device, equipment and medium, the method comprises: obtaining the image to be processed, the image to be processed is pipeline girth weld X-ray weld image;The image to be processed is converted into gray histogram;According to the target gray value corresponding to the second peak value in the gray histogram, the gray value of the pixel point in the weld area in each pixel point corresponding to the gray histogram is enhanced, and a first gray image is obtained;According to the preset visual value, the gray value of each pixel point in the target image is stretched, and a second gray image is obtained, and the target image is the image to be processed or the first gray image. Through the method of the present application, the image gray enhancement process is not affected by the parameter selection, has the characteristics of simple and fast, and the gray value of each pixel point in the stretching calculation process is calculated independently, is suitable for parallel processing, and the real-time performance of the weld image enhancement can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular, the present application relates to a pipeline girth weld X-ray weld image enhancement method, device, equipment and medium. BACKGROUND

[0002] Welding technology is widely used in the manufacture of oil pipelines, and high-quality welding is the basis and fundamental guarantee for the safe operation of long-distance pipelines. Defects left in the weld can cause rupture and explosion of the pipeline and pressure vessel. Therefore, defect detection and identification in the weld is an essential and important link in the manufacture of pipeline equipment in the petrochemical industry.

[0003] The detection of weld defects is achieved by non-destructive testing (NDT) method. Among various non-destructive testing methods, X-ray girth weld image-based defect detection is the most important and widely used method. However, the current X-ray girth weld image is blurred, and the imaging quality is poor, which is not conducive to identifying defects in the weld whether it is manual detection or automatic detection. The existing image enhancement algorithm mainly uses histogram dynamic range stretching, which not only stretches the target area, but also stretches the background area. Therefore, there is still a lack of X-ray weld image enhancement technology for girth weld region of interest without parameter selection. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a pipeline girth weld X-ray weld image enhancement method, device, equipment and medium, which aims to solve at least one of the above technical problems.

[0005] In a first aspect, the technical solution of the present application to solve the above technical problems is as follows: a pipeline girth weld X-ray weld image enhancement method, the method comprising:

[0006] Obtaining a to-be-processed image, the to-be-processed image being a pipeline girth weld X-ray weld image;

[0007] Converting the to-be-processed image into a gray scale histogram;

[0008] According to the target gray value corresponding to the second peak value in the gray scale histogram, the gray scale values of the pixel points in the gray scale histogram corresponding to each pixel point in the weld region are enhanced to obtain a first gray scale image;

[0009] According to the preset visual value, the gray scale values of each pixel point in the target image are stretched to obtain a second gray scale image, and the target image is the to-be-processed image or the first gray scale image.

[0010] The beneficial effects of the present application are: according to the target gray value corresponding to the second peak value in the gray histogram, the gray value of the pixel points in the weld area in each pixel point corresponding to the gray histogram can be image enhanced, the gray value of each pixel point in the target image can also be stretched according to the preset visual value, a second gray image is obtained, the image gray enhancement process is not affected by parameter selection, has the characteristics of simplicity and rapidity, and the gray value of each pixel point in the stretching calculation process is calculated independently, is suitable for parallel processing, and the real-time performance of the weld image enhancement can be improved.

[0011] Based on the above technical solutions, the present application can also be improved as follows.

[0012] Further, the above-mentioned image enhancement of the gray value of the pixel points in the weld area in each pixel point corresponding to the gray histogram according to the target gray value corresponding to the second peak value in the gray histogram to obtain the first gray image, comprising:

[0013] According to the target gray value and the preset selection function, the gray value of the pixel points in the weld area in each pixel point corresponding to the gray histogram is enhanced to obtain the first gray image, wherein the selection function is a function of enhancing the gray value of the pixel points in the weld area in each pixel point corresponding to the enhanced gray histogram.

[0014] The beneficial effects of the above-mentioned further scheme are that the gray value of the pixel points in the weld area in each pixel point corresponding to the gray histogram can be enhanced through the selection function, and the data processing amount is reduced.

[0015] Further, the above-mentioned image enhancement of the gray value of the pixel points in the weld area in each pixel point corresponding to the gray histogram according to the target gray value and the preset selection function to obtain the first gray image, comprising:

[0016] According to the target gray value and the preset selection function, the gray value of the pixel points in the weld area in each pixel point corresponding to the gray histogram is enhanced to obtain the first gray image, wherein the selection function is:

[0017]

[0018] Wherein, gray(i,j) represents the gray value of each pixel point corresponding to the gray histogram, and a represents the gray value.

[0019] The beneficial effects of the above-mentioned further scheme are that the gray value of the pixel points in the weld area in each pixel point corresponding to the gray histogram can be enhanced through the selection function, and the data processing amount is reduced.

[0020] Further, the above-mentioned stretching the gray scale value of each pixel point in the target image according to the preset visual value to obtain a second gray scale image comprises:

[0021] According to the preset visual value, the gray scale value of each pixel point in the target image is stretched to the visual value through a preset mathematical function to obtain the gray scale value of each pixel point after stretching.

[0022] The gray scale value of each pixel point after stretching is normalized to obtain a second gray scale image, wherein the mathematical function is:

[0023]

[0024]

[0025] Wherein, gray(i, j) represents the gray scale value of each pixel point in the target image, and o represents the visual value.

[0026] The beneficial effect of the above-mentioned further scheme is that according to the preset visual value, the gray scale value of each pixel point in the target image is stretched to the visual value through a preset mathematical function to obtain a second gray scale image consistent with the preset visual value.

[0027] Further, the above-mentioned normalizing the gray scale value of each pixel point after stretching to obtain a second gray scale image comprises:

[0028] The gray scale value of each pixel point after stretching is normalized to obtain the gray scale value of each pixel point after normalization:

[0029] The gray scale value of each pixel point after normalization is converted to a gray scale value of 0-255 to obtain a second gray scale image.

[0030] The beneficial effect of the above-mentioned further scheme is that the gray scale value of each pixel point after normalization is converted to a gray scale value of 0-255, which is convenient for identifying defects.

[0031] Further, the value range of the visual value o is [80, 90].

[0032] The beneficial effect of the above-mentioned further scheme is that the above-mentioned range is a range that is more easily recognized by the naked eye, so that the gray scale value of each pixel point in the first gray scale image is stretched to the visual value, which is more convenient for the naked eye to distinguish.

[0033] In a second aspect, the present application also provides a pipeline girth weld X-ray weld seam image enhancement device to solve the above technical problems, which comprises:

[0034] An image acquisition module is configured to acquire a to-be-processed image, which is a pipeline girth weld X-ray weld seam image.

[0035] a gray scale histogram acquisition module, configured to convert the image to be processed into a gray scale histogram;

[0036] a first enhancement module, configured to perform image enhancement on the gray scale values of the pixel points in the gray scale histogram corresponding to the weld area according to a target gray scale value corresponding to a second peak value in the gray scale histogram, to obtain a first gray scale image;

[0037] a second enhancement module, configured to perform stretching processing on the gray scale values of the pixel points in the target image according to a preset visual value, to obtain a second gray scale image, the target image being the image to be processed or the first gray scale image.

[0038] In a third aspect, the present application provides an electronic device to solve the above technical problems, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the pipe girth weld X-ray weld image enhancement method of the present application when executing the computer program.

[0039] In a fourth aspect, the present application provides a computer readable storage medium to solve the above technical problems, which stores a computer program, and the computer program is executed by a processor to implement the pipe girth weld X-ray weld image enhancement method of the present application.

[0040] Additional aspects and advantages of the present application will be made apparent by the following description and the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced.

[0042] Figure 1 A flowchart of the pipe girth weld X-ray weld image enhancement method provided by an embodiment of the present application;

[0043] Figure 2 The original girth weld X-ray weld image of embodiment one;

[0044] Figure 3 The gray scale histogram of the original girth weld X-ray weld image of embodiment one;

[0045] Figure 4 The enhanced girth weld X-ray weld image of embodiment one;

[0046] Figure 5 The original girth weld X-ray weld image of embodiment two;

[0047] Figure 6Gray scale histogram of the original girth weld X-ray weld image of Example Two;

[0048] Figure 7 The enhanced girth weld X-ray weld image of Example Two;

[0049] Figure 8 The original girth weld X-ray weld image of Example Three;

[0050] Figure 9 Gray scale histogram of the original girth weld X-ray weld image of Example Three;

[0051] Figure 10 The enhanced girth weld X-ray weld image of Example Three;

[0052] Figure 11 The original girth weld X-ray weld image of Example Four;

[0053] Figure 12 Gray scale histogram of the original girth weld X-ray weld image of Example Four;

[0054] Figure 13 The enhanced girth weld X-ray weld image of Example Four;

[0055] Figure 14 The structural schematic diagram of the girth weld X-ray weld image enhancement device provided by an embodiment of the present application;

[0056] Figure 15 The structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0057] The principles and features of the present application are described below, and the examples are only used to explain the present application, and are not used to limit the scope of the present application.

[0058] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in detail in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0059] The scheme provided by the embodiments of the present application can be applied to any application scenario that needs to enhance the girth weld X-ray weld image of a pipeline. The scheme provided by the embodiments of the present application can be executed by any electronic device, such as a terminal device of a user, including at least one of the following: a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart television, and a smart vehicle-mounted device.

[0060] The embodiment of the present application provides a possible implementation manner, as shown in Figure 1 A flowchart of a pipeline girth weld X-ray weld seam image enhancement method is provided, which can be executed by any electronic device, for example, a terminal device, or jointly executed by a terminal device and a server (hereinafter referred to as a file server). For the sake of description, the method provided by the embodiment of the present application will be described below by taking a terminal device as an execution subject, as shown in the flowchart in Figure 1 The method can include the following steps:

[0061] In step S110, a to-be-processed image is acquired, and the to-be-processed image is a pipeline girth weld X-ray weld seam image.

[0062] In step S120, the to-be-processed image is converted into a gray histogram.

[0063] In step S130, according to a target gray value corresponding to a second peak value in the gray histogram, the gray value of a pixel point in the gray histogram corresponding to a weld seam region is subjected to image enhancement, and a first gray image is obtained.

[0064] In step S140, according to a preset visual value, the gray value of each pixel point in a target image is subjected to stretching processing, and a second gray image is obtained, and the target image is the to-be-processed image or the first gray image.

[0065] Optionally, in step S130, according to the target gray value corresponding to the second peak value in the gray histogram, the gray value of the pixel point in the gray histogram corresponding to the weld seam region is subjected to image enhancement, and the first gray image is obtained, including:

[0066] According to the target gray value and a preset selection function, the pixel point in the gray histogram corresponding to the weld seam region is subjected to image enhancement, and the first gray image is obtained, wherein the selection function is a function of enhancing the gray value of the pixel point in the weld seam region corresponding to each pixel point of the gray histogram. After the first image enhancement, the background region and the weld seam region in the to-be-processed image can be better distinguished.

[0067] Optionally, in step S130, according to the target gray value corresponding to the second peak value in the gray histogram, the gray value of the pixel point in the gray histogram corresponding to the weld seam region is subjected to image enhancement, and the first gray image is obtained, including:

[0068] According to the target gray value and a preset selection function, the gray value of the pixel point in the weld seam region in the gray value of each pixel point in the gray histogram is subjected to image enhancement, and the first gray image is obtained, wherein the selection function is:

[0069]

[0070] wherein, gray(i,j) represents the gray value of each pixel point corresponding to the gray histogram, and a represents the gray value.

[0071] Optionally, the gray value of each pixel point in the target image is stretched according to the preset visual value, to obtain a second gray image, wherein the target image is a to-be-processed image or a first gray image, and the method comprises the following steps:

[0072] The gray value of each pixel point in the target image is stretched to the visual value through a preset mathematical function according to the preset visual value, to obtain the stretched gray value of each pixel point.

[0073] The stretched gray value of each pixel point is normalized to obtain a second gray image, wherein the mathematical function is:

[0074]

[0075]

[0076] wherein, gray(i,j) represents the gray value of each pixel point in the target image, and o represents the visual value.

[0077] Optionally, the stretched gray value of each pixel point is normalized to obtain a second gray image, and the method comprises the following steps:

[0078] The stretched gray value of each pixel point is normalized to obtain the normalized gray value of each pixel point.

[0079] The normalized gray value of each pixel point is converted into a gray value of 0-255 to obtain a second gray image. After the above stretching processing, the features in the weld area can be further enhanced to better distinguish by naked eyes.

[0080] Optionally, the value range of the visual value o is [80, 90].

[0081] According to the target gray value corresponding to the second peak value in the gray histogram, the gray value of each pixel point in the gray histogram which is in the weld area can be enhanced by the method, and the gray value of each pixel point in the target image can be stretched according to the preset visual value to obtain a second gray image. The image gray enhancement process is not affected by parameter selection, has the characteristics of simplicity and rapidity, the gray value of each pixel point is calculated independently in the stretching calculation process, is suitable for parallel processing, and the real-time performance of the weld image enhancement can be improved.

[0082] The scheme of the present application will be further described below in combination with the following specific embodiments.

[0083] Example 1:

[0084] The method for enhancing X-ray weld images of pipe circumferential welds may include the following steps:

[0085] Step S110: Obtain the image to be processed, which is an X-ray weld image of the pipe circumferential weld.

[0086] Step S120: Convert the image to be processed into a grayscale histogram;

[0087] Step S130: Based on the target gray value corresponding to the second peak in the gray-level histogram, perform image enhancement on the gray values ​​of the pixels in the weld area of ​​each pixel in the gray-level histogram to obtain the first gray-level image.

[0088] Step S140: Based on the preset visual values, stretch the gray values ​​of each pixel in the target image to obtain a second grayscale image. The target image is either the image to be processed or the first grayscale image.

[0089] Among them, the X-ray weld image of the pipe circumferential weld, i.e., the image to be processed, can be as follows: Figure 2 As shown, the grayscale histogram corresponding to the image to be processed can be found in [reference needed]. Figure 3 As shown, by traversing the grayscale histogram, the grayscale value corresponding to the second peak is obtained as a = 25. In this example, the target image is the image to be processed. Then, based on the target grayscale value and a preset selection function, image enhancement is performed on the pixels within the weld area corresponding to each pixel in the grayscale histogram to obtain the first grayscale image. The selection function is a function that enhances the grayscale values ​​of pixels within the weld area corresponding to each pixel in the grayscale histogram. In this embodiment, the selection function is:

[0090]

[0091] Where Δ is a positive number less than 1, taken as 0.1, and gray(i,j) is the gray value of pixel (i,j) in the image to be processed; when gray(i,j) is greater than 25, f(x) is close to 1, otherwise it is close to 0.

[0092] By using the grayscale value corresponding to the second peak, the pixels within the weld area in each pixel of the grayscale histogram can be enhanced to distinguish the weld area and the background area in the image to be processed.

[0093] Subsequently, in this embodiment, a preset visual value of 80 is selected, i.e., the optimal visual value is 80. The original X-weld image (the image to be processed) is processed using the enhancement function shown in the mathematical function. The resulting second grayscale image can be found in [reference needed]. Figure 4 As shown. The mathematical function is:

[0094]

[0095] In the formula,

[0096] The pixel point gray value of a in the girth weld X-ray weld image (the image to be processed) can be stretched to o=80; the gray value can be normalized to the interval [0, 1] by gray(i,j)255; and the gray value of the pixel point less than a will not be enhanced or will be weakly enhanced by f(x). The converted gray value can be normalized to the interval [0, 1]; due to the introduction of f(x), the pixel point with a gray value less than a will not be enhanced or will be weakly enhanced, and the multiplication by 255 can convert the g(x) value into a gray value of 0-255.

[0097] It should be noted that when the input image of the mathematical function is the first gray image, that is, the target image is the first gray image, the meaning of gray(i,j) in formula (2) is different from that of gray(i,j) in formula (1). At this time, gray(i,j) in formula (2) is the gray value of a pixel point (i,j) in the first gray image.

[0098] Example Two:

[0099] Based on the scheme of the above example one, in this example, the pipeline girth weld X-ray weld image is as shown in Figure 5 The corresponding gray histogram is as shown in Figure 6 The gray value a=25 corresponding to the second peak value of the gray histogram is obtained by traversal, and the selection function is introduced as shown in formula (1):

[0100]

[0101] Wherein, Δ is a positive number less than 1, and is 0.1; gray(i,j) is the gray value of the pixel point (i,j) in the image to be processed; f(x) is close to 1 when gray(i,j) is greater than a=25, otherwise it is close to 0.

[0102] In this example, the best visual value is selected as 80, the image to be processed is processed by using the enhancement function (mathematical function) shown in formula (2), and the obtained second gray image can be seen from Figure 7 The mathematical function is:

[0103]

[0104] In the formula, The pixel point gray value of a in the girth weld X-ray weld image (the image to be processed) can be stretched to o=80; the gray value can be normalized to the interval [0, 1] by gray(i,j)255; and the gray value of the pixel point less than a will not be enhanced or will be weakly enhanced by f(x). The converted gray value can be normalized to the interval [0, 1]; due to the introduction of f(x), the pixel points with a gray value less than a will not be enhanced or will be weakly enhanced, and finally multiplying 255 can convert the g(x) value into a gray value of 0-255.

[0105] Example Three

[0106] Based on the schemes of the above examples 1 and 2, in this example, the pipeline girth weld X-ray weld seam image is as shown in Figure 8 The corresponding gray histogram is as shown in Figure 9 The second peak value corresponding gray value a = 25 of the gray histogram is obtained by traversal, and a selection function is introduced as shown in equation (1):

[0107]

[0108] where Δ is a positive number less than 1, taking 0.1; gray(i, j) is the gray value of the pixel point (i, j) in the image to be processed; f(x) is close to 1 when gray(i, j) is greater than a = 25, otherwise close to 0.

[0109] In this example, the best visual value is selected as 80, and the original X-weld seam image (image to be processed) is processed by using the enhancement function (mathematical function) shown in equation (2) to obtain a second gray image, which can be as shown in Figure 10 The mathematical function is:

[0110]

[0111] In the formula, The gray value of the pixel point with a gray value of a in the girth weld X-ray weld seam image (image to be processed) can be stretched to o = 80; the gray value can be normalized to the interval [0, 1] by gray(i, j) 255; and The converted gray value can be normalized to the interval [0, 1]; due to the introduction of f(x), the pixel points with a gray value less than a will not be enhanced or will be weakly enhanced, and finally multiplying 255 can convert the g(x) value into a gray value of 0-255.

[0112] Example Four

[0113] Based on the above examples 1 to 3, in this example, the pipeline girth weld X-ray weld seam image is as shown in Figure 11 The corresponding gray histogram is as shown in Figure 12 The second peak value corresponding gray value a = 25 of the gray histogram is obtained by traversal, and a selection function is introduced as shown in equation (1):

[0114]

[0115] wherein, Δ is a positive number less than 1, and is 0.1; gray(i,j) is the gray value of the pixel point (i,j) in the image to be processed; f(x) is close to 1 when gray(i,j) is greater than a=25, otherwise close to 0.

[0116] In this embodiment, the best visual value is selected as 80, the original X-weld image (image to be processed) is processed by using the enhancement function (mathematical function) shown in formula (2), and the obtained second gray image is as shown in Figure 13 The mathematical function is:

[0117]

[0118] In the formula, The gray value of the pixel point with the gray value a in the girth-weld X-ray weld image (image to be processed) can be stretched to o=80; the gray value can be normalized to the interval [0,1] by gray(i,j)255; and the value of g(x) can be converted to the gray value of 0-255 by multiplying 255. The converted gray value can be normalized to the interval [0,1]; due to the introduction of f(x), the pixel point with the gray value less than a will not be enhanced or will be weakly enhanced, and finally multiplying 255 can convert the value of g(x) to the gray value of 0-255.

[0119] Embodiment five:

[0120] Based on the above embodiments 1-4, in this embodiment, the girth-weld X-ray weld image of the pipeline is as shown in Figure 11 The corresponding gray histogram is as shown in Figure 12 The gray value a=25 corresponding to the second peak value of the gray histogram is obtained by traversing, and the selection function is introduced as shown in formula (1):

[0121]

[0122] wherein, Δ is a positive number less than 1, and is 0.1; gray(i,j) is the gray value of the pixel point (i,j) in the image to be processed; f(x) is close to 1 when gray(i,j) is greater than a=25, otherwise close to 0.

[0123] In this embodiment, the best visual value is selected as 80, the first gray image is processed by using the enhancement function (mathematical function) shown in formula (2), and the obtained second gray image is as shown in Figure 13 The mathematical function is:

[0124]

[0125] In the formula, The gray value of the pixel point with the gray value a in the first gray image can be stretched to o=80; the gray value can be normalized to the interval [0,1] by gray(i,j)255; and the value of g(x) can be converted to the gray value of 0-255 by multiplying 255. The converted gray scale value can be normalized to the interval [0, 1]; due to the introduction of f(x), the pixel points with a gray scale value less than a will not be enhanced or will be weakly enhanced, and finally multiplying 255 can convert the g(x) value into a gray scale value of 0-255.

[0126] Based on the same principle as the method shown in Figure 1 Based on the same principle as the method shown in Figure 14 The pipeline girth weld X-ray weld seam image enhancement device 20 can include an image acquisition module 210, a gray scale histogram acquisition module 220, a first enhancement module 230, and a second enhancement module 240, as shown in

[0127] The image acquisition module 210 is configured to acquire a to-be-processed image, which is a pipeline girth weld X-ray weld seam image.

[0128] The gray scale histogram acquisition module 220 is configured to convert the to-be-processed image into a gray scale histogram.

[0129] The first enhancement module 230 is configured to perform image enhancement on the gray scale values of the pixel points in the weld seam region in each pixel point corresponding to the gray scale histogram according to a target gray scale value corresponding to a second peak value in the gray scale histogram, to obtain a first gray scale image.

[0130] The second enhancement module 240 is configured to perform stretching processing on the gray scale values of each pixel point in a target image according to a preset visual value, to obtain a second gray scale image, the target image being the to-be-processed image or the first gray scale image.

[0131] Optionally, when the first enhancement module 230 performs image enhancement on the gray scale values of the pixel points in the weld seam region in each pixel point corresponding to the gray scale histogram according to the target gray scale value corresponding to the second peak value in the gray scale histogram, to obtain the first gray scale image, the first enhancement module 230 is specifically configured to:

[0132] perform image enhancement on the pixel points in the weld seam region in each pixel point corresponding to the gray scale histogram according to the target gray scale value and a preset selection function, to obtain the first gray scale image, wherein the selection function is a function of enhancing the gray scale values of the pixel points in the weld seam region in each pixel point corresponding to the gray scale histogram.

[0133] Optionally, when the first enhancement module 230 performs image enhancement on the gray scale values of the pixel points in the weld seam region in each pixel point corresponding to the gray scale histogram according to the target gray scale value and the preset selection function, to obtain the first gray scale image, the first enhancement module 230 is specifically configured to:

[0134] According to the target gray value and the preset selection function, the gray value of the pixel point in the gray value of each pixel point in the gray histogram in the weld area is enhanced to obtain a first gray image, wherein the selection function is:

[0135]

[0136] Wherein, gray(i, j) represents the gray value of each pixel point corresponding to the gray histogram, and a represents the gray value.

[0137] Optionally, the second enhancement module 240 is specifically configured to:

[0138] According to the preset visual value, the gray value of each pixel point in the target image is stretched to the visual value through a preset mathematical function to obtain the stretched gray value of each pixel point.

[0139] The stretched gray value of each pixel point is normalized to obtain a second gray image, wherein the mathematical function is:

[0140]

[0141]

[0142] Wherein, gray(i, j) represents the gray value of each pixel point in the target image, and o represents the visual value.

[0143] Optionally, when the second enhancement module 240 normalizes the stretched gray value of each pixel point to obtain a second gray image, it is specifically configured to:

[0144] The stretched gray value of each pixel point is normalized to obtain the normalized gray value of each pixel point:

[0145] The normalized gray value of each pixel point is converted to a gray value of 0-255 to obtain a second gray image.

[0146] Optionally, the value range of the visual value o is [80, 90].

[0147] The pipeline girth weld X-ray weld seam image enhancement device provided by the embodiment of the present application can execute the pipeline girth weld X-ray weld seam image enhancement method provided by the embodiment of the present application, and the implementation principle is similar. The actions performed by each module and unit in the pipeline girth weld X-ray weld seam image enhancement device in each embodiment of the present application are corresponding to the steps in the pipeline girth weld X-ray weld seam image enhancement method in each embodiment of the present application. For the detailed function description of each module of the pipeline girth weld X-ray weld seam image enhancement device, please refer to the description of the corresponding pipeline girth weld X-ray weld seam image enhancement method shown in the foregoing.

[0148] The pipeline girth weld X-ray weld image enhancement device can be a computer program (including program code) running in a computer device, for example, the pipeline girth weld X-ray weld image enhancement device is an application software; the device can be used to execute the corresponding steps in the method provided by the embodiments of the present application.

[0149] In some embodiments, the pipeline girth weld X-ray weld image enhancement device provided by the embodiments of the present application can be implemented in a combination of software and hardware, for example, the pipeline girth weld X-ray weld image enhancement device provided by the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the pipeline girth weld X-ray weld image enhancement method provided by the embodiments of the present application, for example, the processor in the form of a hardware decoding processor can use one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0150] In some other embodiments, the pipeline girth weld X-ray weld image enhancement device provided by the embodiments of the present application can be implemented in software, Figure 14 The pipeline girth weld X-ray weld image enhancement device stored in the memory is shown, which can be software in the form of programs and plug-ins, and includes a series of modules, including an image acquisition module 210, a gray histogram acquisition module 220, a first enhancement module 230 and a second enhancement module 240, for implementing the pipeline girth weld X-ray weld image enhancement method provided by the embodiments of the present application.

[0151] The modules described in the embodiments of the present application can be implemented in software or hardware. Among them, the name of the module does not constitute a limitation of the module itself in some cases.

[0152] Based on the same principles as the method shown in the embodiments of the present application, the embodiments of the present application also provide an electronic device, which can include but is not limited to: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the method shown in any embodiment of the present application by calling the computer program.

[0153] In one optional embodiment, an electronic device is provided, which can include but is not limited to: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the method shown in any embodiment of the present application by calling the computer program.Figure 15 As shown, Figure 15 The electronic device 4000 shown includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 can also include a transceiver 4004, which can be used for data interaction, such as data transmission and / or data reception, between the electronic device and other electronic devices. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0154] The computer readable storage medium of the embodiment of the present application stores a computer program, and when the computer program runs on a computer, the computer can execute the corresponding content in the foregoing method embodiment.

[0155] According to another aspect of the present application, a computer program product or computer program is also provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the method provided in the various embodiment implementation manners.

[0156] The above description is merely preferred embodiments of the present application and a description of the principles of the technology used. Those skilled in the art should understand that the disclosed range of the present application is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the disclosed concept. For example, the technical solutions formed by replacing the above features with the technical features disclosed in the present application (but not limited to) having similar functions.

Claims

1. A method for enhancing X-ray weld images of pipe circumferential welds, characterized in that: Includes the following steps: Acquire an image to be processed, wherein the image to be processed is an X-ray weld image of a pipe circumferential weld. Convert the image to be processed into a grayscale histogram; Based on the target gray value corresponding to the second peak in the gray-scale histogram, image enhancement is performed on the gray values ​​of the pixels within the weld area in each pixel corresponding to the gray-scale histogram to obtain a first gray-scale image. Based on preset visual values, the grayscale values ​​of each pixel in the target image are stretched to obtain a second grayscale image, wherein the target image is the image to be processed or the first grayscale image. The step of enhancing the gray values ​​of pixels within the weld area in each pixel of the gray-level histogram based on the target gray value corresponding to the second peak in the gray-level histogram to obtain a first gray-level image includes: Based on the target grayscale value and a preset selection function, image enhancement is performed on the pixels within the weld area corresponding to each pixel in the grayscale histogram to obtain a first grayscale image. The selection function is a function that enhances the grayscale value of the pixels within the weld area corresponding to each pixel in the grayscale histogram. The step of enhancing the gray values ​​of pixels within the weld area in each pixel of the gray histogram according to the target gray value and a preset selection function to obtain a first gray image includes: Based on the target grayscale value and a preset selection function, image enhancement is performed on the grayscale values ​​of pixels within the weld area in the grayscale histogram to obtain a first grayscale image. The selection function is: Where gray(i,j) represents the gray value of each pixel corresponding to the gray histogram, a represents the target gray value corresponding to the second peak, Δ is a positive number less than 1, which is 0.

1. When gray(i,j) is greater than a, f(x) is close to 1, otherwise it is close to 0.

2. The method according to claim 1, characterized in that, The step of stretching the grayscale values ​​of each pixel in the target image according to preset visual values ​​to obtain a second grayscale image includes: Based on a preset visual value, the grayscale value of each pixel in the target image is stretched to the visual value using a preset mathematical function to obtain the stretched grayscale value of each pixel. The grayscale values ​​of each stretched pixel are normalized to obtain a second grayscale image, wherein the mathematical function is: Where gray(i,j) represents the gray value of each pixel in the target image, and o represents the visual value.

3. The method according to claim 2, characterized in that, The step of normalizing the grayscale values ​​of each stretched pixel to obtain a second grayscale image includes: The stretched grayscale values ​​of each pixel are normalized to obtain the normalized grayscale values ​​of each pixel: The normalized gray values ​​of each pixel are converted into gray values ​​of 0 to 255 to obtain the second grayscale image.

4. The method according to claim 1, characterized in that, The visual value o ranges from [80, 90].

5. A device for enhancing X-ray images of pipe circumferential welds, characterized in that, The method for enhancing X-ray weld images of pipe circumferential welds according to claim 1, the apparatus comprising: The image acquisition module is used to acquire an image to be processed, wherein the image to be processed is an X-ray weld image of a pipe circumferential weld. A grayscale histogram acquisition module is used to convert the image to be processed into a grayscale histogram; The first enhancement module is used to enhance the gray values ​​of pixels located within the weld area in each pixel of the gray-scale histogram according to the target gray value corresponding to the second peak in the gray-scale histogram, so as to obtain a first gray-scale image. The second enhancement module is used to stretch the grayscale values ​​of each pixel in the target image according to a preset visual value to obtain a second grayscale image, wherein the target image is the image to be processed or the first grayscale image.

6. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method of any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1-4.

Citation Information

Patent Citations

  • Image processing method and device, computing equipment and computer readable storage medium

    CN114627029A

  • Radiological examination device and image processing method

    JP2014134531A