Distance between black pixels along a transect in a binary image


I am trying to find the distance between multiple points along a transect. I know that if I individually select the points that I will be able to compute the distance but I have many images to do this on and was hoping that there was a faster way.

I can create a binary image and then a plot profile to get the peaks but I then want to find the distance between point 1 and 2, 2 and 3 and so on.

Any help would be greatly appreciated :slight_smile:


It is unclear what is exactly that you want to do, but if your points are thresholded, you can compute the Euclidean distance transform (Distance Map in IJ) which gives you the distance of the background pixels to the nearest foreground pixels (not necessarily the ones that you would get if you “join the dots”, which seems to be complicated to do).