|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
|||
|
|||
|
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 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |