## 2 Materials and Methods
### Acquisition and Processing of Target Images  
Digital images of test targets were acquired using a Perfection V39 EPSON FBS. This model provides a working area of 216 mm \(\times\) 297 mm. Each test specimen was placed upside-down, so that the last manufactured layer lay directly upon the glass. Scanning was carried out at 2400 dpi resolution along both sensor and scanning axes, and greyscale bitmap files (\(I0x\)) were obtained. An example of a raw image is provided in Figure 4a. Two steps of image processing were considered to define test factors: image filtering and edge detection. Image noise negatively influences discrete gradient computation [20]. Accordingly, filtering could affect the accuracy of contour characterisation. Digital images obtained from FBSs and other optical devices are frequently subjected to a \"salt and pepper\" noise type [28]. This noise could be caused by malfunctioning of pixel elements in the sensors, as well as by timing errors in the digitising [29] or related to flecks of dust inside the camera [30]. There are many filters that could be applied to remove this type of noise, but preparatory tests, as well as part of the results of previous researcher [PERSON] [31] led to the selection of a bi-dimensional median filtering stage as the first step in the image processing procedure. FBS output images (\(I0x\)) were processed by means of MathWorks(r) function medfilt2 [32]:  
\[J\ =\ medfilt2(I,[m\ n]) \tag{9}\]  
This filter provided a transformed image (Figure 4b) where the value of each pixel has been substituted by the result of calculating a median filter in the \(m\)-by-\(n\) neighbourhood around the corresponding pixel. In the case of the present analysis, a square neighbourhood \(m=n\) was considered, so a single value of filter size (\(S_{f}\)) was used to parameterise the filtering stage. It must be noted that \(S_{f}\) only makes sense considering odd numbers, so that a regular matrix centred in the pixel is used for median calculation. Consequently, odd values between 1 and 59 were established as experimental levels for the \(S_{f}\) factor. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Contrast Scenario** & S01 & S02 & S03 & S04 \\ \hline
**H [mm]** & 8 & 8 & 4 & 2 \\
**Target Layer Colour** & White & White & White & White \\
**Background Colour** & Matte Black & White & White & White \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Experimental set characteristics. Regarding edge detection, alternative approaches include methods based on the first derivative, second derivative and multi-step algorithms. Furthermore, the way these methods are implemented present slight differences when different digital image processing software is considered. In order to conduct a homogenous analysis, edge detection in this research was performed using the Edge function provided by MathWorks(r). The Edge function is used to find edges in an intensity image, which is a data matrix that contains intensity values within a given range, corresponding each individual datum to an individual pixel [33]. The basic syntax of the Edge function can be seen in Equation (10) [34]:  
\[BW\ =\ edge(I,method,threshold) \tag{10}\]  
where \(BW\) is a matrix of the same size as the input image (\(I\)) where each pixel adopts a value of 1 where the function identifies an edge point and a 0 value elsewhere. This function can be parameterised basically using two parameters: _Method_ and _Threshold_. * _Method_ (\(M\)) is used to identify the specific edge-detection algorithm employed by the Edge function. Although this function uses the Sobel operator by default, it is possible to indicate an alternative method from a shortlist that includes first derivative operators (Roberts, Prewitt, Sobel), second derivate operators (LoG, ZeroCross) and two additional options based on Gaussian filtering approximation to the first derivative: Canny and ApproxCanny. * _Threshold_ (\(T\)) is a scalar used to discriminate between pixels and promote edge candidates to contour points.