Detection and Characterization of Defects in Additive Manufacturing by Polarization-Based Imaging System

Additive manufacturing (AM) technology such as selective laser melting (SLM) often produces a high reflection phenomenon that makes defect detection and information extraction challenging. Meanwhile, it is essential to establish a characterization method for defect analysis to provide sufficient information for process diagnosis and optimization. However, there is still a lack of universal standards for the characterization of defects in SLM parts. In this study, a polarization-based imaging system was proposed, and a set of characterization parameters for SLM defects was established. The contrast, defect contour information, and high reflection suppression effect of the SLM part defects were analyzed. Comparative analysis was conducted on defect characterization parameters, including geometric and texture parameters. The experimental results demonstrated the effects of the polarization imaging system and verified the feasibility of the defect feature extraction and characterization method. The research work provides an effective solution for defect detection and helps to establish a universal standard for defect characterization in additive manufacturing.


Introduction
Additive manufacturing (AM) technology has the advantages of shortening processing time, producing complex customized parts, repairing various mechanical parts, and machining various free-form components [1], thus it has been widely used in the aerospace, military, medical equipment, energy, and automotive manufacturing [2][3][4].Selective laser melting (SLM) is a mature AM technology, which utilizes a high-power density laser to perform layer-by-layer scanning to selectively melt metal powder [5], process complex threedimensional structures [6], and effectively perform an in-situ alloying process [7,8].Presently, various alloys and metals have been successfully processed using SLM technology, including aluminum alloys [9], stainless steels [10], nickel-based superalloys [11], and titanium alloys [12].However, in the SLM process, many factors affect the quality of parts, such as powder size, laser power, scanning speed, etc. Improper parameter control would lead to defects and seriously deteriorate the physical and mechanical properties of the parts [13][14][15].Therefore, it is essential to understand the factors that affect the part quality and develop effective defect detection methods.
Many defect detection methods for the SLM process also have been applied in the fields of the nuclear industry, aerospace, machinery manufacturing, and petrochemical industry [16].Nadipalli et al. [17] proposed installing on-axis and off-axis sensors in the SLM system and tested single-rail samples at different power levels, duty cycles, and scan speeds.Pavlov et al. [18] used a two-color pyrometer to study the temperature radiation in the laser action area during the SLM process and explored the effects of processing strategy, scan spacing, and powder layer thickness on thermal changes.Ye et al. [19] used a near-infrared (NIR) camera to study the changes in the plume and spatter characteristics with changes in laser power and scan speed.Caltanissetta et al. [20] proposed the use of a measurement system to characterize the accuracy of in situ contour recognition in SLM layered images.Land et al. [21] investigated a novel non-contact metrology system that combines traditional machine vision with a phase-shifted fringe projection system.Zheng et al. [22] proposed a high-speed vision system to extract plume, melt pool, and spatter features based on the processing process.Yakout et al. [23] proposed an in-situ monitoring system consisting of a high-speed infrared thermal imager and an infrared pyrometer to detect powder delamination and spattering in the SLM process.Gould et al. [24] proposed a means of combining high-speed infrared imaging with highspeed X-ray imaging to detect steam plume dynamics, cooling rate, splash, and three-dimensional topography of molten pool.Craeghs et al. [25], Tatsuaki et al. [26], and Sebastian et al. [27] investigated continuous detection of high-speed melt pools in SLM processes to achieve real-time feedback control of process parameters.The in-situ detection system is mainly composed of a CCD (Charge Coupled Device)/CMOS (Complementary Metal Oxide Semiconductor) camera, a photodiode, and a data acquisition and processing system.Aniruddha et al. [28] studied SLM process data over a wide range of laser velocities and laser powers using a high-speed camera and a pyrometer.Gusarov et al. [29] developed a detection system consisting of a high-speed CCD camera, a near-infrared camera, and a pyrometer to diagnose the SLM process under different laser power densities and obtained the relationship between geometric parameters of each machining trajectory and the laser power density distributions.In summary, various detection methods using optical, acoustic, and thermal signals have been widely used in the SLM, and can qualitatively establish a relationship between the monitoring signals and defects.However, when building a visual detection system, some problems such as lighting environment, detection scheme, image processing process, and defect feature extraction and characterization still need to be solved.
Metal SLM parts usually produce a high reflection phenomenon.When the defect detection system based on reflective illumination performs detection on the surface of a metal part with high reflectivity, the pixels of the image sensor are often overexposed due to the strong reflected light, resulting in a lot of defect information being annihilated.It is difficult to highlight and extract information on defect areas.Therefore, how to suppress the influence of strong reflected light on the detection of common metal part surface defects is a valuable research issue.Compared with traditional optical detection methods, polarization imaging technology has unique advantages, which can obtain spectral information, polarization information, and spatial information of detection targets, thus it is widely used in industrial imaging, remote sensing, biomedical diagnosis, and military applications [30][31][32].Defect detection based on polarization technology is conducive to extracting information such as texture structure, surface material, and surface roughness from the polarization information of the detection target, which can effectively improve accuracy and reliability [33].
To effectively identify and extract information about defect areas under the interference of complex high reflection phenomena, this study incorporates polarization technology into the SLM part defect detection system.A set of polarization imaging systems for defect detection research was developed by changing the polarization angle and capturing multiple sets of polarization images.The process fused Stokes vector, polarization degree, and multisource polarization angle images with rich information.Meanwhile, the contrast, defect contour information, and high reflection suppression effect of the target defect area were analyzed.Furthermore, comparative analysis was carried out with the defect characterization parameters of the four groups of samples, which indicates the effects of the polarization imaging system and verify the feasibility of the defect feature extraction and characterization method.This paper is organized as follows.The polarization theory is described in Section 2. In Section 3, the establishment of characterization parameters and algorithms are presented.Section 4 illustrates the experiments and discussion.Section 5 describes the conclusions.

