Ask Your Question

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

asked 2020-02-16 23:17:00 -0500

titli gravatar 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.

image description

I have coded this far:

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

After this I am instructed to measure euclidian distance. Please help

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-02-18 13:05:14 -0500

holger gravatar image

updated 2020-02-18 13:06:51 -0500

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

result = sqrt(pow(0-255) + pow(255-0) + pow(255-0))

You can repeat this for other pixels too.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-02-16 23:17:00 -0500

Seen: 105 times

Last updated: Feb 18 '20