Introduction

Additive Manufacturing (AM) technologies allow fast and economic production of customized and complex designs (Niaki & Nonino, 2019; Perram et al., 2017); lightweight components (Meboldt & Klahn, 2017; Perram et al., 2017), part consolidation combining many components into one functional part (Gu, 2016), reproduce or repair via Reverse Engineering and processing different kind of materials (Kumar et al., 2019). Consequently, they change the entire supply chain of production and consumption, from product design to implementation of the finished product (Yadroitsev et al., 2021).

AM is increasingly being used to develop new products in a variety of industries such as aerospace, biomedical implants, and automotive. Among all the AM technologies, Laser Powder Bed Fusion (L-PBF) and specifically Selective Laser Melting (SLM) has been regarded as the most promising process for fabricating metal components (Froes et al., 2019). In SLM a thin layer, corresponding to a slice of a 3D CAD model (Kumar, 2020), is spread over the working platform (or a substrate) using a blade. The laser scans the powder bed according to the shape defined in the CAD file. After each layer has been scanned, the powder bed is moved down by one layer thickness, followed by an automatic leveling mechanism that dispenses a new layer of powder. The laser then melts a new cross-section. The process is repeated to form the desired solid metal part (Kruth et al., 2015). Generally, Nd: YAG-fiber laser is used for melting the powder. The working area is enclosed and either filled with an inert gas for protecting molten metal from reacting with the air (Kumar et al., 2019).

SLM is showing many advantages: parts with high density and strength; negligible waste of material because unused powders can be recycled; possibility of producing complicated and customized shapes ability to process a wide variety of metals and their mixtures (Kruth et al., 2015; Yanget al., 2017). These benefits are extremely helpful and have fueled the rapid expansion of this technology as well as its widespread acceptance in a variety of sectors (Yadroitsev et al, 2021).

However, critical events can occur during the layerwise process which can affect the fabrication and consequently lead to defects such as internal porosity (Sanaei et al., 2019; Brennan et al. (2021); Hamidi Nasab et al., 2020), cracking (Carter et al., 2014; Wang et al., 2018), formation of the material balling on the part surface (Galy et al., 2018; Hamidi Nasab et al., 2020; McCann et al., 2021; Sanaei & Fatemi, 2021) and high residual stresses (Aboulkhair et al., 2019). These defects introduce common quality issues such as layer misalignment, dimensional errors, and distortions (Aboulkhair et al., 2019; Lee et al., 2021; Martin et al., 2019; Sanaei & Fatemi, 2021; Seifi et al., 2017). The reproducibility, the precision, and the mechanical properties (Gong, 2013; Jaber et al., 2020; Zhao et al., 2018) of the finished product can be compromised due to the abovementioned defects (Dowling et al., 2020; Smith et al., 2016; Yadroitsev et al., 2021). Reliable and robust monitoring tools are necessary for quick detecting defects and reducing the time and costs associated to post-process quality inspections.

Monitoring methods

Despite the technological advancements in the last 20 years, the SLM suffers from poor repeatability. The development of sensors led to a significant increase of data that an operator is not capable of manually screen. The analysis of data coming from SLM fabrication was significantly improved in the recent years. This is demonstrated by several papers published in the area of in situ monitoring and control of AM processes (Everton et al., 2016).

Different methods are used to evaluate the physical characteristics of the fabricated parts. It is necessary to gain a comprehensive representation of errors distribution and their features in an AM component, to investigate the trends that these distributions follow. These data are used to improve process optimization techniques, post-processing treatments and performance prediction (Sanaei et al., 2019). It is critical to discover flaws as early in the manufacturing process as feasible to improve product quality and reduce the risk of failure caused by defects. In theory, this could enable corrective actions during the process to reduce part failure and to minimize additional post processing operations necessary to refine the fabricated components (Koester et al., 2016). To obtain optimal parts, in-situ approaches are necessary for understanding the causes of flaws, recognizing defects, and their spatial distribution within the components (Perram et al., 2017). This form of monitoring is an early step toward closed-loop control of the process, in which in-situ data is used to modify processing parameters to avoid or rectify problems as the following layers are processed (Croset et al., 2021). At present, most of the works are related to off-line monitoring performed in either a destructive or nondestructive manner (du Plessis et al., 2018; Ziółkowski et al., 2014). Non-destructive characterization of SLM fabricated parts, using Scanning Electron Microscopy (SEM), X-ray Computed Tomography (XCT), ultrasonic, electromagnetic, eddy current, and thermography are studied in many works (Seifi et al., 2016, 2017; Maire & Withers, 2013; Croset et al., 2021; du Plessis et al., 2018, 2020; Yadroitsev et al., 2021; Repossini et al., 2017; Grasso & Colosimo, 2017; Taheri et al., 2017; Sharratt, 2015; Lu & Wong, 2017). Quality monitoring has frequently been carried out alongside conventional testing methods enabling detection of abnormalities in advance and aids in the rapid decision-making process for quality concerns (du Plessis et al., 2020).

Generally, the amount of data necessary for understanding the repeatability of the SLM process avoids traditional manual analysis and modeling. Artificial intelligence is a solution to overcome the challenge in handling data and it is nowadays used to identify pattern and irregularities with limited process knowledge (Razvi et al., 2019). Cross-sectioning coupled with SEM is a common method for SLM monitoring. Rahman et al., (2022) proposed a deep learning-based filler detection system using Mask Region-based Convolutional Neural Network (CNN) architecture to extract the filler morphology (size distribution, orientation distribution, and spatial homogeneity) from SEM images. Another study (Rahman et al., 2021) proposed five distinct approaches for automatically extracting straight fibers from SEM pictures to address major problems, morphological fiber extraction and overlapping or cross-linking issues. SLM surface roughness was evaluated in (Akhil et al., 2020) by deriving image texture parameters from surface SEM pictures using first-order and second-order statistical techniques; prediction models were developed using various Machine Learning (ML) algorithms. The SEM approaches are neither in-situ nor real-time. Furthermore, SEM analysis necessitates the preparation of metallographic samples, which is an inherently destructive technology, limiting it to an offline process study tool (Collins et al., 2017). Traditional methods of cross-section analysis or bulk density may provide quantitative assessment of the geographic distribution and shape of AM inherent flaws problematic. Because AM components are somewhat expensive, nondestructive methods of defect assessment like the Archimedes method, gas pycnometry, thermal imaging and X-ray micro-computer tomography are quite appealing (Sanaei et al., 2019). Baumgartl et al. (2020) used thermographic imaging and thermal mapping in a deep learning model for monitoring powder bed anomalies. Mohr et al. (2020) used thermography and optical tomography for defect detection in comparison with Computed Tomography (CT). Guerra et al. (2022) used High Resolution-Optical Tomography (HR-OT) for detecting geometric distortions specifically on the overhang as critical area of defect formation. All these approaches showed promising results in defect detection. As mentioned in (du Plessis et al., 2018), one of the drawbacks of XCT is the limited resolution for large objects. Depending on parameters used, X-ray penetration problems can result in image quality issues and hence decreased data quality (du Plessis et al., 2018). In general, reliable defects detection by these techniques are determined by the size, geometry, location, and morphology of the defect, as well as the complexity, density, and surface finish of the part (Yadroitsev et al., 2021). In addition, these techniques are expensive. On the other hand, during the fabrication phase, process parameters such as shielding gas flow and laser power might change, affecting the melting process. Variations in these parameters can result in a lack of fusion-based porosity, even if they occur in just a few layers of the part. Depending on the size of the item, it might be difficult to detect this type of process failure using typical inspection techniques (Froes et al., 2019).

