Go to Post It's just a game. - artdutra04 [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 18-01-2010, 22:39
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Problem using the camera.

I've been trying out the camera in the vision assistant and it works great. Now I wanna put ellipse detection into our robot. The code below is the code straight from the documentation but it isn't working though because it doesn't know where any of the mentioned classes are (mono image, color image). I've been looking around in WPI LIB and stuff trying to find where the classes are so I can reference them properly, but to know avail. Anyone got any working code that they'd be happy to show me? Or at least tell me where the classes are?

Code:
ColorImage *image; 

MonoImage *luminancePlane = image->getLuminancePlane();
vector<EllipseMatch> *results = luminancePlane->DetectEllipses(&ellipseDescriptor, &curveOptions, NULL, NULL);
printf("Found %d ellipses\n", results->size()); 
delete luminancePlane;
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!
  #2   Spotlight this post!  
Unread 18-01-2010, 23:22
TheDominis TheDominis is offline
Registered User
FRC #2152
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Port Orange, Florida
Posts: 88
TheDominis has a spectacular aura aboutTheDominis has a spectacular aura about
Re: Problem using the camera.

The header files are under WPILib/Vision

You should be able to import them without adding an include directory. If not, right-click your project, select properties, and then one of the build options will have a tab about includes (I'm at home and lack the dev tools) add the path:

Code:
-I$(WIND_BASE)/target/h/WPIlib/Vision
  #3   Spotlight this post!  
Unread 18-01-2010, 23:57
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Re: Problem using the camera.

I don't follow. My WPI LIB must be a different version or something because it isn't set up like that. It doesn't have a WPILib/Vision folder. Could you send me a link to the latest version?
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!
  #4   Spotlight this post!  
Unread 19-01-2010, 01:33
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Problem using the camera.

Quote:
Originally Posted by Teh1337Bix View Post
I don't follow. My WPI LIB must be a different version or something because it isn't set up like that. It doesn't have a WPILib/Vision folder. Could you send me a link to the latest version?
http://www.usfirst.org/frccontrolsystem includes a section of required Software updates. You probably want http://first.wpi.edu/FRC/frcupdates.html specifically.
  #5   Spotlight this post!  
Unread 19-01-2010, 02:00
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Re: Problem using the camera.

Great! I had the wrong version. Now I'm just wondering how in WindRiver it knows which folder to go to to import WPI LIB when you write #include <WPIlib> or whatever that is.

EDIT: The script to update the WPI lib that wind river uses is broken. It does everything in a folder called WorkbenchUpdate which doesn't exist YET my WPI LIB is working fine.

EDIT: After manually updating EVERYTHING (I took a while) I'm pretty sure to access vision classes I need to include a different .h file. Anyone know what it is?
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!

Last edited by Teh1337Bix : 19-01-2010 at 03:09.
  #6   Spotlight this post!  
Unread 19-01-2010, 09:05
TheDominis TheDominis is offline
Registered User
FRC #2152
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Port Orange, Florida
Posts: 88
TheDominis has a spectacular aura aboutTheDominis has a spectacular aura about
Re: Problem using the camera.

The update tool is only slightly "broken" if you install Windriver somewhere other than c:/windriver. Cut and paste fixes this.

Your c:/windriver/vxworks-6.3/target/h/WPIlib should have a "Vision" directory as well as a "Vision2009" directory (and some other miscellaneous directories).

You must tell the project to use the "Vision" directory as an addition source of includes.

Code:
Right-Click Your Project's Name ->
Properties ->
On the Left, Click "Build Properties" ->
Select the tab "Build Paths" ->
Click "Add" use the path: "-I$(WIND_BASE)/target/h/WPIlib/vision"
Click "OK"
"AxisCamera2010.h" or "PCVideoServer.h" will get you started.

Take a look at the manual:
http://first.wpi.edu/Images/CMS/Firs...sers_Guide.pdf

Last edited by TheDominis : 19-01-2010 at 09:08. Reason: Headers and Link
  #7   Spotlight this post!  
Unread 19-01-2010, 22:20
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Re: Problem using the camera.

Yeah I did all that stuff before you posted it. What I'm asking is do I have to include all the .h files myself or can I just include one which would include them all. All this stuff would be soooooooooooooooooooooooooooooooooooo much easier if we could use C#.
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!
  #8   Spotlight this post!  
Unread 19-01-2010, 22:31
TheDominis TheDominis is offline
Registered User
FRC #2152
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Port Orange, Florida
Posts: 88
TheDominis has a spectacular aura aboutTheDominis has a spectacular aura about
Re: Problem using the camera.

Quote:
Originally Posted by Teh1337Bix View Post
Yeah I did all that stuff before you posted it. What I'm asking is do I have to include all the .h files myself or can I just include one which would include them all. All this stuff would be soooooooooooooooooooooooooooooooooooo much easier if we could use C#.
Yes. C#. Invest in a .NET VM to run on VxWorks PPC

Also AxisCamera2010.h would be what you want. You have to explicitly import image types ColorImage, HSLImage, etc.
  #9   Spotlight this post!  
Unread 19-01-2010, 22:33
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Re: Problem using the camera.

Quote:
Originally Posted by TheDominis View Post
Yes. C#. Invest in a .NET VM to run on VxWorks PPC

Also AxisCamera2010.h would be what you want. You have to explicitly import image types ColorImage, HSLImage, etc.
Oh yay! Now I can start doing my work instead of spending most of the time with my team on facebook.
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!
  #10   Spotlight this post!  
Unread 20-01-2010, 00:14
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Re: Problem using the camera.

Ok everything is awesome cool BUT the documentation tells me that I need give it "curve options".

Code:
luminancePlane->DetectEllipses(&ellipseDescriptor, &curveOptions, NULL, NULL);
The Vision Assistant helped me choose what I should set the values to in the EllipseDescriptor struct because it shows what settings it uses but it doesn't tell me what settings it use for CurveOptions and as a result, I can't make a CurveOptions struct and therefore I can't use ellipse detection.
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!
  #11   Spotlight this post!  
Unread 20-01-2010, 08:14
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,753
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: Problem using the camera.

Perhaps you can look at the sample code, the code in WPILib, or the documentation to fill in that struct.

Greg McKaskle
  #12   Spotlight this post!  
Unread 20-01-2010, 21:51
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Re: Problem using the camera.

What sample code where?!?! I have the documentation but it doesn't have what's in the struct written down.
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!
  #13   Spotlight this post!  
Unread 21-01-2010, 09:20
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,753
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: Problem using the camera.

All languages come with 2010 specific sample code. I'm sure a search of CD would give you the exact path. The documentation could include things like the NI Vision header file, or perhaps the NI Vision manuals. The Start menu>>National Instruments>>Vision>>Manuals, or a similar menu will contain in depth documentation for each language and even some conceptual stuff.

Greg McKaskle
  #14   Spotlight this post!  
Unread 21-01-2010, 11:34
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Problem using the camera.

from 2010ImageDemo:
Quote:
Originally Posted by Target.cpp
// These parameters set ellipse finding in the NI imaq (Image Aquisition) library.
// Refer to the CVI Function Reference PDF document installed with LabVIEW for
// additional information.
static EllipseDescriptor ellipseDescriptor = {
3, // minMajorRadius
200, // maxMajorRadius
3, // minMinorRadius
100 // maxMinorRadius
};

static CurveOptions curveOptions = { IMAQ_NORMAL_IMAGE, // extractionMode
40, // threshold
IMAQ_NORMAL, // filterSize
25, // minLength
15, // rowStepSize
15, // columnStepSize
10, // maxEndPointGap
1, // onlyClosed
0 // subpixelAccuracy
};
static ShapeDetectionOptions shapeOptions = {
IMAQ_GEOMETRIC_MATCH_SHIFT_INVARIANT, // mode
NULL, // angle ranges
0, // num angle ranges
0, // scale range
500 // minMatchScore
};
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #15   Spotlight this post!  
Unread 21-01-2010, 19:52
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Re: Problem using the camera.

Oh thanks, I'll try this when I meet up with my team later today.
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!
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
Is anyone using the Camera? GillSt.Bernards General Forum 19 05-03-2009 21:52
Getting the Image from the Camera Using Windriver (C++) computerish C/C++ 0 17-01-2009 16:03
Where do I begin to get the robot to move using the camera? Ianuser Programming 10 16-02-2007 17:55
Using Easy C to program the camera. Tazlikesrobots Programming 5 19-02-2006 21:33
How many teams are using the Camera? Matt Goulart Electrical 3 30-01-2005 09:29


All times are GMT -5. The time now is 21:28.

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