I have a image of the colorchecker get by a digital camera, how i use this to calibrate the images using opencv?
follow below the colorchecker image:
Are you asking how to do color calibration or how to do it with OpenCV?
In order to do color calibration you use the last row (gray tones) of the calibration board. Here is what you should do for color calibration step by step:
You can check if the calibration is done correctly by taking a small region from another color and check its average value with its given value. If they matches or pretty much same, then you have color calibrated your camera successfully.
All you need to do is being able to set camera gains, after that just capture images and try to match values and find correct camera gains.
If you understand the process, doing this using OpenCV should be piece of cake.
[EDIT]
Well, I don't know any ways to calculate the gain. But the most easy way is brute force. You can do something like this;
suppose your gain values vary between 0.0 and 3.0, specify a step value such as 0.1 and try all values. You should have a for loop like this:
for (double redGain=0.0; redGain <= 3.0; redGain += 0.1)
for (double greenGain=0.0; greenGain <= 3.0; greenGain += 0.1)
for (double blueGain=0.0; blueGain<= 3.0; blueGain+= 0.1)
setCameraGain(redGain, greenGain, bluegain);
// do the rest of the stuff
end
end
end