Go to Post But seriously? White paper.. CD.. upload.. You get what I'm sayin'! :) - Elgin Clock [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-01-2010, 18:15
2549wootwoot's Avatar
2549wootwoot 2549wootwoot is offline
meber of 2549 - millerbots!
AKA: Ambre Joi
FRC #2549
Team Role: Student
 
Join Date: Dec 2009
Rookie Year: 2007
Location: Mpls
Posts: 1
2549wootwoot is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 12-01-2010, 19:30
star_lancer's Avatar
star_lancer star_lancer is offline
Programming Addict
AKA: Mike Berney
FRC #2346 (CRASH)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Kansas City
Posts: 30
star_lancer is a jewel in the roughstar_lancer is a jewel in the roughstar_lancer is a jewel in the rough
Send a message via AIM to star_lancer Send a message via Yahoo to star_lancer
Re: Camera programing

Quote:
Originally Posted by 2549wootwoot View Post
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.
__________________
If you found anything I said helpful, please click the scales next to my post. I really appreciate those reputation points.
Team 2346 - Build, test, panic, repeat.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-01-2010, 20:15
bladetech932's Avatar
bladetech932 bladetech932 is offline
Programmer of awesome
AKA: Jon
FRC #0932 (Circuit Chargers)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Tulsa
Posts: 242
bladetech932 is on a distinguished road
Talking 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
Reply With Quote
  #4   Spotlight this post!  
Unread 12-01-2010, 22:43
RoboMaster's Avatar
RoboMaster RoboMaster is offline
Alum, former programmer&co-captain
FRC #2472 (The Centurions)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Minnesota, Twin Cities
Posts: 268
RoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant future
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.
__________________
My engineering blog: noeticbrainwaves.blogspot.com

I'm not slacking, my code's compiling
...and I'm using LabVIEW
Reply With Quote
  #5   Spotlight this post!  
Unread 12-01-2010, 23:45
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2010, 16:19
TheBigCheese TheBigCheese is offline
Registered User
FRC #0619
 
Join Date: Jan 2010
Location: Charlottesville, VA
Posts: 7
TheBigCheese is an unknown quantity at this point
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 01-02-2010, 17:04
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
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.
__________________
Get yer robot source code here!
Reply With Quote
  #8   Spotlight this post!  
Unread 01-02-2010, 20:57
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
Reply


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
Programing with camera? excel2474 Programming 3 14-02-2009 08:08
Programing camera in labview frcchile NI LabVIEW 1 23-01-2009 13:03
Programing servo in Axis camera 206 frcchile NI LabVIEW 6 18-01-2009 08:53
Programing great_one411 General Forum 2 01-02-2003 17:27
Programing pfortunejr Programming 1 08-01-2002 13:18


All times are GMT -5. The time now is 22:40.

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