View Full Version : Math for Finding the distance to the hoop
Neko81795
01-02-2012, 21:33
This is a XML slideshow showing how to find the distance from the turret to the hoop using the distance and angles from the camera to the backboard. if there are errors in my math, please correct me.
file is up to date as of 2/2/12 3:23 PM
techhelpbb
02-02-2012, 10:07
I have a question...I can see how you could get the Kinect camera to find the distance to the backboard. However, how did you get theta (the angle of the camera to the backboard)?
notmattlythgoe
02-02-2012, 10:24
I would also think about fixing the camera at a set angle, you get a good range of visibility. Then you can find distance based on where on the screen the target is.
if there are errors in my math, please correct me.
Mostly typos:
Page 10 first equation has the denominators swapped
Page 16 what's the area calculation for? you can get H directly from sin(90-(theta+s))=H/Q
Page 19 should be sin(90-(theta+s))
Here's another way to do it:
I = 180-o
T = sqrt[R^2 + C^2 - 2*R*C*cos(I)] (Law of Cosines)
s = asin((R/T)*sin(I)) (Law of Sines)
w = 90-(theta+s) <-angle between T and Q
H = Q*sin(w)
B = Q*cos(w)
F = sqrt[H^2 + (T-B)^2]
Neko81795
02-02-2012, 18:18
Sorry about those typo's. Here are the changes. also, my calculations were in deg. i changed them to rad which is what the coding usualy uses. Ether is right about using the law of cosines, I just went over it today and couldn't remember it before. that was my fault.
we are not using the kinect. we are using the axis camera and ratios to find the distance and angles. however, I wasn't working on getting the images, i just did the math so I can't help you there.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.