An underwater image restoration method based on adaptive dark pixel and color correction
By using adaptive dark pixel and color correction methods, combined with channel intensity prior and unsupervised depth map estimation, backscattering in underwater images is dynamically removed, solving the color cast and fog effects in underwater images and achieving high-quality image restoration.
Patent Information
- Application Number
- CN202310249681.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2043-03-15
AI Technical Summary
Due to the selective absorption and scattering of aquatic media, underwater images suffer from severe color distortion and fog effects, making it difficult for existing technologies to effectively recover high-quality underwater images.
By fusing the channel intensity prior depth map and the unsupervised depth map estimation, and combining adaptive dark pixel and color correction methods, backscattering is dynamically removed, brightness compensation and blue-green channel restoration are performed, and the best result is automatically selected.
It effectively removes color cast and fog effects from underwater images, improves image contrast and color constancy, and achieves higher quality underwater image restoration.
Smart Images

Figure CN116777760B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater image processing technology, and more particularly to an underwater image restoration method based on adaptive dark pixel and color correction. Background Technology
[0002] Underwater imaging is a key technology for studying and exploring the underwater world. Underwater cameras can directly capture images of the underwater environment, providing crucial observational data and evidence for research and exploration in marine energy development and underwater life monitoring. The imaging model can be represented as a linear superposition of three components: the direct component of light reflected from objects; the forward scattering component caused by light reflected from objects encountering suspended particles before reaching the camera lens; and the backscattering component caused by direct diffuse reflection of light. However, underwater image restoration is more challenging than terrestrial image restoration. Due to the selective absorption and scattering of various aquatic media, lack of illumination, and the immaturity of underwater imaging equipment, underwater images suffer from severe color casts and fog effects. Furthermore, the addition of artificial lighting further complicates the underwater lighting environment. Underwater image reconstruction is an important and valuable research area that has received widespread attention. High-quality underwater images are beneficial for target detection, recognition, and segmentation tasks. Summary of the Invention
[0003] To address the technical problems mentioned in the background section, this invention provides an underwater image restoration method based on adaptive dark pixels and color correction. Based on a more comprehensive imaging model, this invention primarily estimates the depth map of the underwater image by fusing a priori depth map of channel intensity and an unsupervised depth map. It then uses adaptive dark pixels to implement dynamic depth transformation and an adaptive strategy to eliminate backscattering and restore the underwater image. Next, it obtains a color-corrected output image through brightness compensation and blue-green channel restoration factors. Finally, it automatically selects the optimal result based on natural image quality evaluation metrics.
[0004] The technical means employed in this invention are as follows:
[0005] An underwater image restoration method based on adaptive dark pixel and color correction includes the following steps:
[0006] Step S01: Obtain an initial image and create an imaging model based on the initial image;
[0007] Step S02: Obtain the inverted red channel and the maximum channel difference of the initial image; based on the image brightness fusion method, obtain the channel intensity prior depth map of the initial image;
[0008] Step S03: Obtain the unsupervised depth map of the initial image using the Monodepth2 method, and fuse it with the prior depth map of the channel intensity based on the image color shift to obtain a relative depth map;
[0009] Step S04: Perform Gaussian filtering smoothing on the relative depth map in step S03; set multiple depth maxima according to different background types of the initial image; obtain the depth minima according to the proportion of global background light in pixel intensity of the initial image;
[0010] Step S05: Based on the relative depth map, the maximum depth value, and the minimum depth value, perform depth stretching to convert the relative depth map into an absolute depth map and determine the depth interval division criteria.
[0011] Step S06: Based on the interval division and adaptive dark pixels in step S05, dark pixels within the interval are selected through a filtering strategy, and the dark pixels are used as the initial estimated values of backscattering for fitting.
[0012] Step S07: Subtract the backscatter obtained from step S06 from the initial image to obtain the dehazed image;
[0013] Step S08: Estimate the illumination map based on the absolute depth map from step S05 to compensate for the brightness of the dehazed image from step S07; correct the blue-green channel color shift based on the blue-green color factor to obtain the corrected image;
[0014] Step S09: Based on the corrected images corresponding to the different maxima obtained in step S08, select the restored image according to the selection rule of natural image quality evaluation index, and obtain the restored image.
[0015] Furthermore, the imaging model in step S01 is as follows:
[0016]
[0017] Among them, I c J represents the initial image, i.e., the underwater image to be restored. c This represents the restored underwater image, where c represents the R, G, and B color channels, x represents different pixel positions, d(x) represents the distance from the camera to scene x, and A c This represents the global atmospheric light in an underwater image. Indicates the attenuation coefficient. Indicates the scattering coefficient; This can be further expressed as:
[0018]
[0019]
[0020] Where ξ represents the scene reflectivity, H represents the illumination map, and R... s This represents the spectral response parameter of the sensor, β represents the attenuation coefficient of the light beam, and A... ∞ λ represents global atmospheric light, z represents the imaging distance, and λ represents the wavelength of visible light.
[0021] Furthermore, step S02, obtaining the channel intensity prior depth map of the initial image, also includes the following steps:
[0022] Step S021: Separate the RGB channels of the initial image, invert the red channel intensity, and take the minimum value of each region to obtain the inverted red channel image R(x):
[0023]
[0024] Where Ω(x) represents a square local patch centered at x, I c R(x) represents the intensity observed in color channel c at pixel x in the input image; R(x) is normalized and stretched to obtain the inverted red channel depth map d. r (x), the stretching formula is:
[0025]
[0026] Where v represents a vector;
[0027] Step S022: Subtract the maximum value of the R channel within the region from the maximum value of the GB channel within the region to obtain the color difference image M(x):
[0028]
[0029] The maximum difference depth map d is obtained after normalized stretching. m (x);
[0030] Step S023: Convert the initial image into a grayscale image, and obtain the image brightness parameter α by calculating the proportion of pixels with a value greater than 127.5 in the total number of pixels in the grayscale image.
[0031]
[0032] Among them, I gray Sum(I) represents the grayscale image corresponding to the initial image. gray >127.5) represents the number of pixels in a grayscale image with an intensity greater than 127.5, where 127.5 represents half of the maximum pixel intensity. Size(I gray ) represents the total number of pixels in the grayscale image, and S(a,δ) represents the sigmoid function, defined as:
[0033]
[0034] Where s represents an empirical constant of 32.
[0035] Step S024: To avoid single-channel prior faults caused by bright areas or solid-color objects in the image, a channel intensity prior depth map is obtained by fusing the inverted red channel and the maximum difference depth map based on the image brightness parameters; the channel intensity prior depth map d cip The estimation formula for (x) is:
[0036] d cip (x)=αd m (x)+(1-α)d r (x);
[0037] Where α represents the image brightness parameter, d r (x) represents the inverted red channel depth map, d m (x) represents the depth map with the maximum difference.
[0038] Further, step S03, obtaining the relative depth map, includes the following steps:
[0039] Step S031: Obtain the unsupervised depth map d of the initial image using the unsupervised depth estimation method Monodepth2. mono (x);
[0040] Step S032: Obtain the image color cast factor k using a colorimetric detection method based on the equivalent circle:
[0041]
[0042] Among them, (d) a ,d b (m) represents the coordinate center of the equivalent circle. a ,m b The variance of the equivalent circle is represented by the following formula:
[0043]
[0044] Where (a,b) represents the coordinates of the equivalent circle, W represents the width of the image, and V represents the height of the image, in pixels;
[0045] Step S033: Fuse the channel strength prior depth map d cip (x) and unsupervised depth map d mono (x) obtains d cip+ (x) Relative depth map, calculated using the formula:
[0046]
[0047] Where β=S(k,2) represents the image color cast parameter.
[0048] Furthermore, obtaining the absolute depth map in step S04 includes the following steps:
[0049] Step S041: To avoid the influence of details in the underwater image on the scene depth, the relative depth map in step S03 is smoothed by Gaussian filtering;
[0050] Step S042: Take the maximum depth d max ∈(8,12), different maxima represent different degrees of image degradation;
[0051] Step S043: Estimate the depth minimum d based on the principle of consistency between the proportion of global background light in pixel intensity and distance. min The estimation formula is:
[0052]
[0053] Among them, θ=I c (argmaxd(x)) represents the pixel value at the maximum depth, i.e., the global background light.
[0054] Furthermore, the depth conversion stretching formula in step S05 is as follows:
[0055]
[0056] Where x and y represent the depth values before and after stretching, respectively, and d1 and d2 represent the maximum and minimum depth values before stretching, respectively; in addition, the formula for dividing the image depth interval according to the image type is as follows:
[0057]
[0058] Where T represents the number of depth intervals, Y represents the number of dark pixels selected in each interval, and N = 500 limits the minimum number of dark pixels selected in each interval. i This represents the total number of pixels within each interval.
[0059] Furthermore, the dehazing rule based on adaptive dark pixels includes the following steps:
[0060] Step S061: Obtain the sum channel by adding the pixel intensities of the RGB three channels of the initial image;
[0061] Step S062: Based on the depth interval division, take the smallest Y pixels (i.e., dark pixels) in the corresponding channel of each depth interval as the initial estimate of backscattering;
[0062] Step S063: Obtain backscattered B c After obtaining the initial estimate of z(x) and the corresponding depth value z(x), the backscattering estimate is obtained by fitting. The fitting formula is as follows:
[0063]
[0064] Step S064: Subtract the fitted backscatter from the initial underwater image. Obtain the dehazed image D c (x):
[0065]
[0066] Furthermore, the color correction and selection criteria based on natural image quality assessment metrics include the following steps:
[0067] Step S081: Calculate the illumination map H based on the local spatial average color. c (x), refine the attenuation coefficient using the known depth map z(x).
[0068]
[0069] After obtaining the refined attenuation coefficient, use the following formula to compensate for the illumination:
[0070]
[0071] Among them, J c (x) represents the image after illumination compensation.
[0072] Step S082: Calculate the blue-green color restoration factor as the reciprocal of the average value of the top 10% of the blue-green channel intensities, and perform color correction on the blue-green channels, as shown in the following formula:
[0073]
[0074] Among them, W g W represents the color restoration factor for the green channel. b This represents the blue channel color recovery factor.
[0075] Step S083: Determine the final output result by automatically selecting the depth maxima based on the selection rules of natural image quality assessment indicators.
[0076] Compared with the prior art, the present invention has the following advantages:
[0077] 1. This invention proposes a channel intensity prior by observing the attenuation characteristics of light of different wavelengths underwater, and uses the attenuation intensity of each channel to estimate the depth map, thus solving the single-channel prior fault caused by bright areas or solid-color objects.
[0078] This invention also introduces a color deviation factor to fuse the obtained channel intensity prior depth map with the unsupervised depth map, addressing the impact of artificial lighting on the channel intensity prior and expanding the application scenarios of unsupervised methods. Adaptive dark pixels are constructed based on different levels of image degradation and natural image quality assessment metrics, enabling dynamic depth transformation and adaptive strategies to eliminate backscattering, thus solving the problems of fixed interval division and limited dark pixel selection. Finally, based on color correction and blue-green channel restoration factors, a more visually appealing output image is obtained.
[0079] 2. This invention considers the proportion of global background light in pixel intensity and the distance consistency to estimate the depth minimum, and combines multiple different depth maxima corresponding to different image degradation types to achieve dynamic stretching. Finally, the final output image is determined based on the selection rule of natural image quality evaluation index.
[0080] Based on the above reasons, this invention can be widely applied in fields such as image processing. Attached Figure Description
[0081] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0082] Figure 1 This is a schematic diagram of the process of the present invention.
[0083] Figure 2This image shows a comparison of the restoration effects of this invention and other algorithms on underwater coral images. (a) represents the initial image before restoration; (b) represents the result processed using the IBLA (Underwater Image Restoration based on Image Blurriness and Light Absorption) method; (c) represents the result processed using the GDCP (Generalization of the Dark Channel Prior for Single Image Restoration) method; (d) represents the result processed using the ULAP (A Rapid Scene Depth Estimation Model Based on Underwater Light Attenuation Prior for Underwater Image Restoration) method; (e) represents the result processed using the WaterNet (An Underwater Image Enhancement Benchmark Dataset and Beyond) method; and (f) represents the result processed using this invention.
[0084] Figure 3 This image shows a comparison of the restoration effects of this invention and other algorithms on deep-sea fish. (a) represents the initial image before restoration; (b) represents the result processed using the IBLA (Underwater Image Restoration based on Image Blurriness and Light Absorption) method; (c) represents the result processed using the GDCP (Generalization of the Dark Channel Prior for Single Image Restoration) method; (d) represents the result processed using the ULAP (A Rapid Scene Depth Estimation Model Based on Underwater Light Attenuation Prior for Underwater Image Restoration) method; (e) represents the result processed using the WaterNet (An Underwater Image Enhancement Benchmark Dataset and Beyond) method; and (f) represents the result processed using this invention.
[0085] Figure 4This image shows a comparison of the restoration effects of this invention and other algorithms on images of complex underwater environments. (a) represents the initial image before restoration; (b) represents the image processed using the IBLA (Underwater Image Restoration based on Image Blurriness and Light Absorption) method; (c) represents the image processed using the GDCP (Generalization of the Dark Channel Prior for Single Image Restoration) method; (d) represents the image processed using the ULAP (A Rapid Scene Depth Estimation Model Based on Underwater Light Attenuation Prior for Underwater Image Restoration) method; (e) represents the image processed using the WaterNet (An Underwater Image Enhancement Benchmark Dataset and Beyond) method; and (f) represents the image processed using this invention. Detailed Implementation
[0086] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0087] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0088] To verify the effectiveness of this invention in underwater image restoration, underwater images from different scenes were selected as a test set. The results were compared and analyzed qualitatively and quantitatively with those of the IBLA (Underwater Image Restoration based on Image Blurriness and Light Absorption) algorithm, GDCP (Generalization of the Dark Channel Prior for Single Image Restoration) algorithm, ULAP (A Rapid Scene Depth Estimation Model Based on Underwater Light Attenuation Prior for Underwater Image Restoration) algorithm, and WaterNet (An Underwater Image Enhancement Benchmark Dataset and Beyond) algorithm. The specific steps and principles are as follows:
[0089] like Figure 1 As shown, this invention provides an underwater image restoration method based on adaptive dark pixels and color correction, comprising the following steps:
[0090] Step S01: Obtain an initial image and create an imaging model based on the initial image:
[0091]
[0092] Among them, I c J represents the initial image, i.e., the underwater image to be restored. c This represents the restored underwater image, where c represents the R, G, and B color channels, x represents different pixel positions, d(x) represents the distance from the camera to scene x, and A c This represents the global atmospheric light in an underwater image. Indicates the attenuation coefficient. Indicates the scattering coefficient; This can be further expressed as:
[0093]
[0094]
[0095] Where ξ represents the scene reflectivity, H represents the lighting map, and R... s This represents the spectral response parameter of the sensor, β represents the attenuation coefficient of the light beam, and A... ∞λ represents global atmospheric light, z represents the imaging distance, and λ represents the wavelength of visible light.
[0096] Step S02: Obtain the inverted red channel and the maximum channel difference of the initial image; based on the image brightness fusion method, obtain the channel intensity prior depth map of the initial image;
[0097] Step S021: Separate the RGB channels of the initial image, invert the red channel intensity, and take the minimum value of each region to obtain the inverted red channel image R(x):
[0098]
[0099] Where Ω(x) represents a square local patch centered at x, I c R(x) represents the intensity observed in color channel c at pixel x in the input image; R(x) is normalized and stretched to obtain the inverted red channel depth map d. r (x), the stretching formula is:
[0100]
[0101] Where v represents a vector;
[0102] Step S022: Subtract the maximum value of the R channel within the region from the maximum value of the GB channel within the region to obtain the color difference image M(x):
[0103]
[0104] The maximum difference depth map d is obtained after normalized stretching. m (x);
[0105] Step S023: Convert the initial image into a grayscale image, and obtain the image brightness parameter α by calculating the proportion of pixels with a value greater than 127.5 in the total number of pixels in the grayscale image.
[0106]
[0107] Among them, I gray Sum(I) represents the grayscale image corresponding to the initial image. gray >127.5) represents the number of pixels in a grayscale image with an intensity greater than 127.5, where 127.5 represents half of the maximum pixel intensity. Size(I gray ) represents the total number of pixels in the grayscale image, and S(a,δ) represents the sigmoid function, defined as:
[0108]
[0109] Where s represents an empirical constant of 32.
[0110] Step S024: To avoid single-channel prior faults caused by bright areas or solid-color objects in the image, a channel intensity prior depth map is obtained by fusing the inverted red channel and the maximum difference depth map based on the image brightness parameters; the channel intensity prior depth map d cip The estimation formula for (x) is:
[0111] d cip (x)=αd m (x)+(1-α)d r (x);
[0112] Where α represents the image brightness parameter, d r (x) represents the inverted red channel depth map, d m (x) represents the depth map with the maximum difference.
[0113] Step S03: Obtain the unsupervised depth map of the initial image using the Monodepth2 method, and fuse it with the prior depth map of the channel intensity based on the image color shift to obtain a relative depth map;
[0114] Step S031: Obtain the unsupervised depth map d of the initial image using the unsupervised depth estimation method Monodepth2. mono (x);
[0115] Step S032: Obtain the image color cast factor k using a colorimetric detection method based on the equivalent circle:
[0116]
[0117] Among them, (d) a ,d b (m) represents the coordinate center of the equivalent circle. a ,m b The variance of the equivalent circle is represented by the following formula:
[0118]
[0119] Where (a,b) represents the coordinates of the equivalent circle, W represents the width of the image, and V represents the height of the image, in pixels;
[0120] Step S033: Fuse the channel strength prior depth map d cip (x) and unsupervised depth map d mono (x) obtains d cip+ (x) Relative depth map, calculated using the formula:
[0121]
[0122] Where β=S(k,2) represents the image color cast parameter.
[0123] Step S04: Perform Gaussian filtering smoothing on the relative depth map in step S03; set multiple depth maxima according to different background types of the initial image; obtain the depth minima according to the proportion of global background light in pixel intensity of the initial image;
[0124] Step S041: To avoid the influence of details in the underwater image on the scene depth, the relative depth map in step S03 is smoothed by Gaussian filtering;
[0125] Step S042: Take the maximum depth d max ∈(8,12), different maxima represent different degrees of image degradation;
[0126] Step S043: Estimate the depth minimum d based on the principle of consistency between the proportion of global background light in pixel intensity and distance. min The estimation formula is:
[0127]
[0128] Among them, θ=I c (argmaxd(x)) represents the pixel value at the maximum depth, i.e., the global background light.
[0129] Step S05: Based on the relative depth map, the maximum depth value, and the minimum depth value, perform depth stretching to convert the relative depth map into an absolute depth map and determine the depth interval division criteria.
[0130] The formula for depth conversion stretching is as follows:
[0131]
[0132] Where x and y represent the depth values before and after stretching, respectively, and d1 and d2 represent the maximum and minimum depth values before stretching, respectively; in addition, the formula for dividing the image depth interval according to the image type is as follows:
[0133]
[0134] Where T represents the number of depth intervals, Y represents the number of dark pixels selected in each interval, and N = 500 limits the minimum number of dark pixels selected in each interval. i This represents the total number of pixels within each interval.
[0135] Step S06: Based on the interval division and adaptive dark pixel in step S05, select dark pixel points within the interval through different filtering strategies, and use the dark pixel points as the initial estimate of backscattering for fitting.
[0136] Step S061: Obtain the sum channel by adding the pixel intensities of the RGB three channels of the initial image;
[0137] Step S062: Based on the depth interval division, take the smallest Y pixels (i.e., dark pixels) in the corresponding channel of each depth interval as the initial estimate of backscattering;
[0138] Step S063: Obtain backscattered B c After obtaining the initial estimate of z(x) and the corresponding depth value z(x), the backscattering estimate is obtained by fitting. The fitting formula is as follows:
[0139]
[0140] Step S07: Subtract the backscatter obtained from the fitting in step S06 from the initial underwater image to obtain the dehazed image;
[0141] The calculation formula is as follows:
[0142]
[0143] Among them, D c (x) represents the image after dehazing.
[0144] Step S08: Estimate the illumination map based on the absolute depth map from step S05 to compensate for the brightness of the dehazed image from step S07; correct the blue-green channel color shift based on the blue-green color factor to obtain the corrected image;
[0145] Step S081: Calculate the illumination map H based on the local spatial average color. c (x), refine the attenuation coefficient using the known depth map z(x).
[0146]
[0147] After obtaining the refined attenuation coefficient, use the following formula to compensate for the illumination:
[0148]
[0149] Among them, J c (x) represents the image after illumination compensation.
[0150] Step S082: Calculate the blue-green color restoration factor as the reciprocal of the average value of the top 10% of the blue-green channel intensities, and perform color correction on the blue-green channels, as shown in the following formula:
[0151]
[0152] Among them, W g W represents the color restoration factor for the green channel.b This represents the blue channel color recovery factor.
[0153] Step S09: Based on the different maxima corrected images obtained in step S08, select the final restored image according to the natural image quality evaluation index selection rule.
[0154] Example
[0155] like Figure 2 As shown, this invention provides a comparison of the restoration effects of other algorithms on underwater coral images. The experimental results show that all seven algorithms restored the underwater images to some extent and improved their contrast. However, the IBLA, GDCP, and ULAP algorithms showed poor restoration results, with more severe color bias in the resulting images and reduced contrast in the distant areas, resulting in little difference from the original image. While the WaterNet algorithm effectively improved the contrast of the distant areas and removed color bias, it still suffers from dehazing residue and a fog effect. The GDCP algorithm exhibits channel error compensation, leading to overall image color distortion. The algorithm of this invention, compared to other algorithms, better addresses the color bias problem in underwater images and improves the contrast between the distant and near areas. Therefore, this invention has a better restoration effect, effectively solves the color bias problem in underwater images, improves global contrast, and achieves contrast enhancement and color constancy.
[0156] like Figure 3 As shown, this invention provides a comparison of the restoration effects of other algorithms on deep-sea fish images. The experimental results show that all seven algorithms restored the underwater images to some extent and improved their contrast. However, the WaterNet algorithm performed poorly, exhibiting more severe brightness decay and reduced contrast in distant areas. While the IBLA, GDCP, and ULAP algorithms effectively improved the contrast of distant areas and removed color bias, they still suffered from overcompensation and bright spot effects. The algorithm of this invention, compared to other algorithms, better addresses the color cast problem and improves the contrast between distant and near-field areas in underwater images. Therefore, this invention achieves better restoration results, effectively solves the color cast problem in underwater images, improves global contrast, and realizes contrast enhancement and color constancy.
[0157] like Figure 4As shown, this invention provides a comparison of the restoration effects of other algorithms on complex underwater environment images. The experimental results show that all seven algorithms restored the underwater images to some extent and improved their contrast. However, the IBLA, GDCP, and ULAP algorithms showed poor restoration results, with more severe color bias in the resulting images and reduced contrast in distant areas, resulting in little difference from the original image. While the WaterNet algorithm effectively improved the contrast of distant areas and removed color bias, it still suffers from compensation issues, leading to unnatural restoration results. The ULAP algorithm exhibits overcompensation of the red channel, resulting in an overall reddish tint. The algorithm of this invention addresses the color bias problem better than other algorithms, improving the contrast between distant and near-field areas in underwater images. Therefore, this invention achieves better restoration results, effectively solving the color bias problem in underwater images, improving global contrast, and realizing contrast enhancement and color constancy.
[0158] This embodiment compares the experimental results of different algorithms on two objective metrics: UCIQE and IE. As shown in Table 1, on the three selected images of different types, the UCIQE of all algorithms is greater than that of the original images, indicating that all algorithms effectively improve the detail information and image contrast of underwater images. Furthermore, this invention achieves the best UCIQE score, far surpassing other algorithms, meaning that this invention has the best restoration effect. As shown in Table 2, on the three selected sample images, this invention again achieves the best IE score, indicating that the image processed by this invention has higher information content and that this invention has high robustness, capable of processing the vast majority of underwater images. This invention uses a combination of channel intensity prior and unsupervised methods to estimate the depth map, dynamically removes backscattering through adaptive dark pixels, effectively removes fog effects, enhances the contrast of underwater images, and uses blue-green channel color restoration factors to restore the colors of underwater images. Therefore, this invention significantly improves both the UCIQE and IE of the original image and outperforms other underwater image enhancement and restoration algorithms.
[0159] Table 1. Comparison of UCIQE results between the algorithm of this invention and other algorithms.
[0160]
[0161] Table 2 Comparison of IE (Internal Emissions) of the Algorithm of the Present Invention and Other Algorithms
[0162]
[0163] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the above embodiments of the present invention, the descriptions of each embodiment have their own emphasis; parts not described in detail in a certain embodiment can be referred to in the relevant descriptions of other embodiments. It should be understood that the disclosed technical content in the several embodiments provided in this application can be implemented in other ways.
[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An underwater image restoration method based on adaptive dark pixel and color correction, characterized in that, The method comprises the following steps: Step S01: obtaining an initial image, and creating an imaging model for the initial image; Step S02: obtaining an inverted red channel and a channel maximum difference value of the initial image; obtaining a channel intensity prior depth map of the initial image based on an image brightness fusion method; Step S03: obtaining an unsupervised depth map of the initial image by a Monodepth2 method, and fusing the unsupervised depth map with the channel intensity prior depth map based on image color deviation to obtain a relative depth map; Step S04: performing Gaussian filtering smoothing on the relative depth map in the step S03; setting a plurality of depth maximum values according to different background types of the initial image; and obtaining a depth minimum value according to a proportion of a global background light on a pixel intensity of the initial image; Step S05: performing depth stretching to convert the relative depth map into an absolute depth map according to the relative depth map, the depth maximum values and the depth minimum value, and determining a depth interval division standard; Step S06: selecting dark pixel points in an interval by a screening strategy according to the interval division in the step S05 and adaptive dark pixels, and fitting the dark pixel points as initial estimation values of back scattering; Step S07: subtracting back scattering obtained by the fitting in the step S06 from the initial image to obtain a defogged image; Step S08: compensating brightness of the defogged image in the step S07 according to an illumination map estimated from the absolute depth map in the step S05; and correcting blue-green channel color deviation to obtain a corrected image according to a blue-green color factor; Step S09: selecting a restored image according to a natural image quality evaluation index selection rule according to the corrected image corresponding to different maximum values obtained in the step S08, and obtaining a restored image.
2. The method of claim 1, wherein the method is based on adaptive dark pixel and color correction. The imaging model of the initial image in the step S01 is: ; wherein, represents the initial image, i.e. the underwater image to be restored, represents the restored underwater image, c represents the R, G, B three color channels, represents different pixel positions, represents the distance from the camera to the scene , represents the global airlight of the underwater image, represents the attenuation coefficient, represents the scattering coefficient; , represents is: ; ; wherein, represents the scene reflectance, represents the lighting map, represents the spectral response parameter of the sensor, represents the attenuation coefficient of the light beam, represents the global atmospheric light, represents the imaging distance, represents the wavelength of the visible light.
3. The method of claim 1, wherein the method is characterized by, The step S02 of obtaining the channel intensity prior depth map of the initial image further comprises the following steps: Step S021: RGB channel separation is performed on the initial image, the red channel intensity is reversed, and the minimum value of each region is taken to obtain the reversed red channel image : ; wherein, represents a square local patch centered at , represents the intensity observed in the color channel at pixel ; the inverted red channel depth map is obtained by normalizing and stretching, the stretching formula is: ; wherein represents a vector; Step S022: Take the maximum value of the GB channel in the region minus the maximum value of the R channel in the region to obtain a color difference map : ; Normalized stretch to get maximum difference depth map ; Step S023: converting the initial image into a gray scale image, obtaining an image brightness parameter by calculating the proportion of pixels greater than 127.5 in the total pixels in the gray scale image : ; wherein, represents a gray scale image corresponding to the initial image, represents the number of pixels in the gray scale image whose intensity is greater than 127.5, 127.5 representing half of the maximum pixel intensity, represents the total number of pixels in the gray scale image, represents a sigmoid function, defined as: ; wherein represents an empirical constant taken as 32; Step S024: To avoid the single-channel priori failure caused by the highlight area or the pure color object in the picture, the channel intensity priori depth map is obtained based on the image brightness parameter fusion of the reversed red channel and the maximum difference depth map; the channel intensity priori depth map The estimation formula is: ; wherein, represents an image luminance parameter, represents an inverted red channel depth map, represents a maximum difference depth map.
4. The method of claim 1, wherein the method is based on adaptive dark pixel and color correction. The step S03 of obtaining the relative depth map comprises the following steps: Step S031: obtaining an unsupervised depth map of the initial image by an unsupervised depth estimation method Monodepth2 ; Step S032: Obtain the image color cast factor based on the equivalent circle colorimetric detection method : ; wherein, denotes the coordinate center of the equivalent circle, denotes the variance of the equivalent circle; calculated by the following formula: ; wherein, represents the coordinates of the equivalent circle, represents the width of the image, represents the height of the image in pixels; Step S033: fusing the channel intensity prior depth map and unsupervised depth map obtained relative depth map, computed as: ; wherein denotes the image color cast parameter.
5. The method of claim 1, wherein, The step S04 of obtaining the absolute depth map comprises the following steps: Step S041: to avoid the influence of details in the underwater image on the scene depth, the relative depth map in the step S03 is smoothed by Gaussian filtering; Step S042: taking the depth maximum value Different maximum values represent different image degradation degrees; Step S043: Estimate the depth minimum value according to the consistency principle of the proportion of global background light on pixel intensity and distance The estimation formula is: ; wherein, represents the pixel value at the maximum depth value, i.e. the global background light.
6. The method of claim 1, wherein the method is based on adaptive dark pixel and color correction for underwater image restoration. The depth conversion stretching formula in the step S05 is as follows: ; wherein, , respectively represent the depth values before and after stretching, , respectively represent the maximum and minimum depth values before stretching; in addition, the formula for solving the image depth interval division according to the image type is as follows: ; wherein, represents the number of depth interval divisions, represents the number of selected dark pixel points in each interval, limits the minimum number of selected dark pixel points in each interval, represents the number of all pixel points in each interval.
7. The method of claim 1, wherein the method is based on adaptive dark pixel and color correction for underwater image restoration. The defogging rule based on adaptive dark pixels comprises the following steps: Step S061: obtaining a sum channel by adding RGB three-channel pixel intensities of the initial image; Step S062: According to the depth interval division, the minimum front scattering initial estimation is taken as the backscattering initial estimation Step S063: Obtain backscattering of the initial estimate value and the corresponding depth value After that, the backscattering estimate value is fitted The fitting formula is as follows: ; Step S064: The initial image is subtracted from the fitted backscattering , to obtain the image after fog removal : 。 8. The method of claim 1, wherein, The color correction and the selection rule based on the natural image quality evaluation index comprise the following steps: Step S081 : Compute the lighting map from the local spatial average color , using the known depth map Refine the attenuation coefficients : ; After obtaining the refined attenuation coefficient, the illumination is compensated by using the following formula: ; wherein, represents the image after illumination compensation; Step S082: calculating a blue-green color recovery factor as an inverse of an average value of the top 10% of blue-green channel intensities, and performing color correction on the blue-green, specifically as follows: ; wherein, represents a green channel color restoration factor, represents a blue channel color restoration factor; Step S083: determining a final output result according to a depth maximum value selected automatically based on the selection rule based on the natural image quality evaluation index.
Citation Information
Patent Citations
Underwater image sharpening method based on light attenuation and depth estimation
CN113850747A
System and method for color motion holography
WO2010068820A1