Not being entirely convinced that RGB is the best colour space to do mathematical computations in, I’ve started running some of my algorithms in the HSI colour space. Even though I did not do exhaustive testing, the HSI space did not yield very promissing results.
One reason might be because HSI and HSB have a discontinuity between 0º and 360º. When computing distances between values, which is the basis of a number of my classification algorithm, one might get inaccurate results.

Figure 1: HSB Colour Space
In Figure 1, it is clear that the red colours at 0º and 360º are quite ‘close’, i.e. a distance measurement should be close 0. However, because of the discontinuity a big distance is obtained between the yellowish-reds and the pinkish-reds.
Another colour space one might consider is the CIE 1931 space, which was the first mathematically defined colour space. However, it is not suitable for giving direct difference between two colours.
The Lab colour spaces are later renditions of mathematical colour spaces, which allows one to more accurately measure the distance between two colours. These measures are (apparently) not perfect, but it seems to produce the best results at present.
There’s a pretty good article on colour spaces on CompuPhase’s website, which provides insights into the difficulties involved with colour metrics. It is also suggested to use the square root of L* in Lab, rather than standardized cube root.
Next thing would be to implement the Lab conversion and to do a couple of experiments.
Posted in Research