Distance of a line by camera points

1 view (last 30 days)
arun Dhillon
arun Dhillon on 7 Jun 2019
Edited: Matt J on 11 Jun 2019
Hello Everyone
I have a stereo camera,
I want to figure out the angle of an object with respect to ground.
Please see the attached image.
I know the length of the line lp, hp and bc. What I want to do is to figure out the angle bac. I know if I can find either ab or ac; I can use trigonometry to solve for angel bac. But please edify me for how can I find this.
Any suggestions or help is greatly appreciated.
arun Dhillon
arun Dhillon on 10 Jun 2019
The camera that I am using is Intel D435i, and to get the distance you have to use the following line of code.
depth.get_distance(x,y) %x,y are coordinates of the point that I wanna get distance for..

Sign in to comment.

Answers (1)

Matt J
Matt J on 11 Jun 2019
Edited: Matt J on 11 Jun 2019
Well, I have no familiarity with the 3rd party Github library that you're using. However, it is a stereo camera class. So, it should offer you methods not just to calculate "depth", but the actual real-world coordinates of points in the image. Matlab's own stereo vision routines do offer such things
Once you have the 3D coordinates of a,b, and c, you can of course calculate anything.

Community Treasure Hunt

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

Start Hunting!

Translated by