How to implement color correction based on known background color?
Assuming your pixels are converted to floats in the range 0,0,0 (black) to 1,1,1 (white). You have a vector in 3D (RGB) space from the picture background to the known value.  To correct, calculate a correction by multiplying each component by the magnitude of the correction needed.  So if you have dR, dG, dB as the differences, all between 0.0 and 1.0, and R,G,B is a pixel, Rnew = R * (1.0 + dR) clipping max at 1.0.  This will keep black pixels black.
I have a dataset of face images which were captured with a uniform gray background. Because of the lighting variations during collection, the images no longer have same color tone. The backgrounds color looks different for all the images.
I want to find the exact skin color and wanted to implement color correction using the fact that all images had uniform gray background. How can I implement this using python?