MATLAB: How to automatically calculate distance between two brighter points in an gray scale image

distance b/w brighter regions

In my coding task, I am having an image after thresholding step which is having 9 brighter regions. How may I find distances between these brighter regions automatically in matlab. Thanks in anticipation.

Best Answer

You should be having the pixel value of the spots. Use find to get the location of those pixles and then use pdist or pdist2.