how to find actual distance between points in a image??

Respuestas (2)

Thorsten
Thorsten el 29 de Ag. de 2016
You need a cross in x and y direction of known size in your image. Then you can convert form pixel units to real-world distance.
In this image if you know the width of the white stripe you can use this distance as reference to determine the scaling factor from image to real-word distance in x-direction and assume that the y-distance has the same scaling factor.

1 comentario

thwnx for rply... will u pls elaborate it more properly with code if possible

Iniciar sesión para comentar.

Suleyman
Suleyman el 7 de Nov. de 2022
use a ruler

2 comentarios

I have a digital micrometer right here beside me (picking it up and looking at it as I type this.) It can nominally measure down to 0.1 mm . That is down to roughly 1/3 of one point (0.28 of a point), so you would think that I would be able to measure objects on the screen fairly precisely.
In practice... it does not work. Placing a ruler (or micrometer) on the screen requires a lot of interpretation as to where exactly boundaries are, since there is viewing angle to consider, and since the light emitting layer is not right at the surface (with there being a layer of glass plus internal layers having to do with the light emitting technology involved.)
Using a ruler on the screen at best tells you how large the image is on the screen. But how does size on the screen relate to size of the actual object ? If I have an image on the screen and I stretch the window to see it more clearly, making a larger image on-screen, then does the physical object get larger? If I choose a different resolution for the graphics card, then does the physical size of the object change? What is the relationship between the size I see on screen and the number of physical pixels on-screen that corresponds to, and between the number of pixels on-screen and the number of source pixels in the image ?
This is why @Thorsten talked about needing an object of known size in the image. If you have an object of known physical size then you can do ratios of lengths.. at least to within the margin of error of measuring with a ruler. Or you could use something like data cursor mode to find out the data units being pointed to, and then by moving to different data positions including the data positions of the ends of the object of known physical size, you can calculate physical sizes without ever having to worry about rulers.
Consider the following image:
imshow('cameraman.tif')
I know his feet are out-of-frame, but this man is approximately three inches tall. That's pretty short. I wonder if he could ride a cat like a horse.
Jokes aside, say we knew that the man was six feet (72") tall. We could then estimate that the tripod (sans camera) was about 58" tall, and that tower in the distance would obviously be about 16" tall. I hope nobody trips over it.

Iniciar sesión para comentar.

Productos

Preguntada:

el 29 de Ag. de 2016

Comentada:

DGM
el 7 de Nov. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by