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.

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

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.

HttpConnection con;
DataInputStream conIn;
DataOutputStream conOut;

// Basic authentication expects base-64 encoded “user:pass”.
// This is “root:pass” 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.