A tunnel lining surface defect detection system based on image processing
By combining the adaptive Gaussian kernel Retinex algorithm with a pre-trained model, the problem of defect detection caused by uneven illumination on the tunnel lining surface was solved, achieving efficient and accurate identification of tunnel lining defects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHAANXI RAILWAY INST
- Filing Date
- 2026-04-24
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies, the detection of defects on the surface of tunnel lining is affected by uneven lighting, resulting in low detection accuracy and difficulty in effectively identifying defects.
The Retinex algorithm with an adaptive Gaussian kernel is used to enhance images by combining multi-dimensional information fusion through image acquisition, preprocessing, edge pixel analysis, texture and illumination feature value acquisition, and multi-dimensional information fusion. The adaptive Gaussian kernel is determined for image enhancement, and a pre-trained model is used for defect detection.
It improves the accuracy and efficiency of detecting defects on the tunnel lining surface, enabling better identification of defect location and type, and ensuring tunnel safety.
Smart Images

Figure CN122391168A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision technology, specifically to a tunnel lining surface defect detection system based on image processing. Background Technology
[0002] In transportation infrastructure construction, tunnels are key nodes, and their safety and durability directly affect the stable operation of the overall transportation network. Tunnel lining, as the main load-bearing and protective structure of a tunnel, endures complex effects such as surrounding rock pressure, groundwater erosion, and vehicle vibration over long periods, making it highly susceptible to surface defects such as cracks, water seepage, and spalling. If these defects are not detected and repaired in time, they can gradually expand, leading to structural instability of the lining and even major safety accidents such as tunnel collapse, seriously threatening traffic safety and the lives and property of the victims. However, in actual inspections, due to the complex internal environment of tunnels and the difficulty in precisely controlling lighting conditions, uneven lighting has become a prominent challenge affecting the detection of surface defects in tunnel lining. Therefore, before conducting defect detection on the surface of tunnel lining, it is necessary to address the problem of uneven image lighting.
[0003] Based on the human visual mechanism, the Retinex algorithm can effectively separate the illumination and reflection components of an image, enhance image contrast, remove interference from uneven illumination, and preserve defect details. It is particularly suitable for tunnel lining surfaces with local over-brightness or under-brightness caused by complex lighting conditions, thus improving defect detection accuracy. In existing technologies, the Retinex algorithm uses a fixed Gaussian kernel to estimate illumination. However, in tunnel environments, the lighting conditions and texture complexity of different areas of the image vary greatly. Using an inappropriate Gaussian kernel can lead to loss of details or failure to effectively estimate background illumination, affecting the image enhancement effect and resulting in low accuracy in detecting defects on tunnel lining surfaces. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a tunnel lining surface defect detection system based on image processing to solve the problem that the existing technology has poor image enhancement effect, resulting in low accuracy of tunnel lining surface defect detection.
[0005] A first aspect of the present invention provides an image processing-based tunnel lining surface defect detection system, comprising: The image acquisition module is used to acquire images of the tunnel lining surface and preprocess the images to obtain the target image. The first analysis module is used to acquire edge pixels in the target image and determine the suspected defect feature value of each pixel in the target image based on the edge pixels. The second analysis module is used to acquire the texture information, discrete information, gradient information and local binary pattern (LBP) value of each pixel in the target image, and to determine the texture feature value of each pixel in the target image based on the texture information, discrete information, gradient information and LBP value of the pixel. The third analysis module is used to obtain the Laplacian response level and grayscale feature information of each pixel in the target image, and to determine the illumination feature value of each pixel in the target image based on the Laplacian response level and grayscale feature information. The parameter acquisition module is used to determine the adaptive Gaussian kernel of the corresponding pixel based on the suspected defect feature value, texture feature value and illumination feature value; The image optimization module is used to enhance the target image based on the adaptive Gaussian kernel of each pixel to obtain an optimized image; The defect detection module is used to detect defects in optimized images based on a pre-trained target recognition model.
[0006] Optionally, the first analysis module determines the suspected defect feature value of each pixel in the target image based on edge pixels, including: Based on a preset window size, determine the target window centered on each pixel in the target image; Get the maximum and minimum gray values of pixels within the target window; Get the number of edge pixels within the target window; Obtain the average grayscale value of the pixels within the target window and the global average grayscale value of the target image; Based on the maximum gray value, minimum gray value, number of edge pixels, average gray value, and global average gray value, the suspected defect feature value of the center pixel within the target window is determined.
[0007] Optionally, the first analysis module determines the suspected defect feature values of the pixels corresponding to the target window based on the maximum gray value, minimum gray value, number of edge pixels, average gray value, and global average gray value, including: Get the first grayscale difference between the maximum and minimum grayscale values; Obtain the second grayscale difference between the average grayscale value and the global average grayscale value; Get the ratio of the number of edge pixels to the total number of pixels in the target window; The suspected defect feature value of the center pixel within the target window is determined by multiplying the first gray level difference, the second gray level difference, and the ratio.
[0008] Optionally, the second analysis module acquires the texture information, discrete information, gradient information, and local binary pattern (LBP) value of each pixel in the target image, including: Based on a preset window size, determine the target window centered on each pixel in the target image; The grayscale entropy within each target window is obtained as the texture information of the center pixel within the target window, thus obtaining the texture information of the target image. The mean gray value and standard deviation of each pixel in the target window are obtained, and the ratio of the mean gray value to the standard deviation is used as the discrete information of the center pixel in the target window to obtain the discrete information of the target image. Obtain the gradient covariance matrix of each target window, perform eigenvalue decomposition on the gradient covariance matrix, and obtain the first eigenvalue and the second eigenvalue. The first and second feature values of all target windows are used as gradient information of the target image. The LBP value of a pixel is obtained based on the grayscale values of its neighboring pixels in the target image.
[0009] Optionally, the second analysis module determines the texture feature value of each pixel in the target image based on texture information, discrete information, gradient information, and the LBP value of the pixel, including: Obtain the feature difference between the first and second eigenvalues and the feature sum of the first and second eigenvalues in the gradient information; The anisotropy index of the target window is determined based on the ratio of the feature difference to the feature summation. Get the average LBP value of all pixels within the target window; Calculate the LBP difference between the LBP value of each pixel within the target window and the average LBP value; The average LBP difference is obtained by averaging all LBP differences within the target window. The texture feature value of the center pixel within the target window is obtained by multiplying the gray-level information entropy of the target window in the texture information, the ratio of the gray-level mean to the gray-level standard deviation of the target window in the discrete information, the LBP average difference, and the anisotropy index.
[0010] Optionally, the third analysis module obtains the grayscale feature information of each pixel in the target image, including: Based on a preset window size, determine the target window centered on each pixel in the target image; Obtain the grayscale histogram of each target window and determine the corresponding grayscale curve based on the grayscale histogram; Obtain the number of peaks in the grayscale curve; In response to a set value for the number of peaks, the grayscale value corresponding to each peak point is obtained; In response to the number of peaks not being a set value, the grayscale value corresponding to each peak point is defined as 0. Obtain the standard deviation of grayscale values for pixels within the target window; The gray value of the peak point and the gray standard deviation of the target window are used as the gray feature information of the center pixel point within the target window.
[0011] Optionally, the third analysis module determines the illumination feature value of each pixel in the target image based on the Laplacian response level and grayscale feature information, including: Obtain the absolute value of the difference in gray values between peak points in the gray-scale feature information; The illumination feature value of the center pixel within the target window is determined based on the Laplacian response level, grayscale standard deviation, number of peaks, and absolute value of the difference in grayscale feature information.
[0012] Optionally, the third analysis module determines the illumination feature value of the center pixel within the target window based on the Laplacian response level, the grayscale standard deviation, the number of peaks, and the absolute value of the difference in the grayscale feature information, including: The formula for calculating the illumination characteristic value is: in, Let i be the illumination feature value of pixel i; Let be the Laplacian response level of pixel i; is the standard deviation of grayscale within the target window centered at pixel i; The number of peak points within the target window when pixel i is the center; Let be the gray value of peak point 1 corresponding to pixel i; Let be the gray value of peak point 2 corresponding to pixel i; c is a constant; nrom is the normalization function.
[0013] Optionally, the parameter acquisition module determines the adaptive Gaussian kernel for the corresponding pixel based on the suspected defect feature value, texture feature value, and illumination feature value, including: The suspected defect feature values, texture feature values, and illumination feature values are weighted and fused to obtain an adaptive Gaussian kernel.
[0014] Optionally, the parameter acquisition module performs weighted fusion of suspected defect feature values, texture feature values, and illumination feature values to obtain an adaptive Gaussian kernel, including: The formula for calculating the adaptive Gaussian kernel is: in, The adaptive Gaussian kernel for pixel i; Let i be the suspected defect feature value of pixel i; Let i be the texture feature value of pixel i; Let i be the illumination feature value of pixel i; The preset maximum Gaussian kernel.
[0015] The beneficial effects of this invention compared to existing technologies are as follows: The image acquisition module acquires images of the tunnel lining surface and preprocesses these images to obtain a target image, improving image analysis efficiency. The first analysis module obtains the suspected defect level of pixels based on edge pixels in the target image. The second analysis module obtains texture feature values based on multi-dimensional information such as texture information, discrete information, gradient information, and LBP values of the target image. The third analysis module obtains the illumination feature values of pixels based on Laplacian response and grayscale feature information, performing a comprehensive analysis of pixels from multiple information dimensions. The parameter acquisition module fuses the suspected defect level, texture feature values, and illumination feature values of pixels to obtain the adaptive Gaussian kernel for the current pixel, improving the reliability of obtaining the adaptive Gaussian kernel corresponding to each pixel. This ensures the effectiveness of image enhancement based on the adaptive Gaussian kernel by the image optimization module, enabling defect detection and recognition using images with better enhancement effects. The defect detection module can more accurately identify the location and type of defects in the tunnel, ensuring tunnel safety. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a structural block diagram of a tunnel lining surface defect detection system based on image processing provided in an embodiment of this application. Detailed Implementation
[0018] Embodiments of this disclosure are described in detail below, with examples of these embodiments illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting it.
[0019] It should be noted that the terms "first," "second," etc., used in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure.
[0020] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0021] Figure 1 This is a structural block diagram of a tunnel lining surface defect detection system based on image processing, provided in an embodiment of this application. Figure 1 As shown, the image processing-based tunnel lining surface defect detection system 100 includes: The image acquisition module 101 is used to acquire images of the tunnel lining surface and preprocess the images of the tunnel lining surface to obtain the target image.
[0022] In some embodiments, a high-resolution, high-sensitivity industrial camera can be selected to acquire images of the tunnel lining surface to ensure that the details of the lining surface can be clearly captured; alternatively, one or more industrial cameras can be reasonably arranged to acquire images covering all directions, depending on the actual environment of the tunnel; it is understood that during the image acquisition process, camera parameters such as focal length, aperture, and shutter speed should be reasonably set to adapt to different lighting conditions.
[0023] In some embodiments, professional personnel may be arranged to operate the acquisition equipment and move it according to a predetermined route and speed to ensure the continuity and integrity of image acquisition and obtain images of the tunnel lining surface.
[0024] In some embodiments, to facilitate the analysis of tunnel lining surface images, this embodiment preprocesses the tunnel lining surface images by converting them into grayscale images and using the grayscale images as the target images to be analyzed, thereby improving image analysis efficiency.
[0025] The first analysis module 102 is used to acquire edge pixels in the target image and determine the suspected defect feature value of each pixel in the target image based on the edge pixels.
[0026] It is understandable that the surface image of the tunnel lining is complex and the characteristics of different areas vary greatly. For example, the edges of defective areas are dense and the contrast and brightness are abnormal, while non-defective areas are relatively smooth. Therefore, the possibility of defects in pixels can be analyzed based on the edge pixel conditions, local contrast conditions, and local brightness conditions.
[0027] In some embodiments, the Canny edge detection algorithm can be used to obtain edge pixels in the target image.
[0028] In some embodiments, a target window can be determined based on a preset window size, with each pixel in the target image as the center; for example, the preset window size is n. If n is an arbitrary pixel in the target image, then n is established as the center. A window of size n is used to obtain the target window corresponding to the current pixel; optionally, in this embodiment, n is 9, so as to capture the features within the target window corresponding to the pixel.
[0029] In some embodiments, the maximum and minimum grayscale values of pixels within the target window are obtained.
[0030] In some embodiments, the number of edge pixels within the target window is obtained.
[0031] In some embodiments, the average grayscale value of the pixels within the target window and the average grayscale value of the target image are obtained. It can be understood that the average grayscale value of the pixels within the target window refers to the average grayscale value of all pixels within the target window, and the average grayscale value of the target image refers to the average grayscale value of all pixels in the target image.
[0032] Furthermore, the suspected defect feature value of the center pixel within the target window can be determined based on the maximum gray value, minimum gray value, number of edge pixels, average gray value, and global average gray value.
[0033] Optionally, a first grayscale difference between the maximum and minimum grayscale values can be obtained; a second grayscale difference between the average grayscale value and the global average grayscale value can be obtained; the ratio of the number of edge pixels to the total number of pixels in the target window can be obtained; and the suspected defect feature value of the center pixel in the target window can be determined based on the product of the first grayscale difference, the second grayscale difference, and the ratio.
[0034] Alternatively, the formula for calculating the suspected defect characteristic value can be expressed as: in, This represents the suspected defect feature value corresponding to pixel i; This represents the number of edge pixels within the target window centered at pixel i. This represents the total number of pixels within the target window centered at pixel i. This represents the maximum grayscale value within the target window centered at pixel i. The minimum grayscale value within the target window centered at pixel i; The average gray value of the target window centered at pixel i; The global grayscale mean of the target image; This is a normalization function used to standardize the units of measurement.
[0035] Understandable, This is the ratio of the number of edge pixels to the total number of pixels in the target window. The larger this value is, the more it matches the dense edge characteristics of defects (such as cracks) on the surface of the tunnel lining. This is the first grayscale difference value. The larger this value is, the greater the contrast within the window, which is more consistent with the characteristics of high contrast in a local area of defects such as cracks and peeling. The absolute value of the second grayscale difference is the larger the difference, the more it matches the abnormal brightness characteristics of defects that are too dark (such as cracks) or too bright (such as peeling or reflection) under uneven tunnel lighting conditions.
[0036] The second analysis module 103 is used to acquire the texture information, discrete information, gradient information and local binary pattern (LBP) value of each pixel in the target image, and to determine the texture feature value of each pixel in the target image based on the texture information, discrete information, gradient information and LBP value of the pixel.
[0037] It is understandable that texture in the target image has a significant impact on the image recognition process. For example, areas with rich texture have more details, and using a smaller Gaussian kernel can better preserve the texture. Therefore, this embodiment analyzes from the perspective of texture and obtains the texture feature value of each pixel.
[0038] In some embodiments, a target window can be determined based on a preset window size, with each pixel in the target image as the center; for example, the preset window size is n. If n is an arbitrary pixel in the target image, then n is established as the center. A window of size n is used to obtain the target window corresponding to the current pixel; optionally, in this embodiment, n is 9, so as to capture the features within the target window corresponding to the pixel.
[0039] In some embodiments, the grayscale entropy within each target window is obtained as the texture information of the center pixel within the target window to obtain the texture information of the target image; alternatively, the grayscale histogram of the target window can be obtained, and then the grayscale entropy can be calculated based on the grayscale histogram to characterize the information richness of the local area.
[0040] In some embodiments, the mean gray value and standard deviation of each pixel within the target window are obtained, and the ratio of the mean gray value to the standard deviation is used as the discrete information of the center pixel within the target window to obtain discrete information of the target image, which is used to represent the degree of drastic change in the current region.
[0041] In some embodiments, the gradient covariance matrix of each target window is obtained, and the gradient covariance matrix is decomposed into eigenvalues to obtain first eigenvalues and second eigenvalues; the first eigenvalues and second eigenvalues of all target windows are used as gradient information of the target image.
[0042] Optionally, the gradient of each pixel within the target window can be obtained, the gradient outer product of each pixel can be calculated to obtain the local matrix corresponding to the pixel, the local matrix can be smoothed / weighted averaged to obtain the gradient covariance matrix, and then the gradient covariance matrix can be decomposed into eigenvalues to obtain the first eigenvalue and the second eigenvalue.
[0043] In some embodiments, the LBP value of a pixel is obtained based on the grayscale values of its neighboring pixels in the target image. Optionally, the 8 neighboring pixels of a pixel can be obtained, and the grayscale value of the 8 neighboring pixels is compared with that of the current pixel. If the grayscale value of the neighboring pixels is greater than or equal to that of the current pixel, the neighboring pixels are recorded as 1; if the grayscale value of the neighboring pixels is less than that of the current pixel, the neighboring pixels are recorded as 0. The marker values of all neighboring pixels are obtained sequentially to obtain a string of 8-bit binary numbers as the LBP value of the current pixel. The LBP value can be used to describe the complexity of the texture.
[0044] Furthermore, the feature difference between the first and second eigenvalues in the gradient information, and the feature sum of the first and second eigenvalues can be obtained. Based on the ratio of the feature difference to the feature sum, the anisotropy index of the target window is determined to measure the directionality of the texture, such as the directionality of crack-like defects. The average LBP value of all pixels in the target window is obtained. The LBP difference between the LBP value of each pixel in the target window and the average LBP value is calculated. The average LBP difference of all LBP differences in the target window is obtained. Based on the grayscale entropy of the target window in the texture information, the ratio of the grayscale mean and grayscale standard deviation of the target window in the discrete information, the product of the average LBP difference and the anisotropy index, the texture feature value of the center pixel in the target window is obtained.
[0045] Alternatively, the formula for calculating texture feature values can be expressed as: in, Let i be the texture feature value of pixel i; Let be the grayscale entropy of the target window centered at pixel i; The average gray value of the target window centered at pixel i; Let be the standard deviation of the grayscale of the target window centered at pixel i; Let LBP be the LBP values of j pixels within the target window centered at pixel i; The LBP value corresponding to pixel i; The number of pixels other than pixel i within the target window; The first feature value of the target window when pixel i is the center; is the second feature value of the target window when pixel i is the center; c is a local constant used to prevent the denominator from being 0; nrom is a normalization function used to unify the dimensions.
[0046] Understandable, This represents the discrete information corresponding to the target window when pixel i is the center. The more drastic the change in the defect area, the larger the current value, and the greater the possibility of complex local texture. This is the average LBP difference. The larger the value, the greater the fluctuation in the complexity of the texture within the window, and the more likely there are defects. The feature difference; Summing for characteristics; The anisotropy index represents the target window. The larger the index, the more directional the texture within the window, and the more it conforms to the directional characteristics of crack-type defects.
[0047] In some embodiments, it is also possible to... Normalization is performed before calculation to improve computational efficiency.
[0048] The third analysis module 104 is used to acquire the Laplacian response level and grayscale feature information of each pixel in the target image, and to determine the illumination feature value of each pixel in the target image based on the Laplacian response level and grayscale feature information.
[0049] It is understandable that image quality is not only affected by texture, but also by lighting conditions. Uneven lighting can interfere with defect judgment. Therefore, lighting conditions have a significant impact on the image recognition process. For example, in areas with smooth lighting, the lighting changes are small, and a larger Gaussian kernel can be used to effectively estimate the lighting. Therefore, this embodiment analyzes the lighting from the perspective of lighting to obtain the lighting feature value of each pixel.
[0050] In some embodiments, a target window can be determined based on a preset window size, with each pixel in the target image as the center; for example, the preset window size is n. If n is an arbitrary pixel in the target image, then n is established as the center. A window of size n is used to obtain the target window corresponding to the current pixel; optionally, in this embodiment, n is 9, so as to capture the features within the target window corresponding to the pixel.
[0051] In some embodiments, a grayscale histogram of each target window can be obtained, and a corresponding grayscale curve can be determined based on the grayscale histogram; the number of peaks in the grayscale curve can be obtained; in response to the number of peaks being a set value, the grayscale value corresponding to each peak point can be obtained; in response to the number of peaks not being a set value, the grayscale value corresponding to each peak point can be defined as 0.
[0052] For example, in this embodiment, the value is set to 2, that is, when the number of peaks is 2, the gray value corresponding to each peak point is determined, and when the number of peaks is not 2, the gray value corresponding to each peak point is defined as 0.
[0053] In some embodiments, the grayscale standard deviation of pixels within the target window can also be obtained; the grayscale value of the peak point and the grayscale standard deviation corresponding to the target window are used as the grayscale feature information of the center pixel within the target window.
[0054] In some embodiments, the Laplacian response level of each pixel can also be obtained by convolving the Laplacian kernel with the local region of the image to obtain the corresponding Laplacian response level. The specific process is an existing method and will not be described in detail here.
[0055] Optionally, the absolute value of the difference between gray values between peaks in the gray-scale feature information can be obtained; the illumination feature value of the center pixel in the target window can be determined based on the Laplacian response degree, the gray standard deviation, the number of peaks, and the absolute value of the difference in the gray-scale feature information.
[0056] Alternatively, the formula for calculating the illumination characteristic value can be expressed as: in, Let i be the illumination feature value of pixel i; Let be the Laplacian response level of pixel i; is the standard deviation of grayscale within the target window centered at pixel i; The number of peak points within the target window when pixel i is the center; Let be the gray value of peak point 1 corresponding to pixel i; is the gray value of peak point 2 corresponding to pixel point i; c is a very small constant used to prevent the corresponding terms from being calculated meaninglessly. For example, c can be 0.01.
[0057] Understandable, It is the reciprocal of the degree of Laplace response. The Laplace response is sensitive to abrupt changes in illumination. The Laplace response is small in areas of smooth illumination. Therefore, the smaller the degree of Laplace response, the better the corresponding local smoothness. It is the reciprocal of the standard deviation of grayscale within the target window. The standard deviation of grayscale can reflect the degree of brightness dispersion in a local area. The smaller the standard deviation, the smaller the brightness variation and the stronger the lighting smoothness. This is the difference in gray values corresponding to the peak points. The gray-level histogram of uneven lighting areas usually shows a bimodal distribution, namely the illuminated area and the shadow area. The more it conforms to the bimodal distribution, the smaller the local lighting smoothness of the target pixel. When the number of peak points is not 2, this item is 0. The closer the gray values within the target window are to a bimodal distribution, and if a bimodal distribution exists, the smaller the difference in gray values between the two peaks, the more it conforms to the characteristics of a smooth lighting region.
[0058] The parameter acquisition module 105 is used to determine the adaptive Gaussian kernel of the corresponding pixel based on the suspected defect feature value, texture feature value and illumination feature value.
[0059] Optionally, the suspected defect feature values, texture feature values, and illumination feature values can be weighted and fused to obtain an adaptive Gaussian kernel.
[0060] Alternatively, the formula for calculating the adaptive Gaussian kernel is expressed as: in, The adaptive Gaussian kernel for pixel i; Let i be the suspected defect feature value of pixel i; Let i be the texture feature value of pixel i; Let i be the illumination feature value of pixel i; The preset maximum Gaussian kernel is 15 in this embodiment.
[0061] Understandable, This means that the initial Gaussian kernel is obtained based on the suspected defect level of each pixel. The higher the suspected defect level, the smaller the initial Gaussian kernel, thereby preserving local details. This means that the initial Gaussian kernel is adjusted based on the texture feature value of each pixel. The larger the texture feature value, the richer the texture. In subsequent processing, the scale parameter should be reduced to retain more details. This indicates that the initial Gaussian kernel is adjusted based on the illumination feature values of each pixel. A larger illumination feature value indicates smoother illumination, and the scale parameter should be increased in subsequent processing to effectively estimate the illumination. The texture feature values are then adjusted... Adjusted with illumination characteristic values Perform mean calculation to obtain the adaptive Gaussian kernel for pixel i.
[0062] In some embodiments, in order to ensure that the algorithm can run stably, the range of the adaptive Gaussian kernel can also be set. For example, the range of the adaptive Gaussian kernel value can be set to [5, 15]. When the adaptive Gaussian kernel is less than 5, the adaptive Gaussian kernel of the current pixel is determined to be 5. Correspondingly, when the adaptive Gaussian kernel is greater than 15, the adaptive Gaussian kernel of the current pixel is determined to be 15.
[0063] The image optimization module 106 is used to enhance the target image based on the adaptive Gaussian kernel of the pixels to obtain an optimized image.
[0064] In some embodiments, after obtaining the adaptive Gaussian kernel corresponding to each pixel in the target image, the adaptive Retinex algorithm is used to enhance the target image based on the adaptive Gaussian kernel of each pixel, thereby obtaining an optimized image.
[0065] The defect detection module 107 is used to perform defect detection on the optimized image based on a pre-trained target recognition model.
[0066] In some embodiments, the pre-trained target recognition model can be trained on a large number of tunnel lining images containing various defects and non-defects, including but not limited to cracks, seepage, and spalling. For example, a large number of tunnel lining images containing various defects and non-defects can be labeled to clarify the location and category of defects, thereby constructing a training dataset. Then, a suitable machine learning model, such as a convolutional neural network, is selected to automatically learn the defect features in the images based on its powerful feature extraction capabilities. The enhanced training images are input into the model for training. During the training process, the model parameters are adjusted to minimize the loss function so that the model can accurately distinguish between defective and non-defective regions, thereby obtaining the trained target recognition model. After training, the performance of the target recognition model can be evaluated using a test set to ensure its generalization ability.
[0067] Furthermore, the optimized image, which has been acquired and enhanced in real time, is input into the target recognition model. The target recognition model then outputs information on the defect location and defect category, thereby assisting professionals in quickly locating and handling defects and ensuring the safe operation of the tunnel.
[0068] This embodiment includes an image acquisition module, a first analysis module, a second analysis module, a third analysis module, a parameter acquisition module, an image optimization module, and a defect detection module. The image acquisition module acquires tunnel surface images in real time and performs preprocessing to obtain the target image. The first, second, and third analysis modules sequentially acquire the suspected defect level, texture feature value, and illumination feature value of each pixel in the target image. The parameter acquisition module combines the suspected defect level, texture feature value, and illumination feature value of the pixel to obtain the adaptive Gaussian kernel of the current pixel. The Gaussian kernel is determined from the multi-dimensional features of texture and illumination, improving the reliability of the adaptive Gaussian kernel corresponding to each pixel. This ensures the effectiveness of the image enhancement based on the adaptive Gaussian kernel by the image optimization module. The image with better enhancement effect is used for defect detection and identification. The defect detection module accurately identifies the location and type of defects in the tunnel, ensuring tunnel safety.
[0069] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A tunnel lining surface defect detection system based on image processing, characterized in that, The system includes: The image acquisition module is used to acquire images of the tunnel lining surface and preprocess the images of the tunnel lining surface to obtain a target image; The first analysis module is used to acquire edge pixels in the target image and determine the suspected defect feature value of each pixel in the target image based on the edge pixels. The second analysis module is used to acquire the texture information, discrete information, gradient information and local binary pattern (LBP) value of each pixel in the target image, and to determine the texture feature value of each pixel in the target image based on the texture information, discrete information, gradient information and LBP value of the pixel. The third analysis module is used to acquire the Laplacian response level and grayscale feature information of each pixel in the target image, and to determine the illumination feature value of each pixel in the target image based on the Laplacian response level and the grayscale feature information. The parameter acquisition module is used to determine the adaptive Gaussian kernel of the corresponding pixel based on the suspected defect feature value, the texture feature value and the illumination feature value; The image optimization module is used to enhance the target image based on the adaptive Gaussian kernel of the pixels to obtain an optimized image; The defect detection module is used to perform defect detection on the optimized image based on a pre-trained target recognition model.
2. The tunnel lining surface defect detection system based on image processing according to claim 1, characterized in that, The first analysis module determines the suspected defect feature value of each pixel in the target image based on the edge pixels, including: Based on a preset window size, determine the target window centered on each pixel in the target image; Obtain the maximum and minimum grayscale values of the pixels within the target window; Obtain the number of edge pixels within the target window; Obtain the average grayscale value of the pixels within the target window and the global average grayscale value of the target image; Based on the maximum gray value, the minimum gray value, the number of edge pixels, the average gray value, and the global average gray value, the suspected defect feature value of the center pixel within the target window is determined.
3. The tunnel lining surface defect detection system based on image processing according to claim 2, characterized in that, The first analysis module determines the suspected defect feature values of the pixels corresponding to the target window based on the maximum gray value, the minimum gray value, the number of edge pixels, the average gray value, and the global average gray value, including: Obtain the first grayscale difference between the maximum and minimum grayscale values; Obtain the second grayscale difference between the mean grayscale value and the global mean grayscale value; Obtain the ratio of the number of edge pixels to the total number of pixels in the target window; The suspected defect feature value of the center pixel within the target window is determined by multiplying the first grayscale difference, the second grayscale difference, and the ratio.
4. The tunnel lining surface defect detection system based on image processing according to claim 1, characterized in that, The second analysis module acquires the texture information, discrete information, gradient information, and the local binary pattern (LBP) value of each pixel in the target image, including: Based on a preset window size, determine the target window centered on each pixel in the target image; The grayscale entropy within each target window is obtained as the texture information of the center pixel within the target window, in order to obtain the texture information of the target image; The mean gray value and standard deviation of each pixel in the target window are obtained, and the ratio of the mean gray value to the standard deviation is used as the discrete information of the center pixel in the target window to obtain the discrete information of the target image. Obtain the gradient covariance matrix of each target window, and perform eigenvalue decomposition on the gradient covariance matrix to obtain the first eigenvalue and the second eigenvalue; The first feature value and the second feature value of all the target windows are used as the gradient information of the target image; The LBP value of a pixel is obtained based on the grayscale values of its neighboring pixels in the target image.
5. The tunnel lining surface defect detection system based on image processing according to claim 4, characterized in that, The second analysis module determines the texture feature value of each pixel in the target image based on the texture information, the discrete information, the gradient information, and the LBP value of the pixel, including: Obtain the feature difference between the first feature value and the second feature value, and the feature summation of the first feature value and the second feature value in the gradient information; The anisotropy index of the target window is determined based on the ratio of the feature difference to the feature summation. Obtain the average LBP value of all pixels within the target window; Calculate the LBP difference between the LBP value of each pixel within the target window and the average LBP value; The average LBP difference is obtained by averaging all LBP differences within the target window. The texture feature value of the center pixel in the target window is obtained by multiplying the gray-level information entropy of the target window in the texture information, the ratio of the gray-level mean to the gray-level standard deviation of the target window in the discrete information, the LBP average difference, and the anisotropy index.
6. The tunnel lining surface defect detection system based on image processing according to claim 1, characterized in that, The third analysis module obtains the grayscale feature information of each pixel in the target image, including: Based on a preset window size, determine the target window centered on each pixel in the target image; Obtain the grayscale histogram of each target window, and determine the corresponding grayscale curve based on the grayscale histogram; Obtain the number of peaks in the grayscale curve; In response to the set value of the number of peaks, the gray value corresponding to each peak point is obtained; In response to the fact that the number of peaks is not a set value, the gray value corresponding to each peak point is defined as 0. Obtain the grayscale standard deviation of the pixels within the target window; The gray value of the peak point and the gray standard deviation corresponding to the target window are used as the gray feature information of the center pixel point within the target window.
7. The tunnel lining surface defect detection system based on image processing according to claim 6, characterized in that, The third analysis module determines the illumination feature value of each pixel in the target image based on the Laplacian response level and the grayscale feature information, including: Obtain the absolute value of the difference in gray values between peak points in the gray-scale feature information; The illumination feature value of the center pixel within the target window is determined based on the Laplacian response level, the grayscale standard deviation in the grayscale feature information, the number of peaks, and the absolute value of the difference.
8. The tunnel lining surface defect detection system based on image processing according to claim 7, characterized in that, The third analysis module determines the illumination feature value of the center pixel within the target window based on the Laplacian response level, the grayscale standard deviation in the grayscale feature information, the number of peaks, and the absolute value of the difference, including: The formula for calculating the illumination characteristic value is: in, Let i be the illumination feature value of pixel i; Let be the Laplacian response level of pixel i; is the standard deviation of grayscale within the target window centered at pixel i; The number of peak points within the target window when pixel i is the center; Let be the gray value of peak point 1 corresponding to pixel i; Let be the gray value of peak point 2 corresponding to pixel i; c is a constant; nrom is the normalization function.
9. The image processing-based tunnel lining surface defect detection system according to any one of claims 1-8, characterized in that, The parameter acquisition module determines the adaptive Gaussian kernel for the corresponding pixel based on the suspected defect feature value, the texture feature value, and the illumination feature value, including: The suspected defect feature value, the texture feature value, and the illumination feature value are weighted and fused to obtain the adaptive Gaussian kernel.
10. The tunnel lining surface defect detection system based on image processing according to claim 9, characterized in that, The parameter acquisition module performs weighted fusion of the suspected defect feature value, the texture feature value, and the illumination feature value to obtain the adaptive Gaussian kernel, including: The formula for calculating the adaptive Gaussian kernel is: in, The adaptive Gaussian kernel for pixel i; Let i be the suspected defect feature value of pixel i; Let i be the texture feature value of pixel i; Let i be the illumination feature value of pixel i; The preset maximum Gaussian kernel.