Automatic tunnel surface crack image detection method, device and equipment and storage medium

By performing image preprocessing, edge extraction and crack refinement on tunnel surface images, the problems of noise, low contrast and uneven light are solved, and the accuracy of crack detection is significantly improved.

CN119624866APending Publication Date: 2025-03-14SHUOHUANG RAILWAY DEV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411593396.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The tunnel surface images have problems with noise, low contrast and uneven light, resulting in low accuracy in crack detection.

Method used

An automatic detection method for crack images on the tunnel surface is adopted, including image preprocessing, edge extraction and crack refinement treatment. Image preprocessing includes grayscale processing, filtering processing, local image histogram stretching processing and binarization processing. In the filtering processing, it determines whether the image contains salt and pepper noise. If there is, median filtering and bilateral filtering are performed. If there is no, only bilateral filtering is performed.

Benefits of technology

It effectively improves the noise elimination effect in tunnel surface images, improves the accuracy of crack detection, and weakens the impact of uneven light.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119624866A_ABST
    Figure CN119624866A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the field of image detection, and discloses a tunnel surface crack image automatic detection method, device and equipment and a storage medium, and the method comprises the steps: carrying out the image preprocessing of a tunnel surface image, and obtaining a binary image, the image preprocessing comprises the filtering processing, the local image histogram stretching processing and the binary processing, the filtering processing comprises the steps of judging whether the image contains salt-and-pepper noise or not, and if the image contains the salt-and-pepper noise, sequentially performing median filtering processing and bilateral filtering processing on the image; removing residual noise in the binarized image to obtain a crack image by analyzing crack characteristics of a connected region in the binarized image; and carrying out crack refining processing on the crack image to obtain a crack skeleton image. According to the tunnel surface crack image automatic detection method disclosed by the invention, the problem that the accuracy of crack detection is influenced by noise existing in the tunnel surface image is solved, and the effect of eliminating the noise existing in the tunnel surface image can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of image detection, and in particular to a method, device, equipment and storage medium for automatic detection of tunnel surface crack images. Background Art

[0002] In the field of urban rail transit, tunnel crack disease detection is one of the important tasks of periodic inspection of railway tunnels. At present, the main methods of tunnel crack disease detection are ultrasonic detection, impact elastic wave detection, acoustic emission detection, optical fiber sensing detection and image processing detection. Among them, the image processing detection method has the advantages of non-contact, high efficiency, convenience and intuitiveness.

[0003] Since tunnel crack images generally have problems such as low contrast, uneven illumination, and severe noise pollution, the use of traditional image processing algorithms to detect tunnel cracks has the following problems, resulting in large errors in the detection results:

[0004] (1) The texture of tunnel surface images is complex, and there are a large number of noises of different types, shapes, and irregular distribution. These noises seriously affect the accuracy of crack detection, and traditional filtering algorithms cannot effectively filter out various noises.

[0005] (2) Tunnels are prone to insufficient lighting and shadows, which can lead to uneven brightness of the tunnel surface image and increase the error of crack detection results. Summary of the invention

[0006] The purpose of the present invention is to at least provide a method, device, equipment and storage medium for automatic detection of tunnel surface crack images, which can at least solve the problem that the noise in the tunnel surface image affects the accuracy of crack detection, and at least effectively improve the effect of eliminating the noise in the tunnel surface image.

[0007] In a first aspect, the present application provides a method for automatic detection of crack images on a tunnel surface, comprising: acquiring a tunnel surface image; performing image preprocessing on the tunnel surface image to obtain a binary image, wherein the image preprocessing comprises grayscale processing, filtering processing, local image histogram stretching processing and binarization processing, wherein the filtering processing comprises determining whether the image contains salt and pepper noise, and if the image contains salt and pepper noise, performing median filtering processing and bilateral filtering processing on the image in sequence, and if the image does not contain salt and pepper noise, performing bilateral filtering processing on the image; obtaining a crack image by removing residual noise in the binary image by analyzing crack features of connected areas in the binary image; and performing crack refinement processing on the crack image to obtain a crack skeleton image.

[0008] In some optional embodiments, the image preprocessing further includes performing light uniformity processing on the grayscale processed image, which can make the overall grayscale distribution of the image balanced, eliminate the dark corner phenomenon, effectively suppress the problem of uneven image illumination, and enhance the crack details.

[0009] In some optional embodiments, the local image histogram stretching process includes: performing block processing on the image to obtain multiple local area block images of the image; performing histogram contrast stretching processing on each local area block image; and merging the local area block images after the histogram contrast stretching process. After the block processing, the histogram contrast stretching process is performed on each local area block image, which can balance the light intensity of each local area block image to improve the grayscale balance of the local area block image and can better reduce the impact of uneven lighting; finally, the local area block images after the histogram contrast stretching process are merged to form an overall image to maintain the continuity of the tunnel texture and ensure the integrity of crack detection.

[0010] In some optional embodiments, the binarization process includes: using the Sobel operator to perform edge detection on the image; using the OTSU algorithm to perform threshold segmentation on the image after edge detection to obtain a binary image. By using the Sobel operator to resist certain noise interference, after finding the most suitable threshold from eight directions, and then using the OTSU algorithm to perform threshold segmentation, the accuracy of threshold segmentation can be greatly improved.

[0011] In some optional embodiments, the crack features include crack width, crack length, crack area, crack perimeter, rectangularity of the largest connected region, and perimeter ratio of the largest connected region, Hu first invariant moment, and Hu second invariant moment, so that residual noise in the connected region can be filtered out more accurately.

[0012] In some optional embodiments, after the binary image is obtained, the image preprocessing further includes at least one of edge detection processing, corrosion processing, expansion processing, and grayscale inversion processing, which can further improve the quality of the binary image.

[0013] In some optional embodiments, after filtering, a first erosion process is performed before local image histogram stretching; after binarization, a second erosion process and edge detection process are performed. By retaining more crack textures through erosion, edge detection is performed on the binarized image, and the quality of the binarized image can be improved.

[0014] In the second aspect, the present application provides an automatic detection device for tunnel surface crack images, including: an acquisition module for acquiring a tunnel surface image; a first processing module for performing image preprocessing on the tunnel surface image to obtain a binary image, wherein the image preprocessing includes grayscale processing, filtering processing, local image histogram stretching processing and binarization processing, wherein the filtering processing includes determining whether the image contains salt and pepper noise, and if the image contains salt and pepper noise, performing median filtering processing and bilateral filtering processing on the image in sequence, and if the image does not contain salt and pepper noise, performing bilateral filtering processing on the image; a second processing module for removing residual noise in the binary image by analyzing crack features of connected areas in the binary image to obtain a crack image; a third processing module for performing crack refinement processing on the crack image to obtain a crack skeleton image.

[0015] In a third aspect, the present application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned tunnel surface crack image automatic detection method.

[0016] At least one embodiment of the present application further provides a computer-readable storage medium storing a computer program, which implements the above-mentioned tunnel surface crack image automatic detection method when executed by a processor.

[0017] The embodiments of the present application provide a method, device, equipment and storage medium for automatic detection of crack images on the tunnel surface. The method obtains a tunnel surface image, performs image preprocessing such as grayscale processing, filtering processing and binarization processing on the tunnel surface image, performs edge extraction processing on the binarized image to obtain a connected area in the binarized image, and finally performs crack refinement processing on the crack image to obtain a crack skeleton image. The filtering processing includes determining whether the image contains salt and pepper noise. If the image contains salt and pepper noise, the image is sequentially subjected to median filtering processing and bilateral filtering processing. If the image does not contain salt and pepper noise, the image is subjected to bilateral filtering processing, which can effectively improve the effect of eliminating salt and pepper noise and Gaussian noise in the tunnel surface image. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] One or more embodiments are exemplarily described by the pictures in the corresponding drawings, and these exemplary descriptions do not constitute limitations on the embodiments.

[0019] Figure 1 is a flow chart of a method for automatically detecting cracks on a tunnel surface provided by an embodiment of the present application;

[0020] Figure 2is a flow chart of a method for automatically detecting crack images on a tunnel surface provided by an embodiment of the present application;

[0021] Figure 3 is a flow chart of a method for automatically detecting cracks on a tunnel surface provided by an embodiment of the present application;

[0022] Figure 4 (a) is a result diagram of a transverse crack image after binarization processing provided by an embodiment of the present application; Figure 4 (b) is a result diagram of a longitudinal crack image after binarization processing provided by an embodiment of the present application;

[0023] Figure 5 is a flow chart of a method for automatically detecting cracks on a tunnel surface provided by another embodiment of the present application;

