Skip to content

RGB data processing pipeline including auto-white-balance based on principle component analysis (PCA).

License

Notifications You must be signed in to change notification settings

ksonod/pca-auto-white-balance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About this Repository

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.

How to Use

  1. Open main.py in ./sample/rgb_processing and specify config dictionaries.
  2. 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 Data

Sample raw data in ./data/sample_image is taken from [2].

References

[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