## 3 Principles and Thermographic Data Analysis
### Laboratory Validation  
To check the capability to assess, by means thermographic images, the texture of masonry wall covered with plaster or frescoes, a research program was started [9; 10; 11]. In particular, three masonry samples, which differed for the textures periodic, quasi-periodic, and random, were built. Using UNI bricks of dimensions 250 \(\times\) 120 \(\times\) 55 mm, either used as a whole or split in two or four, the periodic texture was built with the running bond scheme and using bricks with the same widths and heights. For the quasi  
Figure 5: Preliminary tests of thermographic imaging. (**a**) Quasi-periodic masonry wall sample covered with plaster. (**b**) Its thermographic image. periodic texture, bricks with different widths but equal heights were used avoiding the correspondence between vertical joints. In the last case, a random texture, made using bricks with different widths and heights, was used. The masonry walls, before applying 10 mm-thick plaster, are shown in Figure 6.  
In that research, as well as for the present paper, the thermographic camera model 885-2 produced by the Testo company has been used. This has a sensor of dimension 320 \(\times\) 240 pixels. All the samples have been exposed to direct sunlight in order to improve the heat flux through the body. To obtain the texture from thermographic images, the following procedure was proposed. Temperature data, relating to each thermographic image pixel, can be represented as a scalar field. \[T_{i}=T_{i}(x,y)\quad x=1,2,...,N\quad y=1,2,...,N \tag{3}\]  
where \(N\) is the image width in pixels, it is assumed that the image has equal width and height. Assuming a \(T_{t}\) threshold temperature, that field is converted to a binary function, which is a \"black and white image\" or material binary image, by  
\[b_{i}=b_{i}(x,y)=\left\{ \begin{array}{ll}0&\text{if }T_{i}\leq T_{t}\\ 1&\text{if }T_{i}>T_{t}\end{array} \right. \tag{4}\]  
where the value 1 (black) is associated with mortar pixels, the value 0 (white) with brick/stone pixels. However, the obtained binary image requires specific treatments in order to improve its quality. At first, mortar (black) region of pixels which are surrounded by brick (white) pixels are removed. Then the use of morphological operators is required. In particular erosion and dilation operator, in this sequence, have to be applied, in order to smooth the contour of the inclusions which otherwise would be very fragmented, due to the noise in the image acquisition phase. The erosion operator is defined by  
\[b_{e}(x,y)=\text{maximum}\Big{\{}b(s,t)\text{ for }(s,t)\text{in}N^{l}_{(x,y)} \Big{\}} \tag{5}\]  
and the dilation operator by  
\[b_{d}(x,y)=\text{minimum}\Big{\{}b_{e}(s,t)\text{ for }(s,t)\text{in}N^{l}_{(x,y)} \Big{\}} \tag{6}\]  
where \(N^{l}_{(x,y)}\) is a square of side \(l\) pixels centred in the pixel at \((x,y)\). Moreover, it was highlighted that the use of sampling Kantorovich algorithm permits enhancing remarkably the quality of the thermographic images. Furthermore, a sensitivity analysis has been performed considering two sources of uncertainties: the first has been related to the parameters of the morphological operator, the second to the effects of the environmental conditions highlighting the robustness of the proposed procedure. Figure 6: (a) periodic, (b) quasi-periodic and (c) random. Applying the proposed procedure, the results shown in Figure 7 were obtained; the comparison with a digital image (see Figure 5) highlights the reliability of the procedure. In fact, the resulting black and white image has a consistent separation of phases, i.e., each stone is surrounded by mortar joints and unrealistic conjunction of inclusions is reduced as much as possible. Nevertheless, these results were obtained in laboratory conditions.