diff --git a/README.md b/README.md index c1ab020..b51597c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,81 @@ -# underimage-fusion-enhancement -Reference: -《color balance and fusion for underwater image enhancement》 +# Underimage Fusion Enhancement + +A small MATLAB-based project for enhancing and fusing underexposed / low-quality images using multi-scale fusion and simple color/contrast corrections. The repository contains MATLAB scripts and functions for weight computation, pyramid decomposition/reconstruction, saliency and color compensation, and objective image quality metrics. + +## Highlights + +- Multi-scale image fusion using Gaussian/Laplacian pyramids. +- Color compensation (red/blue), gamma correction, and simple color balance helpers. +- Perceptual and objective quality metrics (UIQM, UCIQE, UICM, UISM) for evaluation. +- Utilities for saliency detection, sharpening, and contrast enhancement. + +## Requirements + +- MATLAB (tested with R2018a+). Core functionality uses basic MATLAB functions. +- Image Processing Toolbox recommended for convenient image IO and visualization, but not strictly required for all scripts. + +## Quick start + +1. Open MATLAB and set the project folder on the path, or change directory to the project root. + +In MATLAB: + +```matlab +cd('d:/mini/underimage-fusion-enhancement') +addpath(genpath(pwd)) +main +``` + + + +`main.m` is the entry script used to run the default fusion pipeline. Input images should be placed in the `image/` folder; outputs are written to `result/`. + +## File overview + +Key files and their purpose: + +- `main.m` — Example driver script for running the fusion/enhancement pipeline. +- `laplacian_pyramid.m`, `gaussian_pyramid.m`, `pyramid_reconstruct.m` — Pyramid decomposition / reconstruction utilities. +- `norm_weight.m`, `lapweight.m`, `Saturation_weight.m` — Weight map computations used during fusion. +- `saliency_detection.m` — Saliency map computation used as one of the fusion weights. +- `sharp.m` — Image sharpening helper. +- `simple_color_balance.m`, `gammaCorrection.m`, `blueCompensate.m`, `redCompensate.m` — Color and exposure correction utilities. +- `rgb_to_lab.m`, `lab_to_rgb.m`, `rgb2lab_n.m` — Color space conversions. +- `hisStretching.m` — Histogram-based stretching. +- `UCIQE.m`, `UICM.m`, `UIConM.m`, `UIQM.m`, `UISM.m` — Image quality metrics and supporting files. +- `image/` — Example input images (place your images here). +- `result/` — Output folder where processed / fused images are written. + +There are several other small helper scripts; filenames are descriptive — see the repository root for the full list. + +## Usage notes and ideas + +- To process a custom image, add it to the `image/` folder and edit `main.m` to select it or adapt the script to iterate through the folder. +- The pipeline is modular: you can replace or tune weight maps (for example, tweak saliency, saturation, or laplacian weights) and then re-run pyramid fusion. +- For reproducible experiments, log parameters and output filenames in `main.m` or add a wrapper that accepts parameters. + +## Evaluation + +The repository includes implementations of common underwater image quality metrics (UIQM, UCIQE, UICM, UISM). Use them to compare variants of the pipeline. Example usage is found in the metric files; typically they accept an RGB image and return a scalar score. + +## Limitations + +- This project is a research/educational codebase implemented in MATLAB. It is not optimized for production or large batch processing. +- GPU acceleration is not implemented — speed depends on MATLAB and your CPU. + +## Contributing + +If you'd like to contribute, please: + +1. Fork the repository. +2. Add tests or examples if you change behavior. +3. Open a pull request with a clear description of the change. + +## License + +No license file is included in this repository. If you want to open-source the project, consider adding an `LICENSE` (for example MIT) so others know how they may use the code. + +## Contact + +If you have questions or need help running the code, open an issue or contact the repository owner. diff --git a/main.m b/main.m index 1ed87c5..de063cb 100644 --- a/main.m +++ b/main.m @@ -12,12 +12,10 @@ imshow(im1); xlabel('red channel compensate'); -% blue channel recover -% In murky waters or high water levels or the presence of plankton in abundance that causes the blue channel to attenuate strongly,Supplement the blue channel -% im1 = blueCompensate(im1); -% subplot(2,3,3) -% imshow(im1); -% xlabel('blue channel compensate') +% blue channel recover In murky waters or high water levels or the presence +% of plankton in abundance that causes the blue channel to attenuate +% strongly,Supplement the blue channel im1 = blueCompensate(im1); +% subplot(2,3,3) imshow(im1); xlabel('blue channel compensate') % white balance enhancement im2 = simple_color_balance(im1);