# calculate the Euclidean distances among one pixel selected from the object of interest and the rest of the points in the image

An image is taken as input and converted to CIE-Lab colour space. Now I have to select the object of interest in the image and find the euclidian distance among one pixel selected from the object of interest and the rest of the points in the image. My problem is

1.Selecting my object of interest. ( In the below image I want to select the red chair) 2. To measure the euclidian distance from one pixel from that red chair to the rest of the points of the image 3. compute the delta values of the image yielding only one chromatic difference on an image referred as to delta image. 4. Since the chromatic difference between two pixels gives a low value when both pixels are similar and a high value otherwise, according to this, such difference can be interpreted as a probability value of belonging to a particular colour.

I have coded this far:

1. Taken input of the image 2.Performed homography 3.Transformed to CIE- Lab space

edit retag close merge delete

Sort by ยป oldest newest most voted

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.

more

Official site

GitHub

Wiki

Documentation