Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Math for Finding the distance to the hoop (http://www.chiefdelphi.com/forums/showthread.php?t=101741)

Neko81795 01-02-2012 21:33

Math for Finding the distance to the hoop
 
1 Attachment(s)
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

Re: Math for Finding the distance to the hoop
 
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

Re: Math for Finding the distance to the hoop
 
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.

Ether 02-02-2012 10:28

Re: Math for Finding the distance to the hoop
 
Quote:

Originally Posted by Neko81795 (Post 1118163)
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:

Code:

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

Re: Math for Finding the distance to the hoop
 
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.


All times are GMT -5. The time now is 23:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi