Ask Your Question
0

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 -0600

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
0

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

holger gravatar image

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

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

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

Seen: 1,153 times

Last updated: Feb 18 '20