Open imdunne8 opened 9 years ago
See http://wpilib.screenstepslive.com/s/4485/m/13503/l/242608-roborio-networking for info on IP address usage in the FRC control system
There is also an example project in Eclipse for communicating with a network camera and drawing things on the image.
Good Java OpenCV example of tote tracking.
The code is complete, we just need to find the correct coordinates for the lines and test the code.
Apparently we may need to use: CameraServer = CameraServer.getInstance().setImage(image);
See last line of post here: http://www.reddit.com/r/FRC/comments/2ta7er/woo_with_some_help_from_faust_1706_i_believe_weve/
Got it working tonight!! Still need to do some further color value tuning and maybe use some more complex algorithms to find edges rather than just finding contours, but overall it's working fairly well. See NickD_YellowToteTracker branch.
com.ni.vision.NIVision.Image im = com.ni.vision.NIVision.imaqCreateImage(com.ni.vision.NIVision.ImageType.IMAGE_RGB, 0); com.ni.vision.NIVision.RawData data = new com.ni.vision.NIVision.RawData(); byte[] bytes = new byte[frame.width() * frame.height() * frame.channels()]; frame.get(0, 0, bytes); ByteBuffer buf = ByteBuffer.wrap(bytes); data.setBuffer(buf); com.ni.vision.NIVision.imaqArrayToImage(im, data, frame.width(), frame.height());
Setting up the camera: http://wpilib.screenstepslive.com/s/4485/m/24194/l/144985-configuring-an-axis-camera
Vision Processing 2014: https://wpilib.screenstepslive.com/s/3120/m/8731 (no 2015 examples/help available at this time)
Also, look at our past code to see how we interacted with the camera.
The two axis cameras will need separate IP addresses, and those will have to be passed into each constructor.