CN116862794A - Underwater image processing method based on double compensation and contrast adjustment - Google Patents

Underwater image processing method based on double compensation and contrast adjustment Download PDF

Info

Publication number
CN116862794A
CN116862794A CN202310814112.XA CN202310814112A CN116862794A CN 116862794 A CN116862794 A CN 116862794A CN 202310814112 A CN202310814112 A CN 202310814112A CN 116862794 A CN116862794 A CN 116862794A
Authority
CN
China
Prior art keywords
channel
value
image
compensation
average
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310814112.XA
Other languages
Chinese (zh)
Inventor
刘浩
赵西超
魏国林
戎行之
黄震
廖荣生
胡敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Donghua University
Original Assignee
Donghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Donghua University filed Critical Donghua University
Priority to CN202310814112.XA priority Critical patent/CN116862794A/en
Publication of CN116862794A publication Critical patent/CN116862794A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/30Assessment of water resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)

Abstract

The application provides an underwater image processing method based on double compensation and contrast adjustment, which comprises the steps of firstly classifying R, G, B channels of an image according to gray value average values, compensating small-average-value channels according to medium-average-value channels, and compensating medium-average-value channels according to large-average-value channels; then, adjusting the gray value of the image channel by adopting a segmented gray value stretching method so as to enhance the contrast ratio and the overall brightness of the image; then, performing color compensation on the small-average value channel and the medium-average value channel according to the large-average value channel, solving the problem of insufficient enhancement of the gray value of part of pixels and obtaining a color correction image; and finally, calculating the mean value and standard deviation of the original image and the color correction image S and V channels, taking the mean value and standard deviation of the original image and the color correction image as parameters for limiting the contrast self-adaptive histogram equalization, and self-adaptively adjusting the S and V channels of the color correction image to obtain a final enhanced image. The application has good color correction capability and lower algorithm complexity.

Description

