Thanks for the reply, we are currently using OpenCV on the Driver Station, and would prefer to do processing there in order to save RoboRIO CPU for max output and reaction speed. We are using the function from the Smart Dashboard camera viewer in order to get the image from the camera. This works well and gives us a BufferedImage of type TYPE_3BYTE_BGR. We can display the image perfectly fine through a simple gui. The problem is with our bufferedImageToMat(Mat img) function:
Code:
public static Mat bufferedImageToMat(BufferedImage i){
byte[] pixels = ((DataBufferByte) i.getRaster().getDataBuffer()).getData();
Mat img = new Mat(i.getWidth(),i.getHeight(), CvType.CV_8UC3);
img.put(0, 0, pixels);
return img;
}
However this is exactly the same as many of the online examples, if anyone has any ideas that would be appreciated. Also, what does everyone think about using OpenCV on the roboRio