Please bear in mind that without the spectral information on light source, reflecting materials and camera response, such a transformation will only be a very rough estimate.
Thank you all for the answers. How does the color temperature of light source and white balance chosen during image acquisition affect the quality of the image? What if both of them are different?