Pipeline welding seam image detection method and device
By separating the signal through Gaussian blurring and logarithmic transformation, high-frequency region information is preserved, which solves the problem of noise interference in DR images of pipe welds and achieves higher detection accuracy and weld feature clarity.
Patent Information
- Application Number
- CN202511471416.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-15
- Publication Date
- 2026-02-10
AI Technical Summary
Low contrast exists in some areas of DR images of pipe welds, making it difficult to identify minute defects. Existing CLAHE technology amplifies noise while enhancing local contrast, affecting the accuracy of defect identification.
The signal is separated by Gaussian blurring and logarithmic transformation, preserving high-frequency information and reducing low-frequency interference. High-frequency features are amplified by signal separation and linear functions to generate target images for detection.
It improves the accuracy of pipeline weld inspection, reduces noise interference, and clearly presents weld characteristics.
Smart Images

Figure CN121504819A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method and apparatus for detecting pipeline weld images. Background Technology
[0002] Digital radiography (DR) image enhancement technology has been widely used in non-destructive testing of pipeline welds due to its high efficiency and convenience. The generated DR images are key to identifying defects such as weld cracks and porosity. However, DR images of pipeline welds often suffer from localized low contrast, making it difficult to identify minute defects. Therefore, image enhancement technology is needed to improve their quality.
[0003] Contrast-Limited Adaptive Histogram Equalization (CLAHE) is a DR image enhancement method that enhances local contrast through block equalization. However, in the low-contrast regions of pipe weld DR images, quantum noise and scattering noise are densely distributed. CLAHE's grayscale stretching in these regions forcibly amplifies this noise. This noise interference severely masks the characteristics of minute defects in the weld, leading to a decrease in defect identification accuracy and failing to meet the high-precision requirements of pipe weld inspection. Summary of the Invention
[0004] This application provides a method and apparatus for detecting pipeline weld images, which improves the accuracy of pipeline weld detection.
[0005] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a method for detecting pipe weld images. The method involves: acquiring an initial pipe weld image; performing Gaussian blurring on the initial pipe weld image to obtain a first Gaussian image, the first Gaussian image including low-frequency region information, which is information in the initial pipe weld image whose change amplitude with spatial position is less than a preset amplitude threshold; performing a logarithmic transformation on the first Gaussian image to obtain a first logarithmic image, and then performing a logarithmic transformation on the initial pipe weld image to obtain a second logarithmic image; performing signal separation on the first and second logarithmic images to obtain a target image; and detecting pipe welds based on the target image, the target image including high-frequency region information, which is image information of the pipe weld in the initial pipe weld image.
[0006] Based on the above technical solution, an initial pipeline weld image is obtained. Gaussian blurring is then applied to the initial pipeline weld image to obtain a first Gaussian image. The first Gaussian image includes low-frequency region information, which refers to information in the initial pipeline weld image whose spatial variation amplitude is less than a preset amplitude threshold. A logarithmic transform is then performed on the first Gaussian image to obtain a first logarithmic image, and the initial pipeline weld image is further transformed using logarithmic transformation to obtain a second logarithmic image. Signal separation is then performed on the first and second logarithmic images to obtain a target image. The target image includes high-frequency region information, which is the image information of the pipeline weld in the initial pipeline weld image. In this way, only high-frequency region information is retained, reducing the interference of low-frequency region information on weld detection during the detection process, thereby improving the accuracy of pipeline weld detection.
[0007] In one possible implementation, the initial pipe weld image is subjected to sharp-edge filtering to obtain a first filtered image. The first filtered image is then spatially filtered to obtain a second filtered image. The second filtered image is then Gaussian blurred to obtain a first Gaussian image.
[0008] In another possible implementation, image enhancement is performed on the first Gaussian image to obtain a second Gaussian image. A logarithmic transformation is then performed on the second Gaussian image to obtain a first logarithmic image.
[0009] In another possible implementation, a bit-depth transformation is performed on the second Gaussian image to obtain first pixel bit-depth information, which includes the pixel value of each pixel in the second Gaussian image. The first pixel bit-depth information is then additively offset and normalized to obtain second pixel bit-depth information, where each pixel value in the second pixel bit-depth information corresponds one-to-one with the pixel values in the first pixel bit-depth information, and the pixel values of pixels in the second pixel bit-depth information are greater than the corresponding pixel values in the first pixel bit-depth information. A logarithmic transformation is then performed based on the second pixel bit-depth information to obtain a first logarithmic image.
[0010] In another possible implementation, the first logarithmic image and the second logarithmic image are separated to obtain a high-frequency feature image. Based on the pixel value of each pixel in the high-frequency feature image, an effective signal range is determined. Based on the effective signal range, a target image is determined, which includes pixels in the high-frequency feature image whose pixel values fall within the effective signal range.
[0011] In another possible implementation, the pixel mean and standard deviation of the high-frequency feature image are determined based on the pixel value of each pixel in the high-frequency feature image. The effective signal range is then determined based on the pixel mean and standard deviation.
[0012] In another possible implementation, target pixels that satisfy the effective signal range are determined from the high-frequency feature image. The pixel values of these target pixels are then amplified using a preset linear function to obtain amplified target pixels. These amplified target pixels fall within a preset signal range, which is greater than the effective signal range. A target image is then generated based on these amplified target pixels.
[0013] In another possible implementation, the linear function is presupposed to satisfy the following formula: T out = [(R min - R min ) / (R max - R min )] × (T max - T min ) + T min .
[0014] Among them, R in T is used to represent the pixel value of the unmagnified target pixel. out R is used to represent the pixel value of the magnified target pixel. min R is used to represent the minimum pixel value within the effective signal range. max T is used to represent the maximum pixel value within the effective signal range. min T is used to represent the minimum pixel value within a preset signal range. max Used to represent the maximum pixel value within a preset signal range.
[0015] Secondly, this application provides an apparatus for detecting images of pipe welds, the apparatus comprising: The module includes an acquisition module for acquiring an initial pipeline weld image. A processing module performs Gaussian blurring on the initial pipeline weld image to obtain a first Gaussian image. The first Gaussian image includes low-frequency region information, which refers to information in the initial pipeline weld image whose spatial variation amplitude is less than a preset amplitude threshold. The processing module also performs a logarithmic transformation on the first Gaussian image to obtain a first logarithmic image, and then performs a logarithmic transformation on the initial pipeline weld image to obtain a second logarithmic image. Finally, the processing module performs signal separation based on the first and second logarithmic images to obtain a target image, and then detects the pipeline weld based on the target image. The target image includes high-frequency region information, which is the image information of the pipeline weld in the initial pipeline weld image.
[0016] In one possible implementation, the processing module is further configured to perform sharp-edge filtering on the initial pipe weld image to obtain a first filtered image. The processing module is further configured to perform spatial filtering on the first filtered image to obtain a second filtered image. The processing module is further configured to perform Gaussian blur processing on the second filtered image to obtain a first Gaussian image.
[0017] In another possible implementation, the processing module is further configured to perform image enhancement on the first Gaussian image to obtain a second Gaussian image. The processing module is also configured to perform a logarithmic transformation on the second Gaussian image to obtain a first logarithmic image.
[0018] In another possible implementation, the processing module is further configured to perform image bit-depth transformation on the second Gaussian image to obtain first pixel bit-depth information, which includes the pixel value of each pixel in the second Gaussian image. The processing module is further configured to perform additive pixel value shifting and normalization on the first pixel bit-depth information to obtain second pixel bit-depth information, where the pixel values of each pixel in the second pixel bit-depth information correspond one-to-one with the pixel values of each pixel in the first pixel bit-depth information, and the pixel values of the pixels in the second pixel bit-depth information are greater than the corresponding pixel values in the first pixel bit-depth information. The processing module is further configured to perform a logarithmic transformation based on the second pixel bit-depth information to obtain a first logarithmic image.
[0019] In another possible implementation, the processing module is further configured to perform signal separation on the first logarithmic image and the second logarithmic image to obtain a high-frequency feature image. The processing module is also configured to determine an effective signal range based on the pixel value of each pixel in the high-frequency feature image. Furthermore, the processing module is configured to determine a target image based on the effective signal range, the target image comprising pixels in the high-frequency feature image whose pixel values fall within the effective signal range.
[0020] In another possible implementation, the processing module is further configured to determine the pixel mean and pixel standard deviation corresponding to the high-frequency feature image based on the pixel value of each pixel in the high-frequency feature image. Based on the pixel mean and pixel standard deviation, the effective signal range is determined.
[0021] In another possible implementation, the processing module is further configured to determine target pixels that satisfy the effective signal range from the high-frequency feature image. The pixel values of the target pixels are then amplified using a preset linear function to obtain amplified target pixels. These amplified target pixels fall within a preset signal range, which is greater than the effective signal range. The processing module is also configured to generate a target image based on the amplified target pixels.
[0022] In another possible implementation, the linear function is presupposed to satisfy the following formula: T out = [(Rmin - R min ) / (R max - R min )] × (T max - T min ) + T min .
[0023] Among them, R in T is used to represent the pixel value of the unmagnified target pixel. out R is used to represent the pixel value of the magnified target pixel. min R is used to represent the minimum pixel value within the effective signal range. max T is used to represent the maximum pixel value within the effective signal range. min T is used to represent the minimum pixel value within a preset signal range. max Used to represent the maximum pixel value within a preset signal range.
[0024] Thirdly, this application provides a device for detecting pipeline weld images, the device comprising: a processor and a memory; the processor and the memory being coupled; the memory being used to store one or more programs, the one or more programs including computer-executable instructions, wherein when the pipeline weld image detection device is running, the processor executes the computer-executable instructions stored in the memory to implement the method as described in the first aspect and any possible implementation thereof.
[0025] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect and any possible implementation thereof.
[0026] Fifthly, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run computer programs or instructions to implement the methods described in the first aspect and any possible implementation thereof.
[0027] Sixthly, this application provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods described in the first aspect and any possible implementation thereof.
[0028] The technical problems that can be solved and the technical effects that can be achieved by the detection device, computer, computer storage medium, chip or computer program product for pipeline weld images mentioned above can be referred to the technical problems and technical effects solved in the first aspect above, and will not be repeated here. Attached Figure Description
[0029] Figure 1 A schematic flowchart illustrating a method for detecting pipeline weld images provided in an embodiment of this application; Figure 2 A flowchart illustrating another method for detecting pipe weld images provided in an embodiment of this application; Figure 3 A flowchart illustrating another method for detecting pipe weld images provided in an embodiment of this application; Figure 4 A schematic diagram of the structure of a pipe weld image detection device provided in an embodiment of this application; Figure 5 A schematic diagram of the structure of another pipe weld image detection device provided in an embodiment of this application; Figure 6 A conceptual partial view of a computer program product provided for an embodiment of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the steps or modules listed, but may optionally include other steps or modules not listed, or may optionally include other steps or modules inherent to such process, method, product, or device.
[0032] Furthermore, in the embodiments of this application, the words "exemplary" or "for example" are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design that is described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design options. Specifically, the use of the words "exemplary" or "for example" is intended to present concepts in a concrete manner.
[0033] like Figure 1 As shown, this application provides a method for detecting pipeline weld images, the method comprising: S101. Obtain the initial pipeline weld image.
[0034] In this embodiment of the application, the initial pipe weld image includes an image of the pipe weld area and an image of the environment surrounding the pipe weld.
[0035] For example, the initial image of the pipe weld can be a digital radiography (DR) image.
[0036] S102. Gaussian blurring is performed on the initial pipeline weld image to obtain the first Gaussian image.
[0037] The first Gaussian image includes low-frequency region information, which is information in the initial pipeline weld image whose change amplitude with spatial position is less than a preset amplitude threshold.
[0038] It should be understood that the amplitude of change refers to the degree of difference in grayscale values (or pixel values) between adjacent pixels in the initial pipe weld image, used to describe the "severity of fluctuation" of the image signal with spatial location. The smaller the difference between adjacent pixels, the smaller the amplitude of change, and the more it conforms to the definition of low-frequency region information.
[0039] For example, the preset amplitude threshold can be 5, 6, 10, etc.
[0040] It should be understood that, according to signal processing logic, an image can be divided into "low-frequency components" and "high-frequency components." High-frequency components correspond to "rapidly changing details" (such as features of objects in an image, like pipe welds), and are the core of reflecting the object's "reflective properties." Low-frequency lighting components correspond to "slowly changing overall brightness" (such as the lighting gradient of "brighter upper half and darker lower half" in a backlit scene, or the light and shadow distribution of "brighter edges and darker corners" in an indoor scene), and are "ambient lighting information" formed by the light source, not reflecting the object's inherent properties.
[0041] In other words, Gaussian blurring can preserve low-frequency information in an image where gray values change slowly with spatial location, which reflects the properties of the object itself.
[0042] In this embodiment of the application, the low-frequency region information includes: the global illumination distribution of the image, uniform bright and dark regions, and macroscopic light and shadow gradient.
[0043] In one possible implementation, the initial pipe weld image can be Gaussian blurred according to preset blur parameters to obtain a first Gaussian image, where the preset blur parameters are used to indicate the degree of blurring of the image.
[0044] It should be understood that the values of the preset fuzzy parameters are not modified in the embodiments of this application. For example, the preset fuzzy parameter is sigma, and the sigma value is 25.
[0045] S103. Perform a logarithmic transformation on the first Gaussian image to obtain the first logarithmic image.
[0046] In one possible implementation, image enhancement is performed on the first Gaussian image to obtain a second Gaussian image. A logarithmic transformation is then performed on the second Gaussian image to obtain a first logarithmic image.
[0047] For example, image enhancement algorithms can be used to perform image enhancement. The Retinex algorithm, for instance, can be used, but this application does not limit the specific implementation of the embodiments.
[0048] In one possible implementation, a bit-depth transformation is performed on the second Gaussian image to obtain first pixel bit-depth information, which includes the pixel value of each pixel in the second Gaussian image. The first pixel bit-depth information is then additively offset and normalized to obtain second pixel bit-depth information, where each pixel value in the second pixel bit-depth information corresponds one-to-one with the pixel values in the first pixel bit-depth information, and the pixel values of pixels in the second pixel bit-depth information are greater than the corresponding pixel values in the first pixel bit-depth information. A logarithmic transformation is then performed based on the second pixel bit-depth information to obtain a first logarithmic image.
[0049] For example, the second Gaussian image can be converted to a 16-bit unsigned integer to complete the image bit-depth conversion. Then, each pixel can be incremented by 1 (i.e., the pixel value is additively offset) to avoid the mathematical error of log(0) in subsequent logarithmic operations. Then, it is normalized to a 32-bit floating-point number and mapped to the [0,1] interval to ensure the numerical stability of the logarithmic operation.
[0050] It is understandable that by performing image bit-depth transformation, additive pixel value shifting, and normalization, the natural logarithm of the image can be calculated, thereby transforming the image from the linear domain to the logarithmic domain. This allows for the compression of the high grayscale range, the expansion of the low grayscale range, and the enhancement of details in dark areas.
[0051] S104. Perform a logarithmic transformation on the initial pipe weld image to obtain a second logarithmic image.
[0052] It should be noted that the description of S104 can be found in the description of S103 above, and will not be repeated here.
[0053] S105. Based on the first logarithmic image and the second logarithmic image, perform signal separation to obtain the target image, and then detect the pipe weld based on the target image.
[0054] The target image includes high-frequency region information, which is the image information of the pipe weld in the initial pipe weld image.
[0055] For example, high-frequency area information includes: pipe weld edges, local textures, and detailed noise.
[0056] In one possible implementation, the first logarithmic image and the second logarithmic image can be separated to obtain a high-frequency feature image, which is then used as the target image. The high-frequency feature image includes high-frequency region information.
[0057] In one possible implementation, a trained weld detection model can be used to detect the target image to obtain information about the pipe weld. The weld detection model is used to detect information about the pipe weld from the image.
[0058] For example, a training set can be used to train the detection weld model to obtain the trained detection weld model. The training set includes training sample images and pipe weld information labeled for each training sample image.
[0059] Based on the above technical solution, an initial pipeline weld image is obtained. Gaussian blurring is then applied to the initial pipeline weld image to obtain a first Gaussian image. The first Gaussian image includes low-frequency region information, which refers to information in the initial pipeline weld image whose spatial variation amplitude is less than a preset amplitude threshold. A logarithmic transform is then performed on the first Gaussian image to obtain a first logarithmic image, and the initial pipeline weld image is further transformed using logarithmic transformation to obtain a second logarithmic image. Signal separation is then performed on the first and second logarithmic images to obtain a target image. The target image includes high-frequency region information, which is the image information of the pipeline weld in the initial pipeline weld image. In this way, only high-frequency region information is retained, reducing the interference of low-frequency region information on weld identification during the recognition process, thereby improving the accuracy of pipeline weld detection.
[0060] like Figure 2 As shown, another method for detecting pipe weld images provided in this application embodiment, wherein step S102 of the method may include: S201. Sharp edge filtering is applied to the initial pipeline weld image to obtain the first filtered image.
[0061] In one possible implementation, the Laplacian operator can be used to process the initial pipe weld image to obtain a first filtered image.
[0062] For example, a 3×3 Laplacian filter template is constructed. This template enhances edge details by combining a positive weight of 5.0 for the center pixel with a negative weight of -0.9 for its four neighbors, while reducing high-frequency noise amplification through asymmetric weights (excluding diagonal pixels). The filter2D function is used to perform convolution operations on the source image, directly updating the result on the initial pipe weld image (in-place operation), thereby improving image sharpness by enhancing the grayscale differences between pixels.
[0063] S202. Perform spatial filtering on the first filtered image to obtain the second filtered image.
[0064] In one possible implementation, median filtering can be used to process the first filtered image to obtain the second filtered image.
[0065] It should be understood that spatial filtering can remove image noise.
[0066] S203. Perform Gaussian blur processing on the second filtered image to obtain the first Gaussian image.
[0067] It should be noted that the description of Gaussian blur processing in S102 can be referred to for the introduction of S203, and will not be repeated here.
[0068] In this embodiment of the application, the first Gaussian image is an image of low-frequency illumination components.
[0069] Based on the above technical solution, sharp-edge filtering is applied to the initial pipeline weld image to obtain a first filtered image. Spatial filtering is then applied to the first filtered image to obtain a second filtered image. This process filters image noise, improving image quality and enhancing high-frequency detail features. Subsequently, Gaussian blurring is applied to the second filtered image to obtain a first Gaussian image, thereby improving the accuracy of acquiring low-frequency region information.
[0070] like Figure 3 As shown, another method for detecting pipe weld images provided in this application embodiment, wherein step S105 of the method may include: S301. Separate the first logarithmic image and the second logarithmic image to obtain a high-frequency feature image.
[0071] In one possible implementation, the high-frequency feature image can be obtained by subtracting the first logarithmic image from the second logarithmic image.
[0072] For example, the high-frequency feature image = the second logarithmic image - the first logarithmic image.
[0073] In this way, by subtracting the low-frequency illumination portion of the first logarithmic image from the second logarithmic image, it is possible to suppress uneven illumination.
[0074] S302. Determine the effective signal range based on the pixel value of each pixel in the high-frequency feature image.
[0075] In one possible implementation, the effective signal range is determined based on the maximum and minimum pixel values in the high-frequency feature image, where the minimum value of the effective signal range is the minimum pixel value in the high-frequency feature image and the maximum value of the effective signal range is the maximum pixel value in the high-frequency feature image.
[0076] In another possible implementation, the pixel mean and standard deviation of the high-frequency feature image are determined based on the pixel value of each pixel in the high-frequency feature image. Then, the effective signal range is determined based on the pixel mean and standard deviation.
[0077] For example, the maximum value of the effective signal range = average pixel value + K × standard pixel deviation. The minimum value of the effective signal range = average pixel value - K × standard pixel deviation, where K is a scaling factor used to adjust the size of the effective signal range, and K is greater than 0.
[0078] For example, K can be 2 or 3.
[0079] S303. Determine the target image based on the effective signal range.
[0080] The target image includes pixels in the high-frequency feature image whose pixel values are within the effective signal range.
[0081] In one possible implementation, target pixels that satisfy the effective signal range are determined from the high-frequency feature image. A target image is then generated based on these target pixels.
[0082] For example, if the pixel values in the high-frequency feature image include 10, 20, 35, 66, and 128, and the effective signal range is [15, 72], then the target pixel is the pixel corresponding to pixel values 20, 35, and 66.
[0083] Understandably, by using the effective signal range, it is possible to identify pixels that better reflect the characteristics of the pipe weld.
[0084] In one possible implementation, target pixels that satisfy the effective signal range are determined from the high-frequency feature image. Then, the pixel values of the target pixels are amplified using a preset linear function to obtain amplified target pixels. These amplified target pixels fall within a preset signal range, which is greater than the effective signal range. Based on these amplified target pixels, a target image is generated.
[0085] In one possible implementation, the linear function is presupposed to satisfy the following formula: T out = [(R min - R min ) / (R max - R min )] × (T max - T min ) + T min .
[0086] Among them, R in T is used to represent the pixel value of the unmagnified target pixel. out R is used to represent the pixel value of the magnified target pixel. min R is used to represent the minimum pixel value within the effective signal range. max T is used to represent the maximum pixel value within the effective signal range. min T is used to represent the minimum pixel value within a preset signal range. max Used to represent the maximum pixel value within a preset signal range.
[0087] For example, with an effective signal range of [15, 72], the pixel value of the target pixel is stretched to the dynamic range of a 16-bit unsigned integer [0, 65535] through a linear mapping. Then R min R is 15. max It is 72, T min =0, T max It is 65535.
[0088] For example, the magnified target pixels are converted into a 16-bit unsigned integer image, which is then used as the target image.
[0089] In this embodiment of the application, after the target image is determined, pipe weld detection can be performed on the target image.
[0090] Understandably, by defining the effective signal range, pixels that better reflect the characteristics of the pipe weld can be identified. Then, by amplifying the pixel values of the target pixels using a preset linear function, the differences between pixels can be maximized, thereby improving contrast. In this way, generating a target image based on the amplified target pixels can more clearly reflect the characteristics of the pipe weld.
[0091] The above primarily describes the solutions provided in the embodiments of this application from a methodological perspective. It is understood that the pipe weld image detection device, in order to achieve the above functions, includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that the pipe weld image detection method steps described in conjunction with the embodiments disclosed in this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0092] This application also provides a device for detecting pipeline weld images. This device can be a server, a CPU within the server, a detection module within the server for detecting pipeline weld images, or a client within the server for detecting pipeline weld images.
[0093] This application embodiment can divide the pipeline weld image detection device into functional modules or functional units according to the above method example. For example, each function can be divided into a separate functional module or functional unit, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or in software functional modules or functional units. The module or unit division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0094] This application provides an apparatus for detecting images of pipe welds. For example... Figure 4 As shown, the device for detecting pipeline weld images may include an acquisition module 401 and a processing module 402.
[0095] The acquisition module 401 is used to acquire an initial pipeline weld image. The processing module 402 is used to perform Gaussian blur processing on the initial pipeline weld image to obtain a first Gaussian image. The first Gaussian image includes low-frequency region information, which is information in the initial pipeline weld image whose change amplitude with spatial position is less than a preset amplitude threshold. The processing module 402 is also used to perform a logarithmic transformation on the first Gaussian image to obtain a first logarithmic image, and then perform a logarithmic transformation on the initial pipeline weld image to obtain a second logarithmic image. The processing module 402 is also used to perform signal separation based on the first and second logarithmic images to obtain a target image. The target image includes high-frequency region information, which is the image information of the pipeline weld in the initial pipeline weld image.
[0096] In one possible implementation, processing module 402 is further configured to perform sharp-edge filtering on the initial pipe weld image to obtain a first filtered image. Processing module 402 is further configured to perform spatial filtering on the first filtered image to obtain a second filtered image. Processing module 402 is further configured to perform Gaussian blur processing on the second filtered image to obtain a first Gaussian image.
[0097] In another possible implementation, processing module 402 is further configured to perform image enhancement on the first Gaussian image to obtain a second Gaussian image. Processing module 402 is also configured to perform a logarithmic transformation on the second Gaussian image to obtain a first logarithmic image.
[0098] In another possible implementation, processing module 402 is further configured to perform image bit-depth transformation on the second Gaussian image to obtain first pixel bit-depth information, which includes the pixel value of each pixel in the second Gaussian image. Processing module 402 is further configured to perform additive pixel value shifting and normalization on the first pixel bit-depth information to obtain second pixel bit-depth information, where the pixel value of each pixel in the second pixel bit-depth information corresponds one-to-one with the pixel value of each pixel in the first pixel bit-depth information, and the pixel value of a pixel in the second pixel bit-depth information is greater than the pixel value of the corresponding pixel in the first pixel bit-depth information. Processing module 402 is further configured to perform logarithmic transformation based on the second pixel bit-depth information to obtain a first logarithmic image.
[0099] In another possible implementation, processing module 402 is further configured to perform signal separation on the first logarithmic image and the second logarithmic image to obtain a high-frequency feature image. Processing module 402 is further configured to determine an effective signal range based on the pixel value of each pixel in the high-frequency feature image. Processing module 402 is further configured to determine a target image based on the effective signal range, the target image comprising pixels in the high-frequency feature image whose pixel values fall within the effective signal range.
[0100] In another possible implementation, processing module 402 is further configured to determine the pixel mean and pixel standard deviation corresponding to the high-frequency feature image based on the pixel value of each pixel in the high-frequency feature image. Based on the pixel mean and pixel standard deviation, the effective signal range is determined.
[0101] In another possible implementation, processing module 402 is further configured to determine target pixels that satisfy the effective signal range from the high-frequency feature image. The pixel value of the target pixel is amplified using a preset linear function to obtain amplified target pixels. The amplified target pixels are within a preset signal range, which is greater than the effective signal range. Processing module 402 is further configured to generate a target image based on the amplified target pixels.
[0102] In another possible implementation, the linear function is presupposed to satisfy the following formula: Tout = [(Rmin - Rmin) / (Rmax - Rmin)] × (Tmax - Tmin) + Tmin.
[0103] Wherein, Rin represents the pixel value of the unmagnified target pixel, Tout represents the pixel value of the magnified target pixel, Rmin represents the minimum pixel value in the effective signal range, Rmax represents the maximum pixel value in the effective signal range, Tmin represents the minimum pixel value in the preset signal range, and Tmax represents the maximum pixel value in the preset signal range.
[0104] Figure 5 This is a schematic diagram illustrating the structure of a pipe weld image detection device according to an exemplary embodiment. The pipe weld image detection device may include a processor 502, which executes application code to implement the pipe weld image detection method of this application.
[0105] The processor 502 may be a central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.
[0106] like Figure 5 As shown, the device for detecting pipe weld images may further include a memory 503. The memory 503 stores the application code that executes the scheme of this application, and its execution is controlled by the processor 502.
[0107] Memory 503 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 503 may exist independently and be connected to processor 502 via bus 504. Memory 503 may also be integrated with processor 502.
[0108] like Figure 5 As shown, the pipe weld image detection device may further include a communication interface 501, wherein the communication interface 501, processor 502, and memory 503 may be coupled to each other, for example, through a bus 504. The communication interface 501 is used for information exchange with other devices, for example, supporting information exchange between the pipe weld image detection device and other devices.
[0109] It should be pointed out that, Figure 5 The equipment structure shown does not constitute a limitation on the detection device for the pipeline weld image, except... Figure 5 In addition to the components shown, the device for detecting the pipe weld image may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0110] In actual implementation, the functions implemented by the processing unit can be derived from... Figure 5 The processor 502 shown calls the program code in memory 503 to implement this.
[0111] This application also provides a computer-readable storage medium storing instructions that, when executed by a processor of a computer device, enable the computer to perform the pipe weld image detection method provided in the above-described embodiments. For example, the computer-readable storage medium may be a memory 503 including instructions, which may be executed by a processor 502 of a computer device to complete the above method. Optionally, the computer-readable storage medium may be a non-transitory computer-readable storage medium, such as a ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.
[0112] Figure 6 A conceptual partial view of a computer program product provided in an embodiment of this application is shown schematically. The computer program product includes a computer program for executing computer processes on a computing device.
[0113] In one embodiment, the computer program product is provided using a signal bearer medium 600. The signal bearer medium 600 may include one or more program instructions.
[0114] In some examples, the signal carrying medium 600 may include a computer-readable medium 601, such as, but not limited to, a hard disk drive, a compact disc (CD), a digital video optical disc (DVD), a digital magnetic tape, a memory, a read-only memory (ROM), or a random access memory (RAM), and so on.
[0115] In some implementations, the signal carrying medium 600 may include a computer recordable medium 602, such as, but not limited to, a memory, a read / write (R / W) CD, an R / W DVD, and so on.
[0116] In some implementations, the signal carrying medium 600 may include a communication medium 603, such as, but not limited to, digital and / or analog communication media (e.g., fiber optic cables, waveguides, wired communication links, wireless communication links, etc.).
[0117] The signal-bearing medium 600 can be transmitted by a wireless communication medium 603. One or more program instructions may be, for example, computer-executable instructions or logical implementation instructions.
[0118] In some examples, the device for detecting pipe weld images can be configured to provide various operations, functions, or actions in response to one or more program instructions via a computer-readable medium 601, a computer-recordable medium 602, and / or a communication medium 603.
[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0120] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0121] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the constituent units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0122] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0123] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, essentially, or the part that contributes to the prior art, or a complete or partial classification of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0124] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for detecting pipeline weld images, characterized in that, The method includes: Obtain the initial image of the pipe weld; Gaussian blurring is performed on the initial pipe weld image to obtain a first Gaussian image. The first Gaussian image includes low-frequency region information, which is information in the initial pipe weld image whose change amplitude with spatial position is less than a preset amplitude threshold. A first logarithmic image is obtained by performing a logarithmic transformation on the first Gaussian image, and a second logarithmic image is obtained by performing a logarithmic transformation on the initial pipe weld image. Signal separation is performed based on the first logarithmic image and the second logarithmic image to obtain a target image, and the pipe weld is detected based on the target image. The target image includes high-frequency region information, which is the image information of the pipe weld in the initial pipe weld image.
2. The method according to claim 1, characterized in that, The step of performing Gaussian blurring on the initial pipe weld image to obtain a first Gaussian image includes: The initial pipe weld image is subjected to sharp edge filtering to obtain the first filtered image; Spatial filtering is performed on the first filtered image to obtain the second filtered image; The second filtered image is subjected to Gaussian blurring to obtain the first Gaussian image.
3. The method according to claim 1, characterized in that, The step of performing a logarithmic transformation based on the first Gaussian image to obtain the first logarithmic image includes: Image enhancement is performed on the first Gaussian image to obtain a second Gaussian image; The second Gaussian image is logarithmically transformed to obtain the first logarithmic image.
4. The method according to claim 3, characterized in that, The step of performing a logarithmic transformation on the second Gaussian image to obtain the first logarithmic image includes: The second Gaussian image is subjected to image bit depth transformation to obtain first pixel bit depth information, which includes the pixel value of each pixel in the second Gaussian image; The first pixel bit depth information is additively offset by pixel value and normalized to obtain the second pixel bit depth information. The pixel value of each pixel in the second pixel bit depth information corresponds one-to-one with the pixel value of each pixel in the first pixel bit depth information. The pixel value of the second pixel bit depth information pixel is greater than the pixel value of the corresponding pixel in the first pixel bit depth information. The first logarithmic image is obtained by performing a logarithmic transformation based on the second pixel bit depth information.
5. The method according to any one of claims 1-4, characterized in that, The step of performing signal separation based on the first logarithmic image and the second logarithmic image to obtain the target image includes: The first logarithmic image and the second logarithmic image are separated to obtain a high-frequency feature image; The effective signal range is determined based on the pixel value of each pixel in the high-frequency feature image. Based on the effective signal range, the target image is determined, and the target image includes pixels whose pixel values in the high-frequency feature image are within the effective signal range.
6. The method according to claim 5, characterized in that, Determining the effective signal range based on the pixel value of each pixel in the high-frequency feature image includes: Based on the pixel value of each pixel in the high-frequency feature image, determine the pixel mean and pixel standard deviation corresponding to the high-frequency feature image; The effective signal range is determined based on the pixel average value and the pixel standard deviation.
7. The method according to claim 5, characterized in that, Determining the target image based on the effective signal range includes: Based on the effective signal range, target pixels that satisfy the effective signal range are determined from the high-frequency feature image; The pixel value of the target pixel is amplified by a preset linear function to obtain an amplified target pixel. The amplified target pixel is within a preset signal range, which is greater than the effective signal range. The target image is generated based on the magnified target pixels.
8. The method according to claim 7, characterized in that, The preset linear function satisfies the following formula: T out = [(R min - R min ) / (R max - R min )] × (T max - T min ) + T min ; Among them, R in T is used to represent the pixel value of the target pixel when it is not magnified. out R is used to represent the pixel value of the magnified target pixel. min R is used to represent the minimum pixel value within the effective signal range. max T is used to represent the maximum pixel value within the effective signal range. min T is used to represent the minimum pixel value within the preset signal range. max Used to represent the maximum pixel value within the preset signal range.
9. A device for detecting images of pipe welds, characterized in that, The device includes: The acquisition module is used to acquire initial pipe weld images; The processing module is used to perform Gaussian blur processing on the initial pipe weld image to obtain a first Gaussian image. The first Gaussian image includes low-frequency region information, which is information in the initial pipe weld image whose change amplitude with spatial position is less than a preset amplitude threshold. The processing module is further configured to perform a logarithmic transformation on the first Gaussian image to obtain a first logarithmic image, and to perform a logarithmic transformation on the initial pipe weld image to obtain a second logarithmic image; The processing module is further configured to perform signal separation based on the first logarithmic image and the second logarithmic image to obtain a target image, and to detect the pipe weld based on the target image. The target image includes high-frequency region information, which is the image information of the pipe weld in the initial pipe weld image.
10. A device for detecting images of pipe welds, characterized in that, include: Processor and memory; The processor and the memory are coupled; The memory is used to store one or more programs, the one or more programs including computer-executable instructions, wherein when the pipe weld image detection device is running, the processor executes the computer-executable instructions stored in the memory to cause the pipe weld image detection device to perform the method as described in any one of claims 1-8.