Polarization Theory
According to the electromagnetic theory of light, the relationship between the amplitude and phase of reflected light, incident light, and refracted light can be expressed by Fresnel's law [34].The plane vector light wave can be decomposed into the s component and p component.The reflection and refraction coefficients are defined as: (1) where r s and t s are the reflection coefficient and projection coefficient of the s component, respectively.r p and t p are the reflection coefficient and projection coefficient of the p component, respectively.θ 1 and θ 2 represent the light reflection angle and projection angle, respectively.n 1 and n 2 represent the refractive index of different medium materials.
In the defect detection process based on polarization imaging technology, to extract the polarization state information of the defect detection image, the Stollers vector method is used to represent the polarized light.The Stokes vector method combines the Stokes vector of the light beam and the Mueller matrix of the optical device, which can be utilized to represent the polarization state information and light intensity of the polarized light, opening the prelude to the full polarization state measurement [35].The Stokes vector method states that any polarization state of light can be represented by four Stokes vectors, defined as: where S x, y is the Stokes vector, which is represented by the column vector composed of S 0 , S 1 , S 2 , and S 3 x, y is the space coordinate.S 0 is the total incident light intensity of the system and is represented by the sum of the linearly polarized light intensities in the 0° and 90° directions.S 1 is the difference between the linearly polarized light intensities in the 0° and 90° directions.S 2 is the difference between the intensities of linearly polarized light in the direction of 45° and 135°.S 3 is the difference between the intensities of right-handed and left-handed circularly polarized light.
When the incident light of the system is linearly polarized light, S 0 , S 1 , S 2 and S 3 satisfy the relationship: When the incident light of the system is partially polarized light, S 0 , S 1 , S 2 and S 3 satisfy the relationship: Based on the Stokes vector method, any beam of polarized light can be represented by the polarization angle Aop, the polarization degree Dop and the polarization ellipticity ̟: (2)

Defect Characterization Parameters and Algorithms
After the defect detection image is preprocessed and the contour extracted, the surface defect area of the part has been segmented.To further analyze the defects, it is necessary to extract the parameters that can characterize different defects from the image.The established geometric characterization parameters are relatively stable defect information, which does not change with the environment and other factors, and mainly include parameters such as defect perimeter and area extracted from defect edge information and defect area.The texture characterization parameters extract the degree of local defect information refinement and edge clarity.Therefore, by establishing geometric characterization parameters and texture characterization parameters to express the key information of parts surface defects, defects can be analyzed more comprehensively.

Scale Setting of the Characterization Parameters
The quantitative calculation of defect characterization parameters based on digital image processing uses pixels as the basic unit.The final calculated size of geometric characterization parameters such as area and the perimeter have a linear relationship with the number of pixels occupied by the image.Therefore, it is necessary to measure the characterization parameters before the measurement.The scale setting is performed, that is, the actual size corresponding to a single pixel in the target image of the defect to be tested is calibrated.The calibration algorithm is as follows: where H is the horizontal distance between two points on the detection image; N x is the number of pixels occu- pied in the horizontal direction; V is the vertical distance (5) between two points on the detection image; N y is the number of pixels occupied in the vertical direction; M is the magnification of the defect detection system, and s is the scaling factor for defective images during image processing.H x is the calibration factor in the horizon- tal direction; V y is the calibration factor in the vertical direction, and D xy is the calibration factor in the diago- nal direction and the unit of the calibration factor is μm/ pixel.