Underwater image processing method based on double compensation and contrast adjustment
Technical Field
The application relates to the field of image processing, in particular to an underwater image processing method based on double compensation and contrast adjustment.
Background
On earth, the area of the ocean is much larger than that of land, the area of the ocean is twice as large as that of land, and the number and variety of resources and organisms in the ocean are much larger than that of land. With the development of human science and technology level and the exploitation of resources by human beings, resources on land are far from meeting the demands of human beings. There are three main aspects of human activities on the ocean, namely ocean science research, ocean exploration and ocean resource development. The ocean exploration provides services for the other two items, and the difficulty of ocean scientific research and ocean resource development is greatly increased when the ocean exploration leaves the ocean exploration. The marine exploration task is therefore extremely important. Underwater image acquisition is an important link in marine exploration. The acquisition of the vast majority of underwater images is based on acoustic imaging and optical imaging. Acoustic imaging relies on acoustic instrumentation and acoustic waves for imaging, and the hardware equipment required for acoustic imaging is expensive and not suitable for imaging with high precision information. In contrast, optical imaging has the advantages of high imaging precision and low cost, and is widely applied to underwater image acquisition.
The propagation of light in the ocean is susceptible to impurities in the ocean, so that the propagation direction of the light is changed, and the problems of contrast reduction, blurring and the like of an imaged image occur. In addition, the different color wavelengths in the light attenuate in the water to different degrees, so that the image has a color cast problem, and the image is mainly blue-green. Therefore, the processing of the underwater image becomes a necessary link, and a plurality of domestic and foreign scholars also put forward a method for solving the problems based on different theories. The underwater image processing method is not limited to a physical model of image imaging, and the states and distribution conditions of the pixels of the image can be empirically adjusted, so that the visual effect of the image is improved.
Disclosure of Invention
The application aims to solve the technical problems that: how to correct the color shift of the underwater image and improve the contrast ratio.
In order to solve the problems, the technical scheme of the application provides an underwater image processing method based on double compensation and contrast adjustment, which comprises the following steps:
step 1, inputting an original underwater image, calculating the gray value average value of a R, G, B channel of the image, and classifying R, G, B channels into small-average value, medium-average value and large-average value channels according to the average value of each gray value;
step 2, compensating the small-average value channel according to the medium-average value channel, and compensating the medium-average value channel according to the large-average value channel;
step 3, adjusting the gray value of the image channel by adopting a segmented gray value stretching method so as to enhance the contrast ratio and the overall brightness of the image;
step 4, performing color compensation on the small-mean value channel and the medium-mean value channel according to the large-mean value channel to solve the problem of insufficient enhancement of partial pixel gray values and obtain a color correction image;
step 5, converting the color correction image into HSV space and calculating the mean value and variance of S, V channels of the color correction image;
step 6, converting the original underwater image into HSV space and calculating the mean value and variance of S, V channels of the original underwater image;
and 7, calculating parameters for limiting the contrast self-adaptive histogram equalization according to the mean and variance of S, V channels of the color correction image and the mean and variance of S, V channels of the original underwater image.
Step 8, adaptively adjusting S, V channels of the color correction image according to the calculated parameters for limiting the contrast adaptive histogram equalization;
and 9, outputting the underwater enhanced image.
Preferably, in the step 2, a specific compensation formula of the compensation method is as follows:
wherein ,respectively a small-average value channel and a medium-average value channel after the first compensation, I l For the large-average color channel, I m For medium average color channel and I s Is a small-average color channel. In order to ensure that pixels with smaller gray values in a small-average value channel and a medium-average value channel obtain more compensation, the application adds weight (1-I to the compensation channel in the compensation process c ). The weight (1-I) is given when the gray value of the compensated channel pixel is small c ) Larger and thus more compensation can be obtained. On the contrary, when the gray value of the pixel of the compensated channel is larger, the weight (1-I c ) Smaller, less compensation is obtained. After the first compensation, the gray value distribution of the small-average and medium-average channels is well corrected, and the gray value is well improved.
Preferably, the method of stretching the segment gray values in the step 3 is as follows:
wherein ,Ic (x) Represents the gray value of the stretched channel,representing the gray value of the channel after gray value stretching, for>Representing the maximum threshold of the channel at gray value stretching. />Representing the minimum threshold of the channel at gray value stretching. Usually->The gray value in the channel is the gray value of which the gray value size is the first 95%. />The gray value in the channel is the gray value of the first 5%.
Preferably, in the step 4, a specific compensation formula of the compensation method is as follows:
wherein ,and respectively representing a small-average value channel and a medium-average value channel after the segmented gray values are stretched. />Representing the small mean channel and the medium mean channel after the second color compensation, respectively. Alpha and beta respectively represent parameters for adjusting the compensation weight.
Preferably, in the steps 5, 6, 7 and 8, the original image and the color correction image are converted into HSV space, and the mean value and standard deviation of the two S and V channels are calculated as follows:
wherein H, W is the length and width of the image channel, L c (i, j) is the value of the image channel, u c Is the average value of the image channels, sigma c Is the standard deviation of the image channels. By u c and σc The parameters are calculated as contrast limit thresholds. The specific formula is as follows:
wherein ,CLc For the contrast limit threshold value obtained by calculation, γ is a weight parameter, and θ is a correction parameter.For the mean and standard deviation of the original image channel, +.>The mean and standard deviation of the image channels are color corrected.
The method solves the problem of color cast of the underwater image by utilizing grading double compensation and subsection gray value stretching, optimizes the underwater image by utilizing a contrast adjustment method, can effectively solve the problems of image color distortion, low brightness and low contrast of different attenuation degrees, can retain the information of an original image, and reduces the problem of excessive enhancement of the image. A large number of experiments prove that the method provided by the application has stronger robustness, is excellent in adjusting contrast, details, colors and the like of the underwater image, and the processed image is excellent in objective index and subjective index. The method provided by the application has low complexity and high speed of processing one underwater image, and provides a good foundation for subsequent application.
Drawings
FIG. 1 is a graph of propagation distances of different wavelengths under water;
FIG. 2 is a schematic illustration of single image processing;
fig. 3 is a flow chart of an overall embodiment.
Detailed Description
The application is further elucidated below in conjunction with the accompanying drawings. It is to be understood that these examples are illustrative of the present application and are not intended to limit the scope of the present application. Furthermore, it should be understood that various changes and modifications can be made by one skilled in the art after reading the teachings of the present application, and such equivalents are intended to fall within the scope of the application as defined in the appended claims.
An underwater image processing embodiment based on dual compensation and contrast adjustment is described below by taking exemplary underwater image data sets UIEBC60, U45, anti 10 as an example. The UIEBC60 contains sixty images of blue tone, bluish green tone, green tone and yellow tone, and there are images with lower brightness in the UIEBC60, so that the UIEBC60 can evaluate the color correction capability of the underwater image processing method on the underwater images with different tones, and can also effectively evaluate the robustness of the method. U45 contains forty-five images of 256 x 256 pixels, which are rich in color and low in contrast. It can well evaluate the robustness and effectiveness of the method. Anticuti 10 contains ten underwater images without original images, which can be used to evaluate the ability of different methods to enhance underwater images. Fig. 1 shows the propagation distances of light of different wavelengths under water. The aqueous medium absorbs light of different wavelengths to different extents and absorbs red light of longer wavelengths to a greater extent, followed by orange, yellow, green and blue light in sequence. This phenomenon causes a problem of color shift of the image, which makes the image mainly bluish green. Referring to fig. 2 and 3, the underwater image processing method based on double compensation and contrast adjustment provided by the application comprises the following specific steps:
(1) First color Compensation
The R, G, B channels of the image were first classified according to the gray value mean. The image channel gray value average value calculation formula is as follows:
wherein N is the number of pixels of the original image I. Dividing R, G, B channels into large-average color channels I according to the gray value average value of each channel l Medium average color channel I m And a small average color channel I s
Because the medium-average color channel and the small-average color channel have smaller average values, the medium-average color channel and the small-average color channel are subjected to color compensation first. In order to avoid overcompensation of the small-mean channel, the application compensates the small-mean channel according to the medium-mean channel, and compensates the medium-mean channel according to the large-mean channel. The gray value average value of the large-average value channel is larger, and more information is carried, so that the gray value average value of the large-average value channel is not compensated. The specific compensation formula is as follows:
wherein ,the first compensated small-average channel and the middle-average channel are respectively adopted. In order to ensure that pixels with smaller gray values in a small-average value channel and a medium-average value channel obtain more compensation, the application adds weight (1-I to the compensation channel in the compensation process c ). The weight (1-I) is given when the gray value of the compensated channel pixel is small c ) Larger and thus more compensation can be obtained. On the contrary, when the gray value of the pixel of the compensated channel is larger, the weight (1-I c ) Smaller, less compensation is obtained. After the first compensation, the gray value distribution of the small-average and medium-average channels is well corrected and the gray value is well improved. As shown in fig. 2, it can be seen that both the R and G channels are well corrected after the first compensation. Gray value distributionThe gray value intensity is improved to a certain extent.
(2) Segmented gray value stretching
The gray value of the image channel is adjusted by adopting a segmented gray value stretching method so as to enhance the contrast ratio and the overall brightness of the image. In order to obtain better stretching effect and avoid the influence of extreme gray values, the application adopts a segmented gray value stretching method. The specific formula of the segmented gray value stretching method is as follows:
wherein ,Ic (x) Represents the gray value of the stretched channel,representing the gray value of the channel after gray value stretching, for>Representing the maximum threshold of the channel at gray value stretching. />Representing the minimum threshold of the channel at gray value stretching. Usually->The gray value in the channel is the gray value of which the gray value size is the first 95%. />The gray value in the channel is the gray value of the first 5%.
(3) Second color compensation
As shown in fig. 2, the segmented gray-value stretched image may appear slightly purple. In order to correct the tone of the image after the segmented gray value stretching, the application adopts a second color compensation method. And performing color compensation on the small-average value channel and the medium-average value channel by using the large-average value channel. The specific compensation formula is as follows:
wherein ,and respectively representing a small-average value channel and a medium-average value channel after the segmented gray values are stretched. />Representing the small mean channel and the medium mean channel after the second color compensation, respectively. Alpha and beta represent parameters for adjusting the compensation weight, and alpha and beta are empirically set to 0.7 and 1.5, respectively. As shown in fig. 2, after the R and G channels are compensated for the second time, the problem of the occurrence of purple hue in the image is solved.
(4) Contrast adjustment based on HSV space
The S and V channels of the color corrected image are adaptively adjusted by calculating the mean and standard deviation of the S and V channels of the original image and the color corrected image, taking the mean and standard deviation of the two as parameters limiting contrast adaptive histogram equalization (CLAHE).
Firstly, converting an original image and a color correction image into an HSV space, and calculating the mean value and standard deviation of an S channel and a V channel of the original image and the color correction image, wherein the specific formula is as follows:
wherein H, W is the length and width of the image channel, L c (i, j) isThe value of the image channel, u c Is the average value of the image channels, sigma c Is the standard deviation of the image channels. By u c and σc The parameters are calculated as contrast limit thresholds. The specific formula is as follows:
wherein ,CLc For the calculated contrast limit threshold, γ is a weight parameter, θ is a correction parameter, γ is empirically set to 0.2, θ is 0.025 when adjusting the S channel, and 0.06 when adjusting the V channel.For the mean and standard deviation of the original image channel, +.>The mean and standard deviation of the image channels are color corrected.
Compared with other underwater image processing methods, the method provided by the method is more robust, and the processed image effect is better. The software and hardware of all code operations are: intel Core i7-8750H processor, 16G memory, windows10 system, MATLAB2017b software. Experiments performed on three data sets of Anti 10, U45 and UIEBC60 have shown that the average values of UIQM, UCIQE and Entropy on the data sets of UIEBC60, U45 and Anti 10 are all in the front of other underwater treatment methods. Also, the present application only requires 35ms to process a 256×256 image in PNG format. This shows that the application offers the possibility for subsequent applications requiring real-time processing. The application can effectively eliminate color cast and uniform brightness, improve image definition, and the restored image can better accord with human visual perception, has vivid color and contains more information.

Claims (5)

1. An underwater image processing method based on double compensation and contrast adjustment is characterized by comprising the following steps:
step 1, inputting an original underwater image, calculating the gray value average value of a R, G, B channel of the image, and classifying R, G, B channels into small-average value, medium-average value and large-average value channels according to the average value of each gray value;
step 2, compensating the small-average value channel according to the medium-average value channel, and compensating the medium-average value channel according to the large-average value channel;
step 3, adjusting the gray value of the image channel by adopting a segmented gray value stretching method so as to enhance the contrast ratio and the overall brightness of the image;
step 4, performing color compensation on the small-mean value channel and the medium-mean value channel according to the large-mean value channel to solve the problem of insufficient enhancement of partial pixel gray values and obtain a color correction image;
step 5, converting the color correction image into HSV space and calculating the mean value and variance of S, V channels of the color correction image;
step 6, converting the original underwater image into HSV space and calculating the mean value and variance of S, V channels of the original underwater image;
step 7, calculating parameters for limiting the contrast self-adaptive histogram equalization according to the mean value and variance of S, V channels of the color correction image and the mean value and variance of S, V channels of the original underwater image,
step 8, adaptively adjusting S, V channels of the color correction image according to the calculated parameters for limiting the contrast adaptive histogram equalization;
and 9, outputting the underwater enhanced image.
2. The underwater image processing method based on double compensation and contrast adjustment as claimed in claim 1, wherein the specific compensation formula of the compensation method in the step 2 is as follows:
wherein ,respectively a small-average value channel and a medium-average value channel after the first compensation, I l For the large-average color channel, I m For medium average color channel and I s In order to ensure that pixels with smaller gray values in a small-average value channel and a medium-average value channel obtain more compensation for the small-average value color channel, the application adds weight (1-I to the compensation channel in the compensation process c ) The weight (1-I) is given when the gray value of the compensated channel pixel is small c ) Larger, and therefore more compensation can be obtained, whereas the gray value of the compensated channel pixel is larger with a weight (1-I c ) The gray value distribution of the small-average and medium-average channel after the first compensation is well corrected and the gray value is well improved.
3. The underwater image processing method based on double compensation and contrast adjustment as claimed in claim 1, wherein the method of segmented gray value stretching in step 3 is as follows:
wherein ,Ic (x) Represents the gray value of the stretched channel,representing the gray value of the channel after gray value stretching, for>Representing the maximum threshold value of the channel at gray value stretching,/->Indicating that the channel is in ashMinimum threshold for stretching of the degree value, usually +.>For gray values in the channel with the gray value of the first 95%, a value of +.>The gray value in the channel is the gray value of the first 5%.
4. The underwater image processing method based on double compensation and contrast adjustment as claimed in claim 1, wherein the specific compensation formula of the compensation method in the step 4 is as follows:
wherein ,respectively representing a small-average value channel and a medium-average value channel after the segmented gray value stretching, and the +_>Respectively representing a small-average value channel and a medium-average value channel after the second color compensation, and alpha and beta respectively representing parameters for adjusting the compensation weight.
5. The underwater image processing method based on double compensation and contrast adjustment as claimed in claim 1, wherein the conversion of the original image and the color correction image into HSV space in the steps 5, 6, 7, 8, the mean and standard deviation of the two S and V channels are calculated as follows:
wherein H, W is the length and width of the image channel, L c (i, j) is the value of the image channel, u c Is the average value of the image channels, sigma c For the standard deviation of the image channel, use u c and σc The specific formula of the calculated parameter as the contrast limiting threshold is as follows:
wherein ,CLc For the calculated contrast limit threshold, γ is the weight parameter, θ is the correction parameter,for the mean and standard deviation of the original image channel, +.>The mean and standard deviation of the image channels are color corrected.
CN202310814112.XA 2023-07-05 2023-07-05 Underwater image processing method based on double compensation and contrast adjustment Pending CN116862794A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310814112.XA CN116862794A (en) 2023-07-05 2023-07-05 Underwater image processing method based on double compensation and contrast adjustment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310814112.XA CN116862794A (en) 2023-07-05 2023-07-05 Underwater image processing method based on double compensation and contrast adjustment

Publications (1)

Publication Number Publication Date
CN116862794A true CN116862794A (en) 2023-10-10

Family

ID=88224590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310814112.XA Pending CN116862794A (en) 2023-07-05 2023-07-05 Underwater image processing method based on double compensation and contrast adjustment

Country Status (1)

Country Link
CN (1) CN116862794A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117078561A (en) * 2023-10-13 2023-11-17 深圳市东视电子有限公司 RGB-based self-adaptive color correction and contrast enhancement method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117078561A (en) * 2023-10-13 2023-11-17 深圳市东视电子有限公司 RGB-based self-adaptive color correction and contrast enhancement method and device
CN117078561B (en) * 2023-10-13 2024-01-19 深圳市东视电子有限公司 RGB-based self-adaptive color correction and contrast enhancement method and device

Similar Documents

Publication Publication Date Title
CN112288658B (en) Underwater image enhancement method based on multi-residual joint learning
Zhou et al. Auto color correction of underwater images utilizing depth information
CN110232661B (en) Low-illumination color image enhancement method based on Retinex and convolutional neural network
CN106897972A (en) A kind of self-adapting histogram underwater picture Enhancement Method of white balance and dark primary
CN111105371B (en) Enhancement method of low-contrast infrared image
CN111696052B (en) Underwater image enhancement method and system based on red channel weakness
CN109118437B (en) Method and storage medium capable of processing muddy water image in real time
CN107481278A (en) Image bit depth expansion method and device based on combination frame
CN116862794A (en) Underwater image processing method based on double compensation and contrast adjustment
CN116188325A (en) Image denoising method based on deep learning and image color space characteristics
CN111476744A (en) Underwater image enhancement method based on classification and atmospheric imaging model
CN111563854A (en) Particle swarm optimization method for underwater image enhancement processing
CN117252773A (en) Image enhancement method and system based on self-adaptive color correction and guided filtering
CN110599426B (en) Underwater image enhancement method for optimizing CLAHE
CN112907470A (en) Underwater image recovery method based on Lab color gamut transformation, classification and white balance
CN116029944B (en) Self-adaptive contrast enhancement method and device for gray level image
CN112488968A (en) Image enhancement method for balanced fusion of degree-based histograms
CN117408915A (en) Color correction and Retinex multi-scale fusion underwater image enhancement method and device
CN113837963B (en) Underwater image enhancement method based on depth network under LAB color space
CN116630198A (en) Multi-scale fusion underwater image enhancement method combining self-adaptive gamma correction
CN112070693B (en) Single dust image recovery method based on gray world adaptive network
CN113850733A (en) Color image enhancement method based on variable power monostable self-adaptive stochastic resonance
CN114529713A (en) Underwater image enhancement method based on deep learning
CN112435174A (en) Underwater image processing method based on double attention mechanism
CN110097497B (en) Multi-scale image transformation and inverse transformation method based on residual multisystemlets

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination