Three-dimensional reconstruction method and system for underwater concrete apparent diseases
By using adaptive color correction and an improved Retinex algorithm to process underwater images, the problems of color cast and detail blurring in underwater images are solved, and the accuracy of three-dimensional reconstruction of surface defects in underwater concrete is improved. This method is suitable for on-site inspection in water conservancy and hydropower projects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUIXIN PLUS (SUZHOU) INTELLIGENT TECH CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-04-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The lack of an adaptive color compensation mechanism in existing technologies means that underwater image enhancement algorithms cannot simultaneously solve problems such as color shift, detail blur, and edge blur, resulting in low accuracy in the three-dimensional reconstruction of underwater concrete surface defects, which is difficult to meet the actual testing needs of engineering projects.
An adaptive color correction method combined with an improved Retinex algorithm and image fusion technology is used to process underwater images through adaptive color correction, detail enhancement branches, and edge enhancement branches to generate high-quality enhanced images, perform refraction correction, and finally perform 3D reconstruction.
It achieves efficient elimination of color cast in complex underwater environments, restores image details and edge features, significantly improves the accuracy of 3D reconstruction, adapts to the needs of engineering field inspection, and has low computational cost.
Smart Images

Figure CN121921452A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater image processing and three-dimensional reconstruction technology, and in particular to a three-dimensional reconstruction method and system for underwater concrete surface defects. Background Technology
[0002] Water conservancy dams play a vital role in flood control, power generation, and irrigation. Due to long-term immersion in the underwater environment, the concrete structure of dams is highly susceptible to erosion, scouring, freeze-thaw cycles, and other factors, resulting in various surface defects such as cracks, spalling, and voids. If these defects are not detected and repaired in time, they will seriously threaten the structural safety and operational stability of the dam. Therefore, it is necessary to regularly inspect the condition of the defects.
[0003] To more comprehensively and accurately assess the severity of underwater concrete surface defects, 3D reconstruction technology has been introduced into the field of underwater inspection. In the 3D reconstruction process, the quality of the input underwater image determines the quality of the reconstruction result. However, in practical applications, the quality of underwater images often fails to meet the feature point requirements for 3D reconstruction. Two types of enhancement methods exist to address the underwater image quality problem: one is based on deep learning models, which, while effective, has high computational costs; the other is traditional methods based on algorithm fusion for image enhancement. However, real-world underwater images commonly suffer from color casts and blurred details. Underwater image enhancement algorithms have poor universality and robustness, making it difficult to adapt to complex underwater environments with varying turbidity and lighting conditions. Furthermore, the lack of consideration for underwater imaging refraction effects leads to distortion of the object-image mapping relationship, reducing reconstruction accuracy. These algorithms also rely on a single image enhancement strategy, making it difficult to simultaneously address multiple problems such as color casts, blurred details, and low contrast in underwater images, thus negatively impacting feature point extraction and matching during 3D reconstruction.
[0004] Therefore, there is an urgent need for an image processing method that is adapted to complex underwater environments and can efficiently achieve underwater image color correction and collaborative enhancement of details and edges, so as to provide a high-quality image foundation for the three-dimensional reconstruction of underwater images. Summary of the Invention
[0005] The purpose of this invention is to provide a three-dimensional reconstruction method for underwater concrete surface defects, in order to solve the problems in the existing technology, such as the lack of an adaptive color compensation mechanism, the easy generation of halo artifacts and the need for manual parameter adjustment, and the inability of a single enhancement strategy to take into account both underwater image detail restoration and edge enhancement, which ultimately leads to poor image processing results and low accuracy of underwater image three-dimensional reconstruction.
[0006] The technical solution of this invention is: a three-dimensional reconstruction method for underwater concrete surface defects, comprising: Acquire raw images of underwater target objects from different perspectives; The original image is subjected to adaptive color correction processing to obtain a color-corrected image; the adaptive color correction includes channel compensation based on color channel loss relationship and color balance operation; The color-corrected image is processed by a detail enhancement branch and an edge enhancement branch based on the improved Retinex algorithm to obtain a detail-enhanced image and an edge-enhanced image, respectively. The improved Retinex algorithm corrects the illumination component in the color-corrected image through guided filtering and combines adaptive contrast modulation and offset compensation to achieve dynamic enhancement of the reflection component. The detail enhancement image and the edge enhancement image are fused together using an image fusion algorithm to obtain an enhanced image; The enhanced image after refraction correction is reconstructed in three dimensions to generate a three-dimensional model of the underwater target object.
[0007] Preferably, the adaptive color correction further includes: determining whether the compensation condition is met based on the average pixel value of each color channel of the original image; if the compensation condition is met, then channel compensation and color balance operations are performed sequentially; otherwise, only color balance operation is performed; the compensation condition is whether the ratio of the sum of the average pixel values of the red and blue channels to the sum of the average pixel values of the red, green, and blue color channels is greater than or equal to a condition threshold; when the ratio is greater than or equal to the condition threshold, the compensation condition is determined to be met.
[0008] Preferably, the channel compensation is achieved by determining a compensation coefficient for the corresponding color channel based on the difference between the average pixel values of each color channel, and then using the compensation coefficient for the corresponding color channel to perform pixel-by-pixel correction on the pixel value of the corresponding color channel. , , ; in, , and The indices in the corrected red, green, and blue channels are respectively: The pixel value of the pixel; , and The indices for each color channel of the original image are: The pixel value of the pixel; , and These represent the average pixel values of each color channel in the original image; , and These are the compensation coefficients for the red, green, and blue channels, respectively.
[0009] Preferably, the method for determining the compensation coefficient is as follows: A preset channel loss threshold is used to compare the difference in average pixel values of each color channel of the original image with the channel loss threshold to determine the compensation mode. The compensation coefficients for the corresponding color channels are obtained based on the calculation method of each compensation coefficient in the aforementioned compensation mode.
[0010] Preferably, the color balance operation includes: Calculate the quantiles of each color channel in the input image, including the first quantile and the second quantile; the first quantile is less than the second quantile. Obtain the first quantile pixel value and the second quantile pixel value of the corresponding color channel, and determine the effective range of pixel values for each color channel based on the first quantile pixel value and the second quantile pixel value. The pixel values in each color channel that exceed the corresponding valid range are truncated and normalized to obtain the output image.
[0011] Preferably, the detail enhancement branch includes: performing multi-scale decomposition on the color-corrected image to obtain a detail layer, fusing the detail layer with the color-corrected image at the pixel level, and performing non-linear enhancement processing on the fusion result to obtain a detail-enhanced image.
[0012] Preferably, the improved Retinex algorithm includes: The first illumination component is obtained based on the components of each color channel in the color-corrected image, and the second illumination component is obtained by combining the global adaptive method. A guided filter is used to construct an illumination component correction model. Based on the illumination component correction model, the second illumination component is processed to obtain the third illumination component. The contrast enhancement factor is determined based on the distribution characteristics of the second illumination component, and a logarithmic model is constructed by combining the second illumination component, the third illumination component, and the adaptive offset. The contrast enhancement factor is used to weight the logarithmic model to obtain the reflection component. The adaptive offset is a parameter that is adaptively corrected based on the second illumination component. The color-corrected image is sharpened, and the sharpened color-corrected image is reconstructed using the reflection component and the first illumination component. The color balance operation is then performed to obtain an edge-enhanced image.
[0013] Preferably, the method for determining the contrast enhancement factor is as follows: based on the ratio of the second illumination component to its global maximum value, a global gain term and a nonlinear exponential term are constructed by introducing preset control parameters, and the contrast enhancement factor of the color-corrected image is calculated pixel by pixel. , in, For color-corrected images, the index is The contrast enhancement factor of the pixels; For index The second illumination component value of the pixel; This represents the maximum value of the second illumination component; The preset control parameters were calibrated through experiments.
[0014] Preferably, the reconstruction involves using the ratio of the reflection component to the first illumination component as a correction factor applied to the sharpened color-corrected image to complete the reconstruction. , in, The index in the reconstructed sharpened color-corrected image is The pixel value of the pixel; Is the index as The reflection component of the pixel; Is the index as The first illumination component of the pixel, This is the sharpened, color-corrected image.
[0015] On the other hand, this application also discloses a three-dimensional reconstruction system for underwater concrete surface defects, including: The image acquisition module is used to acquire raw images of underwater target objects from different perspectives; The color correction module is used to perform adaptive color correction processing on the original image to obtain a color-corrected image; the adaptive color correction includes channel compensation based on color channel loss relationship and color balance operation; A multi-scale fusion module is used to process the color-corrected image through a detail enhancement branch and an edge enhancement branch based on the improved Retinex algorithm, obtaining a detail-enhanced image and an edge-enhanced image respectively. The detail-enhanced image and the edge-enhanced image are then fused based on an image fusion algorithm to obtain an enhanced image. The improved Retinex algorithm corrects the illumination component in the color-corrected image through guided filtering and combines adaptive contrast modulation and offset compensation to achieve dynamic enhancement of the reflection component. The 3D reconstruction module is used to perform 3D reconstruction on the enhanced image after refraction correction, generating a 3D model of the underwater target object.
[0016] Compared with the prior art, the advantages of the present invention are: (1) The adaptive color correction scheme proposed in this invention can achieve pixel-level channel compensation and color balance processing based on the color channel loss relationship. No manual parameter adjustment is required throughout the process. It can adapt to complex underwater environments with different turbidity and lighting conditions. It can efficiently and accurately eliminate the color deviation problem of underwater images, restore the true color information of the image, and provide a high-quality foundation for subsequent image enhancement processing.
[0017] (2) The dual-branch collaborative enhancement structure constructed in this invention, combined with the improved Retinex algorithm, can effectively avoid the halo artifact problem in the underwater image enhancement process by guiding the filtering to correct the illumination component; the differentiated processing of detail enhancement and edge enhancement branches, combined with the image fusion algorithm, can simultaneously realize the accurate restoration of underwater image detail texture and the effective enhancement of edge contour, greatly improve the image contrast and effective information content, and make image feature points easier to extract and match.
[0018] (3) This invention integrates adaptive color correction, dual-branch collaborative enhancement and multi-scale fusion into an integrated underwater image optimization processing flow. The output enhanced image has high color fidelity, clear details and distinct edge features, which can significantly improve the number of feature points extracted and the matching accuracy, providing a high-quality image foundation for the three-dimensional reconstruction of underwater concrete surface defects, thereby effectively improving the overall accuracy of three-dimensional reconstruction. Moreover, the calculation logic of this scheme is simple, does not require high-performance hardware support, has low implementation cost, and can be well adapted to the actual application needs of engineering sites. Attached Figure Description
[0019] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 This is a flowchart of a three-dimensional reconstruction method for underwater concrete surface defects according to the present invention; Figure 2 This is a diagram showing the 3D reconstruction result based on detail-enhanced images according to the present invention; Figure 3 This is a diagram showing the 3D reconstruction result based on edge-enhanced images according to the present invention; Figure 4 This is a diagram showing the 3D reconstruction result based on enhanced images according to the present invention; Figure 5 This is a structural block diagram of a three-dimensional reconstruction system for underwater concrete surface defects according to the present invention. Detailed Implementation
[0020] The present invention will be further described in detail below with reference to specific embodiments: This invention is applicable to underwater concrete structure inspection scenarios in water-related projects such as water conservancy and hydropower, ports and wharves, cross-sea bridges, and submarine tunnels. It can perform three-dimensional reconstruction of surface defects such as spalling, cracks, and exposed rebar in components such as dam stilling basins, bridge pile foundations, and wharf caissons, providing quantitative basis for defect assessment and repair. On-site inspection can be carried out by simply acquiring multi-view images with a low-cost underwater camera, meeting the needs of convenient on-site inspection in engineering projects.
[0021] Current technologies in this field are insufficient to meet the actual detection needs of the aforementioned scenarios. The core technical problem to be solved in this application is that existing underwater image processing lacks an adaptive color compensation mechanism, is prone to producing halo artifacts, and a single enhancement strategy cannot take into account both details and edges, resulting in insufficient image feature points. At the same time, underwater imaging refraction distortion is not considered. In addition, deep learning solutions are costly and laser scanning technology is difficult to promote, ultimately resulting in low accuracy of three-dimensional reconstruction of underwater concrete surface defects, which is difficult to meet the application needs of actual engineering detection.
[0022] like Figure 1 As shown, the present invention proposes a three-dimensional reconstruction method for underwater concrete surface defects, comprising: S1. Obtain original images of underwater concrete from different perspectives.
[0023] Specifically, underwater cameras are used to acquire multi-view images of underwater concrete areas, providing a precise imaging parameter basis for subsequent image processing and 3D reconstruction.
[0024] In one implementation, an underwater monocular camera of model UW-S12ZP-C is used to capture images of an underwater concrete block from different perspectives. The angle interval between each shot is less than 5° to ensure feature overlap and rich information between images, and a total of 17 images from different angles are captured.
[0025] S2. Perform adaptive color correction processing on the original image to obtain a color-corrected image; wherein, adaptive color correction includes channel compensation based on color channel loss relationship and color balance operation.
[0026] Specifically, the adaptive color correction used in this step is based on the color channel loss relationship of underwater imaging. The core includes two operations: channel compensation and color balance. By performing targeted color correction and global color balance adjustment on the red, green and blue color channels of the original image, the color cast problem caused by the underwater environment is eliminated, the true color information of the image is restored, and a color-corrected image that meets the requirements of subsequent image enhancement processing is output.
[0027] In one implementation, a channel compensation operation based on the color channel loss relationship is performed on the original image. For the different loss conditions of each color channel during underwater light propagation, targeted compensation is performed on the color loss channels to make up for the color loss of the channels. After the channel compensation is completed, a color balance operation is performed on the image to globally adapt and adjust the color distribution of each color channel, balance the color performance of the entire image, and finally obtain a color-corrected image with accurate color reproduction.
[0028] S3. The color-corrected image is processed through a detail enhancement branch and an edge enhancement branch based on the improved Retinex algorithm to obtain a detail-enhanced image and an edge-enhanced image, respectively. The improved Retinex algorithm corrects the illumination component in the color-corrected image through guided filtering and combines adaptive contrast modulation and offset compensation to achieve dynamic enhancement of the reflection component.
[0029] Specifically, the detail enhancement branch is a dedicated feature enhancement chain designed to address the problem of blurred details in underwater images, used to extract and enhance subtle texture features in the image; the improved Retinex algorithm is an optimized version of the Retinex algorithm, adapted to the lighting characteristics of underwater imaging; guided filtering is an edge-preserving filtering method that can retain edge information during image smoothing; the illumination component is the brightness component in the image determined by ambient lighting conditions, and the reflection component is the core image feature component formed by the reflection of light from the surface of the target object.
[0030] Adaptive contrast modulation is a processing method that dynamically adjusts contrast based on local image features, while offset compensation is an adaptive parameter correction method for pixel value offsets. This step uses dual-branch differential enhancement processing to restore underwater image detail texture and enhance edge contours, respectively. The improved Retinex algorithm accurately corrects the illumination component through guided filtering, and combines adaptive contrast modulation and offset compensation to dynamically enhance the reflection component, effectively solving the problems of detail loss and edge blurring in underwater images. The output detail-enhanced and edge-enhanced images lay a high-quality feature foundation for subsequent multi-scale fusion.
[0031] In one implementation, the color-corrected image is simultaneously input to a detail enhancement branch and an edge enhancement branch for parallel processing. The detail enhancement branch extracts and enhances the detail features of the color-corrected image and outputs a detail-enhanced image. The edge enhancement branch first extracts the illumination component of the color-corrected image, uses guided filtering to correct the illumination component, and then sequentially performs adaptive contrast modulation and offset compensation operations to achieve dynamic enhancement of the image reflection component. After completing the edge feature enhancement, the edge enhancement image is output. The dual-branch processing retains the color restoration effect of the color-corrected image throughout the process, ensuring that the output image has no secondary color shift.
[0032] S4. Based on the image fusion algorithm, the detail enhancement image and the edge enhancement image are fused to obtain the enhanced image.
[0033] This step uses the algorithm to fuse the detail-enhanced image and edge-enhanced image output from the dual branches. The core is to integrate the feature advantages of the two types of images, combining clear disease detail textures and distinct disease edge contours into the same image. The output enhanced image has both detail and edge feature clarity, solving the feature loss problem of a single enhanced image, and providing a high feature recognition image foundation for subsequent refraction correction and 3D reconstruction.
[0034] In one implementation, the image fusion algorithm employs the non-subsampled shearlet transform (NSST) algorithm. NSST is a commonly used multi-image fusion algorithm, a multi-scale, multi-directional decomposition algorithm that can achieve fine decomposition and reconstruction of images without subsampling, effectively preserving image details, textures, and edge contours. Specifically, in this implementation, the detail enhancement image and the edge enhancement image are simultaneously processed using the NSST algorithm. First, the two images are decomposed at multiple scales and in multiple directions to obtain their respective low-frequency and high-frequency components. A mean fusion strategy is used for the low-frequency components to preserve the overall grayscale and color information of the image, while a maximum absolute value fusion strategy is used for the high-frequency components to accurately preserve the details, textures, and edge contours of both images. Then, the fused low-frequency and high-frequency components undergo an inverse NSST transform to complete image reconstruction, ultimately outputting an enhanced image with both clear details and sharp edges.
[0035] S5. Perform three-dimensional reconstruction on the enhanced image after refraction correction to generate a three-dimensional model of underwater concrete.
[0036] Specifically, the enhanced image after refraction correction is a high-quality underwater image that has undergone color correction, bi-branch enhancement, multi-scale fusion, and refraction distortion correction. It retains the clear details, textures, and edge contours of underwater concrete, and the spatial positions of feature points are accurate. 3D reconstruction is the technical process of converting a 2D image into a 3D spatial model. This step is based on this type of high-quality image to carry out 3D reconstruction. The core is to extract the spatial feature information of underwater concrete in the image and complete the 3D reconstruction. The final generated 3D underwater concrete model can restore its structural morphology and the spatial position and shape of apparent defects, providing intuitive and quantitative 3D data support for the detection and evaluation of underwater concrete structures.
[0037] In one implementation, the underwater imaging refraction process is simplified based on Snell's theorem, reducing it to a double refraction involving water, glass, and air. The camera lens is parallel to the water surface, and refraction occurs only at the interfaces of two media: the interface between water and the lens protective glass, and the interface between the glass and the air inside the camera. The refractive indices of water, glass, and air are pre-calibrated, and the geometric mapping relationship between the incident angle and the refraction angle at these two interfaces is established using Snell's theorem. Based on the lens's parallel-to-water-surface configuration, and ignoring secondary factors such as water scattering and stray lens refraction, a refraction mapping model between the actual underwater object point and the original image point in the enhanced image is constructed. A coordinate transformation formula for refraction distortion is derived, and each pixel of the original image point in the enhanced image is substituted into the formula for coordinate correction. The accurate image point coordinates after refraction correction are obtained, completing the refraction distortion correction of the entire enhanced image and achieving accurate restoration of the object-image mapping relationship.
[0038] The 3D reconstruction in this embodiment is based on the enhanced image after refraction correction, and adopts a commonly used 3D reconstruction method in the field: First, feature points are extracted and matched on the enhanced image after refraction correction. The matched feature points are used as input data for the Structure from Motion (SFM) algorithm to perform sparse reconstruction, outputting a sparse point cloud of underwater concrete. Then, using the sparse point cloud as input, dense reconstruction is performed through the Multi-View Stereo (MVS) method to obtain a dense point cloud and a 3D surface mesh of underwater concrete. After texture mapping of the dense point cloud and the 3D surface mesh using the Meshlab tool, a high-precision 3D model of underwater concrete is obtained.
[0039] In summary, this invention proposes a 3D reconstruction method for underwater concrete surface defects. It constructs a complete technical chain from underwater multi-view image acquisition to adaptive color correction, dual-branch image enhancement, non-subsampled shear wave transform fusion, and finally, 3D reconstruction after refraction correction. The synergistic effect of each step achieves comprehensive optimization of underwater image quality and high-precision 3D reconstruction. This method, through adaptive color correction based on color channel loss relationships, can adapt to complex underwater environments with varying turbidity and lighting without manual parameter tuning, effectively eliminating image color cast. Relying on the detail enhancement branch and the improved Retinex algorithm's edge enhancement branch, it avoids the halo artifact problem of traditional algorithms while simultaneously restoring image details and textures and strengthening edge contours. Multi-scale fusion integrates the advantages of the dual-branch features, significantly improving the image's feature point recognition accuracy. Finally, 3D reconstruction is performed based on the optimized enhanced image, providing high-quality image support for feature point extraction and matching of underwater concrete surface defects, effectively improving the overall accuracy of 3D reconstruction. Furthermore, the overall solution is built based on traditional optical algorithms, resulting in low computational cost, convenient deployment, and direct adaptation to the actual underwater inspection needs of engineering sites.
[0040] Based on the aforementioned three-dimensional reconstruction method for underwater concrete surface defects, the technical details of this invention will be further explained below. The adaptive color correction further includes: determining whether a compensation condition is met based on the average pixel values of each color channel of the original image; if the compensation condition is met, channel compensation and color balancing operations are performed sequentially; otherwise, only color balancing is performed. The compensation condition is calculated by determining whether the ratio of the sum of the average pixel values of the red and blue channels to the sum of the average pixel values of the red, green, and blue color channels is greater than or equal to a condition threshold; when the ratio is greater than or equal to the condition threshold, the compensation condition is deemed met.
[0041] Specifically, the compensation condition determination is a preliminary determination step in adaptive color correction. It is based on the average pixel values of the red, green, and blue channels of the original image to quantify the degree of color loss caused by underwater imaging, thereby determining the subsequent color correction execution process. This step makes the color correction operation more targeted, avoids performing meaningless channel compensation on low-loss images, improves the overall color correction processing efficiency, and further enhances the adaptive characteristics of color correction, matching the actual color loss of different underwater images without manual intervention.
[0042] In one implementation, the average pixel value of the red, green, and blue color channels in the original image is calculated based on the green channel, which has better preservation performance in underwater imaging. In this implementation, the compensation condition is set as follows: , in, , and These represent the average pixel values of the red, green, and blue color channels, respectively. In this implementation, the threshold is set to 2 / 3. Under ideal color balance (white balance), the average pixel values of the red, green, and blue channels should be approximately equal, resulting in a ratio of about 2 / 3. If this ratio is greater than or equal to 2 / 3, it means that the sum of the average pixel values of the red and blue channels is twice or more than twice the average pixel value of the green channel. This contradicts the better preservation effect of the green channel in underwater images in an underwater environment, thus requiring color processing. When the above compensation conditions are met, it indicates that the pixel loss in the red and blue channels of the original image is controllable, and channel compensation and color balancing operations will be performed subsequently. If the above compensation conditions are not met, it indicates that the red and blue channels are severely lost, and color cast can be directly removed through color balancing operations without channel compensation.
[0043] Channel compensation determines the compensation coefficient for the corresponding color channel based on the difference between the average pixel values of each color channel, and then uses the compensation coefficient to correct the pixel value of the corresponding color channel pixel by pixel. , , ; in, , and The indices in the corrected red, green, and blue channels are respectively: The pixel value of the pixel; , and The indices for each color channel of the original image are: The pixel value of the pixel; , and These represent the average pixel values of each color channel in the original image; , and These are the compensation coefficients for the red, green, and blue channels, respectively.
[0044] The method for determining the compensation coefficient is as follows: A preset channel loss threshold is used to compare the difference in average pixel values of each color channel in the original image with the channel loss threshold to determine the compensation mode. The compensation coefficients for the corresponding color channels are obtained based on the calculation method of each compensation coefficient in the compensation mode.
[0045] In one implementation, the preset channel loss threshold is: The compensation mode is determined based on the relationship between the difference in average pixel values of each color channel and the channel loss threshold, with a value of 0.1. Specifically, the compensation modes include: when When the loss in the blue and green channels of the original image is small, only the red channel needs to be compensated; in this compensation mode, the compensation coefficient of the red channel is... Adjusted to Compensation coefficients for green and blue channels and Adjust them to 0 respectively.
[0046] when This indicates that the original image exhibits a blue tint, with severe loss in the red and green channels, while the blue channel is well preserved. Therefore, compensation is only applied to the red and green channels. In this compensation mode, the compensation coefficient for the red channel is... Adjusted to The compensation coefficient for the green channel Adjusted to The blue channel compensation coefficient The value is adjusted to 0. It should be noted that the original image has already undergone normalization in the previous steps, therefore the maximum average pixel value for each color channel is 1, and the minimum is 0. In the processing of this invention, if any color channel has an average pixel value of 1, it indicates that the original image is a single tone and is directly deleted. Therefore, in this compensation mode... The value is greater than And less than 1, that is The value is greater than 0, thus achieving compensation for the green channel pixels.
[0047] when and When the original image appears pale green, only the red and blue channels need compensation; in this compensation mode, the compensation coefficient of the red channel... for The compensation coefficient for the green channel The compensation coefficient for the blue channel is 0. Adjusted to .
[0048] when and When the original image appears pale yellow, it indicates severe loss of the blue channel, while the red and green channels are well preserved, requiring only compensation of the blue channel. In this compensation mode, the compensation coefficients for the red and green channels are adjusted to 0, while the compensation coefficient for the blue channel is... Adjusted to .
[0049] This invention uses the green channel as a benchmark and dynamically adjusts the compensation coefficients of each color channel through channel loss judgment logic and performs pixel-by-pixel correction. On the one hand, it can avoid redundant processing of images with slight color loss, improving overall processing efficiency and adaptability. On the other hand, it can automatically compensate for the attenuation differences of different color channels in underwater imaging, and has a certain adaptability to underwater imaging environments with different turbidity. It eliminates the color cast problem of underwater images, restores the true color and texture information of the concrete surface to the greatest extent, and provides an image foundation with accurate color and clear features for subsequent image enhancement and 3D reconstruction.
[0050] After channel compensation, color balance operation is also required, which includes: Calculate the quantiles of each color channel in the input image, including the first quantile and the second quantile; wherein the first quantile is less than the second quantile. Obtain the first quantile pixel value and the second quantile pixel value of the corresponding color channel, and determine the effective range of pixel values for each color channel based on the first quantile pixel value and the second quantile pixel value; The pixel values in each color channel that exceed the corresponding valid range are truncated and normalized to obtain the output image.
[0051] Specifically, color balance operation is used to further normalize the global color and brightness distribution of the image after channel compensation, eliminating residual color shift and extreme pixel interference; the first quantile and the second quantile are used to locate the reasonable distribution boundary of pixel values in each color channel and remove abnormal pixels such as those that are too dark or too bright; the effective range is the range of values of effective pixels in the image, used to preserve normal texture information and eliminate noise interference; truncation is used to remove abnormal pixel values that exceed the reasonable range; pixel value mapping normalization normalizes the effective pixels to the standard range.
[0052] In one implementation, the first quantile and second quantile are calculated for the red, green, and blue color channels of the image, respectively. The effective pixel range for each channel is determined using the first quantile pixel value as the lower limit and the second quantile pixel value as the upper limit. The first quantile is... C represents any color channel; the second quantile is 1 minus the first quantile, thus obtaining the first and second quantile pixel values of each color channel, thereby obtaining the effective range of pixel values for each color channel; in statistics of normal distribution or similar distribution, the extremely small proportion of the edge is usually regarded as an unrepresentative random disturbance; for actual underwater images, due to sensor noise, reflection of suspended objects in the water (snowflake effect) or extreme refraction of light, there are often a very small number of "extremely bright" or "extremely dark" pixels in the image. The pixel values of these pixels are concentrated at 0 or 255. Therefore, outliers at both ends of 0.005 (0.5%) and 0.995 (99.5%) are removed, thus retaining 99% of the information in the middle.
[0053] Within any color channel, iterate through all pixels in the image. When the pixel value at a certain position is less than the first quantile pixel value, correct its pixel value to the first quantile pixel value; when the pixel value is greater than the second quantile pixel value, correct its pixel value to the second quantile pixel value.
[0054] Finally, the pixel values are normalized according to each color channel to output a color-balanced image.
[0055] After adaptive color correction is performed on the original image, further processing is required. The detail enhancement branch includes: multi-scale decomposition of the color-corrected image to obtain a detail layer, pixel-level fusion of the detail layer and the color-corrected image, and non-linear enhancement processing of the fusion result to obtain a detail-enhanced image.
[0056] Specifically, multi-scale decomposition decomposes the color-corrected image into feature layers of different spatial scales to extract detail information of different granularities; the detail layer is a set of high-frequency features such as fine textures and edges separated from the image; pixel-level fusion superimposes the extracted detail layer with the original color-corrected image pixel by pixel to restore and enhance the detail information; nonlinear enhancement processing dynamically amplifies the fused detail features through a nonlinear function to highlight the weakened fine textures in the underwater image.
[0057] This branch effectively solves the problems of blurred details and lost textures in underwater images through multi-scale detail extraction and nonlinear enhancement, significantly improving the detail recognition of concrete surface defects and providing a clear detail foundation for subsequent image fusion and 3D reconstruction.
[0058] In one implementation, a dual-scale decomposition method is employed. By setting filters with different kernel sizes, the color-corrected image is smoothed to obtain a base layer and a detail layer. The detail layer is then fused pixel-by-pixel with the original color-corrected image to enhance detail information. In this implementation, the nonlinear enhancement method uses Gamma correction to dynamically adjust the brightness and detail of the fusion result, resulting in a detail-enhanced image.
[0059] The improved Retinex algorithm includes: The first illumination component is obtained based on the components of each color channel in the color-corrected image, and the second illumination component is obtained by combining the global adaptive method. A guided filter is used to construct an illumination component correction model. Based on the illumination component correction model, the second illumination component is processed to obtain the third illumination component. The contrast enhancement factor is determined based on the distribution characteristics of the second illumination component, and a logarithmic model is constructed by combining the second illumination component, the third illumination component, and the adaptive offset. The contrast enhancement factor is used to weight the logarithmic model to obtain the reflection component. The adaptive offset is a parameter that is adaptively corrected based on the second illumination component. The color-corrected image is sharpened, and the sharpened color-corrected image is reconstructed using the reflection component and the first illumination component, and a color balance operation is performed to obtain an edge-enhanced image.
[0060] The method for determining the contrast enhancement factor is as follows: based on the ratio of the second illumination component to its global maximum value, preset control parameters are introduced to construct a global gain term and a nonlinear exponential term, and the contrast enhancement factor of the color-corrected image is calculated pixel by pixel. , in, For color-corrected images, the index is The contrast enhancement factor of the pixels; For index The second illumination component value of the pixel; This represents the maximum value of the second illumination component; The preset control parameters were calibrated through experiments.
[0061] Reconstruction involves applying the ratio of the reflection component to the first illumination component as a correction factor to the sharpened color-corrected image to complete the reconstruction. , in, It is the index of the reconstructed, sharpened, color-corrected image. The pixel value of the pixel; Is the index as The reflection component of the pixel; Is the index as The first illumination component of the pixel, This is the sharpened, color-corrected image.
[0062] Specifically, the improved Retinex algorithm acquires and corrects the illumination component in stages, adaptively calculates the contrast enhancement factor to construct the reflection component, and then combines image sharpening and reconstruction to achieve edge enhancement, adapting to the illumination characteristics and edge weakening problems of underwater concrete images throughout the process. The first illumination component is the basic brightness component of the image, and the second illumination component is the globally adaptively optimized brightness component. The illumination component correction model constructed through guided filtering can perform edge-preserving smoothing correction on the second illumination component, effectively avoiding the halo artifacts that are easily generated when the traditional Retinex algorithm processes underwater images.
[0063] The contrast enhancement factor is calculated pixel-by-pixel based on the distribution characteristics of the second illumination component, which can realize dynamic modulation of image contrast. Combined with the logarithmic model constructed by the adaptive offset, it can accurately extract the reflection component of the image and restore the edge features of concrete surface defects.
[0064] Finally, the sharpened image is reconstructed by the ratio of the reflection component to the first illumination component. Then, the color and brightness distribution is regulated by the color balance operation to achieve precise enhancement of the edge contour of the underwater concrete image. The output edge-enhanced image has clear edge features and no artifact interference, providing a high-quality edge feature foundation for subsequent image fusion.
[0065] In one implementation, the first illumination component The pixel values for each color channel are obtained as follows: , The above-mentioned formula for calculating the first illumination component is the basic formula for converting RGB images to grayscale images. It is the Luminosity algorithm, also known as the brightness algorithm, which is commonly used in the field of image processing. The coefficients of the red, green, and blue channel pixel values are conventional settings used by those skilled in the art.
[0066] The second illumination component is obtained by combining a global adaptive method. : , in, The maximum value in the first illumination component; The logarithmic average of the first illumination component is as follows: , Where N is the total number of pixels. It is a preset small positive number.
[0067] The illumination component correction model in this embodiment is as follows: , Here, "Guide" indicates guided filtering. For maximum filtering, the third illumination component is obtained after correcting the second illumination component. .
[0068] This invention also proposes a contrast enhancement factor. The contrast enhancement factor is obtained by combining the second illumination component, the third illumination component, and the adaptive offset; and the reflection component is obtained by weighting the logarithmic model using the above calculation method. : , in, This is an adaptive offset that changes adaptively with the scene, specifically: , in, These are preset nonlinear control parameters. This is the logarithmic average of the second illumination component.
[0069] In this embodiment, the sharpening method described above uses Gaussian filtering to enhance the edges of the color-corrected image, resulting in a sharpened color-corrected image. The sharpened color-corrected image is reconstructed by combining the reflection component and the first illumination component: , After the reconstruction is completed, then... Perform a color balance operation to obtain an edge-enhanced image.
[0070] To further illustrate the technical effects of this invention, related experiments were conducted, including ablation experiments and comparative experiments. The experimental setup consisted of an Intel(R) Core(TM) i7-14650HX processor, 16GB of memory, and a Windows 11 system. 3D reconstruction was performed using the open-source library colmap. Concrete specimens exhibiting spalling and defect characteristics were selected as the experimental subjects. Images were captured from different perspectives using an underwater camera, with the angle interval between each shot not exceeding 5°.
[0071] First, the ablation experiment was conducted to demonstrate the effectiveness of the proposed image processing method, comparing the changes in image evaluation metrics when the original image lacked subsequent image processing. This ablation experiment selected PCQI, UCIQE, UIQM, and IE as evaluation metrics. PCQI compares the contrast difference between two images; a higher PCQI value indicates better visibility of the enhanced image. UCIQE reflects the chroma, saturation, and contrast of underwater images; a higher UCIQE value indicates better image quality. UIQM is closely related to human vision, reflecting the color, sharpness, and contrast of underwater images; a higher UIQM value means the enhanced image is more consistent with human visual perception. IE reflects the richness of image information; a higher positive value indicates more detailed information contained in the enhanced image.
[0072] Table 1. Ablation Experiment Results
[0073] The ablation experiment results are shown in Table 1. In the original image, the IE was only 6.4088. After detail enhancement and edge enhancement, the IE increased by 1.3352 and 1.3894, respectively. This indicates that detail enhancement recovers information by amplifying subtle differences in local texture, while edge enhancement recovers information by sharpening high-frequency regions of object boundaries. The latter, because it directly acts on the edges carrying the most information entropy, brings a higher improvement. The algorithm in this paper achieves a maximum IE of 7.8036 through NSST fusion, indicating that it can most effectively recover the geometric details and texture information lost due to scattering and absorption in underwater images, with the best information entropy recovery effect. This can increase the number of feature points extracted subsequently.
[0074] In the comparative experiment, a comparison was conducted on the number of 3D reconstructed feature points and point clouds, including visualization results and quantization results. The visualization results compared the detail-enhanced image, edge-enhanced image, and the enhanced image after NSST fusion obtained during the implementation of this invention. Figure 2 , Figure 3 and Figure 4 The results are shown in Table 2, which presents the 3D reconstruction results of the detail-enhanced image, the edge-enhanced image, and the enhanced image, respectively. The quantization results of the comparative experiment also include the data details of the original image, as shown in Table 2. Since the original image cannot find enough feature points through the SIFT algorithm, sparse reconstruction is not possible. Therefore, "failure" is marked in the results of the number of point clouds in sparse reconstruction and dense reconstruction in Table 2.
[0075] Table 2. Statistical results of feature points and point clouds in 3D image reconstruction at each stage.
[0076] Table 2 shows the number of feature points and the number of point clouds at each stage during the 3D reconstruction process. The quantitative results fully verify the effectiveness and superiority of the image processing link of the present invention. Although single detail or edge enhancement can improve the quality of underwater images and achieve basic reconstruction, it has the limitation of single feature information. However, the image processing strategy based on adaptive color correction, with dual-branch enhancement as the core and NSST multi-scale fusion as the key can effectively solve the problems of color cast, detail blurring and edge weakening in underwater images, and maximize the enrichment of effective feature information in the image. It is the core technical support for realizing high-precision 3D reconstruction of underwater concrete surface defects.
[0077] This invention also provides a three-dimensional reconstruction system for underwater concrete surface defects, such as... Figure 5 As shown, it includes: The image acquisition module is used to acquire raw images of underwater concrete from different perspectives; The color correction module is used to perform adaptive color correction processing on the original image to obtain a color-corrected image; the adaptive color correction includes channel compensation based on the color channel loss relationship and color balance operation. The multi-scale fusion module processes the color-corrected image through a detail enhancement branch and an edge enhancement branch based on the improved Retinex algorithm, obtaining a detail-enhanced image and an edge-enhanced image respectively. The detail-enhanced image and the edge-enhanced image are then fused based on an image fusion algorithm to obtain an enhanced image. The improved Retinex algorithm corrects the illumination component in the color-corrected image through guided filtering and combines adaptive contrast modulation and offset compensation to achieve dynamic enhancement of the reflection component. The 3D reconstruction module is used to perform 3D reconstruction on the enhanced image after refraction correction to generate a 3D model of underwater concrete.
[0078] The above embodiments are merely illustrative of the technical concept and features of the present invention, intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly, and should not be construed as limiting the scope of protection of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects. The scope of the present invention is defined by the appended claims rather than the foregoing description, and thus all changes falling within the meaning and scope of the equivalents of the claims are intended to be included within the present invention.
Claims
1. A three-dimensional reconstruction method for apparent defects in underwater concrete, characterized in that, include: Acquire raw images of underwater concrete from different perspectives; The original image is subjected to adaptive color correction processing to obtain a color-corrected image; The adaptive color correction includes channel compensation based on color channel loss relationships and color balance operations; The color-corrected image is processed by a detail enhancement branch and an edge enhancement branch based on the improved Retinex algorithm to obtain a detail-enhanced image and an edge-enhanced image, respectively. The improved Retinex algorithm corrects the illumination component in the color-corrected image through guided filtering and combines adaptive contrast modulation and offset compensation to achieve dynamic enhancement of the reflection component. The detail enhancement image and the edge enhancement image are fused together using an image fusion algorithm to obtain an enhanced image; The enhanced image after refraction correction is reconstructed in three dimensions to generate a three-dimensional model of underwater concrete.
2. The three-dimensional reconstruction method for underwater concrete surface defects according to claim 1, characterized in that, The adaptive color correction further includes: determining whether the compensation condition is met based on the average pixel value of each color channel of the original image; if the compensation condition is met, channel compensation and color balance operations are performed sequentially; otherwise, only color balance operation is performed; the compensation condition is whether the ratio of the sum of the average pixel values of the red and blue channels to the sum of the average pixel values of the red, green, and blue color channels is greater than or equal to a condition threshold; when the ratio is greater than or equal to the condition threshold, the compensation condition is determined to be met.
3. A three-dimensional reconstruction method for underwater concrete surface defects according to claim 1 or 2, characterized in that, The channel compensation is achieved by determining the compensation coefficient for the corresponding color channel based on the difference between the average pixel values of each color channel, and then using the compensation coefficient for the corresponding color channel to correct the pixel value of the corresponding color channel pixel by pixel. , , ; in, , and The indices in the corrected red, green, and blue channels are respectively: The pixel value of the pixel; , and The indices for each color channel of the original image are: The pixel value of the pixel; , and These are the average pixel values of each color channel in the original image; , and These are the compensation coefficients for the red, green, and blue channels, respectively.
4. The three-dimensional reconstruction method for underwater concrete surface defects according to claim 3, characterized in that, The method for determining the compensation coefficient is as follows: A preset channel loss threshold is used to compare the difference in average pixel values of each color channel of the original image with the channel loss threshold to determine the compensation mode. The compensation coefficients for the corresponding color channels are obtained based on the calculation method of each compensation coefficient in the aforementioned compensation mode.
5. The three-dimensional reconstruction method for underwater concrete surface defects according to claim 1, characterized in that, The color balance operation includes: Calculate the quantiles of each color channel in the input image, including the first quantile and the second quantile; the first quantile is less than the second quantile. Obtain the first quantile pixel value and the second quantile pixel value of the corresponding color channel, and determine the effective range of pixel values for each color channel based on the first quantile pixel value and the second quantile pixel value. The pixel values in each color channel that exceed the corresponding valid range are truncated and normalized to obtain the output image.
6. The three-dimensional reconstruction method for underwater concrete surface defects according to claim 1, characterized in that, The detail enhancement branch includes: performing multi-scale decomposition on the color-corrected image to obtain a detail layer, fusing the detail layer with the color-corrected image at the pixel level, and performing non-linear enhancement processing on the fusion result to obtain a detail-enhanced image.
7. The three-dimensional reconstruction method for underwater concrete surface defects according to claim 1, characterized in that, The improved Retinex algorithm includes: The first illumination component is obtained based on the components of each color channel in the color-corrected image, and the second illumination component is obtained by combining the global adaptive method. A guided filter is used to construct an illumination component correction model. Based on the illumination component correction model, the second illumination component is processed to obtain the third illumination component. The contrast enhancement factor is determined based on the distribution characteristics of the second illumination component, and a logarithmic model is constructed by combining the second illumination component, the third illumination component, and the adaptive offset. The contrast enhancement factor is used to weight the logarithmic model to obtain the reflection component. The adaptive offset is a parameter that is adaptively corrected based on the second illumination component. The color-corrected image is sharpened, and the sharpened color-corrected image is reconstructed using the reflection component and the first illumination component. The color balance operation is then performed to obtain an edge-enhanced image.
8. A three-dimensional reconstruction method for underwater concrete surface defects according to claim 7, characterized in that, The method for determining the contrast enhancement factor is as follows: based on the ratio of the second illumination component to its global maximum value, a global gain term and a nonlinear exponential term are constructed by introducing preset control parameters, and the contrast enhancement factor of the color-corrected image is calculated pixel by pixel. , in, For color-corrected images, the index is The contrast enhancement factor of the pixels; For index The second illumination component value of the pixel; This represents the maximum value of the second illumination component; The preset control parameters were calibrated through experiments.
9. A three-dimensional reconstruction method for underwater concrete surface defects according to claim 7, characterized in that, The reconstruction involves using the ratio of the reflection component to the first illumination component as a correction factor applied to the sharpened color-corrected image to complete the reconstruction. , in, The index in the reconstructed sharpened color-corrected image is The pixel value of the pixel; Is the index as The reflection component of the pixel; Is the index as The first illumination component of the pixel, This is the sharpened, color-corrected image.
10. A three-dimensional reconstruction system for surface defects in underwater concrete, characterized in that, include: The image acquisition module is used to acquire raw images of underwater concrete from different perspectives; The color correction module is used to perform adaptive color correction processing on the original image to obtain a color-corrected image; the adaptive color correction includes channel compensation based on color channel loss relationship and color balance operation; A multi-scale fusion module is used to process the color-corrected image through a detail enhancement branch and an edge enhancement branch based on the improved Retinex algorithm, obtaining a detail-enhanced image and an edge-enhanced image respectively. The detail-enhanced image and the edge-enhanced image are then fused based on an image fusion algorithm to obtain an enhanced image. The improved Retinex algorithm corrects the illumination component in the color-corrected image through guided filtering and combines adaptive contrast modulation and offset compensation to achieve dynamic enhancement of the reflection component. The 3D reconstruction module is used to perform 3D reconstruction on the enhanced image after refraction correction to generate a 3D model of underwater concrete.