Go to Post Much of what you do in the "real world" has no rules. You have to look yourself in the mirror and make them up as you live; knowing that what you do WILL come back to haunt you sooner or later. - dhitchco [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-09-2013, 11:48
ykarkason ykarkason is offline
21st Century Schizoid Man
FRC #3316 (D-Bug)
Team Role: CAD
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Israel
Posts: 63
ykarkason will become famous soon enoughykarkason will become famous soon enough
Vision on the cRIO with OpenCV

Hi folks,
Our team uses java, and I just had an idea about vision for the upcoming season.

Does anybody have any experience with using OpenCV on the robot, after extracting images from the Axis camera?
From reading some posts in here it seems that there's not much support for the NI Vision library in java, so I suppose my next best bet would be to use OpenCV!

Thanks guys!
Yiftach
  #2   Spotlight this post!  
Unread 26-09-2013, 14:41
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: Vision on the cRIO with OpenCV

It is possible to do vision on the cRio, or use an onboard processor. It looks like you have the intent to do it on the cRio in labview.

This forum would be a great place to start. http://forums.ni.com/t5/Machine-Visi...EW/td-p/648429
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
  #3   Spotlight this post!  
Unread 26-09-2013, 16:40
codes02 codes02 is offline
Randolph aka Roxbury aka R_______
AKA: Cody Schafer
no team (Formerly: Team 11, MORT)
 
Join Date: Oct 2007
Rookie Year: 2008
Location: MA, USA
Posts: 57
codes02 is on a distinguished road
Re: Vision on the cRIO with OpenCV

You should be able cross-compile opencv for vxworks-powerpc (the hard part), then use either opencv's java wrapper (which may or may not work) or JNA (which should work as that is what is used to call the NI vision lib) to call into the opencv library.

EDIT: also, if you want to stick with the NI vision lib but need a function C++ has that isn't exposed to Java, you can add a JNA wrapper for it.
  #4   Spotlight this post!  
Unread 26-09-2013, 17:12
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Vision on the cRIO with OpenCV

Out of curiosity, why restrict yourself to working on the cRIO? If you are willing to work with OpenCV, you're probably better off integrating it into a SmartDashboard widget on the driver station. At the cost of some extra network latency (although if you're streaming to the drivers you'll have video traffic going there anyway), you can do all the processing on a machine with more power than the cRIO (I believe even the classmate has better than a 400MHz ARM CPU), and which doesn't have a whole lot of processing going on already (ie. all your robot's logic).

For a great example, look at Miss Daisy's 2012 vision system. It's a paper in CD-Media. If you can't find it yourself, I can get you a link.
__________________
I code stuff.
  #5   Spotlight this post!  
Unread 26-09-2013, 17:28
magnets's Avatar
magnets magnets is offline
Registered User
no team
 
Join Date: Jun 2013
Rookie Year: 2012
Location: United States
Posts: 748
magnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond repute
Re: Vision on the cRIO with OpenCV

Don't use openCV on the cRIO.

Instead, use openCV on an onboard processor, or your driver station laptop. Even the classmate is an order of magnitude faster at vision processing than the cRIO is.

Like a previous poster said, look at 341 for inspiration.
  #6   Spotlight this post!  
Unread 27-09-2013, 10:46
ykarkason ykarkason is offline
21st Century Schizoid Man
FRC #3316 (D-Bug)
Team Role: CAD
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Israel
Posts: 63
ykarkason will become famous soon enoughykarkason will become famous soon enough
Re: Vision on the cRIO with OpenCV

I am not looking for real-time vision processing, I want to process images at need, I will give another look to the NI Vision library in java, and see if I can get something to work.

I want to do it on the cRIO so I won't have to rely on the on-field network(which I already had some issues with in this following season), and I'm not worrying about maxing out the CPU because I will only process the images when it is needed.
  #7   Spotlight this post!  
Unread 27-09-2013, 11:47
protoserge's Avatar
protoserge protoserge is offline
CAD, machining, circuits, fun!
AKA: Some call me... Tim?
FRC #0365 (MOE) & former 836 Mentor)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2002
Location: Wilmington, DE
Posts: 750
protoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond repute
Re: Vision on the cRIO with OpenCV

You don't need to rely on the field network for your processing. The coprocessor option such as the Odroid or other Linux/Android-based single board computer can run OpenCV and spare the cRIO the processing requirement. If you absolutely do not anticipate using real-time image processing, then using the vision library for LabVIEW is a possibility as Greg McKaskle has pointed out before in other threads.
  #8   Spotlight this post!  
Unread 27-09-2013, 12:08
ykarkason ykarkason is offline
21st Century Schizoid Man
FRC #3316 (D-Bug)
Team Role: CAD
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Israel
Posts: 63
ykarkason will become famous soon enoughykarkason will become famous soon enough
Re: Vision on the cRIO with OpenCV

The problem with using the vision library for LabView is that our team is using java!
I understood that there are some C++ functions from that library wrapped for java use, but not all of them, and I wonder if it'd be possible for me to use the NI Vision Assistant and rewrite the code I get from there in java.

I really don't think "real-time image processing and use of that data" can be done, and I want to try the "single-frame processing and actions based on it" thing to see if it can go well enough.

So to sum up, I'll give up on OpenCV for now(as it seems) and check out the NI Vision Library for java.
  #9   Spotlight this post!  
Unread 27-09-2013, 16:58
protoserge's Avatar
protoserge protoserge is offline
CAD, machining, circuits, fun!
AKA: Some call me... Tim?
FRC #0365 (MOE) & former 836 Mentor)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2002
Location: Wilmington, DE
Posts: 750
protoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond repute
Re: Vision on the cRIO with OpenCV

Quote:
Originally Posted by ykarkason View Post
The problem with using the vision library for LabView is that our team is using java!
I understood that there are some C++ functions from that library wrapped for java use, but not all of them, and I wonder if it'd be possible for me to use the NI Vision Assistant and rewrite the code I get from there in java.
You're right. I have been reading so many vision threads lately that I got this one mixed up. I believe the LabVIEW WPI library is a variant of OpenCV, check on this for accuracy. What I was actually referring to was the algorithm for single image vision using the cRIO. The single image is relatively simple for the cRIO to handle, especially if you know what you are comparing the camera image to. If you want to go to a real-time algorithm, you will need to start looking into coprocessors.
  #10   Spotlight this post!  
Unread 27-09-2013, 17:02
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,751
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: Vision on the cRIO with OpenCV

I'm not directly responding to any of the posts on this thread, but just wanted to try and clarify what NI Vision is.

NI Vision consists of hundreds of highly optimized kernel routines written in C/C++ and library wrappers into that kernel for a few languages. Those languages are C++, LabVIEW, and .NET. NI doesn't ship java wrappers for NIVision, and WPI has written only written JNI wrappers for a few functions. In addition, the WPILib wrappers for C++ usage of NI Vision are not really that compatible with how NI Vision was intended to be used. Many parameters are remapped or left out entirely.

If you are interested in using NI Vision from LabVIEW, it is easy and all wrappers are already done for you.

If you are interested in using NI Vision from C++, it is pretty straightforward. Open the Program Files/National Instruments/Vision directory. You will find includes, libraries, examples, and documentation for C users. The C manual is the CVI one. Note that it is a C interface and not class based.

If you are interested in using NI Vision from Java, see the C++ case and use an import tool or write JNI wrappers.

NI Vision is included for Windows and VxWorks.

Greg McKaskle
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 03:03.

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