Reliable color detection in difference lightings.
I am working on a project where I need to detect color of a particular region of the object. While It's very easy to get RGB value from the frame of a particular object. Results fluctuate a lot when lighting changes. Ie, from natural light to artificial ones. I am wondering if there is anything to eliminate minor lighting changes to get a reliable color detection.
Things I have tried so far.
- Tried converting RGB to YCrCy and try hist_equalization on Y part.
- Converted from BGR to gray, hist_equalizarion and converted back to RGB.
Any suggestions ? Thanks in advance.
What I do in most of my setups is calibrating the color beforehand. This can be done by adding a color calibration pattern inside the capture area and compensate the colors for know color values. A more easier approach is to use simpe pieces of white paper and already compensate for that.