MATLAB: Determine size of object in image having two laser spots.

length of object having two spots at specific distance

hi all, i'm new to matlab and have started work on determining size of object in image, by this i mean length of object not in pixels. The idea is i've used two laser beams of fixed length and i take a picture of object having two laser spots on it. By this fixed laser spots i want to calculate length of that object. Can someone suggest me an algorithm to do this?
many thanks..

Best Answer

How about using imdistline() for a manual method? Or for an automatic method you'll have to locate those two spots, perhaps by thresholding or color segmentation, then use the Pythagorean theorem to get the Euclidean distance.
Related Question