Geometric Characterization Parameters
Set the defect binary image that has undergone image processing as I(x, y) , the image size is X × Y , (x, y) represents the coordinate position of the pixel point, and any pair (x, y) of values I xy ∈ [0, 1] in the image.The image can be represented as a square matrix I:   1. Defect area S is the number of all pixels in the connected area wrapped by the defect edge after the image is binarized and detected.Its size depends on the number of pixels and the calibration factor, not the pixel gray value, and the unit is square microns.For the defect detection image I , the pixel value of the defect area is I x, y = 1 , and the pixel value of the background area is 0, then the area S of the defect is defined as: Defect perimeter P is the total length of the contour composed of pixels on the continuous boundary of the image after edge detection.It can be used to distinguish the shape complexity of the defect target.The size depends on the number of pixels on the continuous boundary and the calibration factor, the unit is microns.For the defect detection image I , the pixel value of the defect edge is I x, y = 1 , then the perimeter P of the defect is defined as: The defect marking rectangle is utilized to locate the position of the defect area in the image, and to a certain extent, it can describe the basic shape of the defect area.The width L x and the height L y of the defect marking    rectangle respectively represent the maximum distance of the edge contour point set G of the defect area in X-axis and Y-axis directions of the coordinate system, and the unit is microns.As shown in Figure 1, the widths L x and L y of the defect marking rectangle are defined as follows: The defect circumscribing rectangle is the smallest rectangle enclosing the target defect area.The defect circumscribing rectangle and the long axis H represents the maximum distance between any two points on the contour of the defect edge.The direction of the short axis W is perpendicular to the direction of the long axis H, which indicates that the defect area is in the maximum straight-line distance in this direction, the unit is microns.Assuming that there are any two-point sums G i2,j2 (i 2 , j 2 ) and G i1,j1 (i 1 , j 1 ) on the defect boundary, the long axis H and the short axis W of the circumscribed rectangle of the defect is defined as: Defect direction factor Q is used to characterize the approximate direction of the target defect in the detection image, which is represented by the ratio of the width L x and height L y of the defect marking rectangle: where Q > 1 represents the L x of the defect marking rec- tangle is greater than the height L y , that is, the length of the defect in X-axis direction is larger, so the main body of the defect is in the horizontal direction, while Q < 1 , the main body of the defect was in the vertical direction.
Defect shape factor C is used to characterize the approximate shape of the defect area, which is expressed by the long axis H and the short axis W of the defect-circumscribed rectangle as: where C ∈ [1, ∞) , when the value of C is close to 1, it indicates that the long and short axes of the circumscribed rectangle of the defect are close in size, and the shape of the defect area is approximately (10) ( circular or square, such as common pores and balling defects.When the value of C is large, the defect areas approximate the shape of elongated strips, such as crack and scratch defects.Defect slender length K is utilized to detect whether the shape of the defect is close to a rectangle, a circle, or an elongated curved shape, which is of great significance for the shape detection of common defects such as balling, pores, and cracks, defined as: where S r is the area of the circumscribed rectangle of the defect, K ∈ [0, 1] .When the value of K is π/4 , the shape of the defect area is a circle.When the value of K is 1, the shape of the defect area is a rectangle.When the value of K is close to 0, the shape of the defect region is elongated.
Defect circularity J is used to measure the degree to which the defect shape is close to a circle, indicating the complexity of the edge contour of the extracted defect area, which is defined by the area of the defect area and the boundary perimeter as follows: When the shape of the defect area is circular, J = 1 .If the shape of the defect area is non-circular, then J > 1 .The rounded balling and pore defects are closely related to the roundness parameter.
Defect inclination θ is used to characterize the inclination degree and main body direction of the target defect in the inspection image, which is defined by the angle between the long axis of the defect-circumscribed rectangle and the X-axis of the image: The characteristic parameter moment of the defect image is analogous to the concept of the moment, which takes the pixel coordinates in the defect area as the force arm, and the pixel point as the centroid, and obtains each order moment through the calculation to describe the geometric shape of the defect area.Among them, the moment of the defect image has the characteristics of rotation, translation, and scaleinvariant, so it is called the moment invariant [36][37][38].For a defect image I(x, y) of size X × Y , the relationship between the I(x, y) with the defect matrix is established as: where ϕ rt is the central moment of order r + t; (x d , y d ) is the barycentric coordinate of the defect area.After normalization: The seven-moment invariant combinations calculated are expressed as: This paper extracts T 1 − T 3 for defect characterization.

Texture Characterization Parameters
The texture is defined as the result of human visual perception, and it is an important description method that contains the inherent laws of target defects.The texture can be regarded as the distribution law of multiple pixels in the image, and the texture of the defect image is expressed as the grayscale change of the image, which can be used to characterize the unique characteristics of different defect areas [39].The gray level cooccurrence matrix (GLCM) is used to construct a texture representation parameter system and extract the texture information of defects.
Assuming that there is a point (x 0 , y 0 ) on the defect image, and another point is (x 0 + �x, y 0 + �y) , x and y are the displacement amounts in X axis and Y axis directions, the gray value of this pair of pixels is (g 1 , g 2 ) , and the image size is X × Y .Pixel (x 0 , y 0 ) slide in dif- ferent distances and directions in the image and multiple sets of different pixel-to-gray values (g 1 , g 2 ) can be obtained.Select the four commonly used directions of 0 °, 45 °, 90 °, and 135 °, and set the gray level G 0 in the image, the GLCM of M X can be constructed, the size of value of the row g 1 and column g 2 in and the matrix of M X is expressed as: Matrix M X reflects the texture information in the defect image, which can be used to analyze the roughness and contrast in the image, calculate the secondary statistics by normalizing it, and further utilized the M X parameters to describe the change speed of the texture, which can conveniently characterize and analyze different defect types.
Four defect texture characterization parameters are established, as shown in Table 2.
The angular second-order moment M 1 is utilized to measure the uniformity of the grayscale distribution of the texture of the defect image, which reflects the thickness of the texture.When the texture of the defect image is relatively rough, the value of the second-order moment M 1 is large, while the grayscale change in the image is small, the non-zero elements in the matrix M X are mainly concentrated near the main diagonal, the texture is finer and the angular second-order moment M 1 is smaller.M 1 is defined as: where M X is the normalized result of the matrix M X .
Entropy M 2 is used to measure the information richness of the defect image and characterize the complexity (20)  of the texture.When the M X (g 1 , g 2 ) is a zero matrix, the value of entropy M 2 is zero, and the image has no texture information.When the elements in the matrix M X are approximately equal, M 2 has the maximum entropy value, and when the elements in the matrix M X are dif- ferent, and the value of M 2 is smaller.M 2 is defined as: Contrast M 3 is used to measure the texture clarity of the defective image, which can effectively detect the grayscale contrast in the image.When the value of the elements far from the main diagonal in the matrix M X is larger, the M 3 would be larger, the grooves of the defect image are deeper, and the texture effect is more remarkable.M 3 is defined as: Correlation M 4 is utilized to detect the main direction of the texture in the defect image and measure the similarity of the rows and columns in the matrix M X .If the value of the correlation M 4 of the matrix M X in the vertical direction is greater than the value of the matrix in other directions, indicating there is a textured image in the vertical direction.The correlation M 4 is defined as: (22) 4 Experiments and Discussion

Experimental Setup
To further verify the effectiveness of the defect characterization parameters and the reliability of utilizing polarization imaging technology in SLM part defect detection, a visual detection system was established as depicted in Figure 2. The detection system mainly includes the part to be tested, an LED light source, a linear polarizer, an electric rotating frame, a CMOS camera, and a processing computer.The size of the linear polarizer (THORLABS, LPVISE100-A) is 25.4 mm, the operating wavelength range is 400-700 nm, and the CMOS camera has a resolution of 2448×2048 and a single-pixel size of 3.45 μm.The focal length of the objective lens is 50 mm, the working distance is 300 mm and the F-number is 2. The electric rotating frame (Standa, FPSTA-8MPR16-1) can achieve 360° rotation angle and 0.75 arcmin step resolution of the polarizer rotation control as shown in Figure 2(b), and it is equipped with a controller (8SMC4-USB) as shown in Figure 2(c).
The computer used for image acquisition and analysis is a ThinkPad S2, the CPU is i5 8250U, and its maximum frequency is 1.8G Hz.During the experiment, the parts to be tested are illuminated by an LED light source, and the light is reflected by the parts' surface and then captured by the CMOS camera through a polarizer.The surface of the metal parts to be tested would have a high reflection phenomenon.The angle of the polarizer is adjusted by the computer-controlled rotating frame, and four sets of defect detection images with different polarization angles are collected and processed by the Stokes vector method.After that, the preliminary detection of parts' defects is completed.

Technical Roadmap for Defect Detection and Characterization
Figure 3 presents the technical roadmap for defect extraction and characterization based on a polarization imaging system.The overall procedures are as follows: 1. Build the polarization imaging system and capture four sets of defect detection images under different polarization angles.2. Extract S1, S2, Dop, and Aop images, fuse Stokes vector images, polarization degree, and polarization angle images, and analyze the fusion effect to determine the region of interest (ROI).3. Import the captured data into the image processing system and convert it into a grayscale image, perform super-resolution reconstruction, then perform median filtering and binarization post-processing, and use the Canny operator to extract the edge of the defect area contour.

Suppression Effect Analysis of Highly Reflected Light
The SLM parts tested in the experiment exhibited areas with high reflection phenomena, making it challenging to detect key defect information using conventional visible light cameras.To verify the effectiveness of high reflection light suppression by polarization technology, the polarizer angle was adjusted by a computer-controlled motorized rotating frame.The detection images and the original unpolarized original images under different polarization angles of α, β and γ were captured and converted from RGB to HSV channel for threshold determination, thereby realizing efficient characterization and analysis of high-reflection areas.
The RGB model of the image divides the obtained light intensity information into three independent channels of red, green, and blue, which are distinguished and defined according to the fusion of image colors, but in the defect detection application based on polarization technology, it cannot be used.The RGB model is utilized to analyze the high-reflection area of the detected image and the suppression effect of high-reflection light.Therefore, the detection image is converted from an RGB channel to HSV channel containing hue, saturation, and lightness information, and the brightness of different pixels in the image is analyzed by extracting the brightness-related channel value (V-channel value).The defect detection image converted from RGB to HSV channel satisfies the following relationships: (25) As shown in Figure 4, the left column shows the detection original image without polarizer and the corresponding detection images with polarization angles of α, β and γ, and the right column shows the profiles of the V-channel value distribution of the 400-, 900-and 1400line pixels in the extracted image based on Eq. ( 25).
Figure 5 shows the V-channel value distribution of image pixels collected under different polarization angles, where the abscissa is the pixel number in the image, and the numbering sequence is obtained by scanning from the upper left to the lower right pixel of the image line by line.In the case of no polarizer, the V-channel value of the detected image is significantly larger, and there are many pixels in the high-reflected area whose intensity value is greater than the threshold (0.65).In the case of utilizing a polarizer, the V-channel value of the pixel shows an overall downward trend with the change in the rotation angle of the polarizer, the number of pixels in the high-reflection area changes significantly.When the polarization angle is α , there are still more pixels with high V-channel value in the extracted sample, which reflects the large area of the high reflection area in the detection image.When the polarization angle is γ, the V-channel values of all the pixels in the image are basically smaller than the threshold, and the area of the high reflection area in the image is significantly reduced.Obviously, the defect detection system based on polarization technology has a good effect of suppressing high reflected light, which is beneficial to the later defect extraction and characterization.

Fusion Results of the Polarization Detection Images
To further verify the performance of the polarizationbased detection system, four sets of defect detection images (#1, #2, #3, #4) were captured at polarization angles of 0°, 45°, 90° and 135°, respectively, as shown in Figure 6.According to Eqs. ( 2) to ( 6  As shown in Figure 7, after polarization processing, the proportion of pixels with high V-channel value in Stokes vector images S1 and S2 is relatively low, and the pixels below the threshold account for 98.15% and 99.08%, respectively.The proportion of polarization degree and polarization angle images is 83.29% and 99.86% respectively.Compared with the original intensity image, the negative influence of the high reflection area is obviously eliminated, and the three-dimensional V-channel value distribution of the defect areas in the image can be accurately identified.The image data shown in Figures 7, 8, 9, 10 are porosity, cracks, scratches, and balling defects commonly found in SLM parts, respectively.Obviously, the information highlighted by the obtained Stokes vector, polarization degree and polarization angle images have strong complementarity.Meanwhile, the image fusion processing can significantly increase the amount of information and contrast.Figure 11 shows the fusion results of the Stokes vector images S1, S2, and the polarization degree Dop and polarization angle Aop images.It is obvious that the fused image has a prominent effect on the edge contour of the defect.The contrast between the area and the adjacent background area is effectively improved, making the details of the defect clearer and more intuitive.The overall contrast, clarity and information of the image are improved.To objectively and quantitatively evaluate the quality of the fused image and compare it with the original intensity image, the average gradient (AG), information entropy (E), spatial frequency (SF), edge intensity (EI), and standard deviation (SD) are utilized.The results are shown in Figure 12.
Assuming that the size of the fused image is X×Y, the five image performance evaluation indicators are as follows.The AG, also known as the grayscale, reflects the changes in the details and clarity of the image and is a measure of the image's ability to express the contrast of details and texture information [40].The AG is defined as: where the I x = I i + 1, j − I i, j represents the horizontal gradient information in the image i, j ; I y = I i, j + 1 − I i, j represents the vertical gradient information in the image i, j .
The E is an index to measure the richness of image information.The larger the information entropy value, the greater the contrast of the image, the greater the (26) where L represents the total gray level of the image; P i is the proportion of pixels with the gray level i in the image to the total pixels.The SF can reflect the overall activity level of the image in the spatial domain.The larger the SF value, the better the quality of the fused image [41], defined as: where the SF represents the spatial frequency; CF is the spatial column frequency, and RF is the spatial row frequency.
The EI is essentially the magnitude of the image edge point gradient, that is, the local variation intensity of the image along the edge normal direction.The larger the edge strength value is, the more obvious the edge effect of the image is, which is of great significance in defect identification and extraction.For an image I i, j , the Canny operator detects edges and the edge strength of the image at a point i, j is expressed as: where G i, j represents the center edge point operator; ∂G ∂i and ∂G ∂j are the gradients of the graph in ij direction, respectively.* represents the convolution operation.
The SD can reflect the grayscale difference information of the image, measure the difference between the source image and the fusion image, and can compare and evaluate the fusion quality more intuitively.The SD is defined as: where I represents the mean value.
As shown in Figure 12, compared with the original intensity image, the average improvement rates of the average gradient, information entropy, spatial frequency, edge intensity and standard deviation of sample 1 are 163.458%,20.043%, 163.198%, 123.029% and 28.413%, respectively.The average improvement rates of the average gradient, information entropy, spatial frequency, edge strength and standard deviation of sample 2 are 73.795%,90.752%, 78.234%, 124.238% and 91.406%, respectively.The average gradient, information entropy, spatial frequency, edge strength and standard deviation of sample 3 are 26.025%,54.537%, 25.084%, 34.904% and 11.261%, respectively.The average improvement rates of the average gradient, information entropy, spatial frequency, edge strength and standard deviation are 58.549%,16.084%, 58.689%, 70.518% and 28.399%, respectively.The above results fully demonstrate that the polarization image after fusion processing has more abundant information, and the image details are clearer, the contrast of the defect area is higher, and the edge contour information of the defect is clearer.

Defect Extraction and Characterization Results
As shown in Figure 11, the ROI is first selected for the defect detection image processing based on the image fusion, and then the defect feature extraction and characterization analysis are performed on the ROI.The ROI of sample 1 is a typical porosity defect, the ROI of sample 2 is a crack defect, and the ROI of sample 3 and sample 4 are scratches and balling defects, respectively.In the (29)  3, which respectively test and characterize the defect area, perimeter, direction factor, and shape factor, among which the scratch defect numbered #3 ROI has the largest area of 18246.8μm 2 , which is mainly caused by the damage of the powder scraping device, resulting in scratches on the part's surface or large-scale slag inclusion and unmelted phenomenon during the powder scraping process.The #1 ROI2-1 has the smallest spherical porosity defect area of 474.3 μm 2 , the maximum circumference of scratch defects is 656.9 μm, and the minimum circumference of spherical porosity defects is 78.68 μm.The marked rectangles of the porosity defect numbered #1 ROI and the balling defect numbered #4 ROI2 are coincident with the circumscribed rectangle.The width of the marked rectangle and the short axis of the circumscribed rectangle of #1 ROI are both 50.0 μm, while the height of the marked rectangle and the circumscribed rectangle of the #1 ROI are both 50.0 μm.The long axes of the rectangles are both 96.0 μm.It is obvious that the porosity defects of #1 ROI are not spherical structures, but elongated porosity extending along the Y-axis of the image.The inert gas was adsorbed during the powder feeding process of material manufacturing.The width of the marked rectangle and the long axis of the circumscribed rectangle of #4 ROI2 are both 67.1 μm, while the height of the marked rectangle and the short axis of the circumscribed rectangle are both 65.8 μm.The balling defect of the #1 ROI is relatively regular and close to a complete sphere.The main reason for its occurrence is that the energy density of the laser beam is too low or too high during the processing.When the energy is too low, the metal powder is not completely melted and it is easy to produce balling defects.When the energy is too high, the liquid balling can also occur as the metal splashes onto the un-melted metal powder.
The marked rectangle of the crack defect numbered #2 ROI has the largest difference from the circumscribed rectangle.The width and height of the marked rectangle are 138.1 μm and 93.4 μm, respectively.The long and short axes of the circumscribed rectangle are 155.2μm and 17.6 μm, respectively.Obviously, the overall width of the crack defect region is relatively narrow.The main reason is that the internal stress generated during the transient melting process exceeds the material strength limit, and is affected by factors such as temperature distribution and poor melting.The direction factors of #1 ROI1, #1 ROI2-1, #1 ROI2-2 and #4 ROI1 are all less than 1, which clearly shows that the main direction of the defect is the vertical direction, while the direction factors of #2 ROI and #4 ROI2 are 1.48 and 1.02, respectively, which indicates the main direction is the horizontal direction.From the perspective of the shape factor, the value of #4 ROI2 is the closest to 1, and the long axis and short axis of its circumscribed rectangle are similar, which is also consistent with its approximately circular regular balling defect characteristics, while the value of #2 ROI is as high as 8.83, which is much larger than 1, indicating that it is a narrow and long defect, which is also consistent with the characteristics of crack defects.From the analysis of the slender length, the values of #3 ROI, #4 ROI1 and #4 ROI2 are all 0.81, which are closest to π⁄ 4 in the test dataset, which illustrates the spherical defects of #4 ROI1 and #4 ROI2 are approximately circular in the 2D test image, but the scratch defect of #3 ROI needs to be characterized with other characterization parameters.Combined with the analysis of roundness, the porosity defects of #1 ROI2-1 and the balling defects of #4 ROI1 and #4 ROI2 are 1.04, 1.06 and 1.04, respectively, which are all close to 1 and indicate that the overall shape of the defect area is approximately regular circular, while the scratch defect of #3 ROI and the crack defect of #2 ROI are as high as 1.88 and 5.65, respectively.From the inclination results to judge the approximate direction of the defect, it is obvious that the long axis direction of the circumscribed rectangle of #1 ROI1 and #4 ROI2 parallel to Y-axis of the image, #1 ROI2-2, #2 ROI, #3 ROI and #4 ROI1 are distributed along the lower left to upper right direction with different inclination degrees, while #1 ROI2-1 is inclined at 90.97° along the upper left to the upper right distribution in the lower right direction.Based on the above analysis, the 11 geometric characterization parameters in Table 3 can better complete the characterization analysis and type judgment of SLM part defects, which is of great significance for the application of SLM.
The moment invariant has the characteristics of translation, rotation, and scale invariance, and the parameters , respectively, when compared with porosity defects, while the rates are 18.26% and 20.86% when compared with balling defects.The ξ 12 and ξ 13 of balling defects are more prominent, and their average growth rates are 10.88% and 21.43%, respectively, when compared with pore defects, while 9.35% and 15.87%, respectively, when compared with scratch defects.Figure 14 shows the experimental results of texture characterization parameters ξ 16 -ξ 19 .The angular secondorder distance of the defect image is extracted from four directions of 0°, 45°, 90° and 135°, and the distance is one adjacent pixel.Obviously, the mean value of the angular second-order distance of the scratch defect of #3 ROI is the smallest, indicating that the texture is finer, compared with that, the average growth rate of porosity defects of #1 ROI1 and #1 ROI2 is 123.38%, and the average growth rate of the crack defect of #2 ROI is 216.27%.The average growth rate of the balling defect for #4 ROI1 and #4 ROI2 are 236.97%,which indicates a coarser texture.The average entropy of scratch defects in #3 ROI is the largest, and the average growth rates of pore defects, crack defects and balling defects are as high as 92.72%, 221.03% and 162.29%, respectively.Obviously, the scratch defect images contain rich information, and all defect images have the smallest entropy value in the 90° direction, indicating the least amount of information in the 90° direction.
From the results of contrast ξ 18 and correlation ξ 19 , the defects of #1 ROI1, #4 ROI1 and #4 ROI2 have the smallest contrast values in the 0° direction, indicating that there are defect textures in the 0° direction, and their correlation values are the largest.However, the defects of #1 ROI2-1 #1, ROI2-2 and #2 ROI have the smallest contrast value in the 90° direction, and their corresponding correlation values are the largest, illustrating that there are defective textures in the 90° direction.#4 ROI1 and #4 ROI2 have the highest average contrast ratio of balling defects, and the numerical average growth rates of porosity, crack and scratch defects are 320.37%,1445.10% and 821.47%, respectively.It is obvious that the grayscale contrast of balling defect area and the background area is large, and the defect outline information is clear, which is also related to the improvement of the overall image intensity of the balling area due to the reflection of light on the surface.Obviously, the establishment of texture characterization parameters plays an important role in extracting and analyzing part defects, and its ability to identify different types of defects is different.Therefore, the polarization imaging system and defect characterization parameters established in this paper has been verified, which provides a good solution for the defect detection and characterization of part defects in the SLM.

Conclusions
(1) A novel method for extracting and characterizing surface defects in additive manufacturing (AM) parts has been proposed and experimentally validated.(2) A set of defect characterization parameters has been established for both geometric and texture analysis, with geometric parameters including defect area, perimeter, marking rectangle, direction factor, and shape factor, and texture parameters including second-order distance of the defect image angle, entropy, contrast, and correlation.(3) A detection system based on polarization imaging is setup, through which the feasibility of the proposed defect feature extraction and characterization method is verified.The technical route of defect feature extraction and characterization is proposed.The main process includes: 1) the Stokes vector image, polarization degree and polarization angle image of defects are calculated and fused; 2) the ROI of defects are processed with super-reso- lution reconstruction method and the edge contour information of the defect is extracted; 3) the defects are extracted and characterized with the proposed geometric characterization parameters and texture characterization parameters.(4) In the experiments, defect feature extraction and characterization analysis were carried out for four groups of the SLM samples, focusing on the high reflected light suppression effect based on polarization technology, the fusion effect of polarization images and calculation of defect characterization parameters.(5) The experimental results demonstrate that the feature extraction and characterization method for surface defects proposed in this study can characterize AM part defects in an information-rich way, and provide a solid theoretical basis for the processing parameters diagnosis, as well as the classification, identification and prediction of defects in the SLM processes.The research work is also helpful for the advances of standardization of defects characterization in additive manufacturing.

