loading
 
Calculate_distance
Anonymous
11 year
Hi. I new in roborealm, and I have a problem.

How can I calculate the distance in meters in the detection of an object?

Thanks
program.robo
Steven Gentner from United States  [1446 posts] 11 year
You will need to know the pixel to meters factor. I.e. how much distance a pixel represents in the real world. This can be determined in many ways but will depend a lot on the image. If you are imaging a plane its not too hard, if you are not then some form of depth information is also needed in order to calculate distance. If you have a sample image of what you are trying to measure we can help further.

STeven.
Anonymous 11 year
Hi steven.

For example, what is the distance in meters from the fire of the image?

I need the program in vbscript.

 

program.robo
Steven Gentner from United States  [1446 posts] 11 year
We can't know without access to the physical environment. You would need to actually measure it and use that measurement to create that pixel height to distance ratio. I suggest several measurements at different distances to get a better accurate curve (note, the formula is not linear).

You can read more about this at

http://stackoverflow.com/questions/8698889/how-to-measure-height-width-and-distance-of-object-using-camera

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index