We have been trying to figure out how to use an HD Microsoft Camera on the SmartDashboard with Java but it doesn’t work. It only works when the SmartDashboard on Default.
The code we have for the Camera:
public void robotInit() {
new Thread(() -> {
UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();
camera.setResolution(640, 480);
CvSink cvSink = CameraServer.getInstance().getVideo();
CvSource outputStream = CameraServer.getInstance().putVideo("Blur", 640,
480);
Mat source = new Mat();
Mat output = new Mat();
while(true) {
cvSink.grabFrame(source);
Imgproc.cvtColor(source, output, Imgproc.COLOR_BGR2GRAY);
outputStream.putFrame(output);
}
}).start();
}
}
We got it from
Everything works perfectly well when we use Default.
Thanks in advance,
Team4536