I know many ways to find the distance between two colors – Euclidean or other, in any color space – RGB, HSV or other, but I am now coming upon a problem much more simpler, find the distance between two colors in a grayscale image and I am not sure how to face it.
Lets say we have two pixels with two different grays, a = 122 and b = 201.
How would you define the distance? Is it 79? Or using the Euclidean distance for instance, knowing that Ra = 122 Ga = 122 Ba = 122 and same for Rb = 201, Gb = 201, Bb = 201, which gives an Euclidean distance of ~136.
I’ve computed the two different methods with quite a number of examples, the results are very different and I am not sure which approach to choose. Any idea?
Taken from Wikipedia: Color Difference
Even though in grayscale R = G = B, a pixel still has all three values.
I would stick with Euclidean distance, it seems to be the convention.