## 4 Discussion and Conclusions  
This research work presents HawkEye, an integrated software system for the automatic metallographic analysis of nodular cast iron. The tool enables full automation of the characterization process by combining CV and ML techniques in a user-oriented interface. Figure 21: Example of software-based analysis applied to an etched steel sample, revealing carbide regions embedded in a ferrite and perlite matrix. The pipeline begins with the classification of image typology--determining the material type, etching status, and usability. These classifications allow us to start with the selection of the appropriate workflow. Prior to processing, various models evaluate the image confidence to predict the efficacy of the outcomes. This proactive assessment significantly enhances the trustworthiness of the results. We compare HawkEye's performance with ImageJ, which utilizes a macro developed by Azterlan technicians for particle identification. Due to differences in the threshold value (a discrepancy of 0 to 10 units), particles may exhibit minor variations in size and shape. This can lead to differing classifications between the two systems. When the same threshold value is used, the differences between the systems evidently disappear. Figure 22 illustrates these discrepancies, highlighted by red arrows. Furthermore, the handling of particles touching the image border also affects the results. The HawkEye system discards particles that touch the image border, and it also excludes particles touching the scale bar, a feature not present in ImageJ. These differences in particle exclusion criteria contribute to the observed variations between the two analytical approaches. For non-etched samples, graphite nodules are automatically segmented, classified according to standard graphite types, and measured for key morphological descriptors such as size, circularity, and spatial distribution. Later, the quality classification, previously performed manually, has been refined using a slope-based curve analysis and supervised ML models. The comparative results presented in this research work demonstrate strong  
Figure 22: Representative images illustrating particle identification results. Arrows highlight the key differences attributed to varying threshold values, and the distinct handling of particles that touch image borders or the scale bar. alignment with expert judgment, with an error margin of only 1-4% in the worst cases. This confirms the consistency and reliability of the approach. Nonetheless, there are still several challenges and limitations to manage. One of the most relevant issues arises during the segmentation of graphite nodules, particularly when nodules are in contact. In such cases, nodules of type V or VI can be misclassified as type III due to their merged contours and reduced circularity. As shown in Figure 23, these misclassifications compromise both morphological analysis and final quality grading. In order to solve this problem, segmentation refinement is required. A proposed solution involves the use of watershed-based segmentation, which has been shown to be effective in separating overlapping objects by identifying contours [51]. However, the watershed method can lead to over-segmentation, particularly in cases with noise or irregular shapes. As an alternative, the concave point algorithm [76] has been identified as a more geometry-preserving method. Detecting inward curvatures on the particle boundary enables targeted separation without significantly altering the original object shape. This technique helps preserve critical descriptors like roundness and area, avoiding artifacts introduced by over-segmentation. Before applying these corrections, it is necessary to identify whether a detected object corresponds to a single or a fused nodule. This is possible by analyzing Hu moments, which provide shape descriptors invariant to rotation, scale, and translation.