[0024] Figure 6 (a) is a result diagram of a transverse crack image after expansion processing provided by an embodiment of the present application, Figure 6 (c) is a result diagram of a longitudinal crack image after expansion processing provided by an embodiment of the present application; Figure 6 (b) is a result diagram of a transverse crack image after corrosion treatment provided by an embodiment of the present application; Figure 6 (d) is a result diagram of a longitudinal crack image after corrosion treatment provided by an embodiment of the present application;

[0025] Figure 7 is a flow chart of a method for automatically detecting cracks on a tunnel surface provided by another embodiment of the present application;

[0026] Figure 8 (a) is a result diagram of a binary image of a transverse crack after edge detection provided by an embodiment of the present application; Figure 8 (b) is a result diagram of a binary image of a longitudinal crack after edge detection provided by an embodiment of the present application;

[0027] Fig. 9 is a flow chart of a method for automatically detecting cracks on a tunnel surface provided by another embodiment of the present application;

[0028] Fig.10 (a) is a crack image of a transverse complex crack after connected area filtering provided by an embodiment of the present application; Fig.10 (b) is a crack image of a longitudinal crack after connected area filtering provided by an embodiment of the present application;

[0029] Fig.11 (a) is an original image of a longitudinal crack provided by an embodiment of the present application, Fig.11 (b) Fig.11(a) A longitudinal crack skeleton image obtained by the method of the present invention;

[0030] Fig.12 (a) is an original image of a transverse complex crack provided by an embodiment of the present application, Fig.12 (b) Fig.12 (a) Transverse complex crack skeleton image obtained by processing the method of the present invention;

[0031] Fig.13 (a) is an original image of a transverse complex crack provided by an embodiment of the present application, Fig.13 (b) Fig.13 (a) Transverse complex crack skeleton image obtained by processing the method of the present invention;

[0032] Fig.14 is a schematic diagram of an automatic detection device for crack images on a tunnel surface provided by another embodiment of the present application;

[0033] Fig.15 It is a schematic diagram of the application of the tunnel surface crack image automatic detection device provided by another embodiment of the present application. DETAILED DESCRIPTION

[0034] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not be construed as any limitation, and the various embodiments can be combined and referenced with each other under the premise of no contradiction.

[0035] In order to facilitate understanding of the embodiments of the present application, relevant content about crack image processing is first introduced here.

[0036] Nowadays, many systems use machine learning, neural network and other algorithms to extract and identify cracks for crack image processing, but such algorithms have great disadvantages. First, a large amount of data sets are needed to train the algorithm. The richer the data set and the larger the amount of data, the more accurate the crack extraction result will be. However, this will undoubtedly greatly increase the pressure on computer hardware, and the improvement of accuracy will also bring about a substantial increase in costs. Secondly, even if the cracks are extracted by neural network algorithms, machine learning and other methods, morphological processing is still required to obtain information such as crack skeletons. The equipment needs to take a large number of photos first and then consume a lot of time to identify cracks on several terabytes (T) or tens of T of pictures, obtain the crack images therein, and then extract information such as crack skeletons. Finally, the hazards of cracks can be evaluated and analyzed, which will undoubtedly increase a lot of time costs. Considering this, the present invention still uses morphological pixel-level image processing, which can realize the extraction of information such as crack skeletons while collecting, with fewer pictures and a small amount of data, and does not need to perform a large amount of sample annotation work. The hardware requirements are low, which can greatly reduce costs. When the collection is completed, the extraction of the crack skeleton is completed and can be immediately sent to the analysis center for hazard assessment, which greatly saves time costs.

[0037] In order to solve the above-mentioned technical problem that the accuracy of crack detection is affected by the noise in the tunnel surface image, the present invention proposes an automatic detection method for tunnel surface crack images. The implementation details of the automatic detection method for tunnel surface crack images of this embodiment are specifically described below. The following content is only the implementation details provided for the convenience of understanding and is not necessary for the implementation of this solution.

[0038] Embodiment 1:

[0039] The tunnel surface crack image automatic detection method of this embodiment can be applied to electronic devices with communication, computing and data storage capabilities. The specific process can be as follows: Figure 1 , Figure 2 As shown, including:

[0040] Step S1, obtaining a tunnel surface image, which may be obtained by a camera, a scanner or other image acquisition equipment.

[0041] Step S2, performing image preprocessing on the tunnel surface image to obtain a binary image. Image preprocessing includes grayscale processing, filtering processing, local image histogram stretching processing and binary processing.

[0042] Specifically, noise is generally dominated by Gaussian noise and salt and pepper noise. The most commonly used noise processing methods include mean filtering, median filtering, etc., but usually some details are lost while filtering out noise. Bilateral filtering has a dual filtering effect, which can better maintain the edge on the basis of filtering Gaussian noise. Bilateral filtering contains two Gaussian filter functions. Unlike the fixed filter kernel used by mean filtering and median filtering, the filter kernel of bilateral filtering adopts different filtering methods for different areas based on the neighborhood distance between pixels, the similarity of gray levels between pixels, and the nonlinear combination of the two, to ensure that only pixels with similar gray levels in the neighborhood can be weighted averaged together. Bilateral filtering has a good effect on filtering Gaussian noise, but a poor effect on filtering salt and pepper noise. Based on this, the present invention improves the filtering process: first, it is determined whether the image contains salt and pepper noise. If the image contains salt and pepper noise, the image is first subjected to median filtering to filter out the salt and pepper noise in the image, and then the image is subjected to bilateral filtering to filter out the Gaussian noise in the image; if the image does not contain salt and pepper noise, the image is directly subjected to bilateral filtering to filter out the Gaussian noise in the image. The improved filtering method can effectively filter out both salt and pepper noise and Gaussian noise in the image.

[0043] In practical engineering applications, due to the limitations of shooting conditions, tunnel crack images have problems such as low contrast and uneven illumination, which greatly affects the accuracy of tunnel crack detection. Figure 3 As shown, the process of image preprocessing of the tunnel surface image of the present invention includes: firstly, grayscale processing is performed on the tunnel surface image to remove unnecessary color information and reduce the amount of data calculation. Then, filtering processing is performed to filter out the interference of salt and pepper noise and Gaussian noise in the image; and local image histogram stretching processing is performed again to improve the grayscale balance of the local image. Finally, binarization processing is performed to retain more crack textures to obtain a binarized image.

[0044] In some examples, the local image histogram stretching processing includes: first, dividing the image into blocks to obtain multiple local area block images of the image; then performing a histogram contrast stretching processing on each local area block image, which can balance the light intensity of each local area block image to improve the grayscale balance of the local area block image and better reduce the impact of uneven lighting; finally, the local area block images after the histogram contrast stretching processing are merged to form an overall image to maintain the continuity of the tunnel texture and ensure the integrity of crack detection.

[0045] In some examples, the binarization process uses a threshold segmentation method, which has a fast budget speed, small memory usage, and good stability, but cannot adapt to complex environments. The Sobel operator has a good ability to suppress noise, so the present invention combines the Sobel operator and the OTSU algorithm to perform binarization on the image to obtain a binary image.

[0046] Specifically, first use the Sobel operator to perform edge detection on the image: let the original image be f(x,y), the output image be g(x,y), h(x,y) be a 5*5 window, and the eight directions of Sobel be sk(k=0-7). Convolve h(x,y) with sk, remove the absolute value and put the result into sk, then find the maximum value of sk, and finally, use the maximum value as the output of g(x,y) at the pixel point. Then use the OTSU algorithm to perform threshold segmentation on the image after edge detection to obtain a binary image with a complete crack area and less noise. Among them, the OTSU method for threshold segmentation includes: calculating the gray value of each pixel in the image, and then calculating the gray histogram of the image; then calculating the inter-class variance corresponding to each possible threshold, and finally selecting the threshold that maximizes the inter-class variance for image segmentation. The binarization processing result is as follows: Figure 4 As shown, Figure 4 (a) is the result of the transverse crack image after binarization processing; Figure 4 (b) is the result of the longitudinal crack image after binarization. This method can well segment the crack from the background, so as to facilitate the next step of feature extraction and improve the accuracy of image processing.

[0047] In some embodiments, Figure 5 As shown, the image preprocessing also includes performing light homogenization processing on the image after grayscale processing.

[0048] Specifically, insufficient lighting and shadows are common in tunnels, which results in uneven brightness of tunnel surface images and increases the error of crack detection results. Therefore, in the image preprocessing stage, the image is homogenized to balance the overall grayscale distribution of the image and eliminate the dark corner phenomenon, effectively suppressing the problem of uneven image lighting and enhancing the crack details.

