![]() |
Access to WPIImages and IPLImages
We are using SmartDashboard to view and process the images from the camera.
We have access to a WPIColorImage. Unfortunately, when we isolate the blue, red and green channel as per examples given, the detection of rectangles of a specific color (around the hoop) is erratic. So I thougt of using HSL space to isolate specific colors but this can be done only from an IPLImage. Paul indicated here a way to access the underneath IPLImage using a java wrapper. http://www.chiefdelphi.com/forums/sh...ferrerid=46078 Now I have access to the IPLImage but my detection still does not work as expected - I need to see the IPLImage and check what I am doing. Anybody knows how to obtain the WPIImage from an IPLImage ? Thanks. |
Re: Access to WPIImages and IPLImages
The following code fragments demonstrate going both directions:
Code:
|
Re: Access to WPIImages and IPLImages
This is essentially what we did, and it works great.
|
Re: Access to WPIImages and IPLImages
I understood how to do vision processing on the cRIO and our program is very good at recognizing the target using HSL color space. However, I know next to nothing about programming SmartDashboard extensions with WPI/javacv libraries. Does anyone have example code on using HSL color space with vision processing through SmartDashboard?
|
Re: Access to WPIImages and IPLImages
Sorry to bump, but I know that someone has a solution and may have just missed this thread/post. Can anyone please give an example of how to track using HSL color space on SmartDashboard?
|
Re: Access to WPIImages and IPLImages
For accessing SmartDashboard, just extend the WPICameraExtension class provided in the jar in the SmartDashboard extensions directory.
Then just override the processImage(WPIColorImage rawImage) method. The only real change you'll need to make code wise is to figure how you want to output the data to SD. When you're done, compile your widget into a jar and place it in the extensions directory. I'm sorry, but I don't have good example code of this. |
Re: Access to WPIImages and IPLImages
I'm working on improving our vision processing over the off season. I'm trying to create a grid of images to display but I can't figure out how to get the BufferedImage converted back into a WPIImage. It compiles but throws this error when I try to build it.
cannot access com.googlecode.javacv.cpp.opencv_core class file for com.googlecode.javacv.cpp.opencv_core not found return new WPIColorImage(img); |
Re: Access to WPIImages and IPLImages
I got the last problem figured out but have run into another problem. I am having problems with getting the IplImage out of a WPIImage. When I try to access the image field variable it tells me that it has protected access. What is the work around for this?
|
Re: Access to WPIImages and IPLImages
What we did here is make a static helper class that lives within the same package namespace as the WPIJavaCV classes with methods to expose the protected member variables (since protected members are visible to all classes within the same package).
|
Re: Access to WPIImages and IPLImages
Quote:
|
| All times are GMT -5. The time now is 10:12. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi