how to get the actual distance between two points

I have a rectangular arena ,the length and breadth of the rectangle is known in units of centimeters ,I have an image(521*441) of the arena .How can we calculate the distance between any two points in the arena if I know the coordinates of the points in the image??

 Respuesta aceptada

Image Analyst
Image Analyst el 17 de Dic. de 2015

0 votos

See my attached spatial calibration demo to let you designate two points and say what the real world distance is. Then measurements you make will be reported in those, for example meters.

2 comentarios

Soumya Behera
Soumya Behera el 17 de Dic. de 2015
Thanks A lot sir .Sir please look into the problem I just mentioned in the above comment .
Image Analyst
Image Analyst el 17 de Dic. de 2015
It will show you how to find the centroids. After that, you can order them in whatever order or pattern you want.

Iniciar sesión para comentar.

Más respuestas (1)

Renato Agurto
Renato Agurto el 17 de Dic. de 2015
This should do the job:
length_cm = 30;
width_cm = 20;
length_px = 521;
width_px = 441;
length_cm_pro_px = length_cm/length_px;
width_cm_pro_px = width_cm/width_px;
% point1: (x1, y1)
% point2: (x2, y2)
dx = x2-x1;
dy = y2-y1;
distance_in_cm = sqrt((dx*length_cm_pro_px)^2 + (dy*width_cm_pro_px)^2);
cheers!
Renato

3 comentarios

Soumya Behera
Soumya Behera el 17 de Dic. de 2015
Thanks a lot sir Actually I am working on a problem if I have an arena having a starting and ending point and i have to follow the triangles(Equilateral with equal dimensions) to reach the end point how can I save the centroids of the triangles in an array on the sequence they are encountered .I have shown the arrow marks to illustrate the path ,but they are absent in actual image.
Renato Agurto
Renato Agurto el 17 de Dic. de 2015
Hi. I'm not sure if the answer helped you or not. If your are asking a new question you should create a new topic
Soumya Behera
Soumya Behera el 17 de Dic. de 2015
Yes sir your answer too helped me .Thanks a lot for that .I will create it sir but for the time being can you please help me solving it??.Thankyou

Iniciar sesión para comentar.

Categorías

Más información sobre Convert Image Type en Centro de ayuda y File Exchange.

Preguntada:

el 17 de Dic. de 2015

Comentada:

el 17 de Dic. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by