Go to Post Give me a week, and a lot of caffeine and I could have one made. Problem is the lack of a week and caffeine. - Mike [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-06-2009, 17:27
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,132
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
Develop and test C++ camera code without a robot

I was planning to do some C++ programming work with the Axis camera over the summer while I'm at school, in order to become familiar with the some of the stuff the vision library can do, like shape recognition and edge detection. But short of lugging a robot to my dorm room or driving an hour and a half to Niagara Falls every weekend, I didn't have a way to do it. So, cognizant of the fact that NI has provided teams with a Windows version of the C++ vision library, I wrote a tool to help me out, and decided to share it with the community.

It can be found at http://patfair.net/frc/cameratest.

Basically, you connect the camera to your PC via Ethernet and run the application, which I'm calling "FRC Camera Test" for the moment. The program grabs a continuous stream of frames from the camera, does whatever image processing you want, and displays the original image on the left and the results of the processing (image and/or text) on the right. The code provides an interface (in the OOP sense) to make it easy to write your own image processing routines. It's BSD-licensed, so you can modify the code of the main application too, if you want.

Since I just finished writing this tool and haven't really used it too much myself, yet, there will likely be improvements made and features added. Comments and suggestions are welcome.
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com

Last edited by Pat Fairbank : 26-06-2009 at 17:30.
  #2   Spotlight this post!  
Unread 27-06-2009, 07:46
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,756
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: Develop and test C++ camera code without a robot

I haven't looked at the specific details, but this sounds like a great harness for developing and tweaking vision code. Let me add some other details, not necessarily for you, but for anyone interested in playing with the NI-Vision libraries.

If you want to learn about the capabilities of the libraries, the Vision Concepts manual is a great resource. It is available in the Start menu>>National Instruments>>Vision>>Documentation. It doesn't cover the syntax of the calls, but rather the algorithmic tradeoffs. For example, there are more than six methods for shape recognition, and it helps give background on the tradeoffs. I also presented some slides on the vision libraries Atlanta. They point out some examples to run and some of the library areas that are most applicable to FRC. They should be available on the NI site.

If you want to experiment at a higher level, you can run Vision Assistant on your Windows PC. Set the IP to 192.168.0.6 or similarly get your camera and PC on a compatible network, in the assistant you can choose to Acquire images, scroll in the list of camera types to Axis, adjust the IP address if needed, and click on either the single or multi frame acquire buttons. You can quickly modify camera settings, and once you have images in the browser pane, you can use menus and UI controls to inspect, correct, and process the IMAQ library functions. It may take away all the programming fun, but you can also have it generate C or LV code.

If you prefer to skip the menus and play with the code, Pat's tool sounds like it does the acquisition and display, and gives you a place to place C code for processing images.

If you are using LV, the WPI VIs work on Windows too. You can take your Robotics project and drag or copy select VIs from the cRIO target in the project to your PC target within the project window. Open the panel under the PC target and it will now run on the PC. You can delete or comment out WPI I/O components -- no simulation just yet, and you can run an app that does vision just fine. I would suggest opening the properties for the project and turning off auto-error-handling. The WPI vision libraries ignores a few HTTP errors from the camera, but with AEH, this will result in a dialog each time and it is distracting.

As always, if you have questions or issues, post them. And thanks for doing this for the C/C++ users.

Greg McKaskle
  #3   Spotlight this post!  
Unread 27-06-2009, 09:53
Nick Lawrence's Avatar
Nick Lawrence Nick Lawrence is offline
Commander Canada
FRC #3940 (CyberTooth, AndyMark)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2005
Location: Kokomo, IN
Posts: 714
Nick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond reputeNick Lawrence has a reputation beyond repute
Re: Develop and test C++ camera code without a robot

Does this program spew out massive amounts of awesome, or is it just me?

-Nick
__________________


Alumnus of 1503 Spartonics
Founding Mentor of 5406 Celt-X
Mechanical Design Mentor of 3940 CyberTooth
Emceeing events since 2013 - come say hi!

Success doesn't always equate to match wins. It's about the wins off the field.
Closed Thread


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
No robot available to test code on smackee618 Programming 12 15-02-2009 15:43
Problems Combining Camera Code and Driving Code cmurdoch Programming 20 10-02-2007 16:34
Edu Robot Camera Test Bed bear24rw Programming 7 06-08-2006 11:37
Trying to import Camera code into program without. Kingofl337 Programming 1 18-02-2005 00:43
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28


All times are GMT -5. The time now is 02:00.

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