A Tone Mapping Method for Casting X-ray High Dynamic Image

By combining the dynamic range segmentation method of image airspace and frequency domain information and the image fusion weight calculation method of guide filtering, the problem of highlighting details and cumbersome window adjustment operations in casting X-ray image processing is solved, and efficient Improved image processing and detection efficiency.

CN113393406BActive Publication Date: 2025-02-07SHENYANG RES INST OF FOUNDRY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110550442.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-20
Publication Date
2025-02-07
Estimated Expiration
2041-05-20

AI Technical Summary

Technical Problem

现有技术在铸件X射线图像处理中,难以在无人工介入的情况下,高效凸显图像全局的细节信息,且窗宽窗位调节操作繁琐耗时。

Method used

The image dynamic range slitting method combining image airspace and frequency domain information, and the image fusion weight calculation method using guide filtering is used to realize multi-slicing fusion of the image to maintain the edge and texture information of the image.

Benefits of technology

It realizes that the global details of the casting X-ray image can be efficiently highlighted without manual intervention, avoiding the cumbersome operation of window width and window position adjustment, and improving detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113393406B_ABST
    Figure CN113393406B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for tone mapping of high-dynamic X-ray images of castings. The method combines an image dynamic range segmentation method with image spatial and frequency domain information to completely retain the global information of the image. The image fusion weight calculation method based on guided filtering enables the final image to maintain the edge and texture information of the original image, that is, to complete the tone mapping of high-dynamic X-ray images of castings. The casting X-ray image enhancement method of the present invention simulates the window width and window position adjustment operation, and proposes an image dynamic range segmentation method combining image spatial and frequency domain information, which completely retains the global information of the image. The present invention proposes an image fusion weight calculation method based on guided filtering, which can not only enable the final image to maintain the edge and texture information of the original image, but also improve the operation efficiency of the algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of casting defect detection and image processing, and in particular to a casting X-ray high dynamic image tone mapping method. Background Art

[0002] Due to various reasons such as casting process and materials, there are often various defects inside the casting. Based on X-ray digital imaging technology, images containing the internal structure and defect information of the casting can be directly generated. It is a non-destructive testing technology that is widely used in the field of casting inspection. However, with the continuous advancement of X-ray digital imaging technology, the bit depth of X-ray images has developed from 8bit to 16bit, while the display still remains at 8bit image display. Only a small number of dedicated displays can display 10-12bit images. Even so, as the dynamic range of the display expands, the brightness of the display also increases, which is not suitable for long-term observation by the human eye. In order to solve the contradiction between the different dynamic ranges between imaging and observation, the image enhancement method of adjusting the window width / window position, a spatial grayscale transformation, is often used to achieve segment-by-segment observation of images in different grayscale ranges. However, this method is cumbersome and extremely time-consuming to operate in actual use. Summary of the invention

[0003] In view of the defects in the prior art, the purpose of the present invention is to provide a casting X-ray high dynamic image tone mapping method, which can highlight the detailed information of the entire image at one time without manual intervention, avoid cumbersome window width and window position adjustment, and improve detection efficiency. The main contents are as follows:

[0004] The technical solution of the present invention is: a casting X-ray high dynamic image tone mapping method, which combines the image dynamic range segmentation method of the image spatial domain and frequency domain information to completely retain the global information of the image, and the image fusion weight calculation method based on the guided filter makes the transition of each slice image after fusion natural, and can make the final image maintain the edge and texture information of the original image, so as to obtain a better casting X-ray high dynamic image tone mapping effect, and the steps are:

[0005] Step 1. Get image slices:

[0006] Step 1.1: Get the dynamic range of the image and the total number of pixels in the image

[0007] l range = l max -l min

[0008] f range =m×n

[0009] Among them l max is the maximum gray value of the initial image, l minis the minimum gray value of the initial image, according to l max With l min Get the dynamic range l of the initial image range , m is the height of the initial image, n is the width of the initial image, f range is the total number of pixels in the initial image.

