Detection of Surface Crack in Building Structures Using Image Processing Technique with an Improved Otsu Method for Image Thresholding

. The detection of cracks is a crucial task in monitoring structural health and ensuring structural safety. The manual process of crack detection is painstakingly time-consuming and suﬀers from subjective judgments of inspectors. This study establishes an intelligent model based on image processing techniques for automatic crack recognition and analyses. In the new model, a gray intensity adjustment method, called Min-Max Gray Level Discrimination (M2GLD), is proposed to preprocess the image thresholded by the Otsu method. The goal of this gray intensity adjustment method is to meliorate the accuracy of the crack detection results. Experimental results point out that the integration of M2GLD and the Otsu method, followed by other shape analysis algorithms, can successfully detect crack defects in digital images. Therefore, the constructed model can be a useful tool for building management agencies and construction engineers in the task of structure maintenance.


Introduction
Cracks are of major concern for ensuring the safety, durability, and serviceability of structures [1].e reason is that when cracks are developed and propagate, they tend to cause the reduction in the effective loading area which brings about the increase of stress and subsequently failure of the concrete or other structures [2].Since there always exist constraints in reinforced concrete structures and buildings deteriorate overtime, cracking seems unavoidable and appears in all types of structures, for example, concrete wall, beam, slab, and brick walls (Figure 1).Particularly for concrete elements, cracks create access to harmful and corrosive chemicals to penetrate into the structure, which consequently damage their integrity as well as esthetics [3].
Virtually, for all types of structures, surface cracks are critical indicators of structural damage and durability [4,5].
us, as clearly stated by atoi et al. [6] and Koch et al. [7], it is crucial to visually inspect the building elements to detect cracking and appraise the physical and functional conditions.However, the task of crack detection in building, especially in developing countries, is often carried out manually.Hence, more time and effort is needed to obtain the measurements of cracks and to compile or process relevant data [8].In addition, manual visual inspection is inefficient in terms of both cost and accuracy because it involves the subjective judgments of inspectors.
Accordingly, fast and reliable surface crack detection and analysis by means of automatic procedure is highly useful to replace the slow and subjective inspection of human inspectors [9].Recent reviews done in [7,[9][10][11] pointed out an increasing trend of applying image processing technique for boosting the productivity of detecting crack in structures.
ese works show that assessing the visual condition of vertical and horizontal structural elements become a vital part of civil engineering.e information of crack can be used for diagnosis and to decide the appropriate rehabilitation method to fix the damaged structures and prevent catastrophic failures [12].
Image binarization, which is widely employed for text recognition and medical image processing [13,14], is very suitable to be used for crack detection.It is because texts and cracks have similar properties, and they feature distinguishable lines and curves.Nevertheless, crack detection utilizing the Otsu method [15] as the standard image binarization approach is unsatisfying; the reason is that image binarization depends on the image quality, characteristics of the background surface, and associated parameters [9].Crack detection also suffers from challenges such as low contrast, uneven illumination, noise pollution, and existence of shading, blemishes, or concrete spall in images [11].Better methods for image binarizing-based crack detection are constantly researched in the academic community.
In the present work, an image processing model that automatically detects and analyzes cracks on the surfaces of building elements in the digital image is established.e proposed model does not only automatically recognize crack pixels out of image background but also perform various measurements of crack characteristics including the area, perimeter, width, length, and orientation.At the center of the proposed model, an image enhancement algorithm called Min-Max Gray Level Discrimination (M2GLD) is put forward as a preprocessing step to improve the Otsu binarization approach, followed by shape analyses for meliorating the crack detection performance.e crack detected by the proposed approach was compared with that acquired by the conventional technique.e experimental results show that the crack on various structure surfaces can be accurately recognized and analyzed using the proposed image processing model.e paper is organized as follows: the next section reviews previous works pertinent to the current study; the third section describes the improved Otsu method based on the M2GLD, followed by the proposed image processing model for the detection of surface crack; the model experimental results are reported in the fifth section; and the final section provides some conclusions of the study.

Review of Related Works.
Cracking is an important indication of the degradation of structures.Detection of cracks is often required in the stage of building maintenance.In addition, inspections of the structural integrity based on crack analyses become substantial for the service life prediction of structures [16].Since the manual process for crack measurement is painstakingly time-consuming for largescale structures (e.g., high-rise buildings and bridges), many researchers have proposed models based on image processing, which enable a faster and more efficient way of measuring the cracks in concrete surfaces.
e general framework of these models is shown in Figure 2.
Lee et al. [8] presented an automated technique-based image processing for detecting and analyzing concrete surface cracks; the crack detection is recognized from an image of a concrete surface, and the crack analysis calculates the characteristics of the detected cracks, such as crack width, length, and area.Adhikari et al. [3] developed a model that numerically represents the crack defects; the proposed approach is also capable of crack quantification and detection.Torok et al. [5] proposed an imagebased automated crack detection model for postdisaster building assessment; based on the numerical experiment, the authors show that the proposed method can bring about great benefits in a postdisaster analysis of building elements.
Recently, Alam et al. [17] have proposed a hybrid detection technique by combining the digital image correlation and acoustic emission.Talab et al. [2] detected cracking defects in digital images using the Otsu method and Sobel's filtering in image processing techniques.Ebrahimkhanlou et al. [18] performed a multifractal analysis of crack patterns with applications in reinforced concrete shear walls.Yu et al. [19] introduced an efficient crack detection method for the tunnel lining surface cracks based on infrared images; the proposed method is capable of overcoming challenging issues such as low contrast, uneven illumination, and severe noise pollution that generally exist in a tunnel lining image.
In addition, detecting cracks that appear on the pavement surface is a central task of pavement surveys.It is because if cracks are detected early and rehabilitation is performed duly, the cost for road restoration can be saved up to 80% [20].Accordingly, various image processing models have been constructed to recognize asphalt pavement crack.Road crack detection models that employ image thresholding algorithms have been put forward by Cheng et al. [21], Oliveira and Correia [22], and Ying and Salari [23].Moreover, the models that are based on edge detection algorithms have also been established by many scholars [24][25][26].Nevertheless, the performance of the aforementioned crack detection models are often deteriorated by the complex texture of asphalt pavement and shading conditions of the digital images [23].Hence, more sophisticated approaches including beamlet transform [23] and shadow removal [27] have been used to enhance the crack detection performance.As can be seen from the literature review, there is an increasing trend of applying intelligent image processing model for automatic crack detection and analysis.
It is noted that other available methods for image thresholding such as the Bernsen method [28], Niblack method [29], Sauvola and Pietikäinen method [30], and Wolf method [31] can also be applied for crack detections on building surface.As pointed out by Kim et al. [9], these methods have certain disadvantages.e Bernsen method is found to require much more computational cost than the other methods; it is because this approach needs to compute an additional histogram in deciding threshold values.e Wolf method is observed to be inappropriate for detecting small cracks.
e Niblack method and the Sauvola and Pietikäinen method can detect appropriate solutions; however, their performances are relatively sensitive to the selection of the window size parameter.A method that combines the Sobel and Otsu method has been proposed in [2]; the proposed approach has shown certain improvement in crack detection on concrete surface in comparison with the original Otsu method.However, this hybrid method cannot successfully remove noncrack objects from the digital image.
Due to its simplicity, low computational cost, and thresholding capability, the Otsu method is widely applied in recent works of crack detection [16][17][18][19]32]. e computational e ciency of the Otsu method is due to the fact that the interclass separability is used to calculate the optimal value of threshold of gray intensity.In addition, the minimum error method of the Otsu approach is based on the Bayes classi cation error [33].Because of such limitations of the reviewed methods and the advantages of the Otsu method, Otsu's image thresholding algorithm has been selected to be employed in this study.