[0049] The mask light-dodging algorithm is used for light-dodging processing. The mask light-dodging algorithm is proposed based on the traditional optical photo printing technology and is used for pictures with uneven brightness due to exposure and other reasons. The mask light-dodging algorithm is as follows:

[0050] f(x,y)=r(x,y)+g(x,y)

[0051] Among them, f(x, y) is the original image affected by uneven illumination; r(x, y) is the image after uniform illumination; g(x, y) is the background image reflecting the brightness distribution.

[0052] From the above, we can see that the original image is used to obtain the uniform light image, and then the difference is used to uniform light, as shown in the following formula:

[0053] r(x,y)=f(x,y)-g(x,y)=offset

[0054] Wherein, offset is the compensation value used to ensure the normal grayscale of the image after uniform illumination, which is mainly the result of low-pass filtering of the background image.

[0055] In some embodiments, after the binary image is obtained, the image preprocessing further includes at least one of edge detection processing, corrosion processing, expansion processing, and grayscale inversion processing.

[0056] Specifically, erosion is the process of finding the local minimum. Image A is convolved with convolution kernel B, the minimum value of the pixels in the area covered by convolution kernel B is calculated, and this minimum value is assigned to the pixel specified by the reference point. Dilation is the opposite of erosion. It is the process of finding the local maximum. Image A is convolved with convolution kernel B, the maximum value of the pixels in the area covered by convolution kernel B is calculated, and this maximum value is assigned to the pixel specified by the reference point. The result of dilation is shown in Figure 1. Figure 6 (a) and Figure 6 (b), where Figure 6 (a) is the result of the transverse crack image after expansion processing. Figure 6 (c) is the result of the longitudinal crack image after expansion processing. Figure 6 (b) and Figure 6 (d), where Figure 6 (b) is the result of the transverse crack image after corrosion treatment; Figure 6 (d) is the result of the longitudinal crack image after corrosion treatment.

[0057] In some examples, a first erosion process is performed after the filtering process and before the local image histogram stretching process; a second erosion process and an edge detection process are performed after the binarization process.

[0058] like Figure 7As shown in the figure, the process of image preprocessing for the tunnel surface image includes: firstly, grayscale processing is performed on the tunnel surface image to remove unnecessary color information and reduce the amount of data calculation. Then, uniform light processing is performed to uniformize the illumination in the image. Then, filtering processing is performed to filter out the interference of salt and pepper noise and Gaussian noise in the image. Then, the first corrosion processing is performed. Then, the local image histogram stretching processing is performed to improve the grayscale balance of the local image. Then, binarization processing is performed to obtain a binarized image; then, the binarized image is subjected to a second corrosion processing to retain more crack textures. Then, edge detection is performed on the binarized image to improve the quality of the binarized image.

[0059] Among them, the Canny operator is used to perform edge detection on the binary image. The result of edge detection is as follows Figure 8 (a) and Figure 8 (b), where Figure 8 (a) is the result of edge detection of the binary image of the transverse crack; Figure 8 (b) is the result of edge detection of the binary image of the longitudinal crack. The Canny operator used in the present invention designs the convolution array shown in the following formula.

[0060]

[0061] Among them, G x is the gradient value calculated according to the convolution parameters in the x direction of the image, G y It is the gradient value calculated according to the convolution parameters in the y direction of the image.

[0062] The gradient magnitude and gradient direction angle θ are calculated using the following equations.

[0063]

[0064] Among them, G is the gradient amplitude; θ is the gradient direction angle.

[0065] Step S3, by analyzing the crack features of the connected areas in the binary image, removing the residual noise in the binary image, and obtaining a crack image.

[0066] Specifically, the biggest feature of a crack image is that there is a section or extreme unbroken pixel connected area. Fig. 9 As shown, based on the crack features of the connected areas in the binary image, the noise in the connected areas is filtered out, and it is determined whether the noise in the connected areas is filtered out. If it is still not filtered out, the threshold is adjusted, and the noise in the connected areas is filtered out again based on the crack features of the connected areas in the binary image until the noise in the connected areas is filtered out, thereby ending the filtering of the connected areas.

[0067] In some examples, crack characteristics include crack width, crack length, crack area, crack perimeter, maximum connected region rectangularity, and maximum connected region perimeter ratio, Hu first invariant moment, and Hu second invariant moment.

