I am trying to identify and differentiate the colours of LEDs against a black background using OpenCV on an Android phone, but am currently struggling. My investigations to date point to two separate issues:
- Using OpenCV, the camera appears to default to automatic white balance which makes it difficult to differentiate between certain colours. Using the native Android camera the best images appear to be produced with a white balance set to "Cloudy".
- OpenCV provides images in the RGB colour space, yet RGB does not match the human-perceived distance between colours meaning a Euclidean RGB distance metric is not an optimum solution (see How to compare two colors).
Consequently I have three questions:
- Is there a way in Android Java or OpenCV to set the camera's white balance so that it influences the resultant image returned by OpenCV?
- If not, is there an algorithm available (preferably in Java) to modify the white balance of the OpenCV image?
- Is there an algorithm available (again, preferably in Java) to convert RGB colours to an alternative colour space that would better match the human-perceived distance between colours?
Thanks