Go to Post My strongest FIRST memories, and the teams that leave the biggest impact on me, are teams that seem like they have every reason to give up, but never do. - Chris is me [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 06-02-2009, 17:20
nheft nheft is offline
Registered User
FTC #0533 (Psichotics)
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 1999
Location: Lindenhurst HS
Posts: 35
nheft is a jewel in the roughnheft is a jewel in the roughnheft is a jewel in the roughnheft is a jewel in the rough
Re: how to find distance using two color servo camera?

Here's what Team 533 did to get distance from the camera:

We started with the 2 color tracker sample project supplied by FIRST.

Once we got the tracker working, the top level VI for the 2-color camera code displayed some calculated parameters including "percentage of area".

This number is the ratio of the size of the target as seen by the camera divided by the area of the camera's entire field of view. The farther away the target, the smaller this ratio is. The percentage of area ratio is approximately proportional to the reciprocal of the square of the distance. So distance is approximately proportional to the reciprocal of the square root of the "percentage of area" value:

DISTANCE = K / SQRT(% OF AREA)

(there is a more exact relationship that involves trigonometric functions but the above simple approximation is good enough to judge distances to within a few inches)

We placed the target exactly 4 feet away from the camera and measured the % of area value, then solved for K:

K = (4 feet) * SQRT(Measured % of area when target is at 4 feet).

Next we programmed the formula DISTANCE = K / SQRT(% OF AREA) with the
K value we measured and added an indicator to the fromt panel.

Finally, we tested the revised code at various distances. Since the equation is only an approximation, there is some error but we were able to obtain distance measurements within a few inches using this method.

Neil
Advisor, Team 533
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do YOU find the distance from the light? Spencer E. Programming 13 24-03-2007 20:44
how do i find the camera with labview? CompMaster NI LabVIEW 0 16-02-2006 12:52
How do I get distance between Camera and the target? sjung9442 Programming 5 27-01-2006 09:44
How many teams are using the Camera? Matt Goulart Programming 5 06-02-2005 15:06
How many teams are using the Camera? Matt Goulart Electrical 3 30-01-2005 09:29


All times are GMT -5. The time now is 11:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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