1 | initial version |
Uhmm euclidenean distance computes the distance between two point in any dimension. So take a pixel - for a non transparent color image it has 3 value for red, green , blue.
So it has a dimensionality of 3. All you need to do is to consider these r,g,b value as value in a coordinate system and just do the math
I.E P1(255,0,0) P2(0,255,255) sqrt(pow(0-255) + pow(255-0) + pow(255-0))
You can repeat this for other pixels too.
2 | No.2 Revision |
Uhmm euclidenean distance computes the distance between two point in any dimension. So take a pixel - for a non transparent color image it has 3 value for red, green , blue.
So it has a dimensionality of 3. All you need to do is to consider these r,g,b value as value in a coordinate system and just do the math
I.E
P1(255,0,0)
P2(0,255,255)
I.E
P1(255,0,0)
P2(0,255,255)
result = sqrt(pow(0-255) + pow(255-0) + pow(255-0))
You can repeat this for other pixels too.
3 | No.3 Revision |
Uhmm euclidenean distance computes the distance between two point in any dimension. The two point must have the same dimensionality. So take a pixel - for a non transparent color image it has 3 value for red, green , blue.
So it has a dimensionality of 3. All you need to do is to consider these r,g,b value as value in a coordinate system and just do the math
I.E
P1(255,0,0)
P2(0,255,255)
result = sqrt(pow(0-255) + pow(255-0) + pow(255-0))
You can repeat this for other pixels too.