Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   I have a quiestion about a distance (http://www.chiefdelphi.com/forums/showthread.php?t=53569)

Shomron1690 06-02-2007 14:01

I have a quiestion about a distance
 
how can i calculate the distabce between the "center of mass" of the green light, and it's corners?

herbboy 07-02-2007 19:48

Re: I have a quiestion about a distance
 
simple get the coordinate for mid (x,y) then get coordinates for corner(x1,y1)
now use the distance formual --

sqareroot( (x-x1)^2 + (y-y1)^2) I think :D

DanDon 07-02-2007 20:28

Re: I have a quiestion about a distance
 
Quote:

Originally Posted by herbboy (Post 573940)
simple get the coordinate for mid (x,y) then get coordinates for corner(x1,y1)
now use the distance formual --

sqareroot( (x-x1)^2 + (y-y1)^2) I think :D

I believe that the centroid values available from the camera are "center of mass" values and not the exact center of the bounding box. With one light being tracked, those are accurate enough, but when tracking two lights, the centroid values will stray towards the light that is closest to you.

herbboy 08-02-2007 15:16

Re: I have a quiestion about a distance
 
O yea I forgot about this how foolish of me. Hmm Well if the twoo or more target are of same area than you can use the pixels but the same problem of distance occurs. Maybe if you can caculate the distance to one off the target or use the VW function to get 1 target you could do it. Using VW gives can *theoretically* get you down to one target I belive. Am I right or dead wrong?


All times are GMT -5. The time now is 04:48.

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