https://github.com/basharatwali/underwater-image-enhancement
https://github.com/basharatwali/underwater-image-enhancement
computer-vision image-enhancement image-processing underwater-images
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/basharatwali/underwater-image-enhancement
- Owner: BasharatWali
- License: mit
- Created: 2025-03-06T07:27:33.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-06T07:32:37.000Z (3 months ago)
- Last Synced: 2025-03-06T08:28:23.368Z (3 months ago)
- Topics: computer-vision, image-enhancement, image-processing, underwater-images
- Language: Jupyter Notebook
- Homepage:
- Size: 4.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Underwater Image Enhancement Pipeline
This repository contains an implementation of an underwater image enhancement pipeline. The project reproduces the DIRS-CLAHS method and extends it with several improvements to restore color balance and enhance local details in underwater images.
## Overview
Underwater images often suffer from low contrast, color imbalance, and haze due to the water medium. Our approach first reproduces the baseline DIRS-CLAHS method and then improves it by:
- Compensating for color attenuation (boosting the red channel)
- Refining global and local contrast correction
- Integrating a Multi-Scale Retinex module with color restoration
- Applying post-processing (gamma correction and weighted blending)## Pipeline
The enhancement pipeline consists of the following steps:
- **Input:** Read the underwater image (and reference image if available for evaluation).
- **Color Attenuation Compensation (CAC):**
- Split the image into its B, G, and R channels.
- Compute average intensities and derive a red compensation factor.
- Boost the red channel while slightly attenuating the blue channel.
- **Global Contrast Correction:**
- Compute the 5th and 95th percentiles for each color channel.
- Apply a piecewise linear stretch that maps the lower intensity region to [0, 127] and the higher region to [128, 255].
- **Adaptive Local Enhancement:**
- Convert the image to the LAB color space.
- Apply CLAHE on the luminance (L) channel with an adaptive clip limit based on the image's brightness.
- **Multi-Scale Retinex with Color Restoration (MSRCR):**
- For each color channel, compute the Single-Scale Retinex (SSR) using Gaussian blurring with multiple scales.
- Combine the SSR outputs using weighted averaging.
- Apply a color restoration function (CRF) to mitigate desaturation.
- **Gamma Correction and Blending:**
- Apply mild gamma correction to adjust brightness.
- Blend the gamma-corrected image with the locally enhanced image to achieve a balanced final output.
- **Evaluation:**
- Compute full-reference metrics (PSNR, SSIM, MSE) when a reference image is available.
- Always compute no-reference metrics (UIQM, UCIQE) to assess visual quality.## Evaluation Metrics
We use the following metrics:
- **PSNR:** Peak Signal-to-Noise Ratio
- **SSIM:** Structural Similarity Index
- **MSE:** Mean Squared Error
- **UIQM:** Underwater Image Quality Measure
- **UCIQE:** Underwater Color Image Quality Evaluation