[0010] Step 1.2: Determine the threshold l for each slice image ei

[0011] In the present invention, each slice threshold is determined by the grayscale of the initial image and the grayscale frequency. First, the threshold I is determined based on the grayscale of the initial image. i :

[0012]

[0013] Secondly, the threshold e is determined according to the gray frequency. i The following equation should be satisfied:

[0014]

[0015] Where N is the number of slice images, and f(j) represents the number of pixels with grayscale j.

[0016] Finally, the final segmentation threshold for each slice is obtained

[0017] l ei = l i +0.2(e i -l i )

[0018] Step 1.3: Grayscale stretching of each slice image

[0019] Grayscale stretching is performed on each image in different grayscale ranges to obtain N slice images. H is the initial image, I j represents the j-th slice image, j = [1, 2, 3, ..., N].

[0020]

[0021] Step 2. Calculate the initial fusion weight matrix of each slice image

[0022] The size of the initial fusion weight matrix is ​​consistent with the slice image. The value M of the initial fusion weight matrix at the position (x, y) j The relationship between (x, y) and the grayscale value H(x, y) of the initial image at the position (x, y) is shown in the following formula:

[0023]

[0024] Step 3. Calculate the final fusion weight matrix of each slice image

[0025] The final fusion weight matrix of each slice image is obtained by guiding the initial fusion weight matrix. g =H / l max , regularization parameter ε = 0.2 2 , Represents mean filtering.

[0026] Step 3.1 Calculate variance and covariance

[0027]

[0028]

[0029] Step 3.2 Calculate linear parameters

[0030] a j =cov j / (var j +ε)

[0031]

[0032] Step 3.3 Get the final fusion weight matrix

[0033]

[0034] Step 4. Multi-slice image fusion

[0035] The tone-mapped result image L is obtained by combining the final fusion weight matrices w j And the corresponding slice image I j The specific formula obtained by multiplying and summing is as follows:

[0036]

[0037] Compared with the prior art, the present invention has the following advantages:

[0038] 1. The present invention is a casting X-ray image enhancement method based on histogram equalization. The invention simulates the window width and window position adjustment operation, and proposes an image dynamic range segmentation method that combines image spatial domain and frequency domain information, thereby completely retaining the global information of the image.

[0039] 2. This invention proposes an image fusion weight calculation method based on guided filtering, which not only enables the final image to maintain the edge and texture information of the original image, but also improves the operation efficiency of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 : Schematic diagram of the algorithm flow of the present invention. DETAILED DESCRIPTION

[0042] Example 1

[0043] This embodiment provides a casting X-ray high dynamic image tone mapping method, the flow chart is as follows Figure 1 As shown, the specific steps are as follows:

[0044] Step 1. Get image slices:

[0045] Step 1.1: Get the dynamic range of the image and the total number of pixels in the image

[0046] L range = l max -l min

[0047] f range =m×n

[0048] Among them l max is the maximum gray value of the initial image, l min is the minimum gray value of the initial image, according to l max With l min Get the dynamic range l of the initial image range , m is the height of the initial image, n is the width of the initial image, f range is the total number of pixels in the initial image.

[0049] Step 1.2: Determine the threshold l for each slice image ei

[0050] In the present invention, each slice threshold is determined by the grayscale of the initial image and the grayscale frequency. First, the threshold I is determined based on the grayscale of the initial image. i :

[0051]

[0052] Secondly, the threshold e is determined according to the gray frequency. i The following equation should be satisfied:

[0053]

[0054] Where N is the number of slice images, and f(j) represents the number of pixels with grayscale j.

[0055] Finally, the final segmentation threshold for each slice is obtained

[0056] l ei = l i +0.2(e i -l i )

[0057] Step 1.3: Grayscale stretching of each slice image

[0058] Grayscale stretching is performed on each image in different grayscale ranges to obtain N slice images. H is the initial image, I j represents the j-th slice image, j = [1, 2, 3, ..., N].

[0059]

[0060] Step 2. Calculate the initial fusion weight matrix of each slice image

[0061] The size of the initial fusion weight matrix is ​​consistent with the slice image. The value M of the initial fusion weight matrix at the position (x, y) j The relationship between (x, y) and the grayscale value H(x, y) of the initial image at the position (x, y) is shown in the following formula:

[0062]

[0063] Step 3. Calculate the final fusion weight matrix of each slice image

[0064] The final fusion weight matrix of each slice image is obtained by guiding the initial fusion weight matrix. g =H / l max , regularization parameter ε = 0.2 2 , Represents mean filtering.

[0065] Step 3.1 Calculate variance and covariance

[0066]

[0067]

[0068] Step 3.2 Calculate linear parameters

[0069] a j =cov j / (var j +ε)

[0070]

[0071] Step 3.3 Get the final fusion weight matrix

[0072]

[0073] Step 4. Multi-slice image fusion

[0074] The tone-mapped result image L is obtained by combining the final fusion weight matrices w j And the corresponding slice image I j The specific formula obtained by multiplying and summing is as follows:

[0075]

Claims

1. A casting X-ray high dynamic image tone mapping method, characterized in that: The specific steps of the casting X-ray high dynamic image tone mapping method are as follows: Step 1, obtain the slice image: First, obtain the dynamic range l of the initial image H range and the total number of pixels of the initial image f range ; Then determine the threshold l of each slice image ei , grayscale stretching is performed on each slice image; Step 2, calculating the initial fusion weight matrix of each slice image; Step 3, calculating the final fusion weight matrix of each slice image; Step 4: Multiple slice images are fused to obtain a tone-mapped result image; The threshold value l of each slice image in step 1 ei It is determined by the initial image grayscale and grayscale frequency, as follows: The threshold determined according to the grayscale of the initial image is as follows: The threshold e is determined according to the gray frequency i The following equation should be satisfied: Where N is the number of slice images, and f(j) represents the number of pixels with grayscale j in the initial image; Finally, we get ei , l ei Represents the threshold of the i-th slice image: l ei = l i +0.2(e i -l i ); In step 1, each slice image is grayscale stretched, that is, each image in a different grayscale range is grayscale stretched to obtain N slice images. The specific formula is as follows: Among them, I j represents the jth slice image, j = [1, 2, 3..., N], I j (x, y) and H(x, y) represent the I at the position (x, y) respectively. j and the gray value of H; The size of the initial fusion weight matrix in step 2 is consistent with the slice image; the initial fusion weight matrix M corresponding to the jth slice image j The relationship between the value at the (x, y) position and the grayscale value of the initial image H at the (x, y) position is shown in the following formula: The final fusion weight matrix of each slice image in step 3 is obtained by performing guided filtering on each initial fusion weight matrix; the guided image I of the guided filtering g =H / l max , regularization parameter ε = 0.2 2 , represents mean filtering; l max is the maximum gray value of the initial image; Calculate variance and covariance Calculate linear parameters a j =cov j / (var j +e) Get the final fusion weight matrix 2. The casting X-ray high dynamic image tone mapping method according to claim 1, characterized in that: The dynamic range of the initial image H in step 1 is l range = l max -l min , where l min is the minimum grayscale value of the initial image.

3. The casting X-ray high dynamic image tone mapping method according to claim 1, characterized in that: The total number of pixels f of the initial image in step 1 range =m×n, where m is the height of the initial image and n is the width of the initial image.

4. The casting X-ray high dynamic image tone mapping method according to claim 1, characterized in that: The tone-mapped result image L in step 4 is obtained by combining the final fusion weight matrices w j And the corresponding slice image I j The specific formula obtained by multiplying and summing is as follows:

Citation Information

Patent Citations

  • Image processing method and image processing apparatus

    CN103544684A

  • Tone mapping method based on Laplacian pyramid

    CN104504666A