[0068] Specifically, crack characteristic parameters can reflect the shape, trend and distribution of cracks, and are important information for distinguishing different cracks. Common crack characteristic parameters include crack width, crack length, crack area and crack perimeter, but these crack characteristic parameters may change with the size of the acquired image, resulting in large errors in subsequent crack identification. In order to highlight the shape characteristics of the crack itself, the present invention adds the following crack characteristic parameters: (1) Rectangularity of the maximum connected area. Generally speaking, the value of this characteristic parameter of non-cracks is larger than that of cracks, so whether there is a crack can be judged by the size of the rectangularity. (2) Perimeter ratio of the maximum connected area. Generally speaking, the perimeter ratio of the crack area is smaller than that of the non-crack area, but at certain special angles, the conclusion presented is the opposite, so in the present invention, other crack characteristic parameters are also combined to jointly identify cracks. (3) Hu first invariant moment and Hu second invariant moment. Hu invariant moment can reflect the distribution of random variables, and images can also be reflected by probability density functions. Considering this, the present invention selects Hu invariant moment as crack characteristic parameter. There are seven Hu invariant moments. The first two are second-order moments, which are better for crack identification. The last five are third-order moments, which are suitable for small changes but not for crack identification. Therefore, the present invention uses the first Hu invariant moment and the second Hu invariant moment as crack characteristic parameters. The crack image obtained is as follows: Fig.10 (a) and Fig.10 (b), where Fig.10 (a) is the crack image of the transverse complex crack after filtering through the connected area; Fig.10 (b) is the crack image of the longitudinal crack after connected area filtering.

[0069] Step S4, performing crack thinning processing on the crack image to obtain a crack skeleton image. Fig.11 , Fig.12 and Fig.13 As shown, Fig.11 (a) is the original image of the longitudinal crack. Fig.11 (b) Fig.11 (a) A longitudinal crack skeleton image obtained by the method of the present invention; Fig.12 (a) is the original image of the transverse complex crack. Fig.12 (b) Fig.12 (a) Transverse complex crack skeleton image obtained by processing the method of the present invention. Fig.13 (a) is the original image of the transverse complex crack. Fig.13 (b) Fig.13(a) Transverse complex crack skeleton image obtained by processing the method of the present invention.

[0070] Specifically, crack thinning is to convert the crack lines in the crack image into lines with a single pixel width through a series of algorithms. The main purpose of crack thinning is to reduce the redundant pixels in the image, making the shape of the crack more concise and convenient for subsequent measurement and analysis. The crack skeleton image after thinning can more accurately reflect the actual shape and size of the crack. Based on the obtained crack skeleton image, crack pixel points can be extracted and annotated.

[0071] In this embodiment, a tunnel surface image is acquired, and then grayscale processing, filtering processing, binarization processing and other image preprocessing are performed on the tunnel surface image, and then edge extraction processing is performed on the binary image to obtain a connected area in the binary image, and finally crack refinement processing is performed on the crack image to obtain a crack skeleton image; wherein, the filtering processing includes determining whether the image contains salt and pepper noise, if the image contains salt and pepper noise, median filtering processing and bilateral filtering processing are performed on the image in sequence, and if the image does not contain salt and pepper noise, bilateral filtering processing is performed on the image, which can effectively improve the effect of eliminating salt and pepper noise and Gaussian noise in the tunnel surface image.

[0072] Embodiment 2:

[0073] Another embodiment of the present application relates to an automatic detection device for crack images on the surface of a tunnel. The implementation details of the automatic detection device for crack images on the surface of a tunnel of this embodiment are described in detail below. The following content is only provided for the convenience of understanding the implementation details and is not necessary for the implementation of this solution. The schematic diagram of the automatic detection device for crack images on the surface of a tunnel of this embodiment can be as follows: Fig.14 As shown, it includes an acquisition module 31 , a first processing module 32 , a second processing module 33 and a third module 34 .

[0074] The acquisition module 31 is used to acquire the tunnel surface image. The first processing module 32 is used to perform image preprocessing on the tunnel surface image to obtain a binary image. The image preprocessing includes grayscale processing, filtering processing, local image histogram stretching processing and binarization processing, wherein the filtering processing includes determining whether the image contains salt and pepper noise. If the image contains salt and pepper noise, the image is sequentially subjected to median filtering processing and bilateral filtering processing. If the image does not contain salt and pepper noise, the image is subjected to bilateral filtering processing. The second processing module 33 is used to remove the residual noise in the binary image by analyzing the crack features of the connected areas in the binary image to obtain a crack image. The third processing module 34 is used to perform crack refinement processing on the crack image to obtain a crack skeleton image.

[0075] like Fig.15As shown, a hand-pushed inspection trolley and a tunnel surface image acquisition device arranged on the hand-pushed inspection trolley. The tunnel surface image acquisition device includes an array camera, an image acquisition card, an industrial computer, an encoder, a positioning system and the industrial computer, and a power supply system for the array camera, the image acquisition card and the industrial computer. The array camera transmits the acquired tunnel surface image to the image acquisition card, the image acquisition card converts the tunnel surface image from an analog signal to a digital signal, the encoder compresses and encodes the tunnel surface image converted to a digital signal, and the industrial computer sends the compressed and encoded tunnel surface image and the position information of the image acquisition to the tunnel surface crack image automatic detection device.

[0076] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by this application, but this does not mean that there are no other units in this embodiment.

[0077] Embodiment three:

[0078] Another embodiment of the present application relates to an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the automatic detection method of tunnel surface crack images in the above-mentioned embodiments.

[0079] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.

[0080] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0081] Embodiment 4:

[0082] Another embodiment of the present application relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.

[0083] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as: ROM), random access memory (Random Access Memory, referred to as: RAM), disk or optical disk and other media that can store program codes.

[0084] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.

Claims

1. A method for automatic detection of crack images on tunnel surface, characterized in that: include: Acquire tunnel surface images; Performing image preprocessing on the tunnel surface image to obtain a binary image, wherein the image preprocessing includes grayscale processing, filtering processing, local image histogram stretching processing and binarization processing, wherein the filtering processing includes determining whether the image contains salt and pepper noise, and if the image contains salt and pepper noise, performing median filtering processing and bilateral filtering processing on the image in sequence, and if the image does not contain salt and pepper noise, performing bilateral filtering processing on the image; By analyzing the crack features of the connected areas in the binary image, the residual noise in the binary image is removed to obtain a crack image; The crack image is subjected to crack thinning processing to obtain a crack skeleton image.

2. The tunnel surface crack image automatic detection method according to claim 1 is characterized in that: The image preprocessing also includes performing light homogenization processing on the image after grayscale processing.

3. The tunnel surface crack image automatic detection method according to claim 1 is characterized in that: The local image histogram stretching process includes: The image is processed into blocks to obtain multiple local area block images of the image; Performing histogram contrast stretching processing on each local area block image; The local area block images after histogram contrast stretching are merged.

4. The method for automatic detection of tunnel surface crack images according to claim 1, characterized in that: The binarization process comprises: Use Sobel operator to detect the edge of the image; The image after edge detection is subjected to threshold segmentation using the OTSU algorithm to obtain the binary image.

5. The method for automatic detection of tunnel surface crack images according to claim 1, characterized in that: The crack characteristics include crack width, crack length, crack area, crack perimeter, rectangularity of the largest connected area, and circumference ratio of the largest connected area, Hu first invariant moment and Hu second invariant moment.

6. The method for automatic detection of tunnel surface crack images according to any one of claims 1 to 5, characterized in that: After the binary image is obtained, the image preprocessing further includes at least one processing method of edge detection processing, corrosion processing, expansion processing, and grayscale inversion processing.

7. The method for automatic detection of crack images on tunnel surface according to claim 6, characterized in that: After the filtering process, the first erosion process is performed before the local image histogram stretching process; after the binarization process, the second erosion process and the edge detection process are performed.

8. An automatic detection device for crack images on tunnel surface, characterized in that: include: An acquisition module, used for acquiring tunnel surface images; A first processing module is used to perform image preprocessing on the tunnel surface image to obtain a binary image, wherein the image preprocessing includes grayscale processing, filtering processing, local image histogram stretching processing and binarization processing, wherein the filtering processing includes determining whether the image contains salt and pepper noise, if the image contains salt and pepper noise, then performing median filtering processing and bilateral filtering processing on the image in sequence, and if the image does not contain salt and pepper noise, then performing bilateral filtering processing on the image; A second processing module is used to remove residual noise in the binary image by analyzing crack features of connected areas in the binary image to obtain a crack image; The third processing module is used to perform crack thinning processing on the crack image to obtain a crack skeleton image.

9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the tunnel surface crack image automatic detection method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for automatically detecting cracks on a tunnel surface according to any one of claims 1 to 7 is implemented.