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

Authors: Nhat-Duc Hoang
Journal: Advances in Civil Engineering
 (2018)

---

## Abstract

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 suffers 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.


---

## Body

## 1. Introduction

Cracks are of major concern for ensuring the safety, durability, and serviceability of structures [1]. The 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].Figure 1
Cracks in building structures: (a) concrete wall, (b) concrete beam, and (c) brick wall with mortar surface.
(a)
(b)
(c)Virtually, for all types of structures, surface cracks are critical indicators of structural damage and durability [4, 5]. Thus, as clearly stated by Thatoi 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–11] pointed out an increasing trend of applying image processing technique for boosting the productivity of detecting crack in structures. These works show that assessing the visual condition of vertical and horizontal structural elements become a vital part of civil engineering. The 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. The 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. The crack detected by the proposed approach was compared with that acquired by the conventional technique. The experimental results show that the crack on various structure surfaces can be accurately recognized and analyzed using the proposed image processing model. The 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.


## 2. Literature Review

### 2.1. 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 large-scale 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. The general framework of these models is shown in Figure 2.Figure 2
General structure of an image processing-based crack detection model.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 image-based 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–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. The 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. The Wolf method is observed to be inappropriate for detecting small cracks. The 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–19, 32]. The computational efficiency 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 classification 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.


### 2.2. Otsu’s Method for Image Thresholding

Otsu’s method [15] is a commonly employed image thresholding technique. The basic idea of this approach is to separate the pixels within an image into two groups. The 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 defined as follows:(1)μ=ω0tμ0t+ω1tμ1t,where t denotes a gray level of the image.The image is optimally binarized if the following optimization functionfst is maximized:(2)Argmaxtfst=ω0tμ0t−μ2+ω1tμ1t−μ2.The value of the gray leveltop corresponding to the maximal value of fs 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 top locating between such two peaks. However, in the cases of unimodal and close to unimodal histograms of images, this method may encounter difficulties in identifying a satisfying value of top.Typically, the task of crack detection in building is subject to variable illuminated conditions, shading conditions, and blemishes. These facts make the histograms of sample images rarely feature a two-peak pattern. Therefore, based on our experiments with sample images, Otsu’s method cannot deliver a satisfying image thresholding outcome. The reason is that a considerable amount of background pixels is mistakenly classified as crack pixels. Hence, this study puts forward an improved Otsu’s method for recognizing and analyzing cracks from building element surfaces.


## 2.1. 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 large-scale 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. The general framework of these models is shown in Figure 2.Figure 2
General structure of an image processing-based crack detection model.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 image-based 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–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. The 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. The Wolf method is observed to be inappropriate for detecting small cracks. The 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–19, 32]. The computational efficiency 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 classification 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.


## 2.2. Otsu’s Method for Image Thresholding

Otsu’s method [15] is a commonly employed image thresholding technique. The basic idea of this approach is to separate the pixels within an image into two groups. The 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 defined as follows:(1)μ=ω0tμ0t+ω1tμ1t,where t denotes a gray level of the image.The image is optimally binarized if the following optimization functionfst is maximized:(2)Argmaxtfst=ω0tμ0t−μ2+ω1tμ1t−μ2.The value of the gray leveltop corresponding to the maximal value of fs 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 top locating between such two peaks. However, in the cases of unimodal and close to unimodal histograms of images, this method may encounter difficulties in identifying a satisfying value of top.Typically, the task of crack detection in building is subject to variable illuminated conditions, shading conditions, and blemishes. These facts make the histograms of sample images rarely feature a two-peak pattern. Therefore, based on our experiments with sample images, Otsu’s method cannot deliver a satisfying image thresholding outcome. The reason is that a considerable amount of background pixels is mistakenly classified as crack pixels. Hence, this study puts forward an improved Otsu’s method for recognizing and analyzing cracks from building element surfaces.


## 3. 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 different locations of surface structure may vary considerably. Therefore, 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.Due to the specific 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 beneficial to devise an approach for better discriminating the two pixel groups of interest. This 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.LetIom,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:(3)IAm,n=minIo_max,Iom,n⋅RAifIom,n>Io_min+τ⋅Io_max−Io_min,IAm,n=maxIo_min,Iom,n⋅RA−1ifIom,n≤Io_min+τ⋅Io_max−Io_min,where IAm,n denotes the adjusted gray intensity of the pixel at position m,n, RA is the adjusting ratio, Io_max and Io_min are the maximum and minimum values of the gray intensity of the original image, and τ represents a margin parameter.The 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. Thus, after the image enhancement process, the crack pixels appear darker and the noncrack pixels turn out to be lighter. This procedure followed by Otsu’s algorithm can significantly help discriminating crack regions from noncrack regions. An example of image enhancement with the proposed method is shown in Figure3. Herein, the parameters RA and τ are set to be 1.1 and 0.5, respectively. Observably, the M2GLD helps convert an apparently unimodal image histogram which is very difficult for thresholding to a more separable image histogram.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.
(a)
(b)
(c)
(d)


