Underwater Image Color Correction

Kirtish S
5 min readMay 9, 2023

--

Introduction

Image captured underwater

If you’ve ever shot underwater footage, you know that it looks bluer and greener than it should. This is because the red light of the spectrum gets absorbed as you go deeper into the ocean, making the footage appear dull and lifeless. Fortunately, there is a solution to this problem: underwater color correction.

Underwater color correction is the process of adjusting the colors in your underwater footage to make them look more natural and vibrant. This tool uses image processing algorithms to fix the colors for you, making your underwater footage look like it was shot on dry land.

Why is underwater color correction important?

Underwater color correction is important for a number of reasons. Firstly, it can help to enhance the visual appeal of your footage, making it more engaging and interesting for viewers. Secondly, it can help to convey a more accurate representation of the underwater environment, allowing viewers to see the true colors and textures of the underwater world. Finally, it can help to improve the overall quality of your footage, making it more professional-looking and suitable for a wider range of applications.

How does underwater color correction work?

Underwater photography is a fascinating field that captures the beauty of the underwater world. However, underwater images often appear bluish or greenish due to the absorption of light by water and the scattering of light by particles in water. To obtain a more accurate and visually appealing representation of the underwater scene, color correction is required.

Underwater Image

Step 1: Histogram Analysis

The first step in color correction is to analyze the histogram of the RGB channels of the image. From the histogram, we observed that the red channel is concentrated on the left side of the histogram, indicating that the red color gets absorbed due to a higher wavelength. We also observed that in images with a greenish appearance, the histogram of the blue channel is also concentrated toward the left.

Histogram of the image

Step 2: Channel Analysis

In addition to the histogram, we also observed the true R, G, and B components of all images to display the degradation of each channel. It was observed that the Green channel is the least degraded as compared to the Red and Blue channel.

Channel Analysis

Step 3: Compensation

The compensation process is to add a fraction of the green channel to the Red and Blue (when required) channel as it is the least degraded channel.

Compensated Image

Step 4: White Balancing

After performing the compensation, the next step in color correction is to perform white balancing using the Gray World algorithm. In this algorithm, the average value of R, G, and B channels is calculated and then scaled such that the gray world assumption is satisfied, which assumes that the average color in a natural scene is gray. This results in a more accurate representation of the colors in the image.

After following these steps, we observed that the color-corrected image had low color distortion and appeared more visually appealing. Color correction is an essential step in underwater image processing and can significantly improve the quality of the images captured in this unique environment.

White Balanced Image

Code

To implement the methodology discussed above for underwater image color correction, we have developed a Python code using the NumPy and Pillow libraries. The code consists of several functions that perform various tasks such as loading the image, plotting the histogram, compensating for the degradation of color channels, and performing white balancing.

Compensation of Image

Code for Compensation of image

White balancing using Gray World Algorithm

Code for White Balancing an Image

Results

Comparison of the original image and color-corrected image

Conclusion

In conclusion, underwater image color correction is a crucial process to enhance the visual quality of underwater images. It is essential to compensate for the degradation of the red and blue channels, which get absorbed as a result of light scattering and attenuation. By adding a fraction of the green channel to the red and blue channels, we can effectively compensate for this degradation. The Gray World algorithm is also used to perform white balancing to ensure that the colors in the image appear natural and not skewed towards a particular color. By following these color correction techniques, we can produce high-quality underwater images with minimal color distortion, which can be used for various applications such as scientific research, marine biology, and underwater photography.

--

--