A method for underwater crack image enhancement in water conveyance tunnels based on mask uniformity

The underwater crack images of the water transmission tunnel were generated through CycleGAN and the Mask uniformity algorithm was improved, which solved the problems of lack of data sets and uneven light, and generated high-quality crack images, which improved the detection effect.

CN117575967BActive Publication Date: 2025-08-29HARBIN ENG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311369720.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-23
Publication Date
2025-08-29
Estimated Expiration
2043-10-23

AI Technical Summary

Technical Problem

In the prior art, underwater crack detection of water transmission tunnels lacks high-quality image data sets, resulting in unreliable detection results, and the uneven light problem caused by underwater illumination affects image quality, making it difficult to effectively detect and segment fractures.

Method used

The CycleGAN model is used to generate underwater crack images of the water transmission tunnel, combined with wavelet transformation for denoising, and the Mask uniformity algorithm is improved to adaptively adjust the filter scale, dynamic compression and linear stretching of the background image to solve the problem of uneven light.

Benefits of technology

A large number of high-quality underwater crack images of water transmission tunnels were generated, which improved image contrast and brightness uniformity, enhanced the contrast between cracks and background, and improved detection effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117575967B_ABST
    Figure CN117575967B_ABST
Patent Text Reader

Abstract

The present invention is a method for enhancing underwater crack images of water conveyance tunnels based on Mask uniform lighting. The present invention relates to the technical field of water conveyance tunnel crack image enhancement. The present invention analyzes the characteristics of the underwater environment of water conveyance tunnels, uses land concrete cracks as the image to be converted, and real water conveyance tunnel underwater environment images as style images, uses the CycleGAN model for training, generates a large number of underwater style crack images of water conveyance tunnels, and selects images with better quality from them. Then, commonly used denoising methods are compared, and finally wavelet transform is used for image denoising. Finally, improvements are made based on the Mask uniform lighting algorithm and experimental comparisons are performed. The results show that the improved algorithm of the present invention has better de-lighting effect than the original algorithm, and the image quality is better, which solves the problem of uneven lighting in water conveyance tunnel images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of water conveyance tunnel crack image enhancement, and is a method for enhancing underwater crack images of water conveyance tunnels based on Mask uniform light. Background Art

[0002] The lining of water diversion tunnels is mostly made of reinforced concrete structure. During long-term operation, it is affected by a series of factors such as water erosion, internal water pressure, external geological pressure, rock layer changes, temperature changes, etc., and the tunnel lining will have defects such as falling off, cracks, deformation, exposed reinforcement, and collapse.

[0003] The most common defect in water supply tunnels is cracks. Cracks reduce the integrity and strength of the lining, significantly shortening the tunnel's service life. Failure to promptly inspect and repair cracks can easily lead to major accidents. Currently, instrumented and manual inspections are the most commonly used methods for crack detection in water supply tunnels. Instrumented inspections use sensors such as strain gauges, rebar gauges, flow meters, and inclinometers embedded in the tunnel to monitor the tunnel's safety status. However, due to the tunnel's long length and large diameter, these sensors cannot fully cover the tunnel. To prevent missed cracks, regular manual inspections are necessary. First, the water supply tunnel is shut off and drained. Workers then enter the tunnel for inspection. If cracks are discovered during the inspection, they take photos, mark significant cracks, and create a crack distribution map. The data is then brought back for expert analysis. Alternatively, after the tunnel is drained, workers can use ultrasonic detection, ground-penetrating radar, infrared imaging, 3D laser scanning, and other techniques to detect cracks. Sometimes, for more accurate results, experts require a secondary on-site inspection to sample and verify cracks and obtain more data. This method requires a long inspection cycle, and some tunnels are difficult to access due to harsh environments, resulting in unreliable inspection results. Another manual inspection method is diver testing, which involves sending professional divers into the water with underwater testing equipment to inspect the water supply tunnels. However, this method has many limitations because professional divers lack understanding of the operational characteristics of hydraulic engineering projects.

[0004] The training results of convolutional neural networks are directly affected by the quantity and quality of the dataset. The richer the data type, the larger the quantity, and the higher the quality, the more robust the training results. The goal is to segment underwater cracks in water tunnels at the pixel level. However, there are currently no publicly available images of underwater cracks in water tunnels. Furthermore, due to the unique characteristics of water tunnels, it is difficult to obtain a high-quality dataset through field acquisition. Summary of the Invention

[0005] To address the issue of missing datasets and the similarity of crack features across the same material, this paper uses a CycleGAN adversarial network to perform style transfer on ground concrete cracks. This generates a large number of simulated underwater crack images of water transfer tunnels for semantic segmentation. This method addresses the issue of uneven image illumination caused by underwater lighting. This paper provides a method for enhancing underwater crack images of water transfer tunnels based on mask uniformity.

[0006] It should be noted that, in the present invention, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.

[0007] The present invention provides a method for enhancing underwater crack images in a water conveyance tunnel based on mask uniformity. The present invention provides the following technical solutions:

[0008] A method for enhancing underwater crack images in a water conveyance tunnel based on mask uniformity, the method comprising the following steps:

[0009] Step 1: Collect crack images, filter and merge crack images;

[0010] Step 2: Pre-process the crack image;

[0011] Step 3: Use the Mask dodging algorithm to enhance the underwater crack image of the water diversion tunnel.

[0012] Preferably, the step 1 is specifically:

[0013] We searched for datasets containing only cracks, including CrackDetection, ConcreteCrack, and SDNET2018. CrackDetection contains 6,069 224×224 images of bridge cracks, including both positive and negative samples. ConcreteCrack contains 40,000 227×227 images of various pavement cracks, half of which are positive and half are negative. SDNET2018 is a large concrete crack dataset covering multiple categories, including walls, bridges, and pavements, with over 56,000 256×256 images.

[0014] We selected 9,300 suitable crack images from the public datasets above, added 500 images of road and wall concrete cracks taken with mobile phones, and 200 images of underwater cracks in dams, for a total of 10,000 original datasets.

[0015] The CycleGAN style transfer model was used to train the ground crack dataset and the underwater style dataset of the water tunnel, obtaining a large number of underwater crack images of the water tunnel. From these images, 3,500 crack images that conform to the real situation were selected as the original dataset.

[0016] Preferably, the step 2 is specifically as follows:

[0017] The denoising of underwater crack images in water conveyance tunnels based on wavelet transform uses a finite and decaying wavelet basis to replace the infinite trigonometric function basis in Fourier transform. The formula is as follows:

[0018]

[0019] Among them, α represents the scale of the wavelet function; τ represents the translation of the wavelet function;

[0020] Average gradient, mean square error and peak signal-to-noise ratio are used as evaluation criteria for denoised images;

[0021] MG expresses the rate at which the image changes in tiny details, reflecting the detail expression of the image. The larger the value, the stronger the image contrast. The calculation formula is as follows:

[0022]

[0023] Among them, M*N is the image size, and Represents the horizontal and vertical gradients of the image;

[0024] MSE measures the grayscale change of the image. The smaller the value, the better the noise suppression effect. The calculation formula is as follows:

[0025]

[0026] Where M·N is the image size, I(i,j) and I'(i,j) represent the grayscale of the pixel before and after filtering;

[0027] PSNR evaluates the degree of image distortion before and after filtering. The larger the value, the less image distortion. The calculation formula is as follows:

[0028]

[0029] Preferably, step 3 includes:

[0030] The original image is divided into 16 4×4 sub-blocks and the signal-to-noise ratio (SNR) of each sub-block is calculated. i , the formula is as follows:

[0031]

[0032] in, is the grayscale mean of each sub-block, Grayscale standard deviation of each sub-block;

[0033] Calculate the maximum signal-to-noise ratio (SNR) among the 16 sub-blocks max , minimum signal-to-noise ratio SNR min , mean signal-to-noise ratio SNRm ean , the size of the filter σ is determined by the following formula:

[0034]

[0035] Among them, σ max and σ min are the maximum and minimum values ​​of σ. For underwater crack images of water conveyance tunnels, the value of σ in the range of 0 to 10 ensures better uniform light results. Therefore, σ max =10,σ min =0.

[0036] Preferably, the step 3 further includes:

[0037] Perform dynamic compression on the background image. Subtraction operation will cause the image output result to fall outside the range of 0 to 255, resulting in loss of image detail information. Dynamic compression is performed on the background image before subtraction operation, so that the subtraction result falls within the range of 0 to 255 as much as possible. The dynamic compression calculation formula is as follows:

[0038] I cbk (x,y)=α×[I bk (x,y)-I mean ]+I mean

[0039] Among them, I cbk is the background image after dynamic compression, I bk is the background image before dynamic compression, I mean is the average brightness of the original image, α is the compression coefficient, 0<α<1;

[0040] For areas with large dynamic changes, the value of α should be as small as possible. For areas with small dynamic changes, the value of α should be as large as possible. The calculation formula is as follows:

[0041] α=min(α L ,α H )

[0042] Among them, α L is the lower limit compression coefficient, which is used to make the output result I out ≥0;α H is the lower limit compression coefficient, which is used to make the output result I out ≤255;

[0043]

[0044] Among them, max(I out ) and min(I out ) represent the maximum and minimum values ​​after subtraction of the traditional Mask dodging algorithm, (x max ,y max ) and (x min ,y min ) are the coordinate positions of the maximum and minimum values ​​corresponding to the original image.

[0045] Preferably, the step 3 further includes:

[0046] When performing linear stretching, the degree of stretching needs to be suppressed. Areas with low brightness values ​​also have low contrast, so the degree of stretching needs to be increased to improve the contrast. Linear stretching is used for stretching, and the stretching parameters can be adaptively adjusted. The stretching formula is as follows:

[0047] I mout (x,y)=β×[I out (x,y)-I mean ]+I mean

[0048] Among them, I mout Represents the mean brightness of the image after stretching, I out Represents the output result of the subtraction operation, I mean Represents the brightness mean of the original image, β represents the stretching coefficient, and in order to make 1≤β≤2, the following stretching coefficient model is designed:

[0049]

[0050] Among them, I ybk Represents the background pixel value after dynamic compression processing, Indicates I ybk The maximum value of Indicates I ybk The minimum value of .

[0051] Preferably, for the area with the highest brightness, At this time, β=1, the image stretching degree is the smallest; for the darkest area, At this time, β=2, the image stretching degree is the maximum, and after linear stretching processing, an image with uniform brightness distribution is obtained.

[0052] A mask-based underwater crack image enhancement system for a water conveyance tunnel, the system comprising:

[0053] A data acquisition module, wherein the data acquisition module collects crack images and screens and merges the crack images;

[0054] A pre-processing module, wherein the pre-processing module performs pre-mathematical processing on the crack image;

[0055] The image enhancement module uses a mask dodging algorithm to enhance the image of underwater cracks in the water conveyance tunnel.

[0056] A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement a method for enhancing underwater crack images in a water conveyance tunnel based on mask uniformity

[0057] A computer device comprising a memory and a processor, wherein the memory stores a computer program and the processor executes the computer program to implement a method for enhancing underwater crack images in a water conveyance tunnel based on mask uniformity.

[0058] The present invention has the following beneficial effects:

[0059] Compared with the prior art, the present invention has the following advantages:

[0060] Currently, there are no publicly available datasets of underwater crack images of water tunnels available for research, either domestically or internationally. To address this missing dataset, this paper proposes using a style transfer network (CycleGAN) to generate underwater cracks in water tunnels. First, the characteristics of the underwater environment of water tunnels were analyzed. Using land concrete cracks as the images to be converted and images of real underwater water tunnel environments as style images, the CycleGAN model was trained to generate a large number of underwater style crack images of water tunnels, from which high-quality images were selected. Then, common denoising methods were compared, and finally, wavelet transform was used for image denoising. Finally, improvements were made based on the Mask uniformity algorithm and experimental comparisons were conducted. The results showed that the improved algorithm of the present invention has a better de-lighting effect than the original algorithm, resulting in better image quality and solving the problem of uneven illumination in water tunnel images. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0062] Figure 1 This is the processing flow of the Mask dodging algorithm;

[0063] Figure 2 This is an image of underwater cracks in a water diversion tunnel;

[0064] Figure 3 This is the processing process of the Mask dodging algorithm of the present invention;

[0065] Figure 4 For the comparison of uniform light effect. DETAILED DESCRIPTION

[0066] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0067] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0068] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.

[0069] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0070] The present invention is described in detail below with reference to specific embodiments. Specific embodiment one:

[0072] according to Figures 1 to 4 As shown, the specific optimization technical solution adopted by the present invention to solve the above technical problems is: the present invention relates to a method for enhancing underwater crack images in a water conveyance tunnel based on Mask uniformity.

[0073] A method for enhancing underwater crack images in a water conveyance tunnel based on mask uniformity, the method comprising the following steps:

[0074] Step 1: Collect crack images, filter and merge crack images;

[0075] The step 1 is specifically as follows:

[0076] We searched for datasets containing only cracks, including CrackDetection, ConcreteCrack, and SDNET2018. CrackDetection contains 6,069 224×224 images of bridge cracks, including both positive and negative samples. ConcreteCrack contains 40,000 227×227 images of various pavement cracks, half of which are positive and half are negative. SDNET2018 is a large concrete crack dataset covering multiple categories, including walls, bridges, and pavements, with over 56,000 256×256 images.

[0077] We selected 9,300 suitable crack images from the public datasets above, added 500 images of road and wall concrete cracks taken with mobile phones, and 200 images of underwater cracks in dams, for a total of 10,000 original datasets.

[0078] The CycleGAN style transfer model was used to train the ground crack dataset and the underwater style dataset of the water tunnel, obtaining a large number of underwater crack images of the water tunnel. From these images, 3,500 crack images that conform to the real situation were selected as the original dataset.

[0079] Step 2: Pre-process the crack image;

[0080] The step 2 is specifically as follows:

[0081] The denoising of underwater crack images in water conveyance tunnels based on wavelet transform uses a finite and decaying wavelet basis to replace the infinite trigonometric function basis in Fourier transform. The formula is as follows:

[0082]

[0083] Among them, α represents the scale of the wavelet function; τ represents the translation of the wavelet function;

[0084] Average gradient, mean square error and peak signal-to-noise ratio are used as evaluation criteria for denoised images;

[0085] MG expresses the rate at which the image changes in tiny details, reflecting the detail expression of the image. The larger the value, the stronger the image contrast. The calculation formula is as follows:

[0086]

[0087] Among them, M*N is the image size, and Represents the horizontal and vertical gradients of the image;

[0088] MSE measures the grayscale change of the image. The smaller the value, the better the noise suppression effect. The calculation formula is as follows:

[0089]

[0090] Where M·N is the image size, I(i,j) and I'(i,j) represent the grayscale of the pixel before and after filtering;

[0091] PSNR evaluates the degree of image distortion before and after filtering. The larger the value, the less image distortion. The calculation formula is as follows:

[0092]

[0093] Step 3: Use the Mask dodging algorithm to enhance the underwater crack image of the water diversion tunnel.

[0094] Step 3 includes:

[0095] The original image is divided into 16 4×4 sub-blocks and the signal-to-noise ratio (SNR) of each sub-block is calculated. i , the formula is as follows:

[0096]

[0097] in, is the grayscale mean of each sub-block, Grayscale standard deviation of each sub-block;

[0098] Calculate the maximum signal-to-noise ratio (SNR) among the 16 sub-blocks max , minimum signal-to-noise ratio SNR min , mean signal-to-noise ratio SNRm ean , the size of the filter σ is determined by the following formula:

[0099]

[0100] Among them, σ max and σ min are the maximum and minimum values ​​of σ. For underwater crack images of water conveyance tunnels, the value of σ in the range of 0 to 10 ensures better uniform light results. Therefore, σ max =10,σ min =0.

[0101] The step 3 further comprises:

[0102] Perform dynamic compression on the background image. Subtraction operation will cause the image output result to fall outside the range of 0 to 255, resulting in loss of image detail information. Dynamic compression is performed on the background image before subtraction operation, so that the subtraction result falls within the range of 0 to 255 as much as possible. The dynamic compression calculation formula is as follows:

[0103] I cbk (x,y)=α×[I bk (x,y)-I mean ]+I mean

[0104] Among them, I cbk is the background image after dynamic compression, I bk is the background image before dynamic compression, I mean is the average brightness of the original image, α is the compression coefficient, 0<α<1;

[0105] For areas with large dynamic changes, the value of α should be as small as possible. For areas with small dynamic changes, the value of α should be as large as possible. The calculation formula is as follows:

[0106] α=min(α L ,α H )

[0107] Among them, α L is the lower limit compression coefficient, which is used to make the output result I out ≥0;α H is the lower limit compression coefficient, which is used to make the output result I out ≤255;

[0108]

[0109] Among them, max(I out ) and min(I out ) represent the maximum and minimum values ​​after subtraction of the traditional Mask dodging algorithm, (x max ,y max ) and (x min ,y min ) are the coordinate positions of the maximum and minimum values ​​corresponding to the original image.

[0110] The step 3 further comprises:

[0111] When performing linear stretching, the degree of stretching needs to be suppressed. Areas with low brightness values ​​also have low contrast, so the degree of stretching needs to be increased to improve the contrast. Linear stretching is used for stretching, and the stretching parameters can be adaptively adjusted. The stretching formula is as follows:

[0112] I mout (x,y)=β×[I out (x,y)-I mean ]+I mean

[0113] Among them, I mout Represents the mean brightness of the image after stretching, I out Represents the output result of the subtraction operation, I mean Represents the brightness mean of the original image, β represents the stretching coefficient, and in order to make 1≤β≤2, the following stretching coefficient model is designed:

[0114]

[0115] Among them, I ybk Represents the background pixel value after dynamic compression processing, Indicates I ybk The maximum value of Indicates I ybk The minimum value of .

[0116] For the brightest area, At this time, β=1, the image stretching degree is the smallest; for the darkest area, At this time, β=2, the image stretching degree is the maximum, and after linear stretching processing, an image with uniform brightness distribution is obtained. Specific embodiment two:

[0118] The difference between the second embodiment of the present application and the first embodiment is that:

[0119] Because the tunnel is buried deep underground, the natural light inside the tunnel is extremely weak. Under normal circumstances, the camera cannot capture images normally and requires underwater lighting assistance. The images captured by the camera under direct lighting conditions show uneven lighting, with bright center and dark surroundings, which can easily cover up the target cracks and have a certain impact on crack detection and segmentation. Therefore, it is necessary to perform uniform lighting processing on the unevenly illuminated images to enhance the contrast between the cracks and the background.

[0120] The present invention is based on the principle of Mask dodging algorithm, and the specific scheme is as follows:

[0121] The Mask dodging algorithm was developed based on traditional optical photo printing technology. An image with uneven lighting can be viewed as the superposition of an image with uniform brightness and a noisy background image. The model is shown below:

[0122] I'(x,y)=I(x,y)+f(x,y)

[0123] Where I'(x,y) represents the image with uneven illumination, I(x,y) represents the image with uniform illumination, and f(x,y) represents the background illumination intensity variation map.

[0124] As can be seen from the formula, to remove the effects of illumination and obtain an image with uniform brightness, we first need to obtain the background illumination intensity variation map f(x,y). Then, we can subtract the background image f(x,y) from the original image I'(x,y) to obtain the uniform illumination image I(x,y). The illumination intensity variation map is usually obtained using a Gaussian low-pass filter, as shown in the following formula:

[0125]

[0126] Where D(u,v) represents the distance from point (u,v) to the origin of the frequency domain, and σ represents the scale of the Gaussian filter.

[0127] Traditional mask dodging algorithms can solve the problem of uneven image brightness distribution, but some problems still exist: 1) The filter size needs to be manually set and tuned, lacking adaptability; 2) Subtracting the original image from the background image will cause some pixel values ​​to fall outside the range of 0 to 255, resulting in a grayscale truncation effect and loss of image detail information; 3) The contrast between the crack and the background area decreases after the subtraction operation.

[0128] Aiming at the above problems, the traditional Mask dodging algorithm is improved. The improved algorithm processing flow is as follows: Figure 1 As shown, the improved principles and steps are as follows.

[0129] (1) Filter selection

[0130] Since each image is shot in a different environment, resulting in different degrees of illumination unevenness, it is necessary to adaptively adjust the filter scale σ. The specific determination steps are as follows.

[0131] ① Divide the original image into 16 4×4 sub-blocks and calculate the signal-to-noise ratio (SNR) of each sub-block. i , the formula is as follows:

[0132]

[0133] in, is the grayscale mean of each sub-block, Grayscale standard deviation of each sub-block.

[0134] ②Calculate the maximum signal-to-noise ratio (SNR) among the 16 sub-blocks max , minimum signal-to-noise ratio SNR min , mean signal-to-noise ratio SNR mean , the size of the filter σ is determined by the following formula:

[0135]

[0136] Among them, σ max and σ min are the maximum and minimum values ​​of σ. For underwater crack images of water conveyance tunnels, after experimental analysis, the value of σ in the range of 0 to 10 can ensure better uniform light results. Therefore, σ max =10,σ min =0.

[0137] (2) Dynamic compression of background images

[0138] Subtraction operations will cause the image output to fall outside the range of 0 to 255, resulting in loss of image detail information. Therefore, it is necessary to first perform dynamic compression on the background image before performing the subtraction operation, so that the subtraction result falls within the range of 0 to 255 as much as possible. The dynamic compression calculation formula is as follows:

[0139] I cbk (x,y)=α×[I bk (x,y)-I mean ]+I mean

[0140] Among them, I cbk is the background image after dynamic compression, I bk is the background image before dynamic compression, I mean is the mean brightness of the original image, α is the compression coefficient, 0<α<1.

[0141] For areas with large dynamic changes, the value of α should be as small as possible. For areas with small dynamic changes, the value of α should be as large as possible. The calculation formula is as follows:

[0142] α=min(α L ,α H )

[0143] Among them, α L is the lower limit compression coefficient, which is used to make the output result I out ≥0;α H is the lower limit compression coefficient, which is used to make the output result I out ≤255.

[0144]

[0145] Among them, max(I out ) and min(I out ) represent the maximum and minimum values ​​after subtraction of the traditional Mask dodging algorithm, (x max ,y max ) and (x min ,y min ) are the coordinate positions of the maximum and minimum values ​​corresponding to the original image.

[0146] (3) Linear stretching

[0147] After the subtraction operation, the image contrast will decrease. In order to improve the contrast of the image, stretching is required. For an image, the contrast of the area with high brightness value is also large, so the stretching degree needs to be suppressed during stretching; the contrast of the area with low brightness value is also low, so the stretching degree needs to be increased to improve the contrast. The present invention adopts linear stretching for stretching processing, and the stretching parameters can be adaptively adjusted. The stretching formula is as follows:

[0148] I mout (x,y)=β×[I out (x,y)-I mean ]+I mean

[0149] Among them, I mout Represents the mean brightness of the image after stretching, I out Represents the output result of the subtraction operation, I mean Represents the brightness mean of the original image, β represents the stretching coefficient, and in order to make 1≤β≤2, the following stretching coefficient model is designed:

[0150]

[0151] Among them, I ybk Represents the background pixel value after dynamic compression processing, Indicates I ybk The maximum value of Indicates I ybk The minimum value of .

[0152] For the brightest area, At this time, β=1, the image stretching degree is the smallest; for the darkest area, At this time, β=2, and the image stretching degree is the largest. After linear stretching processing, an image with uniform brightness distribution can be obtained.

[0153] Experimental simulation results and analysis

[0154] In order to verify the effectiveness of the improved algorithm, two underwater crack images a and b of a water diversion tunnel are randomly selected from the dataset, as shown in Figure 2 As shown in the figure, the traditional mask dodging algorithm, the improved mask dodging algorithm, and the Wallis algorithm are used for processing, and the processing results are evaluated from both subjective and objective perspectives. The main evaluation indicators used are mean absolute error (MAE), signal-to-noise ratio (SNR), and peak signal-to-noise ratio (PSNR).

[0155] The improved Mask dodging algorithm of the present invention first obtains the light intensity distribution image through Gaussian low-pass filtering, then obtains the preliminary dodging image by subtracting the original image from the light intensity distribution map, and finally obtains the final dodging image by linear stretching.

[0156] The uniform light treatment process of crack a and crack b is as follows Figure 3 As shown in the figure, it can be seen that the crack image after uniform light processing can clearly see the crack compared with the original image.

[0157] The cracks a and b are uniformly treated using the traditional Mask algorithm, the improved Mask algorithm of the present invention and the Wallis algorithm. The results are shown in Figure 2. Figure 4 shown.

[0158] Subjectively, the crack images processed using the improved mask dodging algorithm show a significant improvement in contrast compared to the original images, with even brightness distribution and a more consistent contrast. The crack images processed using the traditional mask dodging algorithm also show significant improvement compared to the original images, but the effect is slightly worse than that of the improved mask dodging algorithm. The crack images processed using the Wallis algorithm also show less than ideal dodging, with significant image blockiness and areas of excessive brightness and darkness.

[0159] Objectively, the dodging effects of the three algorithms were evaluated using absolute error, signal-to-noise ratio, and peak signal-to-noise ratio. The results are shown in Tables 1 and 2.

[0160] Table 1 Parameter evaluation of uniform light effect of crack a

[0161]

[0162] Table 2 Parameter evaluation of the uniform light effect of crack b

[0163]

[0164] As can be seen from the table above, the improved Mask dodging algorithm of the present invention outperforms the other two algorithms in all three indicators. From a data perspective, compared with the traditional Mask dodging algorithm, the improved Mask dodging algorithm has an improvement of about 5% in the three indicators of SNR, PSNR, and MAE. Compared with the Wallis algorithm, the improved Mask dodging algorithm has obvious advantages in MAW, SNR, and PSNR, among which PSNR has increased by more than 20%, and MAE is only about 60% of the Wallis algorithm. The above illustrates the effectiveness of the improved Mask dodging algorithm of the present invention in de-lighting underwater crack images of water supply tunnels.

[0165] This paper addresses the problem of a dataset of underwater crack images of water conveyance tunnels that is currently unavailable for research at home and abroad. To address this issue, the present invention proposes using a style transfer network, CycleGAN, to generate underwater cracks in water conveyance tunnels. First, the characteristics of the underwater environment of water conveyance tunnels were analyzed. Using land concrete cracks as the images to be converted and images of real underwater water conveyance tunnel environments as style images, the CycleGAN model was trained to generate a large number of underwater style crack images of water conveyance tunnels, from which images with better quality were selected. Then, commonly used denoising methods were compared, and finally, wavelet transform was used for image denoising. Finally, improvements were made based on the Mask uniform illumination algorithm and experimental comparisons were conducted. The results showed that the improved algorithm of the present invention has a better de-lighting effect than the original algorithm, resulting in better image quality and solving the problem of uneven illumination in water conveyance tunnel images. Specific embodiment three:

[0167] The only difference between the third embodiment of the present application and the second embodiment is that:

[0168] The present invention provides a mask-based underwater crack image enhancement system for a water conveyance tunnel, the system comprising:

[0169] A data acquisition module, wherein the data acquisition module collects crack images and screens and merges the crack images;

[0170] A pre-processing module, wherein the pre-processing module performs pre-mathematical processing on the crack image;

[0171] The image enhancement module uses a mask dodging algorithm to enhance the image of underwater cracks in the water conveyance tunnel. Specific embodiment four:

[0173] The only difference between the fourth embodiment of the present application and the third embodiment is that:

[0174] The present invention provides a computer-readable storage medium having a computer program stored thereon. The program is executed by a processor to implement a method for enhancing underwater crack images in a water conveyance tunnel based on mask uniformity.

[0175] The method comprises the following steps:

[0176] Step 1: Collect crack images, filter and merge crack images;

[0177] Step 2: Pre-process the crack image;

[0178] The step 2 is specifically as follows:

[0179] The denoising of underwater crack images in water conveyance tunnels based on wavelet transform uses a finite and decaying wavelet basis to replace the infinite trigonometric function basis in Fourier transform. The formula is as follows:

[0180]

[0181] Among them, α represents the scale of the wavelet function; τ represents the translation of the wavelet function;

[0182] Average gradient, mean square error and peak signal-to-noise ratio are used as evaluation criteria for denoised images;

[0183] MG expresses the rate at which the image changes in tiny details, reflecting the detail expression of the image. The larger the value, the stronger the image contrast. The calculation formula is as follows:

[0184]

[0185] Among them, M*N is the image size, and Represents the horizontal and vertical gradients of the image;

[0186] MSE measures the grayscale change of the image. The smaller the value, the better the noise suppression effect. The calculation formula is as follows:

[0187]

[0188] Where M·N is the image size, I(i,j) and I'(i,j) represent the grayscale of the pixel before and after filtering;

[0189] PSNR evaluates the degree of image distortion before and after filtering. The larger the value, the less image distortion. The calculation formula is as follows:

[0190]

[0191] Step 3: Use the Mask dodging algorithm to enhance the underwater crack image of the water diversion tunnel.

[0192] Step 3 includes:

[0193] The original image is divided into 16 4×4 sub-blocks and the signal-to-noise ratio (SNR) of each sub-block is calculated.i , the formula is as follows:

[0194]

[0195] in, is the grayscale mean of each sub-block, Grayscale standard deviation of each sub-block;

[0196] Calculate the maximum signal-to-noise ratio (SNR) among the 16 sub-blocks max , minimum signal-to-noise ratio SNR min , mean signal-to-noise ratio SNRm ean , the size of the filter σ is determined by the following formula:

[0197]

[0198] Among them, σ max and σ min are the maximum and minimum values ​​of σ. For underwater crack images of water conveyance tunnels, the value of σ in the range of 0 to 10 ensures better uniform light results. Therefore, σ max =10,σ min =0.

[0199] The step 3 further comprises:

[0200] Perform dynamic compression on the background image. Subtraction operation will cause the image output result to fall outside the range of 0 to 255, resulting in loss of image detail information. Dynamic compression is performed on the background image before subtraction operation, so that the subtraction result falls within the range of 0 to 255 as much as possible. The dynamic compression calculation formula is as follows:

[0201] I cbk (x,y)=α×[I bk (x,y)-I mean ]+I mean

[0202] Among them, I cbk is the background image after dynamic compression, I bk is the background image before dynamic compression, I mean is the average brightness of the original image, α is the compression coefficient, 0<α<1;

[0203] For areas with large dynamic changes, the value of α should be as small as possible. For areas with small dynamic changes, the value of α should be as large as possible. The calculation formula is as follows:

[0204] α=min(α L ,α H )

[0205] Among them, α Lis the lower limit compression coefficient, which is used to make the output result I out ≥0;α H is the lower limit compression coefficient, which is used to make the output result I out ≤255;

[0206]

[0207] Among them, max(I out ) and min(I out ) represent the maximum and minimum values ​​after subtraction of the traditional Mask dodging algorithm, (x max ,y max ) and (x min ,y min ) are the coordinate positions of the maximum and minimum values ​​corresponding to the original image.

[0208] The step 3 further comprises:

[0209] When performing linear stretching, the degree of stretching needs to be suppressed. Areas with low brightness values ​​also have low contrast, so the degree of stretching needs to be increased to improve the contrast. Linear stretching is used for stretching, and the stretching parameters can be adaptively adjusted. The stretching formula is as follows:

[0210] I mout (x,y)=β×[I out (x,y)-I mean ]+I mean

[0211] Among them, I mout Represents the mean brightness of the image after stretching, I out Represents the output result of the subtraction operation, I mean Represents the brightness mean of the original image, β represents the stretching coefficient, and in order to make 1≤β≤2, the following stretching coefficient model is designed:

[0212]

[0213] Among them, I ybk Represents the background pixel value after dynamic compression processing, Indicates I ybk The maximum value of Indicates I ybk The minimum value of .

[0214] For the brightest area, At this time, β=1, the image stretching degree is the smallest; for the darkest area, At this time, β=2, the image stretching degree is the maximum, and after linear stretching processing, an image with uniform brightness distribution is obtained. Specific embodiment five:

[0216] The only difference between the fifth embodiment of the present application and the fourth embodiment is that:

[0217] The present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements a method for enhancing underwater crack images of a water conveyance tunnel based on mask uniformity when executing the computer program.

[0218] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in an appropriate manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples, unless otherwise clearly defined. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In the description of the present invention, "N" means at least two, such as two, three, etc., unless otherwise clearly defined. Any process or method description in a flowchart or otherwise described herein can be understood to represent a module, segment, or portion of code comprising one or more executable instructions for implementing a custom logic function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may be performed in a different order than shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which the embodiments of the present invention pertain. The logic and / or steps shown in a flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logic function, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or for use in conjunction with such instruction execution systems, apparatuses, or devices. For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution systems, apparatuses, or devices. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection having one or N wirings (electronic devices), a portable computer disk cartridge (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM).In addition, the computer-readable medium may even be paper or other suitable medium on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, then editing, interpreting, or processing in other suitable ways as necessary, and then storing it in a computer memory. It should be understood that the various parts of the present invention can be implemented with hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented with hardware, as in another embodiment, any one of the following technologies known in the art or their combination can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0219] The above description is merely a preferred embodiment of a method for enhancing underwater crack images in water transfer tunnels based on masked light uniforming. The scope of protection for a method for enhancing underwater crack images in water transfer tunnels based on masked light uniforming is not limited to the aforementioned embodiment; all technical solutions based on this concept fall within the scope of protection of the present invention. It should be noted that improvements and variations that do not depart from the principles of the present invention, as readily apparent to those skilled in the art, should also be considered within the scope of protection of the present invention.

Claims

1. A method for enhancing underwater crack images in water transfer tunnels based on mask uniformity, characterized by: The method comprises the following steps: Step 1: Collect crack images, filter and merge crack images; Step 2: Pre-process the crack image; Step 3: Use the Mask dodging algorithm to enhance the underwater crack image of the water transfer tunnel; Step 3 includes: The original image is divided into 16 4×4 sub-blocks and the signal-to-noise ratio (SNR) of each sub-block is calculated. i , the formula is as follows: in, is the grayscale mean of each sub-block, Grayscale standard deviation of each sub-block; Calculate the maximum signal-to-noise ratio (SNR) among the 16 sub-blocks max , minimum signal-to-noise ratio SNR min , mean signal-to-noise ratio SNR mean , the size of the filter σ is determined by the following formula: Among them, σ max and σ min are the maximum and minimum values ​​of σ. For underwater crack images of water conveyance tunnels, the value of σ in the range of 0 to 10 ensures better uniform light results. Therefore, σ max =10,σ min =0; The step 3 further comprises: Perform dynamic compression on the background image. Subtraction operation will cause the image output result to fall outside the range of 0 to 255, resulting in loss of image detail information. Dynamic compression is performed on the background image before subtraction operation, so that the subtraction result falls within the range of 0 to 255 as much as possible. The dynamic compression calculation formula is as follows: I cbk (x,y)=α×[I bk (x,y)-I mean ]+I mean Among them, I cbk is the background image after dynamic compression, I bk is the background image before dynamic compression, I mean is the average brightness of the original image, α is the compression coefficient, 0<α<1; For areas with large dynamic changes, the value of α should be as small as possible. For areas with small dynamic changes, the value of α should be as large as possible. The calculation formula is as follows: α=min(α L ,a H ) Among them, α L is the lower limit compression coefficient, which is used to make the output result I out ≥0;α H is the upper limit compression coefficient, which is used to make the output result I out ≤255; Among them, max(I out ) and min(I out ) represent the maximum and minimum values ​​after subtraction of the traditional Mask dodging algorithm, (x max ,y max ) and (x min ,y min ) are the coordinate positions of the maximum and minimum values ​​corresponding to the original image.

2. The method according to claim 1, wherein: The step 1 is specifically as follows: We searched for datasets containing only cracks, including CrackDetection, ConcreteCrack, and SDNET2018. CrackDetection contains 6,069 224×224 images of bridge cracks, including both positive and negative samples. ConcreteCrack contains 40,000 227×227 images of various pavement cracks, half of which are positive and half are negative. SDNET2018 is a large concrete crack dataset covering multiple categories of walls, bridges, and pavements, with over 56,000 256×256 images. We selected 9,300 suitable crack images from the public datasets above, added 500 images of road and wall concrete cracks taken with mobile phones, and 200 images of underwater cracks in dams, for a total of 10,000 original datasets. The CycleGAN style transfer model was used to train the ground crack dataset and the underwater style dataset of the water tunnel, obtaining a large number of underwater crack images of the water tunnel. From these images, 3,500 crack images that conform to the real situation were selected as the original dataset.

3. The method according to claim 2, wherein: The step 3 further comprises: When performing linear stretching, the degree of stretching needs to be suppressed. Areas with low brightness values ​​also have low contrast, so the degree of stretching needs to be increased to improve the contrast. Linear stretching is used for stretching, and the stretching parameters can be adaptively adjusted. The stretching formula is as follows: I mout (x,y)=β×[I out (x,y)-I mean ]+I mean Among them, I mout Represents the mean brightness of the image after stretching, I out Represents the output result of the subtraction operation, I mean Represents the brightness mean of the original image, β represents the stretching coefficient, and in order to make 1≤β≤2, the following stretching coefficient model is designed: Among them, I ybk Represents the background pixel value after dynamic compression processing, Indicates I ybk The maximum value of Indicates I ybk The minimum value of .

4. The method according to claim 3, wherein: For the brightest area, At this time, β=1, the image stretching degree is the smallest; for the darkest area, At this time, β=2, the image stretching degree is the maximum, and after linear stretching processing, an image with uniform brightness distribution is obtained.

5. A mask-based underwater crack image enhancement system for water conveyance tunnels, the system operating based on the mask-based uniforming method for underwater crack image enhancement in water conveyance tunnels according to claim 1, characterized by: The system comprises: A data acquisition module, wherein the data acquisition module collects crack images and screens and merges the crack images; A pre-processing module, wherein the pre-processing module performs pre-mathematical processing on the crack image; The image enhancement module uses a mask dodging algorithm to enhance the image of underwater cracks in the water conveyance tunnel.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement a method for enhancing underwater crack images in a water conveyance tunnel based on mask uniformity as claimed in any one of claims 1 to 4.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, it implements any one of claims 1-4, a method for enhancing underwater crack images in a water transfer tunnel based on mask uniformity.

Citation Information

Patent Citations

  • Method for processing and identifying a pavement crack digital image

    CN111145161A

  • Multi-dimensional pavement disease data set construction method

    CN115329109A

  • Automobile bearing wear state detection method and device and storage medium

    CN116309294A