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 !

 Risposta accettata

Image Analyst
Image Analyst il 24 Apr 2015
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

Più risposte (1)

Joseph Cheng
Joseph Cheng il 24 Apr 2015
Modificato: Joseph Cheng il 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 Commento

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

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by