## 4. The Proposed Image Processing Model for the Detection of Surface Crack

This 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, floor, wall, and brick wall covered by mortar. The model architecture is shown in Figure4. It is noted that the model is coded in MATLAB environment.Figure 4
The proposed crack detection model.The original image acquired from the digital camera serves as the mode input. The original image then undergoes the image thresholding process via the proposed improved Otsu method. The proposed improved Otsu method consists of the M2GLD which is described in the previous section and the conventional Otsu algorithm. The image binarization process is followed by the image cleaning process within which noisy pixels and noncrack objects are eliminated.The image cleaning process includes two steps: first, objects with less than a certain number of pixels (Np) are cast out, and second, an axis ratio index (ARI), which is defined 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:(4)ARI=LMLN,where LM and LN are the major axis length and the minor axis length, respectively.It is worth noting thatARI 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 ARIT) 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. The crack analysis process consists of two operations: image boundary extraction and image thinning (or skeletonization). The 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.The crack perimeter is computed as the number of pixels on the object boundary. The area of a crack object is simply the total number of pixels located within the object boundary. The crack orientation calculation can be converted to a simple linear regression problem within which the independent variable is the pixel position along thex-axis and the dependent variable is the pixel position along the y-axis. The orientation of the crack is inferred via the slope of the regression line (Figure 5).Figure 5
Determination of crack orientation.The 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. The formulas for estimating the crack width at sections of the crack object (denoted as Ws) in the two cases are given as follows:(5)Case1:Ws=Lvs⋅sin90−α,Case2:Ws=Lhs⋅sinα,where Lvs and Lhs 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 (Lc) is approximated via the following formula:(6)Lc=Per−2⋅WAvg2,where Per denotes the crack perimeter and WAvg is the average value of crack widths.


## 5. Experimental Results and Comparison

In this section, the proposed model for crack detection is verified using five testing images. The 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)
The adjusting ratio:RA=2.(ii)
The margin parameter:τ=0.5.(iii)
The minimum number of pixels:Np = round (0.001 IN × IM), where IN × IM is the image size.(iv)
The threshold value of the axis ratio index:ARIT=3.The result comparison is reported in Figures6–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.Figure 6
Testing image no. 1 using (a) the Otsu method and (b) the M2GLD method.
(a)
(b)Figure 7
Testing image no. 2 using (a) the Otsu method and (b) the M2GLD method.
(a)
(b)Figure 8
Testing image no. 3 using (a) the Otsu method and (b) the M2GLD method.
(a)
(b)Figure 9
Testing image no. 4 using (a) the Otsu method and (b) the M2GLD method.
(a)
(b)Figure 10
Testing image no. 5 using (a) the Otsu method and (b) the M2GLD method.
(a)
(b)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. These 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 Table1. It is noted that, in Table 1, crack properties are measured in terms of number of pixels.Table 1
Results of crack analysis.
Testing image
Crack objects
Area
Orientation
Mean crack width
Maximum crack width
Perimeter
Length
1
—
—
—
—
—
—
—
2
1
2441
−17.36
3.24
6.32
750.74
372.13
3
1
2238
−89.58
4.27
9.99
1250.00
620.88
4
1
1738
−14.57
0.18
0.45
879.35
439.50
5
1
97
86.15
1.36
1.94
140.94
69.11
2
194
85.42
0.88
1.12
250.77
124.50


## 6. Conclusion

This 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. The new model employs an image enhancement algorithm called Min-Max Gray Level Discrimination (M2GLD) for improving the Otsu method. The newly constructed model is capable of identifying crack objects and analyzing their characteristics including the area, perimeter, width, length, and orientation. The experimental results confirm that the cracks in testing images have been accurately identified. The M2GLD indeed can improve the performance of the Otsu method.The 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. The first reason is that the proposed approach is relatively straightforward. The 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. Therefore, 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 (RA) and margin parameter (τ). By using the experiment, it is found that RA=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. Therefore, the future research directions may include the application of optimization methods (e.g., metaheuristic) to automatically identify the appropriate value of RA 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.



---

*Source: 3924120-2018-04-02.xml*