OpenKinect-for-Processing
OpenKinect-for-Processing copied to clipboard
Could not claim interface on camera: -3
Trying to run Depth Threshold on 2 cameras simultaneously, but I can only get one of them to work.
I've gotten them both to work individually, but never simultaneously. When I try to run the code, I get the following error
Unable to claim interface -3 Could not claim interface on camera: -3 Failed to open camera subdevice or it is not disabled.Failed to open motor subddevice or it is not disabled.Failed to open audio subdevice or it is not disabled.There are no kinects, returning null
Running a Kinect V1 1414 and V1 1473 on MacOS 10.14.6 Coding on Processing 3.5.4 (newer version did not work for me)
import SimpleOpenNI.*;
import org.openkinect.freenect.*;
import org.openkinect.processing.*;
int numDevices = 0;
int deviceIndex = 0;
Kinect kinect0;
Kinect kinect1;
PImage depthImg0;
PImage depthImg1;
float minDepth = 20;
float maxDepth = 1000;
void setup () {
size (1280, 420);
kinect0 = new Kinect(this);
kinect0.initDepth();
kinect1 = new Kinect(this);
kinect1.initDepth();
kinect0.activateDevice(0);
kinect1.activateDevice(1);
depthImg0 = new PImage(kinect0.width, kinect0.height);
depthImg1 = new PImage(kinect1.width, kinect1.height);
}
void draw() {
//Apply Threshold
int[] rawDepth0 = kinect0.getRawDepth();
for (int i=0; i < rawDepth0.length; i++) {
if (rawDepth0 [i] >= minDepth && rawDepth0[i] <maxDepth) {
depthImg0.pixels[i] = color(255);
} else {
depthImg0.pixels[i]= color(0);
}
}
//Draw Threshold
depthImg0.updatePixels();
image(depthImg0, 640, 0);
int[] rawDepth1 = kinect1.getRawDepth();
for (int i=0; i < rawDepth1.length; i++) {
if (rawDepth1 [i] >= minDepth && rawDepth1[i] <maxDepth) {
depthImg1.pixels[i] = color(255);
} else {
depthImg1.pixels[i]= color(0);
}
}
//Draw Threshold
depthImg0.updatePixels();
image(depthImg1, 0, 0);
}