This repository provides:
- Python version of the auto-white-balance (AWB) method based on principle component analysis (PCA) [1].
- Python RGB data processing pipeline to convert raw mosaiced images to standard RGB images (i.e., demosaicing, AWB, color correction matrix, gamma correction, and color enhancement).
- Matlab script to construct a color correction matrix (CCM) using Macbeth chart.
*I am not the author of the aforementioned paper. I have built this tool only for learning purposes.
- Open main.py in
./sample/rgb_processing
and specify config dictionaries. - Run
./sample/rgb_processing/main.py
. A processed RGB image will be visualized.
If a color correction matrix is not available, create_color_correction_matrix.m in ./sample/color_correction_matrix
can be used to make an original one for a specific system. For this purpose, images containing a color checker are needed.
Sample raw data in ./data/sample_image
is taken from [2].
[1] D. Cheng, D. K. Prasad, and M. S. Brown, Illuminant estimation for color consistency: why spatial domain methods work and the role of the color distribution, J. Opt. Soc. Am. A 31. 1049-1058, 2014
[2] 10xEngineers. (2023). Auto White Balance (AWB) Dataset. Kaggle.com. https://www.kaggle.com/datasets/tenxengineers/auto-white-balance-awb [Accessed]: Dec. 26, 2023