## 3 Analysis Design  
The analysis software was developed based on the free Python language with the Computer Vision Library [22] for image analysis methods. The samples were automatically detected and separated from the background for further analysis of the whole sample area. First, a Gaussian filter was applied to the images to reduce noise. The images were then binarized, using the well-known Otsu algorithm [23] for thresholding. After binarization, image segmentation and morphological analysis of all detected defects was performed using the algorithms from the Computer Vision Library. The classification of defects was based on the defect circularity \(C_{D}\)  
\[C_{D}=\frac{4\pi A_{D}}{P_{D}^{2}} \tag{2}\]  
with \(A_{D}\) and \(P_{D}\) being the area and perimeter of the defect, respectively. Another shape factor was the aspect ratio \(AR_{D}\) derived from the ratio of the two semi axes of a fitted ellipse  
\[AR_{D}=\frac{r_{major}}{r_{minor}} \tag{3}\]  
with \(r_{major}\) and \(r_{minor}\) being the major and minor half axes. This approach was chosen since the classical elongation shape factor in the OpenCV-library does not allow the defect to be rotated at an arbitrary angle while the fitted-ellipse algorithm does. Furthermore, the hierarchy of objects was determined. This allowed us to determine if there were objects located within another object. Currently implemented defect classifications are summarized in Table 3. Unmelted particles are particles which can be found inside a defect. For classification they are \begin{table}
\begin{tabular}{l c} \hline
**Parameter** & **Range** \\ \hline particle size fraction/\(\upmu\)m & 20–63 \\ beam diameter \(d_{L}\)/\(\upmu\)m & 80 \\ layer thickness \(l_{z}\)/\(\upmu\)m & 50 \\ hatch distance \(h_{s}\)/\(\upmu\)m & 90 \\ laser power \(P_{L}\)/\(\uppsi\) & 285–350 \\ scan speed \(v_{s}\)/mm/s & 850–1400 \\ \hline \end{tabular}
\end{table} 
Table 2: Process parameter ranges of LPBF experiments. Figure 2: Samples (diameter: 5 mm) (**a**) as-printed, (**b**) after preparation, (**c**) position of prepared sections. assumed to be a pore with another object inside it. Gas pores are characterized by their high circularity of 95% or more. Cracks are elongated objects. A threshold of AR > 5 was set to characterize cracks. All other defects found in this study were irregular and are believed to be lack of fusion defects. However, defect types can be easily extended and their thresholds can be easily adjusted if necessary. For circular sample geometries, shape accuracy is determined based on the actual perimeter \(P_{C}\) from image analysis in relation to the theoretical perimeter \(P_{th}=\pi D\) (Sample Diameter D). If the shape is irregular, \(P_{C}\) will be much larger than \(P_{th}\). This parameter is meant to help find optimized contour parameters for the LPBF process. This feature is implemented as well for rectangular geometries. The total sample porosity is determined as the ratio of the total area of all defects and the total sample area:  
\[\varepsilon_{rel}=\sum\varepsilon_{defects}=\frac{\sum A_{numleted\ particles}+\sum A_{gas\ pore}+\sum A_{cracks}+\sum A_{lack\ of\ fusion}}{A_{total}} \tag{4}\]  
The area of each defect is used to calculate its circle-equivalent diameter  
\[d_{CED}=\sqrt{\frac{4A}{\pi}} \tag{5}\]  
These diameters are used to calculate the pore size distribution as a number distribution of diameter \(q_{0}\) and an area-weighted distribution of diameter \(q_{2}\) to emphasize the effect of pore size on the mechanical properties. Pre-defined size classes between the minimum and maximum diameters \(d_{min}\) and \(d_{max}\), respectively are summarized in Table 4. \begin{table}
\begin{tabular}{c c} \hline \hline
**Diameter Range/\(\mu\)m** & **Interval Width/\(\mu\)m** \\ \hline \(d_{min}\)-5 & 0.5 \\
5-10 & 1 \\
10-20 & 2 \\
20-50 & 5 \\
50-100 & 10 \\
100–200 & 25 \\
200–400 & 50 \\
400–\(d_{max}\) & 100 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Size classes used for the calculation of the pore size distribution.