Show Hide all comments. I though the OP wants the Euclidean distance between two points x1y1 x2y2 which should be sqrtx1-x22y1-y22. You can use color segmentation to find the blue spots.
Learn more about distance 2points nodes digraph colour path.
Then use regionprops to get the centroids of them. How can I find the distance between 2 points. It does not terribly matter which point is which as long as you keep the labels 1 and 2 consistent throughout the problem. I though the OP wants the Euclidean distance between two points x1y1 x2y2 which should be sqrtx1-x22y1-y22.