## 3 Data Processing and Image Elaboration Procedures
### Custom Mapping Optimization in Terms of Thermal Contrast Measurements  
The determination of the thermal contrast has the limitation to be performed at the local level and undergoes preliminary costly choices of specific thermal frames and zones to be investigated. When the heat quantity deposited by the external source is not uniform and the computation zones have slightly different cooling temperatures and gradients, some defects can be misjudged as identical. In any case, is necessary to analyze a single defect at a time: therefore, it was necessary a new method to be implemented on MATLAB and take in account such limitation and improve the processing technique to enhance the inspection defects in terms of accuracy and reduced time.  
The new contrast algorithm allows direct defect mapping on the case of the value of contrasts, as distributed on inspected specimen. In this way, the method automates the determination and mapping simultaneously of the local contrast, to identify defect boundaries onto the analyzed component. In other words, the local contrast is automatically determined, investigating every zone with highest temperature in pre-defined areas.  
For each pixel of the thermographic image, new MATLAB procedures rework the variation of temperatures determined in a two-dimensional array of pixels in the proximity of the calculation point. This algorithm is based on the principle for which temperatures computed around the chosen inspected spot tend to reach similar values when location corresponds to defect border, leading to contrast values being displayed with zero values on contrast maps, clearly distinguishing the damaged zones and defect shape. Figure 13 shows a comparison between original thermal map (Figure 13a) and the proposed contrast image (Figure 13b) of CFRP Plate I on Side B (defects' depth of 2.8 mm) obtained after 11.6 cooling seconds after heating pulse of 20 s.  
Despite the heating not ideal, the contrasts map allows identification even the smallest defects of 5 mm diameter in a single specimen map (top left). The proposed contrast allows better evaluation of internal defects and is physically explained by the fact the thermal properties of defects are different from those of the surrounding material.  
Contrast mapping has been optimized in order to highlight the most reliable boundary for defects of various types in carbon fiber plates, significantly reducing the noise effects and erroneous defective indications.  
The greater depth of defects in the Plate I/Side A (4.9 mm of depth, in Figure 14a) causes difficulty of plate inspection and therefore we use longest heating times (Table 4). In the contrast map of Plate II/Side A (Figure 15b), four small defects of 5 mm diameter are clearly distinguished. Since, higher heating times do not allow smaller and deep defects detection; therefore, higher defect  
Figure 13: (**a**) Example of comparison between raw thermal map and (**b**) contrast map of CFRP Plate I/Side B.  
depth remain the main inspection limit and it was not possible to identify defects with less than 15 mm diameter (denominated D2, D4, D5, and D7 in Table 1) in Figure 14b, consequently the method allows to better distinguish all defects, but the physical limit of higher depth remains and small defects are still not visible. From CFRP Plate II acquisitions, the heating time of 15 s allows us to detect more clearly the greatest number of defects.