I am looking for an algorithm which calculates the color temperature (in K) which is the used to set the color temperature in a digital camera. As input the algorithm gets a captured white area of a photo (which is not white if the white balance is wrong). The algorithm should estimate the color temperature until the white area is realy white (I hope it's clear what I mean).
One straight forward algorithm would be to linearly probe all temperatures, e.g. set the temperature -> capture a picture -> check color of white area and then select the best match.
But how is this correctly done, assuming that I can only capture photos and set the color temperature in the camera (for instance there is no infomation about the color matrices used for white balance calculation, or any other information I could use for the calculation)?
Regards,