## 2 Materials and Methods
### Acquisition and Processing of Target Images
Those pixels with gradient intensity values above selected \(T\) were identified as edge points, whereas those with a gradient intensity value below \(T\) were ignored. When working with an 8-bit greyscale, 256 levels should be considered. Nevertheless, in the case of the present work, variations of \(T\) were sampled using multiples of 5 (from 0 to 250) to reduce the number of test combinations. The analysis of results would indicate whether a higher density of \(T\) levels would be necessary in  
Figure 4: Generalised example of consecutive steps in image processing: (**a**) raw image or \(I0x\); (**b**) image after median filter; (**c**) image after applying differential operator; (**d**) image after thresholding; (**e**) image after annular cropping; (**f**) image (\(J0x\)) after LDA compensation. each scenario for a particular experimental range. If this were the case, an additional higher-density specific processing shall be performed. In the example given in Figure 4, the result of applying a differential operator is provided in Figure 4c, whereas the result of thresholding can be seen in Figure 4d. In summary, three factors have been included in this research: the size of the median filter that is applied at first stage (\(S_{f}\)), the edge-detection algorithm (\(M\)), and the scalar value employed to perform the edge/null discrimination (\(T\)). Tests were conducted using a full factorial; 9180 combinations of image processing factors (Table 2) have been tested for each contrast scenario. Each test combination for a given scenario provided a new image file containing white pixels (contour candidates) and black pixels. However, this image was subjected to two additional post-processing steps to refine the contour information: _Annular Cropping_ and _Local Distortion Adjustment_ (LDA). The annular cropping has been specifically used here to remove unlikely contour candidates, taking advantage of the characteristics of this experimental design. The contour scan is subjected to the noisy influence of different hindrances, such as scratches, nap, dust particles or small wires of material caused by nozzle ooze. Additionally, odd elements related to the deposition path could also be mistaken for contour candidates (Figure 5). Fortunately, manufactured target contours are quite similar in size and shape to their corresponding theoretical definition (a circle). This allowed for the definition of a narrow annular area in the image within which the target contour should be contained. Subsequently, this area was used to crop the image and remove part of the unlikely contour candidates. To locate this annular area, a coarse approximation of the manufactured target diameter and the centre location in the image was obtained using a least-squares algorithm. Both approximate values were then used to define two concentric circles whose respective diameters differed by 1 mm (\(\pm\)0.5 mm with respect to the initial diameter approximation). The output of this step was a new digital image (Figure 4e). Although this \"annular cropping\" step was defined for this specific geometry, it could be easily adapted to different contours by defining the mask according to the correspondent nominal shape. In the following step, LDA was applied to the coordinates of remaining contour points, so that the image distortion effect was compensated. A diffuse reflectance grid distortion target model 62-952--Edmund Optics--was used to characterise the distortion [18], decoupling its effect between sensor axis and scanning axis directions. This procedure minimises \begin{table}
\begin{tabular}{c c} \hline \hline
**Factor** & **Experimental Levels** \\ \hline \(S_{f}\) & 1, 3, 5, 7... 59 \\ \(M\) & [PERSON], [PERSON], [PERSON], Zero Crossing, Canny and ApproxCanny \\ \(T\) & 0, 5, 10, 15... 250 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Test factors and their correspondent experimental levels. Figure 5: Unlikely contour candidates derived from image hindrances and odd elements.