Otsu's
Method for Image resholding.Otsu's method [15] is a commonly employed image thresholding technique.
e basic idea of this approach is to separate the pixels within an image into two groups.e separated object is featured by ω 0 and μ 0 which are the ratio of the number of pixels and the average gray level.In a similar manner, the background of the image also has two parameters: ω 1 and μ 1 .Hence, the total mean of gray level of the image is de ned as follows: where t denotes a gray level of the image.e image is optimally binarized if the following optimization function f s (t) is maximized: ( e value of the gray level t op corresponding to the maximal value of f s is selected as the thresholding value for image binarization.In fact, the right-hand side of ( 2) is the interclass variance between the target of object (e.g., the crack pattern) and the background (e.g., the wall surface).If the histogram of the gray level of the image features two separable peaks, the Otsu method can easily locate an optimum value of t op locating between such two peaks.However, in the cases of unimodal and close to unimodal histograms of images, this method may encounter diculties in identifying a satisfying value of t op .
Typically, the task of crack detection in building is subject to variable illuminated conditions, shading conditions, and blemishes.ese facts make the histograms of sample images rarely feature a two-peak pattern.erefore, based on our experiments with sample images, Otsu's method cannot deliver a satisfying image thresholding outcome.e reason is that a considerable amount of background pixels is mistakenly classi ed as crack pixels.Hence, this study puts forward an improved Otsu's method for recognizing and analyzing cracks from building element surfaces.

The Gray Intensity Adjustment Method
Based on Min-Max Gray Level Discrimination Notably, in images acquired by a digital camera, the amount of light in di erent locations of surface structure may vary considerably.erefore, the background brightness of an image is not uniform.Moreover, building surfaces often feature low contrast, uneven illumination, and severe noise disturbance.To correct this phenomenon, it is necessary to carry out a treatment to improve the detection performance of crack.

Advances in Civil Engineering
Due to the speci c characteristic of cracks that consist of distinguishable lines and curves, the gray-scale value of the crack is often a local minimum within an image.In order to separate the pixels of the image into crack and noncrack groups, it is bene cial to devise an approach for better    Advances in Civil Engineering discriminating the two pixel groups of interest.is study puts forward a technique called Min-Max Gray Level Discrimination (M2GLD).M2GLD is used as an image preprocessing step before the Otsu method is applied for image thresholding.
Let I o (m, n) be the gray intensity of pixel at the coordination (m, n) within the original image acquired from the digital camera and this gray intensity of the image is transformed using the following rules: where I A (m, n) denotes the adjusted gray intensity of the pixel at position (m, n), R A is the adjusting ratio, I o max and I o min are the maximum and minimum values of the gray intensity of the original image, and τ represents a margin parameter.e basic idea of the M2GLD is that this method boosts the gray intensity of potential noncrack pixels and concurrently reduces the gray intensity of potential crack pixels.us, after the image enhancement process, the crack pixels appear darker and the noncrack pixels turn out to be lighter.is procedure followed by Otsu's algorithm can signicantly help discriminating crack regions from noncrack regions.An example of image enhancement with the proposed method is shown in Figure 3. Herein, the parameters R A and τ are set to be 1.1 and 0.5, respectively.Observably, the M2GLD helps convert an apparently unimodal image histogram which is very di cult for thresholding to a more separable image histogram.

The Proposed Image Processing Model for the
Detection of Surface Crack is section describes the overall architecture of the proposed image processing model for detecting the surface crack in building structures.After being constructed, the model can be applied to recognize and analyze cracks on surface of various elements in building, for example, concrete beam, slab, oor, wall, and brick wall covered by mortar.e model architecture is shown in Figure 4.It is noted that the model is coded in MATLAB environment.
e original image acquired from the digital camera serves as the mode input.e original image then undergoes  6 Advances in Civil Engineering the image thresholding process via the proposed improved Otsu method.e proposed improved Otsu method consists of the M2GLD which is described in the previous section and the conventional Otsu algorithm.e image binarization process is followed by the image cleaning process within which noisy pixels and noncrack objects are eliminated.
e image cleaning process includes two steps: rst, objects with less than a certain number of pixels (N p ) are cast out, and second, an axis ratio index (ARI), which is de ned as the ratio of the major axis length to the minor axis length of an object, is employed.An object's circumscribed ellipse is constructed for measuring the major axis length and the minor axis length: where L M and L N are the major axis length and the minor axis length, respectively.It is worth noting that ARI tends towards 0 for an extremely elongated object or tends towards 1 for a circular object.Based on numerical tests, a thresholding value of ARI (denoted as ARI T ) for distinguishing cracks from noncrack objects can be empirically found.After all crack pixels have been recognized, the crack analysis process is carried out to compute the crack properties.e crack analysis process consists of two operations: image boundary extraction and image thinning (or skeletonization).e boundary extraction operation relies on edge detection algorithm, and it is used for computing the crack perimeter, area, length, and width.Image thinning [34] is used to calculate the object orientation.
e crack perimeter is computed as the number of pixels on the object boundary.e area of a crack object is simply the total number of pixels located within the object boundary.
e crack orientation calculation can be converted to a simple linear regression problem within which the independent variable is the pixel position along the x-axis and the dependent variable is the pixel position along the y-axis.e orientation of the crack is inferred via the slope of the regression line (Figure 5).e calculation of the crack width is divided into two cases: Case 1 is crack orientation ≤45 °and Case 2 is crack orientation >45 °.Case 1 is for a crack object that resembles a horizontal crack, and Case 2 is for a crack object that tends towards a vertical crack.e formulas for estimating the crack width at section s of the crack object (denoted as W(s)) in the two cases are given as follows:

Advances in Civil Engineering
Case 1: where L v (s) and L h (s) are the number of crack pixels measured in the vertical and horizontal directions at section s and α is the orientation of the crack object.Accordingly, the crack length (L c ) is approximated via the following formula: where Per denotes the crack perimeter and W Avg is the average value of crack widths.

Experimental Results and Comparison
In this section, the proposed model for crack detection is veri ed using ve testing images.e performance of the M2GLD is compared with that of the conventional Otsu method.Based on a trial-and-error process, the tuning parameters of the proposed model are empirically set as follows: (i) e adjusting ratio: R A 2.
(iii) e minimum number of pixels: N p round (0.001 , where I N × I M is the image size.(iv) e threshold value of the axis ratio index: ARI T 3.
e result comparison is reported in Figures 6-10.In all testing images, the crack pixels revealed by the proposed method are much clearer and well separated from the surface structure when compared with the Otsu method.Moreover, the correctness of crack detection is greatly enhanced with the newly constructed model.
In detail, the model using the Otsu method mistakenly identifies a crack object in image no.1; it also fails to detect crack pixels in image nos.3, 4, and 5. On the contrary, the model equipped with the M2GLD has successfully recognized image no. 1 as no crack; it also correctly identifies existing crack pixels in other testing images.Furthermore, the crack objects found by the proposed approach clearly resemble the actual crack patterns in the original images taken by the digital camera.ese facts confirm that the new model is indeed useful for practical applications of crack detection in building structures.In addition, the results of crack analyses are provided in Table 1.It is noted that, in Table 1, crack properties are measured in terms of number of pixels.

Conclusion
is study constructed an image processing model for detecting crack defects on the surface of building structures.Since the digital images taken for crack analysis feature various difficulties (e.g., low contrast, uneven illumination, and noise pollution) for the image analyzing process, crack detection relying on the standard Otsu method cannot deliver satisfactory outcomes.e new model employs an image enhancement algorithm called Min-Max Gray Level Discrimination (M2GLD) for improving the Otsu method.
e newly constructed model is capable of identifying crack objects and analyzing their characteristics including the area, perimeter, width, length, and orientation.e experimental results confirm that the cracks in testing images have been accurately identified.e M2GLD indeed can improve the performance of the Otsu method.e M2GLD method followed by the Otsu method described in the current work can be easily integrated into many crack detections and categorization models developed in the future.e first reason is that the proposed approach is relatively straightforward.e second reason is that the method, as demonstrated in the experimental results, is capable of delivering accurate crack detection performance.Since the crack objects are successfully separated from the background, further analyses on these detected cracks are more reliable.erefore, the model can potentially be applied for crack detection and appraisal by the building maintenance agency.
A limitation of the current approach is that the users have to fine-tune two parameters: adjusting ratio (R A ) and margin parameter (τ).By using the experiment, it is found that R A � 2 and τ � 0.5 can deliver satisfactory performance on crack detection on building surface.However, with a different type of image such as asphalt pavement, these two values should be adjusted adaptively.As illustrated in Figure 10, which describes testing image no. 5, another shortcoming of the current method is that it may fail to detect some comparatively thin crack objects.erefore, the future research directions may include the application of optimization methods (e.g., metaheuristic) to automatically identify the appropriate value of R A and τ.In addition, the integration of sophisticated image filtering and processing methods into the current model to enhance the capability of the model in detecting thin crack objects is also worth investigating.

Figure 2 :
Figure 2: General structure of an image processing-based crack detection model.

Figure 3 :
Figure 3: Illustrations of image enhancement using the proposed M2GLD approach: (a) original image and (b) the histogram of the original image; (c) enhanced image and (d) the histogram of the enhanced image.

Figure 7 :
Figure 7: Testing image no. 2 using (a) the Otsu method and (b) the M2GLD method.

Figure 9 :
Figure 9: Testing image no. 4 using (a) the Otsu method and (b) the M2GLD method.

Figure 10 :
Figure 10: Testing image no. 5 using (a) the Otsu method and (b) the M2GLD method.

Table 1 :
Results of crack analysis.