![]() |
how to find distance using two color servo camera?
i am having trouble calculating distance using two color servo camera example, i can do it just fine with one color but not with two. i am using labview. any help at all would be great!
|
Re: how to find distance using two color servo camera?
Team 330's BETA code calculates distance between the camera and the gimbal using PIDs. Perhaps you can modify it to your needs.
http://forums.usfirst.org/showthread.php?t=11298&page=2 |
Re: how to find distance using two color servo camera?
Are you referring to calculating distance using a method similar to the one described here (by Kevin Watson)? It seems like it should be fairly easy to use the same tracking algorithm as you did for one color, but just find an average of the green and pink positions to find the center of the target, and then run your tracking algorithms off of that. You say you can do it with one color, so I won't bother going into the details of the visual servoing or distance calculation tasks.
However, this seems trivial enough that I'm wondering if you are referring to something else. Can you provide more detail? --Ryan |
Re: how to find distance using two color servo camera?
There are a couple of ways to calculate distance with a camera. The ones I can think of off the top of my head are:
|
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 |
| All times are GMT -5. The time now is 02:01. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi