Additive manufacturing 3D porosity detection method based on X-ray DR image

By using X-ray DR image detection method to perform DR detection and image processing on the test object before and after movement, the three-dimensional spatial distribution of pore defects is reconstructed, which solves the problems of low efficiency and high cost of porosity detection in the existing technology and realizes efficient and accurate porosity detection.

CN121007915APending Publication Date: 2025-11-25CHINA WEAPON SCI ACADEMY NINGBO BRANCH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511320941.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-16
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing porosity testing methods cannot achieve efficient and accurate porosity testing without damaging the structure of the product under test. This is especially true in additive manufacturing, where traditional metallographic microscopy testing suffers from local sampling errors, while industrial CT testing is costly and time-consuming.

Method used

An additive manufacturing 3D porosity detection method based on X-ray DR images is adopted. The X-ray DR detection system is used to perform DR detection on the object to be inspected before and after movement. Image translation and alignment, grayscale image erosion processing and binarization processing are performed to reconstruct the three-dimensional spatial distribution of pore defects and calculate the porosity.

Benefits of technology

It enables efficient and accurate detection of porosity without damaging the structure of the product under test, improving detection efficiency, reducing costs, and meeting the needs for rapid and accurate quantitative detection of complex structural components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121007915A_ABST
    Figure CN121007915A_ABST
Patent Text Reader

Abstract

The invention relates to an additive manufacturing 3D porosity detection method based on an X-ray DR image, and the method comprises the steps: carrying out the DR detection of a to-be-detected object before and after the movement through an X-ray DR detection system, carrying out the translation alignment operation of the obtained DR image, then carrying out the image erosion, binarization and translation alignment, and obtaining a binary image after translation alignment, all pore defect pairs belonging to the same isolated pore defect in the new binary image are screened out, defect distribution reconstruction is carried out on the isolated pores in a three-dimensional space, and the three-dimensional space after defect reconstruction and position information of the isolated pores in the three-dimensional space after defect reconstruction are obtained; and calculating the ratio of the pore volume per unit volume to the unit volume, and taking the ratio as the 3D porosity of the object to be detected. Therefore, the defect three-dimensional space distribution reconstruction is realized by utilizing the image of the internal volume defect of the to-be-detected object detected by the X rays, and the 3D porosity detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of porosity detection, and more particularly to an additive manufacturing 3D porosity detection method based on X-ray DR images. Background Technology

[0002] In additive manufacturing (i.e., 3D printing) technology, porosity (the ratio of pore volume to total volume in a material) is one of the core indicators for measuring additive manufacturing quality. Since additive manufacturing is a process of building up layers, fluctuations in the operating status of the additive manufacturing equipment or improper printing process parameters can lead to the formation of pores, which directly affect the mechanical properties and reliability of the parts manufactured by the additive manufacturing equipment.

[0003] To detect the porosity of components, existing porosity testing methods in the industrial field primarily involve sampling the product under test using a metallographic microscope, followed by polishing and etching of the material cross-section. Images of the etched cross-section are then captured using the metallographic microscope, and image analysis software is used to calculate the proportion of pore area per unit field of view, thus obtaining the porosity of the product. This metallographic microscope-based porosity testing method offers advantages such as high measurement accuracy (>1µm) and direct observation of pore morphology and distribution, enabling two-dimensional porosity measurement. However, this method is essentially still a "local sampling" with a limited field of view. If the pore distribution on the product is uneven, this method is highly susceptible to porosity detection errors and cannot detect deep pores within the product.

[0004] With the continuous development of CT technology, industrial CT technology, based on the principle of X-ray penetration imaging, has become an advanced technology for non-destructive testing and three-dimensional imaging of the internal structure of industrial products. Industrial CT technology uses computer reconstruction of projection data from different angles of industrial products to generate tomographic images and three-dimensional models of the internal structure of the product, thereby enabling precise analysis of internal defects (such as pores, cracks, or inclusions), structural dimensions, and assembly relationships in materials, parts, or components. Therefore, using industrial CT technology for porosity detection is one of the mainstream solutions for achieving high-precision and non-destructive porosity detection in the industrial field, especially suitable for scenarios with high requirements for the distribution, morphology, and quantification accuracy of internal pores (such as additive manufacturing parts, composite materials, and precision castings). Specifically, industrial CT can acquire a three-dimensional digital model of the internal structure of an industrial product, and then perform image segmentation and quantitative analysis on the acquired three-dimensional digital model to calculate the porosity of the industrial product.

[0005] Compared to porosity detection methods based on metallographic microscopes, porosity detection methods based on industrial CT technology have the advantage of being adaptable to complex structural components. They can achieve three-dimensional full-scale porosity detection and analysis without damaging industrial products, with measurement accuracy down to the micrometer level. However, this porosity detection method based on industrial CT technology has the disadvantages of long detection time and high detection cost.

[0006] Therefore, how to achieve efficient and accurate detection of the porosity of the product under test without damaging its structure has become a technical problem that urgently needs to be solved in the field of porosity detection. Summary of the Invention

[0007] The technical problem to be solved by this invention is to provide a method for detecting 3D porosity in additive manufacturing based on X-ray DR images, addressing the aforementioned shortcomings of the prior art. This method enables highly efficient and accurate detection of the porosity of the product under test without damaging its structure.

[0008] The technical solution adopted by this invention to solve the above-mentioned technical problems is: a method for detecting 3D porosity in additive manufacturing based on X-ray DR images, characterized by comprising the following steps:

[0009] Step 1: Use an X-ray DR detection system to perform DR detection on the pre-placed and prepared item to be inspected, and obtain the initial X-ray projection image of the item to be inspected; wherein, the initial X-ray projection image is marked as C1, and the corresponding pixel grayscale value of the initial X-ray projection image C1 is marked as f1(x,y).

[0010] Step 2: Move the object to be inspected a preset distance in the x or y direction of its plane, and then perform DR inspection on the object to be inspected to obtain a secondary X-ray projection image of the object to be inspected; wherein, the secondary X-ray projection image is labeled C2, and the corresponding pixel grayscale value of the secondary X-ray projection image C2 is labeled f2(x,y).

[0011] Step 3: Perform a translation operation on the initial X-ray projection image relative to the secondary X-ray projection image to align it, and obtain the translation amount corresponding to the translation operation; wherein, the translation amount of the initial X-ray projection image relative to the secondary X-ray projection image is marked as (u,v), where u represents the number of pixels that the initial X-ray projection image C1 of the object to be detected moves in the horizontal direction, and v represents the number of pixels that the initial X-ray projection image C1 of the object to be detected moves in the vertical direction.

[0012] Step 4: Perform image erosion processing based on grayscale image erosion on the initial X-ray projection image and the secondary X-ray projection image respectively to obtain the first eroded image and the second eroded image.

[0013] Step 5: Binarize the first eroded image and the second eroded image respectively to obtain the first binarized image and the second binarized image, and extract the pore defects from the first binarized image and the second binarized image respectively; wherein, the first binarized image is labeled as G1, and the corresponding pixel gray value of image G1 is labeled as g1(x,y); the second binarized image is labeled as G2, and the corresponding pixel gray value of image G2 is labeled as g2(x,y);

[0014] Step 6: Align the second binarized image with the obtained translation amount to obtain the aligned binarized image; wherein, the aligned binarized image is labeled as G'2, the corresponding pixel grayscale value of image G'2 is labeled as g'2(x,y), and images G'2 and G2 are in one-to-one correspondence;

[0015] Step 7: Process the first binarized image and the resulting translated and aligned binarized image to obtain a new binarized image; wherein, the new binarized image is labeled as I. OR Image I OR The corresponding pixel grayscale value is marked as I OR (x,y);

[0016] Step 8: Select all pore defect pairs that belong to the same isolated pore defect in the new binarized image from all pore defects extracted from the first binarized image and all pore defects extracted from the second binarized image; wherein, a pore defect pair includes one pore defect extracted from the first binarized image and one pore defect extracted from the second binarized image, and the pore defect pair corresponds one-to-one with the pore defect on the item to be inspected;

[0017] Step 9: Reconstruct the defect distribution of each isolated pore in three-dimensional space for each pore defect pair, and obtain the three-dimensional space after defect reconstruction and the position information of each isolated pore in the three-dimensional space after defect reconstruction.

[0018] Step 10: Based on the location information and size of all pore defects obtained after defect distribution reconstruction, calculate the ratio of pore volume to unit volume per unit volume, and use this ratio as the 3D porosity of the item to be tested.

[0019] Improvedly, in the additive manufacturing 3D porosity detection method based on X-ray DR images, in step 1, the prepared object to be inspected is subjected to DR detection using an X-ray DR detection system according to a preset optimal detection method; wherein, the optimal detection method includes the following steps:

[0020] Step a1: Obtain the size information of the item to be inspected; the size information includes length, width, and height.

[0021] Step a2: Based on the obtained size information of the item to be inspected, select the angle with the thinnest overall thickness of the item to be inspected as the placement angle for X-ray imaging;

[0022] Step a3: Place the item to be inspected onto the stage of the X-ray DR inspection system at the selected placement angle so that the item is positioned between the X-ray source and the detector of the X-ray DR inspection system.

[0023] Step a4: Based on the thickest area that needs to be penetrated by X-rays at this placement angle, calculate the tube voltage and tube current required for the X-ray DR detection system to perform DR detection, and use the calculated tube voltage and tube current as the optimal working parameters for the X-ray DR detection system to adapt to the current item to be inspected.

[0024] Step a5: Instruct the X-ray DR inspection system to perform DR inspection on the item to be inspected according to the optimal operating parameters.

[0025] Furthermore, in the additive manufacturing 3D porosity detection method based on X-ray DR images, in step 2, the item to be detected is subjected to DR detection again according to the optimal detection method to obtain the secondary X-ray projection image.

[0026] Further improvements include the following steps in the additive manufacturing 3D porosity detection method based on X-ray DR images: In step 3, the translation operation of aligning the initial X-ray projection image with the secondary X-ray projection image includes the following steps:

[0027] Step b1: Obtain the image dimensions of the initial X-ray projection image and the secondary X-ray projection image respectively; wherein, the image dimension of the initial X-ray projection image is marked as M×N, and the image dimension of the secondary X-ray projection image is marked as M×N, where M is the height of the image and N is the width of the image;

[0028] Step b2: Based on the translation amount, the image size of the primary X-ray projection image, and the image size of the secondary X-ray projection image, calculate the cross-correlation function between the primary and secondary X-ray projection images; wherein, the cross-correlation function is denoted as R(f1,f2):

[0029]

[0030] In the process of calculating the product of cross-correlation functions, when the translation amount exceeds the image size range of the corresponding image: for pixel values ​​that exceed the image size range, the edge pixel value that is located within the image size range and is closest to the pixel value that exceeds the image size range is taken as the effective pixel value participating in the product process.

[0031] Improvedly, in the additive manufacturing 3D porosity detection method based on X-ray DR images, in step 4:

[0032] The process of performing grayscale-based image erosion processing on the initial X-ray projection image to obtain the first eroded image is as follows:

[0033] The minimum difference between the grayscale value of each pixel in the initial X-ray projection image and the corresponding grayscale value of a preset structure element is calculated. This minimum value is taken as the grayscale value of the eroded image at that pixel location. The first eroded image of the initial X-ray projection image is obtained from all the eroded image grayscale values. In the first eroded image, the grayscale value of the eroded image at any pixel location is labeled as f1(x,y)Θb(s,t).

[0034] f1(x,y)Θb(s,t)=min[f1(x+s,y+t)-b(s,t)];

[0035] Where b(s,t) is the pixel value of the preset structure element;

[0036] By subtracting the first erosion image from the initial X-ray projection image, the small defect portion with a sharp change in contrast is extracted; this small defect portion is labeled as △f1(x,y):

[0037] △f1(x,y)=f1(x,y)-f1(x,y)Θb(s,t);

[0038] The process of performing grayscale-based image erosion processing on a secondary X-ray projection image to obtain the second eroded image is as follows:

[0039] The minimum difference between the grayscale value of each pixel in the secondary X-ray projection image and the corresponding grayscale value of a preset structure element is calculated. This minimum value is taken as the grayscale value of the eroded image at that pixel location. The second eroded image of the secondary X-ray projection image is obtained from all the eroded image grayscale values. In the second eroded image, the grayscale value of the eroded image at any pixel location is labeled as f2(x,y)Θb(s,t).

[0040] f2(x,y)Θb(s,t)=min[f2(x+s,y+t)-b(s,t)];

[0041] Where b(s,t) is the pixel value of the preset structure;

[0042] By subtracting the second eroded image from the secondary X-ray projection image, the small defect portion with a sharp change in contrast is extracted; this small defect portion is labeled as △f2(x,y):

[0043] △f2(x,y)=f2(x,y)-f2(x,y)Θb(s,t).

[0044] In a further improvement, in the additive manufacturing 3D porosity detection method based on X-ray DR images, in step 5:

[0045] The first eroded image is binarized using a global thresholding method to obtain the first binarized image; the binarization method is as follows:

[0046]

[0047] Wherein, the number of gray levels of the first eroded image is L, and the pixel value range of the first eroded image is [0,L]; T represents the set gray level threshold, T∈[0,L-1];

[0048] A global thresholding method is used to binarize the second eroded image, resulting in a second binarized image. The binarization method is as follows:

[0049]

[0050] Wherein, the number of gray levels of the second eroded image is L, and the pixel value range of the second eroded image is [0,L]; T represents the set gray threshold, T∈[0,L-1].

[0051] Further improvements are made to the additive manufacturing 3D porosity detection method based on X-ray DR images, in step 5:

[0052] The method for extracting pore defects from the first binarized image is as follows:

[0053] All small defect portions extracted and corresponding to the first eroded image are sequentially numbered to obtain the first numbered defect sequence; wherein, the i-th small defect portion in the first numbered defect sequence is labeled as p. i 1≤i≤I, where I represents the total number of small defects in the defect sequence after the first number;

[0054] The defect area of ​​each small defect portion within the defect sequence after the first number is calculated. Then, each small defect portion is fitted into a porosity defect using a circle fitting method, and the center position and diameter of each porosity defect are calculated. Wherein, the small defect portion p... i The center position corresponding to the fitted pore defect is marked as p. i (a,b), small defect p i The diameter corresponding to the fitted pore defect is marked as follows: (a,b) represents the small defect portion p. i The pixel position in the image after the first binarization process;

[0055] The method for extracting pore defects from the image after the second binarization process is as follows:

[0056] All small defect portions extracted and corresponding to the second eroded image are sequentially numbered to obtain the second-numbered defect sequence; wherein, the j-th small defect portion in the second-numbered defect sequence is labeled as q. j 1≤j≤J, where J represents the total number of small defects in the defect sequence after the second number;

[0057] The defect area of ​​each small defect portion within the defect sequence after the second number is calculated. Then, each small defect portion is fitted into a porosity defect using a circle fitting method, and the center position and diameter of each porosity defect are calculated; where, the small defect portion q j The center position corresponding to the fitted pore defect is marked as q. j (c,d), small defect q j The diameter corresponding to the fitted pore defect is marked as follows: (c,d) represents the small defect q. j The pixel position in the image after the second binarization process; where position p i (a,b) and position q j (c, d) belong to the same isolated pore and correspond to the positions in the first and second binarized images, respectively.

[0058] Furthermore, in the additive manufacturing 3D porosity detection method based on X-ray DR images, in step 7, the first binarized image and the obtained translated and aligned binarized image are processed to obtain a new binarized image as follows:

[0059]

[0060] Furthermore, in the additive manufacturing 3D porosity detection method based on X-ray DR images, in step 9, the defect distribution of each isolated pore corresponding to all pore defect pairs is reconstructed in three-dimensional space to obtain the position information of each isolated pore in three-dimensional space as follows:

[0061]

[0062] Where, x r O represents the r-th isolated pore. r The coordinate values ​​of the three-dimensional space in the x-direction after the defect reconstruction, y r O represents the r-th isolated pore. r The coordinate values ​​of the z-axis in the three-dimensional space after the defect reconstruction are... r O represents the r-th isolated pore. r The coordinates of the object to be inspected in the z-direction of the three-dimensional space after the defect reconstruction; s represents the preset distance the object to be inspected has moved; SDD represents the actual distance between the X-ray source and the detector in the X-ray DR detection system; px represents the size of a single detector element within the detector in the X-ray DR detection system; D r O represents the r-th isolated pore. r The diameter of R is the total number of all isolated pores.

[0063] Furthermore, in the additive manufacturing 3D porosity detection method based on X-ray DR images, in step 10, based on all pore defect location information and pore defect size obtained after defect distribution reconstruction, the ratio of pore volume to unit volume is calculated, and this ratio is used as the porosity of the item to be detected as follows:

[0064] Choose a cube with one side length l, and use the volume of this cube as the unit volume; where the volume of the cube is denoted as V, and V = l. 3 l>0;

[0065] The selected cube is moved so that it reconstructs the three-dimensional space through the defect;

[0066] The total volume of all defect sections traversed by the cube during its movement through the reconstructed three-dimensional space is denoted as V'.

[0067] The ratio between the total volume of the defect and the volume of the cube is calculated and statistically analyzed, and this ratio is taken as the 3D porosity of the object to be tested; wherein, the 3D porosity of the object to be tested is denoted as...

[0068]

[0069] Compared with the prior art, the advantages of the present invention are as follows: The additive manufacturing 3D porosity detection method based on X-ray DR images of the present invention uses an X-ray DR detection system to perform DR detection on the object to be tested before and after movement to obtain corresponding images. After performing translation and alignment operations on the obtained images, image erosion processing and binarization processing are performed sequentially. Then, the obtained binarized images are translated and aligned to obtain corresponding translated and aligned binarized images. All pore defect pairs belonging to the same isolated pore defect in the new binarized images are selected. Then, the isolated pores corresponding to all pore defect pairs are reconstructed in three-dimensional space to obtain the 3D space after defect reconstruction and the position information of each isolated pore in the 3D space after defect reconstruction. Finally, based on the position information and size of all pore defects obtained after defect distribution reconstruction, the ratio of pore volume to unit volume is calculated and the ratio is used as the 3D porosity of the object to be tested. In this way, the three-dimensional spatial distribution of defects can be reconstructed from images of volumetric defects inside the object being inspected detected by X-rays. This overcomes the shortcomings of traditional methods that cannot obtain accurate defect size and three-dimensional spatial distribution, greatly improves the efficiency of 3D porosity detection, reduces detection costs, and meets the needs of rapid and accurate quantitative detection of porosity in complex structural components. Attached Figure Description

[0070] Figure 1 This is a schematic diagram of the additive manufacturing 3D porosity detection method based on X-ray DR images in an embodiment of the present invention;

[0071] Figure 2 This is a schematic diagram of DR detection in an embodiment of the present invention;

[0072] Figure 3 A schematic diagram of the status during DR inspection of an X-ray DR inspection system;

[0073] Figure 4 A schematic diagram of the initial X-ray projection image;

[0074] Figure 5 A schematic diagram of a secondary X-ray projection image;

[0075] Figure 6 A comparative illustration of different images (DR image, eroded image, image with structure and gradient background removed, and image with defect removal);

[0076] Figure 7 This is a schematic diagram of the first binarized image after defect numbering.

[0077] Figure 8 This is a schematic diagram of the image after the second binarization process following the defect numbering;

[0078] Figure 9 This is a schematic diagram of the new binarized image;

[0079] Figure 10 This is a schematic diagram of the three-dimensional space after the defect is reconstructed. Detailed Implementation

[0080] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0081] This embodiment provides a method for detecting 3D porosity in additive manufacturing based on X-ray DR images. Specifically, see [link to documentation]. Figure 1 As shown, the additive manufacturing 3D porosity detection method based on X-ray DR images in this embodiment includes the following steps 1 to 10:

[0082] Step 1: Use an X-ray DR detection system to perform DR detection on the pre-placed and prepared item to be inspected, and obtain the initial X-ray projection image of the item to be inspected; wherein, the initial X-ray projection image is marked as C1, and the corresponding pixel grayscale value of the initial X-ray projection image C1 is marked as f1(x,y).

[0083] For example, in this embodiment, the X-ray DR inspection system is configured with an industrial X-ray source 1, an industrial detector 2, and a stage 3. The tube voltage and tube current of the industrial X-ray source 1 are adjustable; the industrial detector 2 can receive X-rays and perform imaging to form a digital image, and the integration time and the number of frames superimposed are adjustable; the stage 3 is used to place the item to be inspected 4 (such as a workpiece or other product). This X-ray DR inspection system also has an automatic mechanical system control function, which can accurately control the X-ray irradiation and imaging position, and the DR inspection system also has a detection parameter display window, such as obtaining the actual distance (SDD) between the X-ray source and the detector;

[0084] In the process of performing DR inspection on an item to be inspected, an X-ray DR inspection system is used to perform DR inspection on the pre-placed and prepared item according to a preset optimal inspection method; wherein the optimal inspection method includes the following steps a1 to a5:

[0085] Step a1: Obtain the size information of the item to be inspected; the size information includes length, width, and height.

[0086] Step a2: Based on the acquired size information of the item to be inspected, select the angle with the thinnest overall thickness of the item as the placement angle for X-ray imaging; for example:

[0087] For a circular object to be inspected, it can be seen that the overall thickness of the object is consistent from all angles.

[0088] For a rectangular object to be inspected, it can be known that the overall thickness is thinnest along the direction perpendicular to the long side of the object.

[0089] For any item to be tested, assume that at a certain angle, the product thickness is superimposed along this angle, and then summed to obtain a thickness accumulation value. Calculate the thickness accumulation value corresponding to each angle in all 360 degrees, and take the minimum thickness accumulation value among all obtained thickness accumulation values ​​as the comprehensive thickness of the item to be tested.

[0090] Step a3: Place the item to be inspected onto the stage of the X-ray DR inspection system at the selected placement angle so that the item is positioned between the X-ray source and the detector of the X-ray DR inspection system.

[0091] Step a4: Based on the thickest area that needs to be penetrated by X-rays at this placement angle, calculate the tube voltage and tube current required for the X-ray DR detection system to perform DR detection, and use the calculated tube voltage and tube current as the optimal working parameters for the X-ray DR detection system to adapt to the current item to be inspected; In the specific implementation process, the set values ​​of tube voltage and tube current required for X-rays to penetrate different thicknesses of the X-ray DR detection system can be obtained by looking up a table.

[0092] Step a5: Instruct the X-ray DR inspection system to perform DR inspection on the item to be inspected according to the optimal operating parameters;

[0093] Step 2: Move the object to be inspected a preset distance in the x or y direction of its plane, and then perform DR inspection on the object to be inspected to obtain a secondary X-ray projection image of the object to be inspected; wherein, the secondary X-ray projection image is labeled C2, and the corresponding pixel grayscale value of the secondary X-ray projection image C2 is labeled f2(x,y).

[0094] For example, in this embodiment, the preset distance the item to be detected moves is s, s>0; according to actual needs, in step 2, the aforementioned optimal detection method is also used to perform DR detection on the item to be detected again;

[0095] See Figure 3 As shown, when the item to be inspected 3 is subjected to the first DR inspection, the defect 5 in the item to be inspected 3 is located at position W1. Then, after the item to be inspected 3 moves the aforementioned preset distance, the defect 5 in the item to be inspected 3 is located at position W2.

[0096] Step 3: Perform a translation operation on the initial X-ray projection image relative to the secondary X-ray projection image to align it, and obtain the translation amount corresponding to the translation operation; wherein, the translation amount of the initial X-ray projection image relative to the secondary X-ray projection image is marked as (u,v), where u represents the number of pixels that the initial X-ray projection image C1 of the object to be detected moves in the horizontal direction, and v represents the number of pixels that the initial X-ray projection image C1 of the object to be detected moves in the vertical direction.

[0097] For example, in step 3 of this embodiment, the translation operation of aligning the primary X-ray projection image with the secondary X-ray projection image includes the following steps b1 to b2:

[0098] Step b1: Obtain the image dimensions of the initial X-ray projection image and the secondary X-ray projection image respectively; wherein, the image dimension of the initial X-ray projection image is marked as M×N, and the image dimension of the secondary X-ray projection image is marked as M×N, where M is the height of the image and N is the width of the image; based on this, the vertical pixel index is y = 0, 1, ..., M-1; and the horizontal pixel index is x = 0, 1, ..., N-1.

[0099] Step b2: Based on the translation amount, the image size of the primary X-ray projection image, and the image size of the secondary X-ray projection image, calculate the cross-correlation function between the primary and secondary X-ray projection images; wherein, the cross-correlation function is denoted as R(f1,f2):

[0100]

[0101] In the process of calculating the product of cross-correlation functions, when the aforementioned translation amount exceeds the image size range of the corresponding image: for pixel values ​​that exceed the image size range, the edge pixel value that is within the image size range and is closest to the pixel value that exceeds the image size range is taken as the valid pixel value participating in the product process;

[0102] In step 3, the similarity between the primary and secondary X-ray projection images can be quantitatively analyzed by calculating the cross-correlation function of the primary and secondary X-ray projection images. The larger the sum of pixel products in the overlapping areas of the primary and secondary X-ray projection images, the more similar the translated secondary X-ray projection image is to the primary X-ray projection image.

[0103] Step 4: Perform image erosion processing based on grayscale image erosion on the initial X-ray projection image and the secondary X-ray projection image respectively to obtain the first eroded image and the second eroded image.

[0104] Specifically, in this embodiment:

[0105] The process of performing grayscale-based image erosion processing on the initial X-ray projection image to obtain the first eroded image is as follows:

[0106] The minimum difference between the grayscale value of each pixel in the initial X-ray projection image and the corresponding grayscale value of a preset structure element is calculated. This minimum value is taken as the grayscale value of the eroded image at that pixel location. The first eroded image of the initial X-ray projection image is obtained from all the eroded image grayscale values. In the first eroded image, the grayscale value of the eroded image at any pixel location is labeled as f1(x,y)Θb(s,t).

[0107] f1(x,y)Θb(s,t)=min[f1(x+s,y+t)-b(s,t)];

[0108] Where b(s,t) is the pixel value of the preset structure element, and the symbol “Θ” represents the erosion algorithm commonly used in image morphology processing methods. The structure here is the structure element in the erosion algorithm.

[0109] By subtracting the first erosion image from the initial X-ray projection image, the small defect portion with a sharp change in contrast is extracted; this small defect portion is labeled as △f1(x,y):

[0110] △f1(x,y)=f1(x,y)-f1(x,y)Θb(s,t);

[0111] The process of performing grayscale-based image erosion processing on a secondary X-ray projection image to obtain the second eroded image is as follows:

[0112] The minimum difference between the grayscale value of each pixel in the secondary X-ray projection image and the corresponding grayscale value of a preset structure element is calculated. This minimum value is taken as the grayscale value of the eroded image at that pixel location. The second eroded image of the secondary X-ray projection image is obtained from all the eroded image grayscale values. In the second eroded image, the grayscale value of the eroded image at any pixel location is labeled as f2(x,y)Θb(s,t).

[0113] f2(x,y)Θb(s,t)=min[f2(x+s,y+t)-b(s,t)];

[0114] Where b(s,t) is the pixel value of the preset structure;

[0115] By subtracting the second eroded image from the secondary X-ray projection image, the small defect portion with a sharp change in contrast is extracted; this small defect portion is labeled as △f2(x,y):

[0116] △f2(x,y)=f2(x,y)-f2(x,y)Θb(s,t);

[0117] It should be noted that by applying image erosion processing based on grayscale image erosion, the gradual grayscale distribution in the image background can be eliminated. Since pore defects are low-density areas, they appear as bright areas on the grayscale image. Grayscale erosion can reduce the bright areas in the image and enhance the dark areas.

[0118] In this embodiment, the preset structure is a matrix, such as a 3×3 matrix. During the calculation of the grayscale value of the etched image, the matrix is ​​used to perform operations on each target pixel (x,y) to calculate the difference between all image pixels f1(x+s,y+t) covered by the preset structure and the corresponding value b(s,t) of the preset structure, and the minimum value among these differences is taken as the target pixel result. Of course, by subtracting the first etched image from the initial X-ray projection image and subtracting the second etched image from the secondary X-ray projection image, most of the gradient background in the corresponding X-ray projection image can be removed, thereby extracting small defect parts with drastic changes in contrast.

[0119] Step 5: Binarize the first eroded image and the second eroded image respectively to obtain the first binarized image and the second binarized image, and extract the pore defects from the first binarized image and the second binarized image respectively; wherein, the first binarized image is labeled as G1, and the corresponding pixel gray value of image G1 is labeled as g1(x,y); the second binarized image is labeled as G2, and the corresponding pixel gray value of image G2 is labeled as g2(x,y);

[0120] Specifically, in this embodiment:

[0121] The first eroded image is binarized using a global thresholding method to obtain the first binarized image; the binarization method is as follows:

[0122]

[0123] Wherein, the number of gray levels of the first eroded image is L, and the pixel value range of the first eroded image is [0,L]; T represents the set gray threshold, T∈[0,L-1]; the gray threshold T here can be automatically calculated by the maximum inter-class variance method, or it can be set manually.

[0124] A global thresholding method is used to binarize the second eroded image, resulting in a second binarized image. The binarization method is as follows:

[0125]

[0126] Wherein, the number of gray levels of the second eroded image is L, and the pixel value range of the second eroded image is [0,L]; T represents the set gray threshold, T∈[0,L-1].

[0127] In addition, in this embodiment:

[0128] The method for extracting pore defects from the first binarized image is as follows:

[0129] All small defect portions extracted and corresponding to the first eroded image are sequentially numbered to obtain the first numbered defect sequence; wherein, the i-th small defect portion in the first numbered defect sequence is labeled as p. i 1≤i≤I, where I represents the total number of small defects in the defect sequence after the first number;

[0130] The defect area of ​​each small defect portion within the defect sequence after the first number is calculated. Then, each small defect portion is fitted into a porosity defect using a circle fitting method, and the center position and diameter of each porosity defect are calculated. Wherein, the small defect portion p... i The center position corresponding to the fitted pore defect is marked as p. i (a,b), small defect p i The diameter corresponding to the fitted pore defect is marked as follows: (a,b) represents the small defect portion p. i The pixel position in the image after the first binarization process;

[0131] The method for extracting pore defects from the image after the second binarization process is as follows:

[0132] All small defect portions extracted and corresponding to the second eroded image are sequentially numbered to obtain the second-numbered defect sequence; wherein, the j-th small defect portion in the second-numbered defect sequence is labeled as q. j 1≤j≤J, where J represents the total number of small defects in the defect sequence after the second number;

[0133] The defect area of ​​each small defect portion within the defect sequence after the second number is calculated. Then, each small defect portion is fitted into a porosity defect using a circle fitting method, and the center position and diameter of each porosity defect are calculated; where, the small defect portion q j The center position corresponding to the fitted pore defect is marked as q. j (c,d), small defect q j The diameter corresponding to the fitted pore defect is marked as follows: (c,d) represents the small defect q. jThe pixel position in the image after the second binarization process; where position p i (a,b) and position q j (c, d) belong to the same isolated pore and correspond to the positions in the first and second binarized images, respectively.

[0134] Step 6: Align the second binarized image with the obtained translation amount to obtain the aligned binarized image; wherein, the aligned binarized image is labeled as G'2, the corresponding pixel grayscale value of image G'2 is labeled as g'2(x,y), and images G'2 and G2 are in one-to-one correspondence;

[0135] Step 7: Process the first binarized image and the resulting translated and aligned binarized image to obtain a new binarized image; wherein, the new binarized image is labeled as I. OR Image I OR The corresponding pixel grayscale value is marked as I OR (x,y);

[0136] Specifically, in this embodiment, the first binarized image and the resulting translated and aligned binarized image are processed to obtain a new binarized image in the following way:

[0137]

[0138] Step 8: Select all pore defect pairs that belong to the same isolated pore defect in the new binarized image from all pore defects extracted from the first binarized image and all pore defects extracted from the second binarized image; wherein, a pore defect pair includes one pore defect extracted from the first binarized image and one pore defect extracted from the second binarized image, and the pore defect pair corresponds one-to-one with the pore defect on the item to be inspected;

[0139] Step 9: Reconstruct the defect distribution of each isolated pore in three-dimensional space for each pore defect pair, and obtain the three-dimensional space after defect reconstruction and the position information of each isolated pore in the three-dimensional space after defect reconstruction.

[0140] For example, in this embodiment, the defect distribution of each isolated pore, corresponding to each pore defect pair, is reconstructed in three-dimensional space to obtain the position information of each isolated pore in three-dimensional space as follows:

[0141]

[0142] Where, x r O represents the r-th isolated pore. r After defect reconstruction, the coordinate values ​​in the x-direction of the three-dimensional space, y rO represents the r-th isolated pore. r The coordinate values ​​in the y-direction and z-direction of the three-dimensional space after defect reconstruction. r O represents the r-th isolated pore. r The coordinate value in the z-direction of the three-dimensional space after defect reconstruction; s represents the preset distance of the movement of the object to be detected; SDD represents the actual distance between the X-ray source and the detector in the X-ray DR detection system; px represents the size of a single detector element in the detector of the X-ray DR detection system, that is, the size is the side length of a square detector element.

[0143] D r O represents the r-th isolated pore. r The diameter of is , and R is the total number of all isolated pores here;

[0144] Step 10: Based on the location information and size of all pore defects obtained after defect distribution reconstruction, calculate the ratio of pore volume to unit volume, and use this ratio as the 3D porosity of the item to be inspected. In this embodiment, the specific method for calculating the 3D porosity is as follows:

[0145] Choose a cube with one side length l, and use the volume of this cube as the unit volume; where the volume of the cube is denoted as V, and V = l. 3 l>0;

[0146] The selected cube is moved so that it reconstructs the three-dimensional space through the defect;

[0147] The total volume of all defect sections traversed by the cube during its movement through the reconstructed three-dimensional space is denoted as V'.

[0148] The ratio between the total volume of the defect and the volume of the cube is calculated and statistically analyzed, and this ratio is taken as the 3D porosity of the object to be tested; wherein, the 3D porosity of the object to be tested is denoted as...

[0149]

[0150] For specific implementation examples, see Figure 3As shown, the actual distance between the X-ray source and the detector in the X-ray DR detection system is SDD = 400 mm. The object to be inspected is a titanium alloy. Calculations show that the optimal tube voltage, tube current, integration time, and average frame count for the X-ray DR detection system to perform DR detection are 90 kV, 80 μA, 1 s, and 50 frames. The preset distance the object to be inspected moves is s = 5 mm. In the obtained primary and secondary X-ray projection images, the image height M = 1920 pixels and the image width N = 1180 pixels. See the primary X-ray projection image for details. Figure 4 As shown, see secondary X-ray projection image. Figure 5 As shown; Figure 6 This diagram illustrates a comparison of different images: a DR image, the resulting erosion image, an image with structure and gradient background removed, and an image after defect removal. Figure 7 This is a schematic diagram of the first binarized image after defect numbering. Figure 8 This is a schematic diagram of the image after the second binarization process following the defect numbering; Figure 9 This is a schematic diagram of the new binarized image; Figure 10 This is a three-dimensional spatial diagram after defect reconstruction. Calculations show that the 3D porosity of the titanium alloy to be tested in this embodiment is 6.5%.

[0151] Although preferred embodiments of the present invention have been described in detail above, it should be clearly understood that various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting 3D porosity in additive manufacturing based on X-ray DR images, characterized in that, Includes the following steps: Step 1: Use an X-ray DR detection system to perform DR detection on the pre-placed and prepared item to be inspected, and obtain the initial X-ray projection image of the item to be inspected; wherein, the initial X-ray projection image is marked as C1, and the corresponding pixel grayscale value of the initial X-ray projection image C1 is marked as f1(x,y). Step 2: Move the object to be inspected a preset distance in the x or y direction of its plane, and then perform DR inspection on the object to be inspected to obtain a secondary X-ray projection image of the object to be inspected; wherein, the secondary X-ray projection image is labeled C2, and the corresponding pixel grayscale value of the secondary X-ray projection image C2 is labeled f2(x,y). Step 3: Perform a translation operation on the initial X-ray projection image relative to the secondary X-ray projection image to align it, and obtain the translation amount corresponding to the translation operation; wherein, the translation amount of the initial X-ray projection image relative to the secondary X-ray projection image is marked as (u,v), where u represents the number of pixels that the initial X-ray projection image C1 of the object to be detected moves in the horizontal direction, and v represents the number of pixels that the initial X-ray projection image C1 of the object to be detected moves in the vertical direction. Step 4: Perform image erosion processing based on grayscale image erosion on the initial X-ray projection image and the secondary X-ray projection image respectively to obtain the first eroded image and the second eroded image. Step 5: Binarize the first eroded image and the second eroded image respectively to obtain the first binarized image and the second binarized image, and extract the pore defects from the first binarized image and the second binarized image respectively; wherein, the first binarized image is labeled as G1, and the corresponding pixel gray value of image G1 is labeled as g1(x,y); the second binarized image is labeled as G2, and the corresponding pixel gray value of image G2 is labeled as g2(x,y); Step 6: Align the second binarized image with the obtained translation amount to obtain the aligned binarized image; wherein, the aligned binarized image is labeled as G'2, the corresponding pixel grayscale value of image G'2 is labeled as g'2(x,y), and images G'2 and G2 are in one-to-one correspondence; Step 7: Process the first binarized image and the resulting translated and aligned binarized image to obtain a new binarized image; wherein, the new binarized image is labeled as I. OR Image I OR The corresponding pixel grayscale value is marked as I OR (x,y); Step 8: Select all pore defect pairs that belong to the same isolated pore defect in the new binarized image from all pore defects extracted from the first binarized image and all pore defects extracted from the second binarized image; wherein, a pore defect pair includes one pore defect extracted from the first binarized image and one pore defect extracted from the second binarized image, and the pore defect pair corresponds one-to-one with the pore defect on the item to be inspected; Step 9: Reconstruct the defect distribution of each isolated pore in three-dimensional space for each pore defect pair, and obtain the three-dimensional space after defect reconstruction and the position information of each isolated pore in the three-dimensional space after defect reconstruction. Step 10: Based on the location information and size of all pore defects obtained after defect distribution reconstruction, calculate the ratio of pore volume to unit volume per unit volume, and use this ratio as the 3D porosity of the item to be tested.

2. The additive manufacturing 3D porosity detection method based on X-ray DR images according to claim 1, characterized in that, In step 1, the prepared X-ray DR inspection system is used to perform DR inspection on the pre-placed item to be inspected according to a preset optimal inspection method; wherein, the optimal inspection method includes the following steps: Step a1: Obtain the size information of the item to be inspected; the size information includes length, width, and height. Step a2: Based on the obtained size information of the item to be inspected, select the angle with the thinnest overall thickness of the item to be inspected as the placement angle for X-ray imaging; Step a3: Place the item to be inspected onto the stage of the X-ray DR inspection system at the selected placement angle so that the item is positioned between the X-ray source and the detector of the X-ray DR inspection system. Step a4: Based on the thickest area that needs to be penetrated by X-rays at this placement angle, calculate the tube voltage and tube current required for the X-ray DR detection system to perform DR detection, and use the calculated tube voltage and tube current as the optimal working parameters for the X-ray DR detection system to adapt to the current item to be inspected. Step a5: Instruct the X-ray DR inspection system to perform DR inspection on the item to be inspected according to the optimal operating parameters.

3. The additive manufacturing 3D porosity detection method based on X-ray DR images according to claim 2, characterized in that, In step 2, the item to be inspected is subjected to DR inspection again according to the optimal detection method to obtain the secondary X-ray projection image.

4. The additive manufacturing 3D porosity detection method based on X-ray DR images according to claim 2, characterized in that, In step 3, the translation operation to align the primary X-ray projection image with the secondary X-ray projection image includes the following steps: Step b1: Obtain the image dimensions of the initial X-ray projection image and the secondary X-ray projection image respectively; wherein, the image dimension of the initial X-ray projection image is marked as M×N, and the image dimension of the secondary X-ray projection image is marked as M×N, where M is the height of the image and N is the width of the image; Step b2: Based on the translation amount, the image size of the primary X-ray projection image, and the image size of the secondary X-ray projection image, calculate the cross-correlation function between the primary and secondary X-ray projection images; wherein, the cross-correlation function is denoted as R(f1,f2): In the process of calculating the product of cross-correlation functions, when the translation amount exceeds the image size range of the corresponding image: for pixel values ​​that exceed the image size range, the edge pixel value that is located within the image size range and is closest to the pixel value that exceeds the image size range is taken as the effective pixel value participating in the product process.

5. The additive manufacturing 3D porosity detection method based on X-ray DR images according to claim 2, characterized in that, In step 4: The process of performing grayscale-based image erosion processing on the initial X-ray projection image to obtain the first eroded image is as follows: The minimum difference between the grayscale value of each pixel in the initial X-ray projection image and the corresponding grayscale value of a preset structure element is calculated. This minimum value is taken as the grayscale value of the eroded image at that pixel location. The first eroded image of the initial X-ray projection image is obtained from all the eroded image grayscale values. In the first eroded image, the grayscale value of the eroded image at any pixel location is labeled as f1(x,y)Θb(s,t). f1(x,y)Θb(s,t)=min[f1(x+s,y+t)-b(s,t)]; Where b(s,t) is the pixel value of the preset structure element; By subtracting the first erosion image from the initial X-ray projection image, the small defect portion with a sharp change in contrast is extracted; this small defect portion is labeled as △f1(x,y): △f1(x,y)=f1(x,y)-f1(x,y)Θb(s,t); The process of performing grayscale-based image erosion processing on a secondary X-ray projection image to obtain the second eroded image is as follows: The minimum difference between the grayscale value of each pixel in the secondary X-ray projection image and the corresponding grayscale value of a preset structure element is calculated. This minimum value is taken as the grayscale value of the eroded image at that pixel location. The second eroded image of the secondary X-ray projection image is obtained from all the eroded image grayscale values. In the second eroded image, the grayscale value of the eroded image at any pixel location is labeled as f2(x,y)Θb(s,t). f2(x,y)Θb(s,t)=min[f2(x+s,y+t)-b(s,t)]; Where b(s,t) is the pixel value of the preset structure; By subtracting the second eroded image from the secondary X-ray projection image, the small defect portion with a sharp change in contrast is extracted; this small defect portion is labeled as △f2(x,y): △f2(x,y)=f2(x,y)-f2(x,y)Θb(s,t).

6. The additive manufacturing 3D porosity detection method based on X-ray DR images according to claim 5, characterized in that, In step 5: The first eroded image is binarized using a global thresholding method to obtain the first binarized image; the binarization method is as follows: Wherein, the number of gray levels of the first eroded image is L, and the pixel value range of the first eroded image is [0,L]; T represents the set gray level threshold, T∈[0,L-1]; A global thresholding method is used to binarize the second eroded image, resulting in a second binarized image. The binarization method is as follows: Wherein, the number of gray levels of the second eroded image is L, and the pixel value range of the second eroded image is [0,L]; T represents the set gray threshold, T∈[0,L-1].

7. The additive manufacturing 3D porosity detection method based on X-ray DR images according to claim 6, characterized in that, In step 5: The method for extracting pore defects from the first binarized image is as follows: All small defect portions extracted and corresponding to the first eroded image are sequentially numbered to obtain the first numbered defect sequence; wherein, the i-th small defect portion in the first numbered defect sequence is labeled as p. i 1≤i≤I, where I represents the total number of small defects in the defect sequence after the first number; The defect area of ​​each small defect portion within the defect sequence after the first number is calculated. Then, each small defect portion is fitted into a porosity defect using a circle fitting method, and the center position and diameter of each porosity defect are calculated. Wherein, the small defect portion p... i The center position corresponding to the fitted pore defect is marked as p. i (a,b), small defect p i The diameter corresponding to the fitted pore defect is marked as follows: (a,b) represents the small defect portion p. i The pixel position in the image after the first binarization process; The method for extracting pore defects from the image after the second binarization process is as follows: All small defect portions extracted and corresponding to the second eroded image are sequentially numbered to obtain the second-numbered defect sequence; wherein, the j-th small defect portion in the second-numbered defect sequence is labeled as q. j 1≤j≤J, where J represents the total number of small defects in the defect sequence after the second number; The defect area of ​​each small defect portion within the defect sequence after the second number is calculated. Then, each small defect portion is fitted into a porosity defect using a circle fitting method, and the center position and diameter of each porosity defect are calculated; where, the small defect portion q j The center position corresponding to the fitted pore defect is marked as q. j (c,d), small defect q j The diameter corresponding to the fitted pore defect is marked as follows: (c,d) represents the small defect q. j The pixel position in the image after the second binarization process; where position p i (a,b) and position q j (c, d) belong to the same isolated pore and correspond to the positions in the first and second binarized images, respectively.

8. The additive manufacturing 3D porosity detection method based on X-ray DR images according to claim 7, characterized in that, In step 7, the first binarized image and the resulting translated and aligned binarized image are processed to obtain a new binarized image as follows:

9. The additive manufacturing 3D porosity detection method based on X-ray DR images according to claim 8, characterized in that, In step 9, the defect distribution of each isolated pore pair corresponding to all pore defects is reconstructed in three-dimensional space to obtain the position information of each isolated pore in three-dimensional space as follows: Where, x r O represents the r-th isolated pore. r The coordinate values ​​of the three-dimensional space in the x-direction after the defect reconstruction, y r O represents the r-th isolated pore. r The coordinate values ​​of the z-axis in the three-dimensional space after the defect reconstruction are... r O represents the r-th isolated pore. r The coordinates of the object to be inspected in the z-direction of the three-dimensional space after the defect reconstruction; s represents the preset distance the object to be inspected has moved; SDD represents the actual distance between the X-ray source and the detector in the X-ray DR detection system; px represents the size of a single detector element within the detector in the X-ray DR detection system; D r O represents the r-th isolated pore. r The diameter of R is the total number of all isolated pores.

10. The additive manufacturing 3D porosity detection method based on X-ray DR images according to claim 9, characterized in that, In step 10, based on the location information and size of all pore defects obtained after defect distribution reconstruction, the ratio of pore volume to unit volume is calculated, and this ratio is used as the porosity of the item to be tested as follows: Choose a cube with one side length l, and use the volume of this cube as the unit volume; where the volume of the cube is denoted as V, and V = l. 3 l>0; The selected cube is moved so that it reconstructs the three-dimensional space through the defect; The total volume of all defect sections traversed by the cube during its movement through the reconstructed three-dimensional space is denoted as V'. The ratio between the total volume of the defect and the volume of the cube is calculated and statistically analyzed, and this ratio is taken as the 3D porosity of the object to be tested; wherein, the 3D porosity of the object to be tested is denoted as...