Figure 1
Figure 1 is a schematic diagram of defect characterization parameters.D is the pixel point set of the defect area; D ij represents a certain point inside the defect area; G is the pixel point set of the defect edge; G ij represents a certain point on the contour of the defect edge; L x is the marked rectangle in the width of X-axis; L y is the height of the marking rectangle on Y-axis; W is the short axis of the circumscribed rectan- gle, and H is the long axis of the circumscribed rectan- gle.Z E x 20 , y 20 is the coordinate of the center point of

Figure 1
Figure 1 Schematic diagram of defect characterization parameters

Figure 2
Figure 2 The defect detection system based on polarization imaging technology

Figure 3
Figure 3 Technical roadmap for defect extraction and characterization based on the polarization imaging system

Figure 7
Figure 7 Detection results of sample 1: Left: Stokes vector image and polarization degree and polarization angle images; Middle: V-channel value distribution map of pixels; Right: 3D V-channel value distribution map of the detected image ), the Stokes vector images S1 and S2 of the detection image, the polarization degree image Dop and the polarization angle image Aop are calculated, as shown in Figures 7, 8, 9, 10, respectively.Obviously, the Stokes vector images S1 and S2 represent the linear polarization information of the defect image, which has a more uniform grayscale distribution compared with the intensity image.The edge contour information of some key defect areas in the image is highlighted, but also part of the detail information is lost.Moreover, compared with the Stokes vector images S1 and S2, the polarization degree image and the polarization angle image have clearer detail information of the defect area.

Figure 8
Figure 8 Detection results of sample 2: Left: Stokes vector image and polarization degree and polarization angle images; Middle: V-channel value distribution map of pixels; Right: 3D V-channel value distribution map of the detected image

Figure 9
Figure 9 Detection results of sample 3: Left: Stokes vector image and polarization degree and polarization angle images; Middle: V-channel value distribution map of pixels; Right: 3D V-channel value distribution map of the detected image

Figure 10
Figure 10 Detection results of sample 4: Left: Stokes vector image and polarization degree and polarization angle images; Middle: V-channel value distribution map of pixels; Right: 3D V-channel value distribution map of the detected image

Figure 11
Figure 11 The result of image fusion: a Sample 1, b Sample 2, c Sample 3, d Sample 4

Figure 12
Figure 12Objective evaluation results of the fused images

Figure 14
Figure 14 Experimental results of texture characterization parameters ξ 16 -ξ 19 A R (x 11 , y 11 ),B R (x 12 , y 12 ) ,C R (x 13 , y 13 ),D R (x 14 , y 14 ) are the four vertices of the marking rectangle, respectively, A E (x 21 , y 21 ),B E (x 22 , y 22 ) ,C E (x 23 , y 23 ) and D E (x 24 , y 24 ) are the four vertices of the circumscribed rectangle, respectively.A total of 15 defect geometrical characterization parameters are established in this paper, as shown in Table

Table 2
Defect texture characterization parameters

Table 3
Experimental results for defect geometric characterization parameters ξ 1 -ξ 11 The mean values of ξ 12 , ξ 13 , ξ 14 and ξ 15 for crack defects in #2 ROI are 5.16, 10.35, 18.36 and 20.35, respectively, and the mean values of ξ 12 , ξ 13 , ξ 14 and ξ 15 for scratch defects in #3 ROI are 7.17, 15.87, 27.17 and 29.33, respectively.The mean values of ξ 12 , ξ 13 , ξ 14 and ξ 15 for balling defects of #4 ROI1 and #4 ROI2 are 7.84, 18.39, 22.98 and 24.27, respectively.The value of the constant moment characterization parameter of crack defects is relatively small, and the maximum difference rate between it and balling defects is 46.33%, the maximum difference rate with scratch defects is 53.36%, of invariant moment representation of different defect images would have obvious differences, which is of great significance for identifying and analyzing defect types.The experimental results of geometric characterization parameters ξ 12 -ξ 15 are shown in Figure13, the average values of ξ 12 , ξ 13 , ξ 14 and ξ 15 for porosity defects of #1 ROI1 and #1 ROI2 are 7.07, 15.14, 20.71 and 22.23, respectively.and the maximum difference rate with balling defects is 77.69%.The ξ 14 and ξ 15 of scratch defects are more prominent, and their average growth rates are 31.17%and 31.92%