# WB_sRGB
**Repository Path**: qinix2/WB_sRGB
## Basic Information
- **Project Name**: WB_sRGB
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-06-09
- **Last Updated**: 2024-10-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# When Color Constancy Goes Wrong: Correcting Improperly White-Balanced Images
*[Mahmoud Afifi](https://sites.google.com/view/mafifi)*1, *[Brian Price](https://www.brianpricephd.com/)*2, *[Scott Cohen](https://research.adobe.com/person/scott-cohen/)*2, and *[Michael S. Brown](http://www.cse.yorku.ca/~mbrown/)*1
1York University 2Adobe Research

Reference code for the paper [When Color Constancy Goes Wrong:
Correcting Improperly White-Balanced Images.](http://openaccess.thecvf.com/content_CVPR_2019/papers/Afifi_When_Color_Constancy_Goes_Wrong_Correcting_Improperly_White-Balanced_Images_CVPR_2019_paper.pdf) Mahmoud Afifi, Brian Price, Scott Cohen, and Michael S. Brown, CVPR 2019. If you use this code or our dataset, please cite our paper:
```
@inproceedings{afifi2019color,
title={When Color Constancy Goes Wrong: Correcting Improperly White-Balanced Images},
author={Afifi, Mahmoud and Price, Brian and Cohen, Scott and Brown, Michael S},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={1535--1544},
year={2019}
}
```
The original source code of our paper was written in Matlab. We also provide a Python version of our code. We tried to make both versions identical.
However, there is no guarantee that the Python version will give exactly the same results.
The differences should be due to rounding errors when we converted our model to Python or differences between Matlab and OpenCV in reading compressed images.
#### Quick start
##### 1. Matlab:
[](https://www.mathworks.com/matlabcentral/fileexchange/73428-image-white-balancing)
1. Run `install_.m`
2. Run `demo.m` to process a single image or `demo_images.m` to process all images in a directory.
3. Check `evaluation_examples.m` for examples of reporting errors using different evaluation metrics. Also, this code includes an example of how to hide the color chart for Set1 images.
##### 2. Python:
1. Requirements: numpy, opencv-python, and skimage (skimage is required for evaluation code only).
2. Run `demo.py` to process a single image or `demo_images.py` to process all images in a directory.
3. Check `evaluation_examples.py` for examples of reporting errors using different evaluation metrics. Also, this code includes an example of how to hide the color chart for Set1 images.
#### Graphical user interface
We provide a Matlab GUI to help tuning our parameters in an interactive way. Please, check `demo_GPU.m`.