finding distance from object

5 views (last 30 days)
omer zchut
omer zchut on 25 Apr 2018
Edited: Florian Morsch on 27 Apr 2018
Hi, in my project I need to fly a drone using one Camera to navigate to some point and to avoid obstacles on the way (using only picture not video). I read here that you can use two Camera (whice i dont have) to find distance , or take 2 picture and revalue the distance using trigonometry,the problem is that the drone is unstable and the distance between the images will be approximately random.So, I ask for your opnion on the subject. thank you! (Sorry about the English).

Accepted Answer

Florian Morsch
Florian Morsch on 26 Apr 2018
With only one camera its very hard to do. Right now im writing my thesis about a similar case, i needed two months to get good results and i use a marker-based approach. I can give a pretty accurate distance-information (+/- 2mm)with a single camera, but only on a marker i designed.
Without a certain amount of knowledge on what you are going to see or a reference in the picture you are taking its nearly impossible to get the 3D-informations out of a 2D-image.
You could try and extract 2 matching spots of two following images, but if the drone is unstable/ flies fast this is pretty much impossible.
My best advice would be: Design a reference point (marker) you can then use to find the distance.
  2 Comments
omer zchut
omer zchut on 27 Apr 2018
thank you, I will look into this !
Florian Morsch
Florian Morsch on 27 Apr 2018
Edited: Florian Morsch on 27 Apr 2018
A pretty simple approach would be to set up a known object ( a black rectange e.g.) from which you know the real measurements ( lets say its 30cm x 30cm).
Now take a picture from exacly 1 m away, so now you have the ammount of pixels from the rectangle from 1 m. If you move your camera to 2 m, the ammount of pixel should get lower by a certain amount. Find a correlation between the distance to the sum of the pixels and you can recreate the distance.
Note that this method will only work if you are looking straight at the reference object ( a angle would change the ammount of pixel you see).
You might want to take a look at this https://zone.biblio.laurentian.ca/bitstream/10219/2458/1/Peyman%2520Alizadeh%2520MSc.%2520Thesis%2520Corrected_2_2.pdf which can give you a idea of different approaches.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Support Package for IP Cameras in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!