|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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;
|
|
#2
|
|||
|
|||
|
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
|
||||
|
||||
|
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?
|
|
#4
|
|||||
|
|||||
|
Re: Problem using the camera.
Quote:
|
|
#5
|
||||
|
||||
|
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? Last edited by Teh1337Bix : 19-01-2010 at 03:09. |
|
#6
|
|||
|
|||
|
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" 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
|
||||
|
||||
|
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#.
|
|
#8
|
|||
|
|||
|
Re: Problem using the camera.
Quote:
Also AxisCamera2010.h would be what you want. You have to explicitly import image types ColorImage, HSLImage, etc. |
|
#9
|
||||
|
||||
|
Re: Problem using the camera.
Oh yay! Now I can start doing my work instead of spending most of the time with my team on facebook.
|
|
#10
|
||||
|
||||
|
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); |
|
#11
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |