Go to Post Engineers crave and demand facts, and won't reach a conclusion without them. - Richard Wallace [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 01-02-2012, 09:56
ganchara ganchara is offline
Registered User
FRC #2523 (Hilltoppers)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: vermont
Posts: 28
ganchara is an unknown quantity at this point
how to use openCV?

Does OpenCV have a program that will spit out code for you similar to what the NI Vision Assistant program does? If it does, it seems like using OpenCV will be easier for my team to implement and understand how our rectangle tracking works, as we are having some trouble understanding the code that is spit out by Vision Assistant.
  #2   Spotlight this post!  
Unread 01-02-2012, 12:12
PaulDavis1968's Avatar
PaulDavis1968 PaulDavis1968 is offline
Embedded Software/Systems Engineer
AKA: Master of Complexity
FRC #2053 (TigerTronics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Endicot NY
Posts: 91
PaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nice
Re: how to use openCV?

Opencv would have to be ported to vxworks. If you use that you would have to do off crio processing. I am attempting that now.
  #3   Spotlight this post!  
Unread 01-02-2012, 12:18
ganchara ganchara is offline
Registered User
FRC #2523 (Hilltoppers)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: vermont
Posts: 28
ganchara is an unknown quantity at this point
Re: how to use openCV?

doing the processing off cRIO has always been the plan, could you let me know if you have success in porting it?
  #4   Spotlight this post!  
Unread 01-02-2012, 16:27
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: how to use openCV?

Just to make you aware, ColorImage and Binary image implement a number of features that you would likely have in your NI Vision Assistant generated code in a c++ interface that is much cleaner, we gutted most of the code out of the vision assist generated stuff except for the convex hull and the particle filter; the threshold and particle analysis are both done in the C++ outside. (we also switched the vision assist file to a cpp file to evade some big errors)

I wouldn't worry to much about trying to fully understand the inards of the generated code, just because C code is written much differently, and maybe confusing to the students. Simply minimize how much of it you are using, make sure they understand what is in the generated code, how it was created from the script, and how to interface with it.

Edit: Also, if you plan to do vision processing on the driver station, I've been told that competition network can be an issue with the added latency.
  #5   Spotlight this post!  
Unread 01-02-2012, 16:53
ganchara ganchara is offline
Registered User
FRC #2523 (Hilltoppers)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: vermont
Posts: 28
ganchara is an unknown quantity at this point
Re: how to use openCV?

the biggest issue with the NIVA code is we aren't sure how it outputs the particle analysis measurements. Latency shouldn't be an issue as we are planning to use it just to establish a baseline of where we need to get to, and use a gyro to actually do the positioning, and finally going back to use the camera to double check that we got to the correct position.
  #6   Spotlight this post!  
Unread 01-02-2012, 17:07
PaulDavis1968's Avatar
PaulDavis1968 PaulDavis1968 is offline
Embedded Software/Systems Engineer
AKA: Master of Complexity
FRC #2053 (TigerTronics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Endicot NY
Posts: 91
PaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nice
Re: how to use openCV?

Quote:
Originally Posted by ganchara View Post
doing the processing off cRIO has always been the plan, could you let me know if you have success in porting it?
Well if you do it off the crio then you do not need to port it. Are you using the driving station? Anon-board computer? Opencv compiles to both linux and windows. I am using the console to take mjpeg files off the network then process them and then send it back to the crio to act on it. I will hook in to the output of the c++ windows app by modifying the console code(Java). I do worry about processing speed. The robot might have to be in a stop state to pull this off.
  #7   Spotlight this post!  
Unread 01-02-2012, 17:12
ganchara ganchara is offline
Registered User
FRC #2523 (Hilltoppers)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: vermont
Posts: 28
ganchara is an unknown quantity at this point
Re: how to use openCV?

well, what i was really trying to figure out is if there is a program that will spit out vision processing code using the WPIJavaCV libraries, as those will both be easier to understand and be compatible with java. we are currently planning to do the processing on the driver station laptop
  #8   Spotlight this post!  
Unread 01-02-2012, 17:19
ganchara ganchara is offline
Registered User
FRC #2523 (Hilltoppers)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: vermont
Posts: 28
ganchara is an unknown quantity at this point
Re: how to use openCV?

Quote:
Originally Posted by DjScribbles View Post
the threshold and particle analysis are both done in the C++ outside. (we also switched the vision assist file to a cpp file to evade some big errors)
When you say that the threshold and particle analysis are done in the C++ how does that work, because that would mean you went from C++ for the plane extraction and threshold, to VA to do the convex hull and particle filter, and then back to C++ for the final particle analysis?

Paul, in your first post you say that to do off cRIO processing you would have to port openCV into vxWorks, but then in your most recent post you say you don't need to port it to do off cRIO processing.
  #9   Spotlight this post!  
Unread 01-02-2012, 18:10
violinuxer violinuxer is offline
Registered User
FRC #2523
 
Join Date: Jan 2012
Location: Vermont
Posts: 13
violinuxer is an unknown quantity at this point
Re: how to use openCV?

Another programmer from team 2523 here...

To clarify- we plan to do the following:

1. Get the image from the camera.
2. Process image on drivestation computer. To do this we use the javacv libraries included in SmartDashboard. We determine the offset of the target from the center of the camera image.
3. Using NetworkTables, send this data back to the robot
4. Move the robot.
5. Rinse, repeat

AFAIK, The OpenCV has to be written manually. Am I right? An automation utility would be great...

Thanks!

violinuxer
  #10   Spotlight this post!  
Unread 01-02-2012, 18:27
catacon catacon is offline
Registered User
FRC #1444 (Lightning Lancers)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2006
Location: St. Louis
Posts: 154
catacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to beholdcatacon is a splendid one to behold
Re: how to use openCV?

OpenCV is just a set of C++/Java/Python libraries. It doesn't generate any code for you....
  #11   Spotlight this post!  
Unread 01-02-2012, 18:28
violinuxer violinuxer is offline
Registered User
FRC #2523
 
Join Date: Jan 2012
Location: Vermont
Posts: 13
violinuxer is an unknown quantity at this point
Re: how to use openCV?

One more thing: where might we find the docs for WPI's JavaCV implementation?

Thanks!

violinuxer
  #12   Spotlight this post!  
Unread 01-02-2012, 18:32
violinuxer violinuxer is offline
Registered User
FRC #2523
 
Join Date: Jan 2012
Location: Vermont
Posts: 13
violinuxer is an unknown quantity at this point
Re: how to use openCV?

Quote:
Originally Posted by catacon View Post
OpenCV is just a set of C++/Java/Python libraries. It doesn't generate any code for you....
Thought so... I just don't know how to use the wrappers provided with SmartDashboard. This is the best I have been able to find:

http://pastebin.com/cYtQiKpF


Gotta love javadocs!

violinuxer
  #13   Spotlight this post!  
Unread 02-02-2012, 14:55
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: how to use openCV?

Quote:
Originally Posted by ganchara View Post
When you say that the threshold and particle analysis are done in the C++ how does that work, because that would mean you went from C++ for the plane extraction and threshold, to VA to do the convex hull and particle filter, and then back to C++ for the final particle analysis?
Code:
binaryImage = colorImage->ThresholdHSL(######);
imaqImage = binaryImage->GetImaqImage();
IVA_ProcessImage(imaqImage); //In here we just convex hull and particle filter
vector<ParticleAnalysisReport> *reports = binaryImage->GetOrderedParticleAnalysisReports();
  #14   Spotlight this post!  
Unread 02-02-2012, 17:27
ganchara ganchara is offline
Registered User
FRC #2523 (Hilltoppers)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: vermont
Posts: 28
ganchara is an unknown quantity at this point
Re: how to use openCV?

Quote:
Originally Posted by DjScribbles View Post
Code:
binaryImage = colorImage->ThresholdHSL(######);
imaqImage = binaryImage->GetImaqImage();
IVA_ProcessImage(imaqImage); //In here we just convex hull and particle filter
vector<ParticleAnalysisReport> *reports = binaryImage->GetOrderedParticleAnalysisReports();
if the code is in C++ where are you running it? on the driver station or the robot? My team is planning to run our image processing on the DS, which supposedly can't send data back to the robot while in C++.
  #15   Spotlight this post!  
Unread 05-02-2012, 12:11
PaulDavis1968's Avatar
PaulDavis1968 PaulDavis1968 is offline
Embedded Software/Systems Engineer
AKA: Master of Complexity
FRC #2053 (TigerTronics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Endicot NY
Posts: 91
PaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nicePaulDavis1968 is just really nice
Re: how to use openCV?

Quote:
Originally Posted by ganchara View Post
When you say that the threshold and particle analysis are done in the C++ how does that work, because that would mean you went from C++ for the plane extraction and threshold, to VA to do the convex hull and particle filter, and then back to C++ for the final particle analysis?

Paul, in your first post you say that to do off cRIO processing you would have to port openCV into vxWorks, but then in your most recent post you say you don't need to port it to do off cRIO processing.
Sorry for the confusion. If on crio you would need to do a port.
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


All times are GMT -5. The time now is 18:47.

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