Go to Post OMG this topic again. Those who stir the pot should lick the spoon. - nuggetsyl [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-01-2011, 23:05
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
Access Axis 206 Image Data

Is there a way to (preferably from within Java) to access the data of (the array of pixels, basically) an AxisCamera ColorImage? I would also like to send back (to the default Dashboard, preferably) a custom, perhaps modified image to the Dashboard.

I tried looking at the respective classes and their super-classes, but it seems like I'll have to bypass NIVision in its entirety. If this is the only option, any pointers/someone else worked on it?

I tried looking for a bit, but quit once I found I wasn't getting relevant results.

EDIT: I tried and failed to connect to the Axis camera from the cRIO.

Last edited by sjspry : 15-01-2011 at 00:00.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2011, 02:24
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,748
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: Access Axis 206 Image Data

If you are wanting to write image processing algorithms from scratch, there are functions in NIVision to return an array of values for the pixels. Type-wise, it is intended to be called from C, and wrappers to put it into a LV array are in the library. I'm relatively sure it can be put into a Java type, but I doubt the library wrapper exists. If you want high performance processing, check to see if the function already exists in nivision.

As mentioned, if you were going to mark some pixels, it is generally better to send some info back to the dashboard and mark it there using the annotation feature.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 16-01-2011, 23:14
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
Re: Access Axis 206 Image Data

Great, thank you for the information. Sadly, I don't think I'll be able to do much via the method you described. Instead I am trying a method which connects the camera to the robot's router/radio (iirc they send out a router instead of a bridge this year). From there I can just query the web server to get a .jpg image.

Quote:
HttpConnection con;
DataInputStream conIn;
DataOutputStream conOut;

// Basic authentication expects base-64 encoded "user$@#$@#$@#".
// This is "root$@#$@#$@#" or whatever the default is.
String encodedLogin = "cm9vdDphZG1pbg==";

con = (HttpConnection)Connector.open("http://10.19.84.10/axis-cgi/jpg/image.cgi?resolution=320x240");
con.setRequestProperty("Authorization", "Basic " + encodedLogin);

System.out.println(con.getResponseCode() + " " + con.getResponseMessage());

conIn = con.openDataInputStream();
conOut = con.openDataOutputStream();
This might or might not be too slow. The response time seems slower than the mjpg stream which can be accessed at /mjpg/video.mjpg

Also, I don't know if it's possible to store cookies or use them (easily). It's probably required that you re-auth on each grab.
Reply With Quote
Reply


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 10:26.

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