## 6 Discussion  
The use of CIS systems could enable the thorough digitization of individual layers in MEX/P components. Although an accurate characterization of layer contours from digital images is hindered by several factors, issues such as image distortion can be mitigated through global or local compensation methods. However, challenges persist with factors like the contrast pattern structure between the layer contour and its background, affecting the performance of popular detection algorithms such as Canny and Sobel. This problem is particularly pronounced when the proximity between the layer and the background leads to noticeable asymmetries in those contrast patterns. The proposed AEDA leverages the peculiarities of contour characterization in MEX/P by minimizing errors in the precise identification and localization of layer contour points within images captured by a CIS. The AEDA operates on the principle that similar contrast scenarios will produce consistent grayscale patterns between the target layer's contour and the surrounding background. The results presented in Section 5 indicate that the average deviation of point position was comparable to that achievable with a CMM in a metrology laboratory, ranging from 8.02 \(\upmu\)m to 13.11 \(\upmu\)m within the experimental limits. These results are sufficiently precise for quality characterization and for implementing compensation strategies, considering that typical dimensional errors in MEX/P are measured in tenths of millimeters for parts similar in size to the test targets used in this study [14]. Furthermore, the proposed AEDA outperforms the results obtained for the worst-case-scenario parts discussed in [29]. Specifically, in that work, the average of radial deviations (\(\overline{D}\)) was 54.9 \(\upmu\)m for an \(H_{2}\) specimen (using Canny processing with \(T=10\) and \(S_{f}=1\)) and 55.97 \(\upmu\)m for an \(H_{4}\) specimen (using Roberts processing with \(T=5\) and \(S_{f}=1\)). This demonstrates that the AEDA significantly surpasses the best results achieved with conventional edge-detection algorithms [40; 41], even when the optimal combination parameters \(T\) and \(S_{f}\) were used [29]. One particularly beneficial characteristic of this implementation is that an approximate expected location of actual layer contours can be established beforehand, given that typical positional errors of individual geometric features in MEX/P are on the order of tenths of a millimeter. Consequently, the expected position of contours within the digitized image is accurate enough to identify a set of tentative points, ensuring that the actual contour points will be situated nearby. This advantageous feature of layer-wise CIS scanning \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \(\mathbf{H_{8}}\) & \(\mathbf{H_{6}}\) & \(\mathbf{H_{4}}\) & \(\mathbf{H_{2}}\) \\ \hline \(C_{f}\) [\%] & 100 & 100 & 100 & 100 \\ \(\overline{D}\) [\(\upmu\)m] & 11.01 & 8.02 & 11.27 & 13.11 \\ \(\sigma_{D}\) [\(\upmu\)m] & 8.35 & 8.60 & 12.21 & 13.35 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Quality indicators for each test artefact. contrasts with typical applications of conventional edge-detection algorithms, where the approximate location of edge contours is unknown beforehand and the algorithms must process the image as a whole. The results demonstrate a consistent improvement in the quality of the reconstruction, achieving two objectives. Firstly, it eliminates the necessity to choose an optimal combination of edge-detection method and processing configuration. The proposed method is, in this regard, more robust. It also reduces the uncertainty of contour point identification, as the algorithm yields only one valid (optimal) contour point location for each local search area. In contrast, conventional edge-detection algorithms often produce multiple-point detections due to the complexity of contrast patterns.