![]() |
Camera programing
Does anybody know how to write a program where our camera would locate the target and tell us the distance to the target.
|
Re: Camera programing
Quote:
|
Re: Camera programing
Its more math than programing you need a multiplier that take an input and change it to feet
for example last year we took the area of the target and used an equation to get feet so the larger the area the closer you are |
Re: Camera programing
I am sure (and I think it was said at kickoff) that NI will be giving us code for sensing and tracking the targets, just like last year. And also like last year, it was pretty helpful but also open to what we could do with it. So we tried calculating the size of the target as sensed by the camera. The smaller the target is, the farther away it must be. At least last year, it was pretty easy to figure out the size of the sensed target. From there, we did some tests and figured out how big the target was compared to how far away it actually was. Once we knew that, we set up something that would convert this in our programming.
|
Re: Camera programing
The default sample project has vision code, and the rotate to target has a small piece that computes distance from the major radius of the target. It has a coefficient that you may want to adjust and make current value default.
Greg McKaskle |
Re: Camera programing
I looked around for the code you mentioned, but I don't see any code that computes distance. It would be much easier if I could find this code than having to write my own.
Thanks. |
Re: Camera programing
It would, but it wouldn't be nearly as fun :)
The radius measurements that are calculated automatically do, as mentioned above, correspond inversely to distance from the robot. What we've done previously in situations like this is, instead of trying tow rok out the precise optics of the camera, simply taken empiricle data using known distances, and interpolated between points to figure out roughly the distance. |
Re: Camera programing
The code is called in TeleOp and I think it is called Rotate To Target. It has a distance indicator on its panel and you should be able to trace it back from there.
Greg McKaskle |
| All times are GMT -5. The time now is 04:29. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi