A Method for Extracting Contours of Building Facade Hollowing Defects Using Polarization Thermal Images Based on Improved Canny Algorithm

: During the service process of high-rise buildings, hollowing defects may be produced in the decorative layer, which not only affect the appearance, but also create a safety hazard of wall covering and shattered plaster peeling. Numerous studies have shown that hollowing can be detected using infrared thermal imagery under normal conditions. However, it is difﬁcult to detect the edge and calculate the area of the hollowing on an exterior facade accurately because of the low contrast and fuzzy boundaries of the obtained infrared thermal images. To address these problems, a method for extracting the contours of building facade hollowing defects using polarization thermal images based on an improved Canny algorithm has been proposed in this paper. Firstly, the principle of thermal polarization imaging was introduced for hollowing detection. Secondly, considering the shortcomings of the Canny edge detection algorithm and the features of polarization thermal images, an improved Canny edge detection algorithm is proposed, including adaptive bilateral ﬁltering to improve noise reduction ability while ensuring defect edges are not virtualized, Laplacian sharpening and histogram equalization to achieve contour sharpening and contrast enhancement, and eight-direction gradient templates for calculating image gradients, which make interpolation with non-maximum suppression more accurate, and the Tsallis entropy threshold segmentation algorithm based on the OTSU algorithm veriﬁcation makes the image contour information more complete and accurate. Finally, a long-wave infrared polarization thermal imaging experimental platform was established and validation experiments were conducted. The experimental results demonstrate that the distinct, smooth, and precise location edges of the hollowing polarization infrared thermal images can be obtained, and the average error of the detected hollowing area is about 10% using the algorithm proposed in this paper.


Introduction
During the construction and service of building facades, the quality of mortar bonding decreases and results in hollowing due to internal factors such as non-standard construction [1] and substandard mortar quality [2], as well as external factors such as gravity, temperature, and humidity.When the bonding force of the building facade decreases to a certain extent, the decorative layer peels off from the basal layer, which can cause a high-altitude falling object accident [3].
According to statistics, over 80% of the building facades in Japan and more than 50% of the building facades in the mainland of China are pasted with a finishing layer [4].From 2013 to 2017, a total of 84 accidents were caused by high-altitude falling objects in China [5].
From 2019 to 2022, there were over 300 accidents of falling caused by hollowing defects, among which over 80% of accidents occurred on buildings with a service life of more than 10 years.So, a high-altitude falling object accident caused by a hollowing defect is a process that gradually appears over time, making it crucial to perform periodic hollowing inspections of existing building facades to prevent accidents.
In the field of construction and civil engineering, the main detection methods for hollowing defects currently include visual inspection, tapping, drawing, and infrared thermography [6].So far, infrared thermography has been widely used in the field of building facade defect detection for its advantages of a long operating distance, strong penetration ability, non-destructive testing, and high detection efficiency.However, on the one hand, relying on experience to identify hollowing defects in infrared thermal images is greatly influenced by human subjectivity; on the other hand, infrared thermography [7] is mainly based on the infrared radiation intensity, temperature, and imaging characteristics of the target and background for achieving the detection and recognition of defects, which makes it difficult to quantitatively analyze the severity of hollow defects.When obtaining images, there will be heat exchange between the target and background, as well as the influence of camera noise and atmospheric scattering, resulting in the blurring of defect edges and low contrast in infrared thermal images [8,9].
In recent years, some scholars have applied image-processing technology to infrared thermal images for effective quantitative analysis, achieving defect recognition and edge contour extraction [10].Edge detection algorithms were confirmed used for building defect detection with effect.The Canny operator [11,12] is computationally more expensive than the Roberts, Prewitt, Sobel, and Laplacian operators; however, it performs better than all of those operators and many others under almost all scenarios and it is widely recognized as the most effective edge-detection method without considering parameter configuration [13], and is most commonly used in the field of detecting building defects.C Liu [14] determined the best performance of the Canny operator for external cladding construction in MSE, PSNR, and SSIM methods by statistically comparing the performance of five algorithms (including the Sobel, Canny, Log, Prewitt, and Roberts algorithms) via application to two scenarios of buildings on construction sites.Although Canny can detect most edges, it shows that parts of edges are not true edges, especially when a defect has several short edges (such as trees), which can lead to many noises.Therefore, the Canny algorithm, which has some room for improvement in edge detection, was selected as the approach for detecting the edges of building facade hollowing defects.Lu YC et al. [5,13] introduced a threshold selection method based on local maximum interclass variance to address the low image-processing speed caused by low gradient values and the existence of false edges in Canny's edge detection algorithm, achieving effective recognition of hollowing edge contours with the error of contour position at about 25%.Wang SG et al. [15] addressed the issues of poor noise-filtering performance and edge detail loss in commonly used filters in Canny edge detection algorithms.They used bilateral filters to smooth noise and adaptively select the high and low thresholds using dual global threshold segmentation algorithms, overcoming the randomness of manual experience threshold settings and achieving better noise suppression and edge detail preservation.Guo LG, Wu ST [16] used eight direction orientation approximation methods to calculate the gradient magnitude and direction and the OTSU algorithm with a logarithmic unit to simplify the calculation process of the edge detection algorithm, which obviously improved the stability and efficiency of the Canny algorithm.
Although the Canny edge detection algorithm has achieved good results in different applications, the selection of optimal parameters for different scenarios often leads to poor detection results, whose errors usually lie between 20% and 25%.This is mainly due to the chaotic infrared radiation of the target facade, which is greatly affected by the external environment.Using image-processing technology, it is difficult to efficiently remove the interference of environmental factors in infrared thermal images [17].
Polarization detection has a high sensitivity to subtle changes in the target surface structure and can obtain surface feature information [18].Thermal polarization imaging polarization detection has been widely used in both civilian and military fields.Hu WN [19] developed a photoelectric detector rough surface damage state polarization imaging system to meet the demand for real-time detector damage detection in the external field.Li LL, et al. [20,21] proposed a three-dimensional reconstruction method of the target based on infrared radiation polarization imaging for the measurement of high-reflective/highradiation and no-texture targets.Xiong ZH [22] found that the multi-wavelength polarization imaging method could quickly classify metal and non-metal targets in blast environments via experiments on various non-metallic and metallic materials.Wang FB [23] established a thermal polarization imaging detection experimental system to observe the changes in the surface roughness of metal specimens and polarization images of spontaneous emission during the fatigue damage process that can efficiently predict the metallic fatigue damage lifetime.The polarization information contained in polarization thermal images can complement the temperature gradient and blurry edge contours in infrared thermal images, while increasing the data required for hollowing discrimination from three-dimensional to seven-dimensional [24] and improving the accuracy of target detection under complex environmental interference.
In order to solve the above problems, a polarization thermal imaging extraction method based on an improved Canny algorithm for the contours of building facade hollowing defects is proposed, which introduces adaptive bilateral filtering [25], Laplace sharpening and histogram equalization to suppress noise and preserve defect edges, and uses an eight-directional gradient template to calculate image gradients, and the Tsallis entropy threshold algorithm based on OTSU verification to obtain the optimal threshold in order to achieve the quantitative detection of hollowing defects and accurate assessment of hazards.

Principles of Polarization Thermography on Building Facade Hollowing Defects
The basic heat transfer process of a building facade is shown in Figure 1, in which the structure of the building facade consists of a basal layer, a leveling layer, a bonding layer, and a decorative layer (without decorative brick) from inside to outside [5] and the amount of heat flow is represented by the number of dashed arrows.
Buildings 2023, 13, x FOR PEER REVIEW 4 of 18 radiation characteristics and polarization characteristics reflecting morphology, moisture content, temperature, etc.The polarization characteristics of target infrared radiation can be used as detection information for thermal polarization imaging, so that hollowing defects can be identified in a much higher dimensional space, and the low reflection area and defect contour of the building facade can be well distinguished [29].Thermal polarization imaging is integrated into infrared thermography to help obtain infrared radiation information that characterizes the temperature gradient distribution of hollowing defects and spontaneous emission polarization information with hollowing edge contour features [30], thereby improving the accuracy of defect edge segmentation.Assuming that the spontaneous emission of the building facade remains stable during the image acquisition process, the Stokes vector is  = , , ,  .As almost no circular polarization information exists in the long-wave infrared spectrum (V is approximately 0) [31], the energy received by the detector after the polarization analyzer is: In the course of real usage, the surface temperature of a building is significantly higher than that of the inner construction or surrounding atmosphere due to the thermal excitation of solar radiation, which causes the high heat quantity in the superficial layer to be conducted to both spontaneously [26].Via the conduction of heat, the temperature of defect-free building inner construction gradually increases with a uniform temperature distribution.When there exists a hollowing defect on the building facade, the thermal conductivity of the sealed air layer in the defect area is far below that of the defect-free area while the heat capacity between the sealed air layer and the defect-free building facade material has a subtle difference.
The inner construction just absorbs a small percentage of heat transmitted from the superficial layer so that much heat is accumulated on the outside of the hollowing defect, which leads to a higher temperature-increasing speed on the surface of the hollowing defect area than on that of the defect-free area.Under the continuous action of solar radiation, a significant temperature difference gradually occurs that results in high-temperature abnormal areas at the area of a hollowing defect, which are known as [27] "hot spots" in engineering.
The heat energy accumulated in the superficial layer of the building not only is transferred to the inner construction via heat conduction, but also to the surrounding atmosphere via heat radiation.Essentially, the spontaneous emission [28] emitted from the building facade is radiated in the form of electromagnetic waves, which contain infrared radiation characteristics and polarization characteristics reflecting morphology, moisture content, temperature, etc.The polarization characteristics of target infrared radiation can be used as detection information for thermal polarization imaging, so that hollowing defects can be identified in a much higher dimensional space, and the low reflection area and defect contour of the building facade can be well distinguished [29].Thermal polarization imaging is integrated into infrared thermography to help obtain infrared radiation information that characterizes the temperature gradient distribution of hollowing defects and spontaneous emission polarization information with hollowing edge contour features [30], thereby improving the accuracy of defect edge segmentation.
Assuming that the spontaneous emission of the building facade remains stable during the image acquisition process, the Stokes vector is S in = [I, Q, U, V] T .As almost no circular polarization information exists in the long-wave infrared spectrum (V is approximately 0) [31], the energy received by the detector after the polarization analyzer is: where α is the polarization azimuth.When α = 0 • , 60 • , and 120 • , the Stokes parameters of spontaneous emission from the building facade can be parsed: Furthermore, the degree of polarization (DOP) of spontaneous emission from the building facade is calculated as:

Traditional Canny Algorithm
The extraction process of hollowing defects using the traditional Canny algorithm can be described as shown in Table 1 [32].The extracted hollowing edge, processed using the traditional Canny edge detection algorithm, can approach the real one, and the continuity of the detected hollowing contour can be maintained as much as possible, while the probability of missed and false detections can also be reduced into the engineering permissible range.
From Table 1, the traditional Canny algorithm has some limitations in extracting the edges of polarization thermal images for building facade hollowing defects [33,34]: (1) The polarizer in the infrared polarization imaging system serves as a filter during the experimental process and can filter out the influence of environmental noises to a certain extent and highlight the edge features of hollowing defects in the polarization thermal image.When using a Gaussian filter to filter out noise in this image, the noise removal effect is not significant if the size of the Gaussian kernel is too small; conversely, the edge contour information of defects in the polarization thermal image will be lost with an oversized Gaussian kernel.(2) In the linear interpolation process of non-maximum suppression, the four-neighborhood method is used to calculate the gradient using a 3 × 3 convolutional template.The gradient of pixels is divided into four directions: horizontal, vertical, and double diagonals, which lead to the loss of pixel features, resulting in inaccurate linear interpolation results of non-maximum suppression.(3) When processing polarization thermal images of building facades under different environmental conditions, the adaptability of the fixed double-threshold segmentation method has a poor performance and the effect is not ideal enough.Thermal polarization imaging is greatly affected by environmental illumination conditions, and the halving of light intensity after passing through the polarizer enlarges the gray-level difference of the polarization thermal images with a narrow dynamic range of gray-level.In the process of edge segmentation, the image edge contour perhaps will be discontinuous or even be missed if the segmentation threshold is too high; if it is too low, the contrast of the image of the building facade will be reduced.

Improved Canny Segmentation Algorithm
The traditional Canny segmentation algorithm is improved based on the features of the polarization thermal image of the hollowing defects and the shortcomings of the traditional algorithm as shown in Table 1. Figure 2 shows the process of extracting the edge contours from the polarization thermal image of the hollowing defects on the building facade in this paper, which contains the import of images, image preprocessing (such as adaptive bilateral filtering, Laplace sharpening, and histogram equalization), the calculation of the gradient magnitude and direction of each pixel, the determination of whether a pixel is an edge point using non-maximum suppression roughly, the acquisition of true edge points determined using the dual-threshold segmentation and isolation judgement, and the connection of unclosed edges using the morphological processing method to obtain complete edges.facade in this paper, which contains the import of images, image preprocessing (such as adaptive bilateral filtering, Laplace sharpening, and histogram equalization), the calculation of the gradient magnitude and direction of each pixel, the determination of whether a pixel is an edge point using non-maximum suppression roughly, the acquisition of true edge points determined using the dual-threshold segmentation and isolation judgement, and the connection of unclosed edges using the morphological processing method to obtain complete edges.[25] In the stage of image preprocessing, the gray-level difference of the polarization thermal images is enlarged with a narrow dynamic range of gray-level and there exists lots of Gaussian noises in the polarization thermal image, due to the disordered infrared radiation outside of the building facade and the halving of the light intensity after passing through the polarizer.The Gaussian filter is used in the traditional Canny algorithm to smooth the entire image indiscriminately, which can easily lead to the loss of edge contour information.Bilateral filtering calculates weights from both the spatial and pixel domains, while filtering noises in the entire image and maintaining the edges of hollowing defects.However, the bilateral filter with a fixed weight can cause over-smoothing in the edge area of hollowing.An adaptive bilateral filter is adopted that adjusts weights based on the local image features to filter out Gaussian noise in polarization thermal images.

Adaptive Bilateral Filtering
The filtering model of the bilateral filter for two-dimensional images is [25]: where  is the original image;  is the filtered image; j is the central pixel of the template; () is the neighborhood of the central pixel of the template;  (, ) is the spatial distance function;  (, ) is the pixel distance function.
The weight of the adaptive bilateral filter is calculated using the spatial distance function and pixel distance function of the center pixel neighborhood.The spatial and pixel distance functions are respectively determined by  (the standard deviation of spatial distance) and  (the standard deviation of pixel distance).So, the weights of the adaptive bilateral filter depend on the selection of  and  parameters.
The standard deviation of spatial distance  is calculated using the phase consistency measurement [35].By determining the maximum moment () and minimum moment () of the local phase of the image, the spatial distance parameter  is obtained.

Adaptive Bilateral Filtering [25]
In the stage of image preprocessing, the gray-level difference of the polarization thermal images is enlarged with a narrow dynamic range of gray-level and there exists lots of Gaussian noises in the polarization thermal image, due to the disordered infrared radiation outside of the building facade and the halving of the light intensity after passing through the polarizer.The Gaussian filter is used in the traditional Canny algorithm to smooth the entire image indiscriminately, which can easily lead to the loss of edge contour information.Bilateral filtering calculates weights from both the spatial and pixel domains, while filtering noises in the entire image and maintaining the edges of hollowing defects.However, the bilateral filter with a fixed weight can cause over-smoothing in the edge area of hollowing.An adaptive bilateral filter is adopted that adjusts weights based on the local image features to filter out Gaussian noise in polarization thermal images.
The filtering model of the bilateral filter for two-dimensional images is [25]: where I in is the original image; I out is the filtered image; j is the central pixel of the template; N(j) is the neighborhood of the central pixel of the template; γ d (i, j) is the spatial distance function; γ r (i, j) is the pixel distance function.
The weight of the adaptive bilateral filter is calculated using the spatial distance function and pixel distance function of the center pixel neighborhood.The spatial and pixel distance functions are respectively determined by σd (the standard deviation of spatial distance) and σr (the standard deviation of pixel distance).So, the weights of the adaptive bilateral filter depend on the selection of σd and σr parameters.
The standard deviation of spatial distance σd is calculated using the phase consistency measurement [35].By determining the maximum moment M(i) and minimum moment m(i) of the local phase of the image, the spatial distance parameter σd is obtained.
where σ de is the edge information constraint of σ d (σ de = 1.45) and σ dc is the corner information constraint of σ d (σ dc = 0.55).The pixel distance parameter σr is directly correlated with the noise variance σ e , and the variance estimation algorithm with gray-level homogeneity measurement [36] is used to establish the relationship between the parameters of brightness distance and noise variance.The noise variance can be expressed as: where σ 2 kl represents variance and N is determined by the number of pixel blocks.The relationship between pixel distance parameter σr and noise variance σ e is: where K is the proportion coefficient.
The spatial distance adjustment strategy of the adaptive bilateral filter is established using the phase consistency measurement, and the pixel distance adjustment strategy is established using the gray-level homogeneity measurement.This effectively filters Gaussian noise while solving the problem of over-smoothing of the edges of hollowing defects in polarization thermal images caused by bilateral filters with fixed parameter weights.

Laplace Sharpening and Histogram Equalization
According to the principle of thermal polarization imaging, the light intensity is halved after passing through the polarizer and the accepted energy by the detector after the polarization analyzer is I/2 [34], resulting in lower-contrast polarization images.Therefore, image enhancement is required for polarization thermal images processed using adaptive bilateral filtering.
Laplace sharpening can preserve the integrity of the background information of processed images while enhancing the pixel region with evident edge features.Histogram equalization can transform the histogram of the processed image into an evenly distributed form, which enlarges the dynamic range of gray-level differences between pixels, thereby enhancing the overall contrast of the polarization thermal image.

Improved Non-Maximum Suppression Method
In the linear interpolation process of non-maximum suppression, for the gradient amplitude of the current pixel in comparison with the gradient amplitude of adjacent pixels in the positive and negative gradient directions, if it is the maximum, the current pixel is kept as the edge point; in the contrary situation, it is suppressed to eliminate a spurious response.When calculating pixel gradient amplitude and direction, the adjacent areas of the center pixel are divided into four directions: horizontal, vertical, and double diagonal [13].This interpolation method may miss true edge points and some edge detail features, especially in areas containing weak edge information.According to the strong complementarity and redundancy between polarization thermal images, as well as the shortcomings of the fixed double-threshold segmentation method [37], the Tsallis entropy threshold segmentation method based on the OTSU algorithm is used to segment defects.Firstly, the threshold of Tsallis [38] entropy is selected

Tsallis Entropy Threshold Segmentation Method Based on the OTSU Algorithm
According to the strong complementarity and redundancy between polarization thermal images, as well as the shortcomings of the fixed double-threshold segmentation method [37], the Tsallis entropy threshold segmentation method based on the OTSU algorithm is used to segment defects.Firstly, the threshold of Tsallis [38] entropy is selected using the q value in the empirical range, and then the interclass variance, which corresponds to the q parameter, is calculated.The optimal threshold corresponding to the maximum interclass variance is selected as the final segmentation threshold of the polarization thermal image of hollowing defects.
The Tsallis entropy of the background and target regions in a polarization thermal image is: The total Tsallis entropy of a polarization thermal image is: The criterion function of the Tsallis entropy threshold segmentation is given as: In the process of the OTSU threshold segmentation method [39], the degree of difference between the background and target can be reflected by the interclass variance of the two classes.If certain target areas are mistakenly divided into background areas or background areas are mistakenly divided into target areas, the degree of difference will decrease.The number of pixels in a polarization thermal image is N and the number of pixels in grayscale i is n i ; the probabilities of L grayscale are {p 1 , p 2 . . .p L }, where p i = n i /N .The gray mean levels of the image background class A and target class B by threshold t* are: The gray mean level of the entire image u T is: where The interclass variance between class A and class B is: The optimal high threshold is calculated using the Tsallis entropy threshold segmentation method based on the OTSU algorithm, and a high-to-low threshold ratio between 2:1 and 3:1 is recommended in the Canny algorithm.

Experimental Image Acquisition
The physical parameters of the corresponding structure of the actual wall material are obtained from Nondestructive Testing handbook, infrared and thermal testing [40] and Thermophysical Properties of Matter, The TPRC Data Series and are shown in Table 2.The experimental wall is mainly made of concrete of a gray color (Figure 4c), with a size of 500 mm (L) × 500 mm (W) × 70 mm (H).According to the literature [41], the thermodynamic property of the air layer in the hollowing defect is far closer to that of a polystyrene foam plate, and the principle of using polarization thermal imaging for detecting hollowing defects is based on the differences in thermodynamic parameters (mainly thermal conductivity) between the defect and defect-free area.So, a polystyrene foam plate can be used to simulate the air layer in the hollowing defect in the reality of the experiments.The hollowing is artificially prefabricated on the experimental facade by fixing four polystyrene foam plates with low thermal conductivity and different sizes, which simulate the various forms of real hollowing defects on building facades.The size and position distribution diagram of the preset hollowing defects is shown in Figure 4.The literature [5] shows that the actual hollowing situation of the depth from the surface of the experimental wall to the exterior face of the foam board is over 5 mm, so the thickness of the hollowing, which is prefabricated on the experimental wall, is 10 mm.Based on the structural composition of actual building facades and the construction parameters of experimental walls referenced in relevant papers [41][42][43], the experimental wall is composed of a substrate (50 mm), a leveling layer (10 mm), a bonding layer (cavity layer) (5 mm), and a decorative layer (without decorative brick, 5 mm) from inside to outside.The cement mortar ratio of the leveling layer is 1:2, the cement mortar ratio of the bonding layer is 1:3, and their thermodynamic parameters are close to those of the corresponding structures of actual building facades.
After curing for 7 days in air under laboratory conditions, the experimental wall was transferred to the experimental scene and was placed towards the device which contained the long-wave infrared polarization instrumentation and thermal infrared imager.The shooting conditions are shown in Table 3 and a schematic diagram of the experimental setup is shown in Figure 5.
Buildings 2023, 13, x FOR PEER REVIEW 9 of 18 The optimal high threshold is calculated using the Tsallis entropy threshold segmentation method based on the OTSU algorithm, and a high-to-low threshold ratio between 2:1 and 3:1 is recommended in the Canny algorithm.

Experimental Image Acquisition
The physical parameters of the corresponding structure of the actual wall material are obtained from Nondestructive Testing handbook, infrared and thermal testing [40] and Thermophysical Properties of Matter, The TPRC Data Series and are shown in Table 2.
The experimental wall is mainly made of concrete of a gray color (Figure 4c), with a size of 500 mm (L) × 500 mm (W) × 70 mm (H).According to the literature [41], the thermodynamic property of the air layer in the hollowing defect is far closer to that of a polystyrene foam plate, and the principle of using polarization thermal imaging for detecting hollowing defects is based on the differences in thermodynamic parameters (mainly thermal conductivity) between the defect and defect-free area.So, a polystyrene foam plate can be used to simulate the air layer in the hollowing defect in the reality of the experiments.The hollowing is artificially prefabricated on the experimental facade by fixing four polystyrene foam plates with low thermal conductivity and different sizes, which simulate the various forms of real hollowing defects on building facades.The size and position distribution diagram of the preset hollowing defects is shown in Figure 4.The literature [5] shows that the actual hollowing situation of the depth from the surface of the experimental wall to the exterior face of the foam board is over 5 mm, so the thickness of the hollowing, which is prefabricated on the experimental wall, is 10 mm.Based on the structural composition of actual building facades and the construction parameters of experimental walls referenced in relevant papers [41][42][43], the experimental wall is composed of a substrate (50 mm), a leveling layer (10 mm), a bonding layer (cavity layer) (5 mm), and a decorative layer (without decorative brick, 5 mm) from inside to outside.The cement mortar ratio of the leveling layer is 1:2, the cement mortar ratio of the bonding layer is 1:3, and their thermodynamic parameters are close to those of the corresponding structures of actual building facades.image resolution of 640 × 480, a thermal sensitivity of 0.1 °C, and a temperature measurement range from −20 to 650 °C (the IR image of the experimental wall from the Fluke Ti200 thermal infrared imager is shown in Figure 4d).The long-wave infrared polarization imaging experimental platform consists of a CCD long-wave infrared cooling camera (1) and a high-precision turntable (3) with an infrared metal grating polarizer (2).In order to verify the effectiveness of the adaptive bilateral filtering algorithm, the polarization thermal images of the building facade hollowing defects obtained from the experimental platform were filtered using different methods.To effectively avoid the interference of redundance, such as the background and border in polarization thermal As shown in Figure 6, the selected thermal infrared imager is a Fluke Ti200, with an image resolution of 640 × 480, a thermal sensitivity of 0.1 • C, and a temperature measurement range from −20 to 650 • C (the IR image of the experimental wall from the Fluke Ti200 thermal infrared imager is shown in Figure 4d).The long-wave infrared polarization imaging experimental platform consists of a CCD long-wave infrared cooling camera (1) and a high-precision turntable (3) with an infrared metal grating polarizer (2).
After curing for 7 days in air under laboratory conditions, the experimental wall was transferred to the experimental scene and was placed towards the device which contained the long-wave infrared polarization instrumentation and thermal infrared imager.The shooting conditions are shown in Table 3 and a schematic diagram of the experimental setup is shown in Figure 5.
As shown in Figure 6, the selected thermal infrared imager is a Fluke Ti200, with an image resolution of 640 × 480, a thermal sensitivity of 0.1 °C, and a temperature measurement range from −20 to 650 °C (the IR image of the experimental wall from the Fluke Ti200 thermal infrared imager is shown in Figure 4d).The long-wave infrared polarization imaging experimental platform consists of a CCD long-wave infrared cooling camera (1) and a high-precision turntable (3) with an infrared metal grating polarizer (2).In order to verify the effectiveness of the adaptive bilateral filtering algorithm, the polarization thermal images of the building facade hollowing defects obtained from the experimental platform were filtered using different methods.To effectively avoid the interference of redundance, such as the background and border in polarization thermal

Experimental Comparisons 4.2.1. Adaptive Bilateral Filtering Algorithm
In order to verify the effectiveness of the adaptive bilateral filtering algorithm, the polarization thermal images of the building facade hollowing defects obtained from the experimental platform were filtered using different methods.To effectively avoid the interference of redundance, such as the background and border in polarization thermal images, a comparative experiment is conducted regarding the filtering effect of the complete images and the images after removing redundant interference.To avoid accidental errors, three sets of polarization thermal images of hollowing defects are selected as experimental objects with optimum distance and observation angles of 0 • , 20 • , and 40 • , respectively.The test image results are shown in Figure 7.
It can be found that the edges of the experimental wall and hollowing defects in the polarization thermal images processed using Gaussian filtering are severely blurred compared with the images processed using the five filtering methods in Figure 7.The overall stability of the image after median filtering behaves badly under different observation angles.The environmental noise and noises caused by the surface character of the object itself in the polarization thermal images can be effectively removed using mean filtering, which results in the loss of edge details and feature information of the hollowing defects.The noise suppression effect of bilateral filtering performs significantly enough that it is superior to mean filtering, but the capability of edge-preserving still needs to be improved.The performance in enhancing edge features and removing noises of adaptive bilateral filtering is obviously better than that of the other filtering algorithms in the processed images and the edges of the experimental wall and hollowing defects are clear enough to be profitable for edge extraction subsequently.By comparing the effects of image cropping in processed polarization thermal images, it is evident that the interference of redundant information is avoided effectively in images after clipping, which significantly suppresses image noise while achieving edge enhancement.
Buildings 2023, 13, x FOR PEER REVIEW 11 of 18 images, a comparative experiment is conducted regarding the filtering effect of the complete images and the images after removing redundant interference.To avoid accidental errors, three sets of polarization thermal images of hollowing defects are selected as experimental objects with optimum distance and observation angles of 0°, 20°, and 40°, respectively.The test image results are shown in Figure 7.It can be found that the edges of the experimental wall and hollowing defects in the polarization thermal images processed using Gaussian filtering are severely blurred compared with the images processed using the five filtering methods in Figure 7.The overall stability of the image after median filtering behaves badly under different observation angles.The environmental noise and noises caused by the surface character of the object itself in the polarization thermal images can be effectively removed using mean filtering, which results in the loss of edge details and feature information of the hollowing defects.The noise suppression effect of bilateral filtering performs significantly enough that it is  4 and 5. Tables 4 and 5 represent the performance of PSNR and SSIM on polarization thermal images processed using the adaptive bilateral filtering algorithm, which is superior to other filtering methods.Compared with the images processed using Gaussian filtering, the PSNR of the images processed using the adaptive bilateral filtering algorithm is increased by 25.64%, 29.41%, and 22.31% for uncut hollowing polarization thermal images, respectively, with the SSIM being increased by 8.62%, 6.56%, and 9.87%.For the cropped hollowing polarization thermal images, compared with the image processed using Gaussian filtering, the PSNR of the image processed using the adaptive bilateral filtering algorithm is increased by 25.05%, 32.29%, and 27.00%, respectively, with the SSIM being increased by 27.59%, 11.26%, and 7.02%.The adaptive bilateral filtering algorithm has a more stable effect on image filtering and stronger ability to resist environmental interference than other filtering methods.

Laplace Sharpening and Histogram Equalization
The filtered polarization thermal image of hollowing defects is enhanced by a mixed processing of Laplace sharpening and histogram equalization.Figure 8 shows the mixed enhancement processing result of the polarization thermal image.After adaptive bilateral filtering processing, the smaller noises in the image are removed well while preserving the internal defect edge information of the building facade.Using a mixed process of image sharpening and histogram equalization, the edge contours of the hollowing defects become clearer and the differences between intact areas and defective areas become larger in gray-level, so that the overall contrast of the polarization thermal image is improved without new noise generation.
filtering processing, the smaller noises in the image are removed well while preserving the internal defect edge information of the building facade.Using a mixed process of image sharpening and histogram equalization, the edge contours of the hollowing defects become clearer and the differences between intact areas and defective areas become larger in gray-level, so that the overall contrast of the polarization thermal image is improved without new noise generation.The circle, rectangle, triangle, and square in Table 6 signify the shapes of the four preset hollowing defects in the experimental wall, respectively.Table 6 contains the actual size of the four defects, the output contour size with pixel area method and error rate, and also presents a comprehensive comparison of the size and error rates of the four hollowing defects in infrared images and polarization thermal images processed using the traditional Canny edge detection algorithm.The average error of the traditional Canny algorithm in detecting the edge contours of hollowing defects in infrared thermal images is

Experimental Results and Analysis
(1) The infrared image and polarization image of the experimental wall, as well as their cropped images, are exhibited in Figure 9.To verify the effectiveness of introducing thermal polarization imaging in edge extraction, the traditional Canny edge detection algorithm is used to extract hollowing defect contours from infrared thermal images and polarization thermal images, which is required under the same experimental conditions.The morphological methods are used to connect the unclosed points in the hollowing defect edge contour, as shown in Figure 10(a2,b2).The size of the output contour is calculated using the pixel area method and then the actual size of the defect is compared with the calculated size to obtain the error rate.
Buildings 2023, 13, x FOR PEER REVIEW 13 of 18 filtering processing, the smaller noises in the image are removed well while preserving the internal defect edge information of the building facade.Using a mixed process of image sharpening and histogram equalization, the edge contours of the hollowing defects become clearer and the differences between intact areas and defective areas become larger in gray-level, so that the overall contrast of the polarization thermal image is improved without new noise generation.

Experimental Results and Analysis
(1) The infrared image and polarization image of the experimental wall, as well as their cropped images, are exhibited in Figure 9.To verify the effectiveness of introducing thermal polarization imaging in edge extraction, the traditional Canny edge detection algorithm is used to extract hollowing defect contours from infrared thermal images and polarization thermal images, which is required under the same experimental conditions.The morphological methods are used to connect the unclosed points in the hollowing defect edge contour, as shown in Figure 10 (a2,b2).The size of the output contour is calculated using the pixel area method and then the actual size of the defect is compared with the calculated size to obtain the error rate.The circle, rectangle, triangle, and square in Table 6 signify the shapes of the four preset hollowing defects in the experimental wall, respectively.Table 6 contains the actual size of the four defects, the output contour size with pixel area method and error rate, and also presents a comprehensive comparison of the size and error rates of the four hollowing defects in infrared images and polarization thermal images processed using the traditional Canny edge detection algorithm.The average error of the traditional Canny algorithm in detecting the edge contours of hollowing defects in infrared thermal images is filtering processing, the smaller noises in the image are removed well while preserving the internal defect edge information of the building facade.Using a mixed process of image sharpening and histogram equalization, the edge contours of the hollowing defects become clearer and the differences between intact areas and defective areas become larger in gray-level, so that the overall contrast of the polarization thermal image is improved without new noise generation.

Experimental Results and Analysis
(1) The infrared image and polarization image of the experimental wall, as well as their cropped images, are exhibited in Figure 9.To verify the effectiveness of introducing thermal polarization imaging in edge extraction, the traditional Canny edge detection algorithm is used to extract hollowing defect contours from infrared thermal images and polarization thermal images, which is required under the same experimental conditions.The morphological methods are used to connect the unclosed points in the hollowing defect edge contour, as shown in Figure 10 (a2,b2).The size of the output contour is calculated using the pixel area method and then the actual size of the defect is compared with the calculated size to obtain the error rate.The circle, rectangle, triangle, and square in Table 6 signify the shapes of the four preset hollowing defects in the experimental wall, respectively.Table 6 contains the actual size of the four defects, the output contour size with pixel area method and error rate, and also presents a comprehensive comparison of the size and error rates of the four hollowing defects in infrared images and polarization thermal images processed using the traditional Canny edge detection algorithm.The average error of the traditional Canny algorithm in detecting the edge contours of hollowing defects in infrared thermal images is The circle, rectangle, triangle, and square in Table 6 signify the shapes of the four preset hollowing defects in the experimental wall, respectively.Table 6 contains the actual size of the four defects, the output contour size with pixel area method and error rate, and also presents a comprehensive comparison of the size and error rates of the four hollowing defects in infrared images and polarization thermal images processed using the traditional Canny edge detection algorithm.The average error of the traditional Canny algorithm in detecting the edge contours of hollowing defects in infrared thermal images is over 30%.The reason, perhaps, is that environmental factors such as temperature, humidity, wind speed, solar radiation, and air quality cause energy attenuation of infrared radiation transmitted from the hollowing area in the detection process [45,46].Moreover, the temperature anomalies detected using infrared thermography actually have no air infiltration [47], which can cause the experimental results to be extremely larger than the actual values.It also can be seen from Table 6 that the introduction of polarization thermal imaging can significantly improve the detection accuracy, whose error rate compared with infrared thermography is down as much as 21.8%, 17.6%, 31.4%, and 22.2% in the hollowing defect areas of the circle, rectangle, triangle, and square under the same experimental treatments.(2) In order to verify the superiority of the improved Canny algorithm proposed in this paper in extracting the contours of building hollowing defects using polarization thermal images, the performances of the Roberts, Sobel, Prewitt, Log [48], Canny, and the output contour size with pixel area method [49] algorithms were compared with each other.The six detection algorithms lead to different errors between the processing results and the actual sizes, and the output edge detection results of hollowing defects processed using these algorithms and the morphological processing results of corresponding images are shown in Figures 11 and 12.
over 30%.The reason, perhaps, is that environmental factors such as temperature, humidity, wind speed, solar radiation, and air quality cause energy attenuation of infrared radiation transmitted from the hollowing area in the detection process [45,46].Moreover, the temperature anomalies detected using infrared thermography actually have no air infiltration [47], which can cause the experimental results to be extremely larger than the actual values.It also can be seen from Table 6 that the introduction of polarization thermal imaging can significantly improve the detection accuracy, whose error rate compared with infrared thermography is down as much as 21.8%, 17.6%, 31.4%, and 22.2% in the hollowing defect areas of the circle, rectangle, triangle, and square under the same experimental treatments.(2) In order to verify the superiority of the improved Canny algorithm proposed in this paper in extracting the contours of building hollowing defects using polarization thermal images, the performances of the Roberts, Sobel, Prewitt, Log [48], Canny, and the output contour size with pixel area method [49] algorithms were compared with each other.The six detection algorithms lead to different errors between the processing results and the actual sizes, and the output edge detection results of hollowing defects processed using these algorithms and the morphological processing results of corresponding images are shown in Figures 11 and 12  After the integrated comparison of the edge detection results of polarization thermal images of hollowing using several methods, it can be found that, as shown in Figure 11a,c,d, the true edge points of hollowing defects extracted using the Roberts, Prewitt, and Log algorithms are missing to varying degrees, with the most severe edge feature loss of hollowing defects in the images processed using the Prewitt algorithm.The true edge points of hollowing defects are preserved integrally after being treated using the Sobel and Canny algorithms, as shown in Figure 11b,e, but many false edges exist.The improved Canny algorithm in this paper not only effectively removes the false edge features over 30%.The reason, perhaps, is that environmental factors such as temperature, humidity, wind speed, solar radiation, and air quality cause energy attenuation of infrared radiation transmitted from the hollowing area in the detection process [45,46].Moreover, the temperature anomalies detected using infrared thermography actually have no air infiltration [47], which can cause the experimental results to be extremely larger than the actual values.It also can be seen from Table 6 that the introduction of polarization thermal imaging can significantly improve the detection accuracy, whose error rate compared with infrared thermography is down as much as 21.8%, 17.6%, 31.4%, and 22.2% in the hollowing defect areas of the circle, rectangle, triangle, and square under the same experimental treatments.(2) In order to verify the superiority of the improved Canny algorithm proposed in this paper in extracting the contours of building hollowing defects using polarization thermal images, the performances of the Roberts, Sobel, Prewitt, Log [48], Canny, and the output contour size with pixel area method [49] algorithms were compared with each other.The six detection algorithms lead to different errors between the processing results and the actual sizes, and the output edge detection results of hollowing defects processed using these algorithms and the morphological processing results of corresponding images are shown in Figures 11 and 12  After the integrated comparison of the edge detection results of polarization thermal images of hollowing using several methods, it can be found that, as shown in Figure 11a,c,d, the true edge points of hollowing defects extracted using the Roberts, Prewitt, and Log algorithms are missing to varying degrees, with the most severe edge feature loss of hollowing defects in the images processed using the Prewitt algorithm.The true edge points of hollowing defects are preserved integrally after being treated using the Sobel and Canny algorithms, as shown in Figure 11b,e, but many false edges exist.The improved Canny algorithm in this paper not only effectively removes the false edge features After the integrated comparison of the edge detection results of polarization thermal images of hollowing using several methods, it can be found that, as shown in Figure the true edge points of hollowing defects extracted using the Roberts, Prewitt, and Log algorithms are missing to varying degrees, with the most severe edge feature loss of hollowing defects in the images processed using the Prewitt algorithm.The true edge points of hollowing defects are preserved integrally after being treated using the Sobel and Canny algorithms, as shown in Figure 11b,e, but many false edges exist.The improved Canny algorithm in this paper not only effectively removes the false edge features from polarization thermal images of hollowing defects, but also maintains the true edge contour features completely, as shown in Figure 11f.Figure 12 shows the results of morphological processing that can effectively connect unclosed edge points to calculate the experimental size of hollowing defects.If still not fully closed, the edge is connected manually [5].
The actual sizes, which are measured in the process of the experimental design, and the experimental sizes of hollowing defects in the polarization thermal images processed using the six algorithms are shown in Table 7, and the circle, rectangle, triangle, and square signify the parts of the four preset defects in the experimental wall, respectively.In Figure 13, the algorithms used to process the polarization thermal images are represented by the horizontal axis and the percentage errors between the actual size and the experimental size are shown on the vertical axis.When the error is less than 0%, it indicates that the experimental size of the hollowing defects calculated using the algorithm is less than the actual size, and vice versa.experimental size of hollowing defects.If still not fully closed, the edge is connected manually [5].The actual sizes, which are measured in the process of the experimental design, and the experimental sizes of hollowing defects in the polarization thermal images processed using the six algorithms are shown in Table 7, and the circle, rectangle, triangle, and square signify the parts of the four preset defects in the experimental wall, respectively.In Figure 13, the algorithms used to process the polarization thermal images are represented by the horizontal axis and the percentage errors between the actual size and the experimental size are shown on the vertical axis.When the error is less than 0%, it indicates that the experimental size of the hollowing defects calculated using the algorithm is less than the actual size, and vice versa.It can be seen from Figure 13 that the utilization of the improved Canny edge detection algorithm for hollowing defects can potentially achieve experimental values that are closer to the actual ones.Compared with the results processed using other algorithms, the improved Canny algorithm shows the highest detection accuracy with error values of 3.87%, 5%, 5.24%, and 2.20% in the circle, rectangle, triangle, and square, which are 2.7%, 0.2%, 1%, and 8.9% lower than the original Canny algorithm, respectively, and shows the best stability in contour detection with an average precision of the size of hollowing defects over 90% in an experimental environment.

Conclusions
This paper is dedicated to solving the problems of poor resolution and low contrast caused by the limitations of infrared thermography principles and the heat transfer characteristics of building facades, as well as the tendency to generate false edges when It can be seen from Figure 13 that the utilization of the improved Canny edge detection algorithm for hollowing defects can potentially achieve experimental values that are closer to the actual ones.Compared with the results processed using other algorithms, the improved Canny algorithm shows the highest detection accuracy with error values of 3.87%, 5%, 5.24%, and 2.20% in the circle, rectangle, triangle, and square, which are 2.7%, 0.2%, 1%, and 8.9% lower than the original Canny algorithm, respectively, and shows the best stability in contour detection with an average precision of the size of hollowing defects over 90% in an experimental environment.

Conclusions
This paper is dedicated to solving the problems of poor resolution and low contrast caused by the limitations of infrared thermography principles and the heat transfer characteristics of building facades, as well as the tendency to generate false edges when extracting contours.According to the polarization thermal imaging and shortcomings of the traditional Canny edge algorithm, an improved method is proposed that addresses these issues and achieves hollowing defect recognition and quantitative analysis.. In the proposed algorithm, the application of adaptive bilateral filtering significantly reduced noise and enhanced edge preservation, while Laplacian sharpening and histogram equalization enhanced image contrast and protruded the image edge of hollowing defects.Additionally, the introduction of an eight-neighborhood calculation method was used to calculate image gradients and the utilization of the Tsallis entropy segmentation algorithm based on the OTSU algorithm was applied to accurately keep the edge information of hollowing defects.Finally, morphological methods were used to erode and expand the defect edges and to connect unclosed contour points while the size of the output edge was calculated using the image pixel area method.The results show that the method for extracting the contours of building facade hollowing defects using polarization thermal images proposed in this paper has better visual effects, a higher edge detection accuracy, and reduces subjective errors caused by human operations compared with the Roberts, Sobel, Prewitt, Log, and traditional Canny algorithms with an average precision of the size of hollowing defects over 93% in an experimental environment.
(1) However, the application scenarios and objects of the improved algorithm proposed in this article also have some limitations: In real life, there are two main forms of building facade, in which one is the structure without decorative bricks, and the other is the structure with decorative bricks.The detection object of this article is a building facade hollowing defect without decorative brick, which can be detected using the improved Canny algorithm with high accuracy and speed.Building facades with decorative brick structures are complex enough that the improved Canny algorithm almost meets the requirement of accuracy, but requires a large amount of time-consuming computation [50].In order to reduce the computational time of the process of threshold segmentation, the optimization algorithms are introduced into the improved Canny algorithm to optimize this process.There are many different domains where metaheuristic optimization algorithms have been applied as solution approaches, which shows the effectiveness of these algorithms in many domains, such as online learning, scheduling, multi-objective optimization, transportation, medicine, data classification, and others [51][52][53][54][55].For example, the calculation speed of segmentation thresholds is improved obviously in the adaptive Canny algorithm by introducing SF-FWA [51] to optimize the calculation process of the maximum interclass variance of infrared thermal images, which [50] shows the potential applications of metaheuristic optimization algorithms in the domain of building hollowing defect detection and provides new ideas for achieving the real-time detection of hollowing defects in future research.
(2) How to achieve real-time results and high accuracy when detecting hollowing defects on real-world building facades with complex structures is the main content of future research.

Figure 1 .
Figure 1.Schematic diagram of heat transfer process of experimental wall and the structural diagram of actual wall.

Figure 1 .
Figure 1.Schematic diagram of heat transfer process of experimental wall and the structural diagram of actual wall.

Figure 7 .
Figure 7.Comparison of image filtering processing effects: (a-f) The polarization thermal original and cropped images processed using Gaussian filtering; median filtering; mean filtering; bilateral filtering; and improved bilateral filtering.

Figure 7 .
Figure 7.Comparison of image filtering processing effects: (a-f) The polarization thermal original and cropped images processed using Gaussian filtering; median filtering; mean filtering; bilateral filtering; and improved bilateral filtering.The Peak Signal to Noise Ratio (PSNR) and Structural Similarity (SSIM) [44] are used to quantitatively analyze five filtering effects on image noises.By comparing the results of several filtering methods, the adaptive bilateral filtering algorithm outperforms other detection algorithms in both PSNR and SSIM.The comparisons of the PSNR and SSIM results of test image filtering are shown in Tables4 and 5.

Figure 8 .Figure 9 .Figure 10 .
Figure 8.The polarization thermal image and image enhancement processing result.4.2.3.Experimental Results and Analysis(1) The infrared image and polarization image of the experimental wall, as well as their cropped images, are exhibited in Figure9.To verify the effectiveness of introducing thermal polarization imaging in edge extraction, the traditional Canny edge detection algorithm is used to extract hollowing defect contours from infrared thermal images and polarization thermal images, which is required under the same experimental conditions.The morphological methods are used to connect the unclosed points in the hollowing defect edge contour, as shown in Figure10(a2,b2).The size of the output contour is calculated using the pixel area method and then the actual size of the defect is compared with the calculated size to obtain the error rate.

Figure 8 .
Figure 8.The polarization thermal image and image enhancement processing result.

Figure 8 .
Figure 8.The polarization thermal image and image enhancement processing result.

Figure 9 .Figure 10 .
Figure 9.The schematic diagram of infrared thermal images and polarized thermal images.

Figure 9 .
Figure 9.The schematic diagram of infrared thermal images and polarized thermal images.

Figure 8 .
Figure 8.The polarization thermal image and image enhancement processing result.

Figure 9 .Figure 10 .
Figure 9.The schematic diagram of infrared thermal images and polarized thermal images.

Figure 10 .
Figure 10.The results of hollowing defect images processed using the traditional Canny algorithm and morphological methods: (a1) Output edge of cropped infrared image; (a2) The result of (a1) after application of morphological methods; (b1) Output edge of cropped polarization image; (b2) The result of (b1) after application of morphological methods. .

Figure 13 .
Figure 13.The error rate of different algorithms in the size of hollowing defects.

Figure 13 .
Figure 13.The error rate of different algorithms in the size of hollowing defects.

Table 1 .
The steps of Canny algorithm edge detection process.

Table 2 .
Physical property table of actual wall.

Table 2 .
Physical property table of actual wall.

Table 3 .
Shooting conditions and equipment parameters.

Table 3 .
Shooting conditions and equipment parameters.

Table 3 .
Shooting conditions and equipment parameters.

Table 4 .
The comparison of PSNR results of test image filtering (dB).

Table 5 .
The comparison of SSIM results of test image filtering (%).

Table 6 .
Comparison of the sizes and error rates of hollowing defects on a building facade (cm 2 ).

Table 6 .
Comparison of the sizes and error rates of hollowing defects on a building facade (cm 2 ).

Table 6 .
Comparison of the sizes and error rates of hollowing defects on a building facade (cm 2 ).

Table 7 .
The experimental size of hollowing defects processed using different algorithms (cm 2 ).

Table 7 .
The experimental size of hollowing defects processed using different algorithms (cm 2 ).