Consequently, several in-situ monitoring methods have been developed to examine specific process parameters and items like as melt pool and spatter behavior (Repossini et al., 2017; Yakout et al., 2021; Ye et al., 2018; Zhang et al., 2018), part distortion (Caltanissetta et al., 2018; Li et al., 2018), dimensional accuracy (Aminzadeh & Kurfess, 2015; Land et al., 2015), powder recoating and powder bed surface (Aminzadeh & Kurfess, 2015; Craeghs et al., 2011; Krauss et al., 2014). These techniques have been reviewed in different studies (Everton et al., 2016; Grasso & Colosimo, 2017; McCann et al., 2021). Among them, in situ layerwise imaging techniques have been widely investigated in order to permit image-based layerwise anomaly identification for powder bed AM techniques. Scanned layer is usually monitored by integrating a Digital Single-Lens Reflex (DSLR) camera with SLM process to achieve the highest possible image quality (Nakamura, 2017). An external light module is common for improving the information obtained from the process (Gobert et al., 2018). Authors in some studies used different lighting conditions and contrast to monitor internal defects (Abdelrahman et al., 2017) or geometrical deviation (Foster et al., 2020), because different lighting preferences are regarded as an important component of the imaging system in order to ease automated flaw detection. The positioning of the camera can be of two types: coaxial setup where the camera is connected to a dichroic mirror to collect images along the laser path; off-axis setup, where the camera is positioned outside the system window (Repossini et al., 2017). Most of the literature works relate to this second type. The employment of ML is gaining more and more interest because it allows process predictions on the output without the need for explicit programming. In the SLM monitoring via Digital Image Processing (DIP) the supervised approach is the more common for layerwise monitoring (Imani et al., 2018). This method is carried out by providing two sets of data, namely the training and testing ones. In the training phase the first set of data is labeled in order to provide an input–output pairing which allows ML algorithm to be trained and establish a set of metrics to predict values on new input data. The testing data are used in the validation phase aiming to determine the model accuracy (Wang et al., 2020). Images are preprocessed through background removal, filtering and cropping to solve problems such as redundancy and noise (Scime & Beuth, 2019). The operations are undertaken by using a solid knowledge, skills and abilities necessary to identify images features and process signatures (Qi et al., 2019). The most common metrics for the performance evaluation is the precision defined as the true to predicted instances ratio. It is worth to note that the supervised ML are well suited for huge amount of data, but it requires a big amount of in situ experiments which must be repeated as the processing conditions changes. The selected camera specifications are characterized by high quality and high resolution: in (Gobert et al., 2018; Imani et al., 2019; Snow et al., 2021) the camera resolution was 36.3 Mpixels and in (Gaikwad et al., 2019) was 24.2 Mpixels; moreover, the optical system is typically focused on the part under-fabrication area to enhance the spatial resolution. The use of the ML applied to these designed for the purpose systems allowed an accuracy ranging between 85% and 99%. Owing high resolution systems for many layers requires big data managing thus point clouds became widely used for computer vision and in AM monitoring. Liu et al. (2021) extracted geometrical features from 3D printed part images to compute Sa roughness via point clouds. In Ye et al., (2020) the relationship between the melt pool images acquired via an off-axial photodiode and the tensile test results was developed. Lin et al. (2019) mapped AM images structuring the point clouds onto grids and comparing the defects with the CAD file. The parts quality produced by directed energy deposition were related to the structured-light scanning image by (Zhang et al., 2020).

In the presented literature review the SLM powder bed monitoring requires high performance systems to detect detailed anomalies and reliably relate them to the part defects. However, warranty issues, manufacturer restrictions or local laws prevent the industry from modifying the original machine to develop a designed for the purpose acquisition setup. This work covers the identified industrial need to implement the DIP for layerwise monitoring without modifying the system and/or hampering the production activities at machine shop floor level. Typically, commercial SLM machines are equipped with an internal camera to manually check possible issues in the powders bed spreading and subsequential laser scanning. Unfortunately, they are not designed for in-depth evaluation and both the resolution, and the optical precision prevent specific investigations since they are addressed to data collection rather than data analysis (Grasso & Colosimo, 2017). Hence, the development of an automatic system for possible anomalies detection via machine built-in camera is a challenging activity. This work focuses on this feasibility and aims to provide a direct and economical way to quickly detect flaws in the final part associated with the powder bed spreading, thus saving time and costs associated with the post-process quality inspection. Furthermore, the proposed methodology is unsupervised, i.e. no preliminary expensive experimentation is necessary for the training stage. The goal is to recognize through DIP various defects including lack-of-fusion porosity, uneven top surfaces, and geometrical deformations. The build-in camera cannot be modified by means of position, field-of-view, resolution and lighting. For the purpose, particular care is paid to the camera calibration in order to maximize the analysis capabilities. Furthermore, quantitative 3D reconstruction of powder bed anomalies is provided and compared to the traditional expensive CT measurement.

SLM design challenges

As previously stated, the SLM process includes the temporal and geographical collaboration of the laser beam, powder bed, and protective gas, resulting in a highly complex interplay of physical, chemical, and thermal processes. Material characteristics (powder sizes, shapes, and packing density), process parameters (laser power, hatch spacing, layer thickness), scanning method, and input geometry design have a direct impact on these complicated connections (including support structure selection). Robust design concepts must account for the functionally relevant results of the complex interactions of the SLM manufacturing process (Yadroitsev et al., 2021).

SLM combines particulate metallic material into the melt pool as well as a supporting framework for the overhanging material. As the powder-bed provides support to the forming melt pool, this scenario results in spattering of particles expelled from the melt pool on upward-facing surfaces and partial melting of particles on downward-facing surfaces (Sarker et al., 2018). Downward-facing surfaces are supported by contact with the powder bed during melt-pool solidification. This powder bed support enables SLM fabrication but compromises surface quality due to partially adhered powders (Yadroitsev et al., 2021). Powder attachment behavior during energy deposition and melt pool evolution is influenced by material parameters (such as thermal diffusivity and contact resistance) and powder bed characteristics (such as powder morphology and packing density). All these parameters determine whether a particle is absorbed by the melt pool, partially melts to the bulk geometry, or remains solid and unattached (Khorasani et al., 2018; Yadroitsev et al., 2021).

Surfaces having a lateral orientation inside the powder bed have higher roughness than corresponding upward-facing surfaces. This finding is attributable in part to the preferential attachment of leftover particles to these lateral surfaces because of their close contact with the powder bed during melt-pool solidification. The phenomenon is most noticeable for downward-facing surfaces with a sharp inclination angle since these surfaces have significantly enhanced heat transmission into the supporting powder bed (Calignano, 2018).

Materials and methods

Material

A powder is a complicated material form comprising of solid (the powder particles), liquid (moisture or solvent on the particle surface), and gas entrained between the particles (typically air, although, this can also be inert gases such as argon or nitrogen). As a result, we may anticipate a complex interaction of qualities such as form, size, and flow, as well as humidity, thermal conductivity, and mechanical strength. (Yadroitsev et al., 2021).

Powder flow behavior is a complicated phenomenon that is critical to the performance and repeatability of SLM process. The form, size, and morphology of the powder particles can have an effect on the flow behavior (Yadroitsev et al., 2021). From a processing standpoint, excellent powder spreading and packing in each layer of the powder bed is critical, which is determined by characteristics such as particle size distribution, packing density, flowability, and the sphericalness of the powder particles (Froes et al., 2019).

AlSi10Mg is the most commonly used Aluminum alloy for SLM process but remains one of the most challenging materials (Yadroitsev et al., 2021). Aluminum alloys have a low density (2.7 g/cm3), high strength, adequate hardenability, good corrosion resistance, and excellent weldability, making them suitable for a variety of applications, including automotive, defense, and aerospace equipment manufacturing. There are some powder properties that must be considered to adjust the continuous deposition of uniform powder layers. Depending on the method of manufacture and the history of processing, the powder of a particular alloy can have different properties. SLM produces low porosity, high-quality parts when process-compliant powders are used. These requirements include spherical morphology, good flowability (Froes et al., 2019) and packing density (Brandt, 2017; Froes et al., 2019), minimal gas pores, and Gaussian particle-size distribution. Aluminum powders have a low flowability, a high reflectivity (Sercombe & Li, 2016), and a high thermal conductivity (Wang et al., 2016; Aboulkhair et al., 2019; Sercombe & Li, 2016). Aluminum has a low laser absorption coefficient implying that a high laser power is required to overcome the rapid heat dissipation (Hosford, 2010). Because of their low melt viscosity, aluminum powders are highly susceptible to oxidation (Totten & Mackenzie, 2003; Sercombe & Li, 2016), which promotes porosity. Therefore, processing them is difficult, which results in parts with a variety of defects.

Powder morphology and size distribution could significantly affect the density of the powder bed, which in turn affects the energy beam–powder bed interaction. Although higher powder bed porosity might promote the overall energy in coupling, it also results in more dispersed distribution of energy, and therefore compromise the fabrication quality by reducing geometrical accuracy and introducing internal defects (Yang et al., 2017).

Methods

The selected case study for the application of the method is the compass case shown in Fig. 1. The virtual model was created using standard modeling programs as represented in Fig. 1a.

Fig. 1
figure 1

Virtual model of designed component (a) and support structures (b)

The employed machine is an EOSINT®M290 characterized by a 400-W ytterbium fiber continuum laser with a Gaussian distribution and a beam spot size of 100 μm. The building platform size is 250 × 250 × 325 mm3. The used process parameters are provided in Table 1. They were set in accordance with the EOS standard. To provide a high final density and minimize residual stresses, the chosen scan strategy is the stripe one, where the stripes were rotated by 67° in relation to the previous layer. Part orientation and build direction are shown in Fig. 1b. The orientation was chosen considering the staircase effect and surface quality. In fact, the staircase effect is zero for geometry that is either vertical or parallel to the manufacturing plane and the geometrical accuracy is maximized. As a result, functional surfaces should be aligned preferentially to the manufacturing plane, but down-facing surfaces may be troublesome (Yadroitsev et al., 2021). SLM process is considered as process where the powder can play the role as support structure, however, high residual stresses generated during the melting and solidification processes require support structures to keep the part from excessive warping (Gibson et al., 2021), to counter the thermal residual stresses (Yang et al., 2017) and for heat dissipation. For the part considered in this work, according to EOS procedure, the support structures were designed in Materialise Magics: the overhanging surfaces were supported by blocks type except for internal zones and very high structures where gussets were used to reduce the post processing. In Fig. 1b the support structures are colored in red in a transparent view of the part; the vertical direction is the direction the layer has stacked each other (stratification direction).

Table 1 Process parameters

In Table 1 the process parameters and the strategies employed for the fabrication of the compass case are reported.

The methodology of powder bed monitoring includes two approaches: a 2D analysis concerning single layer anomaly detection and 3D volumetric analysis. The former can allow a process intervention during the fabrication. The latter requires the process is complete and provides a 3D visualization of the object. This result was compared with the CT measurement. The framework is reported in Fig. 2.

Fig. 2
figure 2

Powder bed defect monitoring workflow

Computer tomography

The fabricated part was measured using a General Electric Phenix V|tome|x m CT. The detector is a temperature stabilized digital GE DXR array, 200 µm pixel size, 1000 × 1000 pixels2, 200 × 200 mm2; the dynamic range is above 10,000:1 at up to 30 frames per second. The voxel size and minimum observable detail can be lowered to 1 µm and 2 µm, respectively. The maximum sample dimension is 360 mm in diameter and 600 mm height. The part was manipulated via a granite-based precision 5-axes manipulator. The measurement accuracy is 4 + L/100 mm, in compliance with the VDI 2630 (2016) standard. The achieved data were processed by the proprietary phoenix Datos|x and saved in STL format for further analysis.

The STL was loaded in Materialise Magics. The platform was selected for its ability to manipulate and analyze this data format. Manual investigations are provided by transparent and sectioned views; the tool for determining trapped volumes inside the part is useful to find internal defects; the thin wall analysis allows determining non-compliances since the case has constant thickness.

Powder bed monitoring

Image calibration and enhancement procedures

In the vision-based inspection system for dimensional accuracy, a 2D measurement data (image) is acquired via installed camera. The EOSINT®M290 machine originally is equipped with a CCD video camera 1280 pixels × 1024 pixels resolution (Fig. 3). This resolution is very low hence an accurate calibration is crucial. The camera optical path is not orthogonal to the platform (Fig. 3a), and forms a 13.8° angle with the laser beam direction. As a consequence, the pictures are markedly deformed both in perspective and radially. The lighting of the powder bed is provided by a lateral LED array which leads to a non-uniform image (Fig. 3b). Two categories of images were taken for each layer during part production, “after recoating” (AR), taken after the recoater has deposited a fine layer of powder, and “after exposure” (AE), taken after laser processing the cross section on the powder bed.

Fig. 3
figure 3

Schematic of the camera position (a) and frontal view of the real system (b)

The visual distortion due to the positioning of the camera requires calibration. The process of image calibrating is a crucial problem for further metric scene measurement. The calibration process is determined by the model used to represent the camera’s behavior. The linear models, such as study of Hall et al. (1982) and Faugeras and Toscani (1986), employ a least-squares approach to calculate model parameters. However, this approach does not model the lens distortion so is useless for lens distortion modelling, entailing a rough accuracy of the system. Moreover, it is sometimes difficult to extract the parameters from the matrix due to the implicit calibration used (Salvi et al., 2002). Thus, to further enhance the accuracy of camera model, so the camera's distortion must be considered. In fact, introducing the distortion will make the entire camera model become a nonlinear model (Qi et al., 2010). Non-linear calibration approaches employ a two-stage process (Tsai, 1987; Weng et al., 1992). In the first stage, they use a linear approximation in order to generate an initial guess, and then an iterative approach is utilized to optimize the parameters. However, these methods have problems: the equations become non-linear, and the linear least-squares technique must be replaced by an iterative algorithm, leading to difficult to manage uncertainty. Note that one of the problems of convergence in iterative algorithms is the initial guess. The method of Tsai is based on modelling radial lens distortion and the attainable accuracy is suitable for most applications. However, in some cases the tangential distortion is not negligible and must be considered together with the radial approximation (Salvi et al., 2002; Qi et al., 2010). Zhang (2000) method has the advantage of removing almost lens distortion factors; however, it requires complex and manual interventions, such as the repositioning of the camera, making the algorithm unsuitable for automated calibration (Qi et al., 2010). Also, in Burger (2020) manual movements of the camera and the objects are required for the calibration. For this study the impossibility of moving the camera prevents the use of these methods. Furthermore, the common methods generally use few points, and many nonlinear trends cannot be considered thus increasing the calibration uncertainty. In particular, the application of these method to the case under investigation in this work revealed a significant combination of barrel, pincushion, non-radial distortions which makes the calibration process more complicated. When errors are moving between iterative steps, it is impossible to exactly correct those distortions. For the challenging aim of this work, we tried to boost the calibration phase by dramatically increasing the number of the points and using a completely different method of regressing them. Fast methods for fitting and evaluating Radial Basis Function (RBFs) allow to model large data sets. A greedy algorithm in the fitting process reduces the number of RBF centers required to represent a surface and results in significant compression and further computational advantages (Carr et al., 2001). A special case of RBFs is the thin–plate (polyharmonic) splines. They are derived as the solution of a variational problem which minimizes the following functional (Fasshauer, 2007):

$$F\left[f\left(r\right)\right]=\sum [f\left({r}_{p}\right)-{{f}_{p}]}^{2}+\lambda /{\left[{\nabla }^{k}f\left(r\right)\right]}^{2}dr$$
(1)

Polyharmonic spline approximants and interpolants are useful methods for particularly good accuracy for the tasks of interpolation and derivative approximations (Flyer et al., 2016). It is frequently used in signal processing, data visualization, computer assisted geometric design, the building of geographic information systems, weather forecasting, neural network applications, and other fields.

The general idea is to use polyharmonic splines for multidimensional approximation. It is well known that the cubic spline used in dimension n = 1 for interpolation minimizes the L2 norm of the second derivative of the interpolant. We introduce some necessary notation. Let x, y ∈ Rn and Eq. 2 be the Euclidean norm of the vector x–y ∈ Rn.

$$r\left(x,y\right)={\parallel x-y\parallel }_{E}=\sqrt{\sum_{S=1}^{N}{({x}_{s}-{y}_{s})}^{2}}$$
(2)

The dimension n of the independent variable can be arbitrary. The following functions are called polyharmonic splines and the equation.

$$\left\{\begin{array}{l}{r}^{k} , \quad k=\mathrm{1,3},\dots ,n\\ {r}^{k}\mathrm{ln}r, \quad k=\mathrm{1,3},\dots ,n\end{array}\right.$$
(3)
$${\Delta }^{m}\upsilon \left({x}_{1}, {x}_{2}, \dots , {x}_{n}\right)=0$$
(4)

where \(\Delta =\sum_{s=1}^{n}{\partial }^{2}/\partial {x}_{s}^{2}\) is the Laplace operator, namely the polyharmonic equation of order m. Apparently, the polyharmonic splines are radial functions. Fixing the vector y ∈ Rn, it is easy to show that the polyharmonic spline rk (or rk ln r) of order m solves the polyharmonic equation of order m = 1 /2 (k + n) in Rn \ {x = y} for n odd (or for n even) (Segeth, 2021).

The used calibration pattern is a matrix of equispaced crosses. Firstly, the image is enhanced by removing salt and pepper noises, namely isolated white and black dots, caused by decoding errors in image transmission systems. The median filter is employed to locally remove this error. (Nixon & Aguado, 2020).

The image is then binarized and a morphological erosion, namely a Minkowski subtraction, is applied (Hornberg, 2017, Russ & Neal, 2015). In this chapter the structuring element is designed with the aim to delete the arms of the cross and leave only the intersection point. The operation is defined by Eq. 5:

$$ A \ominus B = \left\{ {z:\left( B \right)_{z} \cap A \ne \emptyset } \right\} $$
(5)

and the structuring element is:

$$B=\left[\begin{array}{ccc}0& 1& 0\\ 1& 0& 1\\ 0& 1& 0\end{array}\right]$$
(6)

The found points are sorted in a sequential spatial order to have a correspondence with the matrix of the desired positions.

Digital image analysis

Two types of analysis are applied on calibrated images, namely a 2D analysis and 3D volumetric method. The former consists of image denoising, image improvement and image segmentation. A multi-level data processing was employed since the photo is highly noisy due to the grainy behavior of the powder bed. To detect the background, the picture was filtered with a 3D Gaussian function (Russ & Neal, 2015). Image subtraction was used to distinguish the foreground from the background, which greatly decreased noise. This procedure was carefully planned to discriminate between noise and very modest mistakes induced by light scattering from well-developed beds. Morphological binarization was used to segment the image, which employs a hysteresis threshold to transform the multichannel image to one with a pixel value of 0 or 1. To emphasize the damaged area and facilitate two-dimensional analysis, the detected region was placed over the original picture.

To improve and denoise a specific location, a more computationally intense approach was applied. Perona-Malik filtering (Guidotti, 2015) employs anisotropic diffusion, which may retain sharp edges and detailed features. It is an inhomogeneous diffusion method that results in photos with denoised elements that keep their edges. This technique, which is frequently used in medical imaging, provides for background cleaning and consistency inside the defect. It is based on the well-known heat equation which is a canonical smoothing process defined as:

$${u}_{t}=k\Delta u=k\left(\frac{{\partial }^{2}u}{\partial {x}^{2}}+\frac{{\partial }^{2}u}{\partial {y}^{2}}\right)$$
(7)

where \({u}_{t}=u\left(x,y,t\right)\) is the image obtained after a diffusion time t, \(u\left(x,y,0\right)\) is the original noised image and k is the diffusion coefficient. It results in a uniform blurring across all direction where noises are eliminated at the cost of losing edges. Perona and Malik modified this equation by replacing the constant diffusion coefficient by a nonlinear function of u which decreases to 0 as the gradient of u increases (Perona & Malik, 1990). The Perona-Malik equation is:

$$\nabla \cdot \left(c\left(\left|\nabla \mathrm{u}\left(x,y,t\right)\right|\right)\nabla \mathrm{u}\left(x,y,t\right)\right)$$
(8)

where \(\nabla \cdot \) is the divergence operator, \(\nabla \) is the gradient operator and \(\left|\nabla \mathrm{u}\left(x,y,t\right)\right|\) is the magnitude of the local gradient.

The diffusion coefficient, also known as edge stopping function, was proposed by Perona and Malik in the form of Eq. 9.

$$c\left(\left|\nabla \mathrm{u}\left(x,y,t\right)\right|\right)=exp\left(-{\left(\frac{\left|\nabla \mathrm{u}\left(x,y,t\right)\right|}{K}\right)}^{2}\right)$$
(9)

where K is the gradient magnitude threshold parameter, namely the conductance of diffusion current. At edges where the gradient is large in comparison with K, the diffusion is suppressed, thereby preserving the edges.

In the powder bed the shades, i.e., the interaction between light and internal features related to previously uncovered layers, define a defect. However, the grainy behavior gives impressive noise which elimination can reduce the information of the defect. An adequate selection of the conductance allows for preserving lack of covering areas as well as eliminating the noise.

Notwithstanding 2D analysis would give information regarding variances in the powder bed, it does not deliver an adequate amount of data concerning the interaction of powder anomalies as well as how these flaws spread through succeeding layers. In addition to investigating how anomalies in the powder bed caused volume defects, these anomalies must be analyzed by the 3D volumetric method. The outcoming information can be easily compared with other approaches such as CT.

In order to create a 3D representation of powder bed anomalies along the printed layers and processed area, data gathered from various levels are stacked in the 3D picture format, namely the 3D image. It is a unified symbolic representation which contains a 3D array of values typically composed by stacking slices coming from CT, geographical mapping, scientific data. A 3D image can be visualized using a set of techniques known as volumetric rendering: each volume element is known as a voxel and is represented as a projection of discretely sampled 3D data set. This method is distinguished from the thin slice tomography representation and provides coloring, shading and opacity to create a realistic and observable scene. The source data can be stored separately as a set of single images or a single file format supporting multiple frames. Lastly, some standard file formats allow exporting the structured 3D data, rather than the single slices, directly in a single file. This is the way the data were managed in the present work. When this strategy was used to AR photos, the outcome was a dense distribution of anomalies over the total volume of work. This is fascinating data that can be used to investigate scattering quality. However, the purpose of this effort is to discover bed irregularities that impact the final component.

A similar method is applied on the AE images to approximate the laser-processed areas. The resultant 3D image was processed with 3D erosion and 3D dilation operators, to remove anomalies outside the scanned area. Finally, image multiplication process applied on AR and AE 3D images, which indicates each pixel is the result of the corresponding pixels in the input photos. The result is a 3D representation that solely shows the anomalies found in the scanned volume, particularly those found within or on the surface of the part.

Results

Calibration results

The first step is to resolve the optical distortion of in-situ photos induced by the angled position of the camera as well as the aberration. The different steps for image calibration are shown in Fig. 4. The calibration pattern is placed on top of the building platform, then a picture is captured with the camera (Fig. 4a). It is composed by 2601 equispaced crosses. It is well evident the perspective radial distortions affecting the image. Less evident is a non-uniform distortion probably due to small defect on the camera optics. Also, a non-uniform lighting can be observed. The preprocessing by using the median filter allows to reduce noise and preserve the cross edges (Fig. 4b). The application of the morphological binarization clearly identify the crosses (Fig. 4c). The resolution of the image is relatively low, so the placement of the pixels suffers from the discretization. As a result, the Minkowski subtraction provides deformed small region for the cross centers as shown in Fig. 4d. By applying a morphological components algorithm (Russ & Neal, 2015), the binarized image is divided into regions and sorted in a way to make correspondence with the known actual crosses positions. The previous scattering is mitigated by calculating the centroids of each detected region. In Fig. 4e the green circles indicate the achieved positions superimposed to the original image. These positions can be compared with the actual positions of the cross centers (colored in red) by observing the Fig. 4f. There is a coexistence of undistorted and distorted zones.

Fig. 4
figure 4

Uncalibrated image of grid pattern (a), median filtered image (b), morphological binarized image (c), regions after the application of the Minkowski subtraction (d), original image and centroid positions (e), achieved cross centers in green and actual positions in red (f)

The application of polyharmonic spline method allowed to find a model relating the ordered couples of points. The outcoming function is represented in Fig. 5a as a vector field and density plot of the displacements. A non-symmetrical and nonlinear behavior is evident. The Euclidean distances between the calibrated points and the real ones are reported in the histogram of Fig. 5b. In previous calibrations, where common methods were employed, the residuals mean exceeded 0.3 mm, which is similar to the image scale resolution of 0.3125 mm/pixel. With the proposed method, the average difference is reduced to 0.052 mm. From the cumulative sum, it can be observed that more than 80% of the points lie within less than 0.1 mm away from the target. To validate the effectiveness of the calibration accuracy, the available criterions were employed. The most frequently used method for evaluating accuracy is the root mean square re-projection error \({E}_{rms}\) (Lv et al., 2015; Sun et al., 2006). It is defined as the discrepancy between the real points \(\left({x}_{ui},{y}_{ui}\right)\) and the estimated ones \(\left({\widehat{x}}_{ui},{\widehat{y}}_{ui}\right)\). It is given by the following formula:

Fig. 5
figure 5

Vector field of displacement (a), histogram of the deviations (b)

$${E}_{rms}=\frac{1}{n}\sum_{i=1}^{n}\sqrt{{\left({x}_{u,i}-{\widehat{x}}_{u,i}\right)}^{2}+{\left(y-{\widehat{y}}_{u,i}\right)}^{2}}$$
(10)

The \({E}_{rms}\) for the calibration of the present work restituted the value of 0.0519 mm which corresponds to 0.189 pixels. This outcome is really good if compared with the current methods for robust estimation of the camera parameters (Zhou et al., 2013). A limitation of this method is the \({E}_{rms}\) is sensitive to the image resolution, the field-of-view and the object-to-camera distance (Sun et al. 2006). The normalized calibration error \({E}_{nce}\) overcomes this sensitivity by normalizing the errors. It is defined as the discrepancy between the real and estimated points with respect to the area each back-projected pixel covers at \({z}_{c,i}\) distance from the camera. It can be calculated as follows:

$${E}_{nce}=\frac{1}{n}\sum_{i=1}^{n}\sqrt{\frac{{\left({x}_{u,i}-{\widehat{x}}_{u,i}\right)}^{2}+{\left(y-{\widehat{y}}_{u,i}\right)}^{2}}{{z}_{c,i}^{2}\left({f}_{u}^{-2}+{f}_{v}^{-2}\right)/12}}$$
(11)

where \({f}_{u}\) and \({f}_{v}\) are the row focal length and column focal length that are determined through the camera model intrinsic parameter evaluation (Faugueras & Toscani, 1989). The calculated value for the present calibration was 0.0694 mm corresponding to 0.252 pixels. Since it is close to \({E}_{rms}\) we can conclude that the proposed calibration method allowed to overcome the camera condition issues (lighting, distance, inclination).

2D analysis

2D analysis was run through the single pictures. Outputs related to two different layers are shown in Fig. 6. The original images of the powder bed layer (2870) in Fig. 6a presents a significant distortion which may obviously influence the measurement of the potential location of the defects on the build plate. After the calibration, the outcoming image is reported in Fig. 6b. At this layer, 2 zones are highlighted: zone 1, that contains the part under fabrication and shows almost no powder bed irregularities; the zone 2, where waves and large irregularities parallel to recoater movement across powder bed are present. These anomalies are detected by applying the proposed 2D analysis, as shows in Fig. 6c. This area is out of the in-processing zone; thus, it could not affect the part. Moreover, it disappears at layer 4032 analyzed in Fig. 6e (zone 5) which original image is shown in Fig. 6d. At this layer other anomalies are detected (zones 3 and 4) and automatically highlighted by the method (Fig. 6e). Although the powder layer is partially homogenous across the scanning cross section, lack of powder could be due to other factors like support structures torn by the blade (Kleszczynski et al., 2012). Moreover, the detected anomalies are in the scanning area thus they could be responsible of defects on final part.

Fig. 6
figure 6

Powder bed defect detection, layer 2870 original image (a), calibrated image (b), highlighted defects via DIP (c), layer 4032 original image (d), calibrated image (e), defect detection via DIP (f)

Anomalies created in one layer can spread to the next layer, causing various sorts of defects surface, subsurface defects, or geometrical deformation. In the case of a single layer, an anomaly may dissolve after one or a few layers if the recoater can cover it. The defect created by the anomaly is minor or minimal in this scenario. However, if the recoater is unable to recover powder bed irregularities they might extend over multiple layers, resulting in major defects on the final part. Figure 7 shows examples of this phenomena where anomalies travel through continuous layers of powder bed. As it can be seen in Fig. 7a (layer 3700), there are 3 obvious zones on the first layer with lack of powder and dragging particle that can be detect as horizontal line on top of the picture. Figure 7b shows the next layer: although there are many minor irregularities, possibly due to the drag particles regarding defects on previous layer, the recoater covered the previous anomalies present on the under-process part. Nevertheless, Fig. 7c shows that in the following layers the anomalies appear again on the powder bed and, since it grows across the layers, the recoater could not recover the problem. At layer 3800 (Fig. 7d) the powder bed contains a noticeable horizontal line and the under-processing part is affected by big anomalies which are created by drag particles via recoater or a damage powder distributing system.

Fig. 7
figure 7

Defect propagation and detection across subsequent layers on powder bed: lack of powder (a), ceased lack and continuous inhomogeneous powder (b), lack presented again (c), dragged particle across layers (d)

The previous observations highlight that the powder bed anomalies propagation is critical, but it is difficult to assess the amplitude across layers using just 2D analysis. As stated in Sect. “Digital image analysis”, anomalies on a single layer are not directly connected to the defect that would emerge on the produced part. The uneven powder bed, on the other hand, influences the interaction between the laser and the powder bed, resulting in internal or exterior flaws. As a result, an integrated 3D study in which the layers are fused into a unique structure is required. The powder bed anomalies of the surrounding layers are grouped in this manner, enabling for simple detection of probable flaws.

3D volumetric evaluation

The images were subjected to the 3D volumetric evaluation method described in Sect. “Digital image analysis”. The outcoming data were structured in the so-called 3D image format also known as volumetric image. All the layer-related images are characterized by the same width and depth thus they can be stacked in a regular 3D grid of voxels with width, depth, height dimensions. Since they are enumerated from the bottom to the top, a descending order was applied to set the {0,0,0} position to the bottom-left front corner and meet the layer fabrication order. The color space is the standard encoding sRGB (IEC 61966–2-1:1999, 2003) supplemented with a fourth alpha channel which allows to indicate how opaque each pixel is represented. This way, transparent areas can empower the observability of chaotic data which are typical of the present work. The Perona-Malik filtering allowed highlighting specific areas and finding connected regions in 2D. This connection is now extended in 3D giving an adequate importance to the anomalies. The connected entities can be clustered in regions by morphological components. Built-in algorithms in Wolfram Mathematica permit to select the anomaly regions as sub-groups of voxels. The anomaly volume is calculated by counting the constituent voxels and multiplying the result by the cube of the image scale factor. By using false colors, it is possible to distinguish between small and big entities in the data. The Fig. 8a is a visualization of powder bed anomalies all over the processed building volume. Very small defects, i.e., of about 1 mm3, are collected almost everywhere. From the experience of this work, these entities are not affecting the part since the related lack of material is overcome by the laser processing at the standard exposure parameters. Few occurrences are observable in the range 2–5 mm3, from yellow to green colors. Many other defects are 8 mm3 in volume or bigger. The analysis of the powder bed is markedly difficult because embraces all the volume. The understanding of the scanned zones is provided by applying the same methodology to the AE images. The result is shown in Fig. 8b where the part is colored in violet. The machine scanned both the model and the support structures hence the latter are investigated by this analysis type. The image multiplication of the previous data provided the anomalies at the scanned volume as reported in Fig. 8c. As expected, most of the data disappeared and the three main zones are characterized by large flaws. To better locate this information on the part a specific aggregation of the data is provided. Let \(\mathcal{B}\) be the 3D image coming from the application of the 3D volumetric evaluation method to the AR images, namely the powder bed anomalies on the whole building chamber. Let \(\wp \) the 3D image representing the scanned area obtained by applying the method to AE images, meaning the part. The intersection between \(\mathcal{B}\) and \(\wp \) gives the powder bed anomalies on part and it can be attained by the image multiplication operator. Unfortunately, it is difficult as well as important to detect the position of the anomalies on the part geometry. Hence, it is necessary to combine these anomalies with the part without losing their visibility. The previously mentioned alpha channel can be used for the purpose to make \(\wp \) partially transparent. This is provided by premultiplying the 3D image by a scalar value which was set to 0.3 for a good visibility of both the arrays. The combined displaying is given by the algebraic sum of these outcomes according to the following formula:

$$ {\mathcal{B}} \otimes \wp \oplus 0.3\wp $$
(12)

where \(\otimes \) and \(\oplus \) are the 3D image multiplication and addition operators, respectively.

Fig. 8
figure 8

Global volumetric defects, 3D images of AE (a), 3D images of AR (b), multiplication AR&AE (c), analysis on CT from printed model (d)

Now it is easily possible to locate the three zones affected by non-marginal anomalies (Fig. 8d): the zone 1 is on the rear case foot; the zone 2 is on the rear wall of the case nearby the big hole; the zone 3 is on the angled zone of the front foot. This way the method allowed determine probable source of defects on the fabricated part. In the following, these zones are analyzed in depth and verified by the CT measurement.

The zone of the case rear foot (zone 1) is characterized by big anomalies. A zoom of this zone is shown in Fig. 9a. The stratification direction is indicated and highlights the need for support structures, designed of gusset type in this case. The transparent visualization, in accordance with Eq. 12, allows to see the lateral gusset which is affected by many flaws after about 200 layers (6 mm). The powder recoating could not repair to this damage occurred on a very delicate structure. The Fig. 9b shows the configuration of the supports: the algorithm provided a fragmented supporting and the gusset indicated by the green arrow remained alone. As evidenced by the 3D volumetric evaluation, more the height more the damage on the powder bed. Finally, the lateral side is affected by anomalies with sizes exceeding 8 mm3. The CT measurement of this zone is shown in Fig. 9c. It is well evident a real damage on the final part. Through this analysis a vital alarm is provided both for a specific evaluation and a premature stopping of the fabrication which saves time and money.

Fig. 9
figure 9

3D volumetric evaluation of the rear case foot (a), designed support structures in this zone (b), CT measurement of the final component (c)

The proposed method detected many anomalies on the zone 2. Looking at the transparent view shown in Fig. 10a, it is well evident that internal support structures as well as the part are markedly affected by a damaged powder bed development. The sizes of the anomalies are very big, and they could affect the integrity of the final part. The bottom of the hole is damaged as well as the lateral wall. By looking from the inside (Fig. 10b) the source of the defects are the support structures. It can be noticed that most of the lateral anomalies are located inside the part. As a demonstration of these identifications the designed support structures and the CT of the real part in this zone are reported in Fig. 10c and d respectively. From the comparison two important observations can be provided. The uniform structures on the right were not completed during the fabrication: many of them dropped material during the recoating which was detected by the proposed method. This lack of supporting is generally affecting the final part quality: this is in accordance with the part surface anomalies detected by the method. The second observation is that three support structures below the hole are deformed leaving a little space. The analysis highlighted problems both in the supports and the part. It can be assumed that real defects are present on the final part.

Fig. 10
figure 10

3D volumetric analysis of the rear zone of the case: external (a) and internal view (b). Designed (c) and CT measured supports (d)

As a verification of the previous detection a wall thickness analysis performed on the CT data is provided. In Fig. 11 the thicknesses in the range 0.5–1.5 mm are shown. Most of the part is characterized by a nominal thickness of 1.5 mm. Some deviations can be noticed. The rear foot is obvious affected by a lack of material and the thickness gradually becomes zero around this flaw. The thickness surrounding the hole is characterized by two important reductions: the bottom part is confirmed to present a local damage since there is a lack of material; on the right a diffused diminishing is measured by the CT as preannounced by the proposed method. These last defects are difficult to notice, and the use of the CT is expensive both in terms of efforts and time. The method can specifically address less expensive measurements systems such as manual thickness gauging and giving important feedbacks on the fabricated part.

Fig. 11
figure 11

Wall thickness analysis on CT data

The last zone is located on the front foot. The method is applied to AR and AE images of this area. The Fig. 12a shows the powder bed characterized by flaws of different sizes. The biggest ones are located along a line. In Fig. 12b the AE images were processed in order to obtain the laser scanned volume. It is evident that the foot is totally overhanging hence it is totally supported. No error is expected for this sub-part. By multiplying the previous volumes, the result shown in Fig. 12c is obtained. The previous aligned anomalies are inside the part, specifically on the under-skin of the component. An in-depth analysis of the CT can confirm this particular defect. By applying the trapped volume algorithm of Magics it is possible to identify empty spaces inside the STL file coming from the CT. The outcome shown in Fig. 12d claims that in the predicted zone there is a sub-surface porosity probably due to unlucky geometrical features: since the section are quickly varying along with the stratification direction, there is a quick changing in the energy to be dissipated by the same structure. This provides a great thermal gradient and, consequently, important residual stresses in this zone.

Fig. 12
figure 12

Powder bed analysis (a), scanned volume (b), anomalies on scanned volume (c), CT trapped volume analysis (d)

Limitation of the method

The precision of the proposed method is limited by the adopted camera by means of the resolution, the lighting, the positioning, the field-of-view. This makes difficult or impossible to detect the very small porosity typical of a standard SLM process. A CT as well as a micro-CT can detect micro-pores and determine their shape, too. Physiological small porosity can be assumed in a SLM process, hence this method can detect out-of-control damages caused by improper powder bed development. At this stage of the research, it is difficult to establish the minimum anomaly size causing a real defect.

Possible implementations and method performance

The method is prone to be implemented in an online way as, layer by layer, the anomalies can be detected by the 2D analysis during the fabrication. For the purpose, it is necessary to understand the CPU time consumption of the required processing steps. Each single image needs the enhancing, calibration and analysis. In Table 2 the absolute time that have elapsed for each subset of operations is reported. The system used for the evaluation is a commercial laptop with an Intel Core i7-8565@1.80 GHz with 4 cores and 16 Gb memory manufactured by ASUSTek Computer Inc. For a single image the total time is 16.93 s which is comparable with the sum of the recoating and platform repositioning time, hence the online feasibility is even possible on the used laptop. Most of the time is required for the harmonic spline interpolation whilst the 2D analysis required only 0.5 s to process a single image. In the case the calibration is performed off-line, i.e. at the end of the fabrication, the computing was speeded up by using in parallel the cores (4 threads). The total time for the whole image set (AR and AE images for 5135 layers) was 8.9 h. As regards the 3D volumetric evaluation, the computational time is mainly due to the Perona-Malik filtering as expected. However, the time necessary to obtain all the 3D images for the evaluation is less than 1 h.

Table 2 Computing times for the different operations for the compass case

In order to evaluate the performance of the presented methodology, three metrics were adopted. As previously mentioned in the Introduction, the most common one is the so-called precision defined as the true to predicted instances ratio:

$$Precision=\frac{{\it True}\ {\it instances}}{{\it Predicted}\ {\it instances}}$$
(13)

Another important performance metric is the recall defined as the ratio between correct predictions and total number of instances:

$${\it Recall}=\frac{{\it True}\ {\it instances}}{{\it Total}\ {\it instances}}$$
(14)

A third metric is the overall performance F1, namely the harmonic mean between the precision and the recall:

$$F1=2\frac{{\it Precision}\cdot {\it Recall}}{{\it Precision}+{\it Recall}}$$
(15)

In order to allow these calculations, the original 3D CAD model was aligned to CT measurement and a Boolean subtraction was provided to find part defects as previously shown in Fig. 2. A slicing of the output was applied, and found instances were compared with the anomalies predicted via 2D analysis. All the performance metrics were calculated for all the layers and the outcomes are reported in Fig. 13. Not all the layers are affected by instances and a different occurrence density can be observed on the graphs. For the first 120 layers the defects cannot be achieved since the part detachment from the platform required the cutting of the support structures for this length. Between 1150 and 1220 layers there is a dense occurrence: at this stage many anomalies were found in the frontal feet as previously identified. Wider dense occurrence is found between 3600 and 4200 layers: it corresponds to the previously discussed support structure issues. After this stage, the scanning area is smaller since it is related to the thin rear feet fabrication. The denser zones are characterized by a precision ranging between 0.75 and 1 and a recall nearby 1. This indicates that the big flaws are detected with a good precision and the necessary instances are very close to the true ones. However, the small defects are detected with a precision down to 0.6 which is an acceptable result if we consider the limitation of the hardware in terms of resolution. The overall metrics are 82.6%, 95.4% and 88.4% for precision, recall and F1 respectively.

Fig. 13
figure 13

Calculated metrics of 2D analysis method for all the part layers

In Table 3 a comparison with other methods is reported. Most of the researchers adopted high resolution camera (excluding thermal imaging) focusing on a field of view relatively small. Hence, a high spatial resolution is achieved, generally ranging between 29 and 125 µm/pixel. The obtained performance metrics of these works ranged between 60 and 99%. Otherwise, the work of Abdelrahman et al. (2017) monitored the whole building platform. High spatial resolution was obtained by a high-resolution camera reaching a F1-score of 70.7%. The proposed method allows monitoring the field of view and 88.4% F1-score is calculated by using an embedded low-cost low-resolution system.

Table 3 Comparison with other literature works

Conclusions

This work investigates the feasibility of using a SLM machine built-in camera for detecting powder bed anomalies. This monitoring tool aims to minimize the extra costs needed for repairing and reworking of sub-standard parts. The limitations coming from this embedded system concern the lighting, the position, the resolution, the filed-of view which cannot be modified. As a result, a direct implementation in the industrial environment is achievable without manufacturer’s, laws, production, safety restrictions. To increase the system possibilities, particular care was paid to the camera calibration using polyharmonic spline interpolation on a very big set of calibration points. The results claimed a very good accuracy in terms of root mean square calibration reprojection error and normalized calibration error indicating that the barrel, the pincushion, the non-radial distortions were overcome. The monitoring analysis were carried out by developing two methodologies based on image processing, namely a 2D analysis and 3D volumetric evaluation. The former allowed to detect, layer by layer, the anomalies impacting the powder bed development. The routine is fast and prone to an on-line detection with a precision ranging between 0.6 and 1 and between 0.75 and 1 for small and big flaws respectively. The 3D volumetric evaluation provided a structured 3D image of the anomalies which, in turn, was visualized together with the part scanned volume. This representation was compared with the CT measurements highlighting that the method allows to detect relatively small defects on the part, internal and external big flaws and support criticalities. The performance evaluation highlighted 82.6% and 95.4% for the overall precision and recall respectively. These values indicate a good result if compared with other methods especially since a low-cost and embedded system is adopted for monitoring the whole building platform area.