Highway surface image crack detection program

About the author: High-quality creator in the Java field, CSDN blog expert, CSDN content partner, Nuggets guest author, Alibaba Cloud blog expert, 51CTO guest author, many years of architect design experience, Tencent classroom resident lecturer

Main contents: Java projects, Python projects, front-end projects, artificial intelligence and big data, resume templates, study materials, interview question bank, technical mutual assistance

Collect, like and avoid getting lost. It’s good to follow the author

Get the source code at the end of the article

Project number: BS-AI-002

1. Environment introduction

Locale: Matlab

Algorithm: Neural Network CNN

2. Project Introduction

The rapid development of China’s economy since the reform and opening up has also led to heavy investment in infrastructure construction. The total number of roads nationwide has reached more than 5.5 million kilometers, which is nearly seven times more than the 80,000 kilometers when the People’s Republic of China was founded. Such a large highway mileage also brings maintenance troubles. During the use of the highway, it is subject to repeated wear and tear of vehicles for a long time, as well as the effects of rain soaking, etc., causing the highway to often be damaged. The most common one is the highway. The cracks in the building will become larger and larger due to disrepair. The existing main inspection is still through the traditional manual inspection method, which has low timeliness and high cost, which affects the overall inspection and maintenance process. If a system for automatic detection and identification of pavement cracks can be developed to replace the work of traditional pavement maintenance workers, work efficiency and effectiveness will be greatly improved.

This project uses Matlab to process the crack images of the highway. It mainly goes through several steps: image preprocessing, crack detection, feature segmentation extraction, target recognition and result saving. Through these steps, the detection of highway cracks is completed. and identification, and the detection results are called, processed and displayed through the programmed GUI page. The design process of this experiment is clear, and the processing method is simple and easy to understand. It can be easily expanded to other applications related to crack detection in social life, such as crack detection on building walls, etc., and has certain versatility.

The design of the pavement crack detection and recognition system covers four aspects of research: image preprocessing, image segmentation (binarization), target detection and recognition, and image feature extraction and storage. Among them, image preprocessing is used to process the originally collected color pavement crack images to improve the image quality. Image segmentation converts the pavement crack image into a binary image to facilitate subsequent target detection and recognition operations. Target detection and recognition refers to the automatic identification and detection of crack targets in images. Finally, image feature extraction and storage will extract and save the characteristics of the target after the recognition is completed to provide support for subsequent data analysis and application. Comprehensive research and application in these aspects can effectively improve the accuracy and efficiency of pavement crack detection and identification. The overall design flow chart of the crack detection system developed and designed this time is shown in Figure 2-1.

Figure 2-1 Design flow chart

According to the characteristics of crack images, before target detection and recognition, image preprocessing must be performed on them, which mainly include: histogram equalization enhancement, median filtering denoising, contrast enhancement, binarization processing, binary processing, etc. value image filtering, etc. In binary processing, custom threshold methods and iterative adaptive methods are used; binary image denoising mainly denoises the area of connected areas and removes noise and noise in a small range.

By preprocessing the crack image, a binary image that can highlight the crack object is extracted, and then the crack object is extracted based on the morphological regional features, thereby realizing the detection and identification of the crack object. On this basis, a new crack identification method is proposed.

During the test process, this case designed the GUI based on the above processing flow so that each processing step can clearly display the test results, thereby improving the simplicity of the application.

The detection of pavement cracks is a typical linear object visually, so its enhancement and positioning is also a kind of linear object detection. Compared with conventional linear targets, road cracks have the characteristics of smaller objects, low image contrast, natural discontinuities, bifurcations, noise points, etc., and only appear as linear features as a whole121. Traditional methods based on threshold segmentation, edge detection, wavelet transform, etc. usually assume that pavement cracks are high-contrast and well-continuous throughout the entire image, but this assumption is not applicable to actual engineering. Affected by meteorological conditions, pavement damage, crack deterioration, etc., the contrast between some cracks and the pavement background is very small, making it difficult for conventional crack identification methods to be effective. Therefore, preprocessing is required before crack image processing.

Image preprocessing is a method of preprocessing images, which can be used for image recognition and expression. Due to various reasons, image quality is often degraded when acquiring and transmitting images. For example, in a picture, if you look at it from a subjective visual perspective, you will find that the outline of the picture is too sharp and too abrupt; due to the size, shape and other characteristics of the detected object, its image features are relatively blurry. Positioning is difficult; in terms of image contrast, a certain amount of noise will affect the image; there are some distortions, deformations and other phenomena in the entire image. Therefore, the images to be processed will produce a lot of interference in terms of visual intuition and processing operability. We might as well refer to these interferences as image quality problems. Image preprocessing refers to the use of certain calculation steps to perform appropriate transformations in the process of improving image quality, thereby highlighting some interesting information in the image and eliminating or reducing interfering information, such as image contrast enhancement and image denoising. Or edge extraction and other processing. Usually, the acquisition of crack images is done outdoors, so the acquired images inevitably contain noise, distortion and other factors, which makes it difficult to directly detect and extract crack objects. To this end, this paper first preprocessed the crack images to improve the image quality, and then optimized the test results. Image preprocessing mainly includes grayscale transformation, frequency transformation, histogram transformation, noise removal, sharpening, color transformation, etc. This article will select some of these methods for preprocessing crack images.

Three, system display

During the test process, this case designed the GUI based on the above processing flow so that each processing step can clearly display the test results, thereby improving the simplicity of the application. The software design interface is shown in Figure 4-1. In the control panel on the right, you can access the step-by-step processing results of the main algorithm process step by step. In the display area on the left, you can display the results of image processing, projection curves, etc.

In the preprocessing process, steps such as histogram equalization enhancement, median filtering denoising, and image enhancement (Gamma correction) are relatively simple. The experimental results are shown in Figure 4-2.

The crack identification results are shown in Figure 4-3.

Figure 4-3 Crack identification results

After detecting and locating the crack target, in order to accurately obtain the regional information of the crack, this experiment adopted the classic idea of pixel integral projection to perform integral projection on the horizontal and vertical directions of the crack and draw the projection curve. Then locate the specific area and parameter information of the crack. The specific code is as follows.

function[projectr,projectc]=Project(bw)

projectr=sum(bw,2);

projectc=sum(bw,1);

The crack projection is shown in Figure 4-4.

Figure 4-4 Crack projection

Crack identification and feature extraction are shown in Figure 4-5.

(a) Crack mark image

(b) Crack parameter information

Figure 4-5 Crack identification and feature extraction

Four. Core code display

function Result=Process_Main(I)
ifndims(I)==3
I1=rgb2gray(I);
else
I1=I;
end
I2=hist_con(I1);
I3=med_process(I2);
I4=adjgamma(I3,2);
[bw,th]=IterProcess(I4);
bw=~bw;
bwn1=bw_filter(bw,15);
bwn2=Identify_Object(bwn1);
[projectr,projectc]=Project(bwn2);
[r,c]=size(bwn2);
bwn3=Judge_Crack(bwn2,I4);
bwn4=Bridge_Crack(bwn3);
[flag,rect]=Judge_Direction(bwn4);
if flag==1
str='Transverse crack';
wdmax=max(projectc);
wdmin=min(projectc);
else
str='Longitudinal crack';
wdmax=max(projectr);
wdmin=min(projectr);
end
Result.Image=I1;
Result.hist=I2;
Result.Medfilt=I3;
Result.Enance=I4;
Result.Bw=bw;
Result.BwFilter=bwn1;
Result.CrackRec=bwn2;
Result.Projectr=projectr;
Result.Projectc=projectc;
Result.CrackJudge=bwn3;
Result.CrackBridge=bwn4;
Result.str=str;
Result.rect=rect;
Result.BwEnd=bwn4;
Result.BwArea=bwarea(bwn4);
Result.BwLength=max(rect(3:4));
Result.BwWidthMax=wdmax;
Result.BwWidthMin=wdmin;
Result.BwTh=th;

5. Display of related works

Practical projects based on Java development, Python development, PHP development, C# development and other related languages

Front-end practical projects developed based on Nodejs, Vue and other front-end technologies

Related works based on WeChat applet and Android APP application development

Development and application of embedded Internet of Things based on 51 microcontroller and other embedded devices

AI intelligent applications based on various algorithms

Various data management and recommendation systems based on big data