Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Camera programing (http://www.chiefdelphi.com/forums/showthread.php?t=80049)

2549wootwoot 12-01-2010 18:15

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.

star_lancer 12-01-2010 19:30

Re: Camera programing
 
Quote:

Originally Posted by 2549wootwoot (Post 897667)
Does anybody know how to write a program where our camera would locate the target and tell us the distance to the target.

There are multiple ways you could do this mathematically. But I'm not very good with the code when it comes to the camera. What exactly do you need to know the distance to the target for? You can approximate pretty easily just by looking at which section your robot is in. My suggestion: set your camera below the target and have it look parallel (paralell?) to the ground then use the angle of elevation to the center of the target to find the distance. Ask your math teacher for help with this method, it uses some trigonometry.

bladetech932 12-01-2010 20:15

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

RoboMaster 12-01-2010 22:43

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.

Greg McKaskle 12-01-2010 23:45

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

TheBigCheese 01-02-2010 16:19

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.

nathanww 01-02-2010 17:04

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.

Greg McKaskle 01-02-2010 20:57

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