{"id":26487366,"url":"https://github.com/basharatwali/underwater-image-enhancement","last_synced_at":"2026-07-07T02:31:35.722Z","repository":{"id":280957674,"uuid":"943738375","full_name":"BasharatWali/Underwater-Image-Enhancement","owner":"BasharatWali","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-06T07:32:37.000Z","size":4723,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T19:41:56.474Z","etag":null,"topics":["computer-vision","image-enhancement","image-processing","underwater-images"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BasharatWali.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-06T07:27:33.000Z","updated_at":"2025-03-06T07:40:49.000Z","dependencies_parsed_at":"2025-03-06T08:39:17.998Z","dependency_job_id":null,"html_url":"https://github.com/BasharatWali/Underwater-Image-Enhancement","commit_stats":null,"previous_names":["basharatwali/underwater-image-enhancement"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BasharatWali/Underwater-Image-Enhancement","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BasharatWali%2FUnderwater-Image-Enhancement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BasharatWali%2FUnderwater-Image-Enhancement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BasharatWali%2FUnderwater-Image-Enhancement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BasharatWali%2FUnderwater-Image-Enhancement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BasharatWali","download_url":"https://codeload.github.com/BasharatWali/Underwater-Image-Enhancement/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BasharatWali%2FUnderwater-Image-Enhancement/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281011873,"owners_count":26429433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","image-enhancement","image-processing","underwater-images"],"created_at":"2025-03-20T06:38:26.113Z","updated_at":"2025-10-25T19:35:08.975Z","avatar_url":"https://github.com/BasharatWali.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Underwater Image Enhancement Pipeline\n\nThis 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.\n\n## Overview\n\nUnderwater 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:\n- Compensating for color attenuation (boosting the red channel)\n- Refining global and local contrast correction\n- Integrating a Multi-Scale Retinex module with color restoration\n- Applying post-processing (gamma correction and weighted blending)\n\n## Pipeline\n\nThe enhancement pipeline consists of the following steps:\n\n- **Input:** Read the underwater image (and reference image if available for evaluation).\n- **Color Attenuation Compensation (CAC):**  \n  - Split the image into its B, G, and R channels.\n  - Compute average intensities and derive a red compensation factor.\n  - Boost the red channel while slightly attenuating the blue channel.\n- **Global Contrast Correction:**  \n  - Compute the 5th and 95th percentiles for each color channel.\n  - Apply a piecewise linear stretch that maps the lower intensity region to [0, 127] and the higher region to [128, 255].\n- **Adaptive Local Enhancement:**  \n  - Convert the image to the LAB color space.\n  - Apply CLAHE on the luminance (L) channel with an adaptive clip limit based on the image's brightness.\n- **Multi-Scale Retinex with Color Restoration (MSRCR):**  \n  - For each color channel, compute the Single-Scale Retinex (SSR) using Gaussian blurring with multiple scales.\n  - Combine the SSR outputs using weighted averaging.\n  - Apply a color restoration function (CRF) to mitigate desaturation.\n- **Gamma Correction and Blending:**  \n  - Apply mild gamma correction to adjust brightness.\n  - Blend the gamma-corrected image with the locally enhanced image to achieve a balanced final output.\n- **Evaluation:**  \n  - Compute full-reference metrics (PSNR, SSIM, MSE) when a reference image is available.\n  - Always compute no-reference metrics (UIQM, UCIQE) to assess visual quality.\n\n## Evaluation Metrics\n\nWe use the following metrics:\n- **PSNR:** Peak Signal-to-Noise Ratio\n- **SSIM:** Structural Similarity Index\n- **MSE:** Mean Squared Error\n- **UIQM:** Underwater Image Quality Measure\n- **UCIQE:** Underwater Color Image Quality Evaluation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasharatwali%2Funderwater-image-enhancement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasharatwali%2Funderwater-image-enhancement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasharatwali%2Funderwater-image-enhancement/lists"}