View Single Post
  #6   Spotlight this post!  
Unread 21-01-2012, 13:25
Metaphorical's Avatar
Metaphorical Metaphorical is offline
Registered User
FRC #0639 (Code Red)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Ithaca
Posts: 4
Metaphorical is an unknown quantity at this point
Re: Good way to find distance

If you want an interference-free way, do some math. Find the vertices of the target rectangle. If you're pointing at it with a camera of known elevation, the angle to the vertices is linked to the position of the vertices on the camera viewpicture. The height of each vertex is constant and fixed, so now you have an angle and its opposite side in a right triangle, and everything else can be found with a bit of trig.

Of course, no guarantees on accuracy - it'll all depend on your image processing capabilities.