From: Walter Roberson on
Siddharth Magazine wrote:
> I really need someone's help on this. I am trying to acquire an image
> which has two black points in it. So, i mean i need some matlab codes
> which can help me to acquire the image automatically by identifying the
> two black points, and then find the distance automatically with a line
> drawn between the two black points. I am stuck in this automated
> process. Can't really think about any codes which can do that in Matlab?

Threshold the image with a low value. Take the logical negation of the
image. bwlabel that. regionprops to get the centroids. Take a euclidean
distance between the coordinates.

However, unless the points are truly points (single pixels) you need to
define exactly what you mean by the "distance between" the points. Are
you looking for centroid to centroid distances or for closest-pixel to
closest-pixel distance?