How To Find Distance Between Centroids ????

Hey Guyz,
I am working on the project Titled as "Text Detection and Recognition". I have a question about finding the distance between two centriods. How to find it ????? What is the possible approach of finding it ??
Regards and Thanks in advance Cheers !

 Accepted Answer

You can use the Pythagorean theorem, or the functions sqrt() or hypot(). If you don't even have the centroid locations yet, then see my Image Segmentation Tutorial: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

More Answers (1)

Joseph Cheng
Joseph Cheng on 24 Apr 2015
Edited: Joseph Cheng on 24 Apr 2015
So you already have two centroids with coordinates (x1,y1) and (x2,y2) then the distance formula would work right?
distance = sqrt((x2-x1)^2+(y2-y1)^2);

1 Comment

Well bundle of thanks Joseph..Your help worked for me. Thumbs up and Cheers

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!