help; kinect non reconnue sur mac lion
in
Integration and Hardware
•
1 year ago
bonjour a tous
je suis nouveau sur le forum et je suis plus que debutant sur processing et toute sorte de code informatique, mais en tant que plasticien et videaste je souhaite monter un projet sur kinect....
j'ai commencé par prendre la librairie de shiffman et rien ne marche
// Daniel Shiffman
// Basic Library functionality example
// http://www.shiffman.net
// https://github.com/shiffman/libfreenect/tree/master/wrappers/java/processing
import org.openkinect.*;
import org.openkinect.processing.*;
Kinect kinect;
boolean depth = true;
boolean rgb = false;
boolean ir = false;
float deg = 15; // Start at 15 degrees
void setup() {
size(1280,520);
kinect = new Kinect(this);
kinect.start();
kinect.enableDepth(depth);
kinect.enableRGB(rgb);
kinect.enableIR(ir);
kinect.tilt(deg);
}
void draw() {
background(0);
image(kinect.getVideoImage(),0,0);
image(kinect.getDepthImage(),640,0);
fill(255);
text("RGB/IR FPS: " + (int) kinect.getVideoFPS() + " Camera tilt: " + (int)deg + " degrees",10,495);
text("DEPTH FPS: " + (int) kinect.getDepthFPS(),640,495);
text("Press 'd' to enable/disable depth Press 'r' to enable/disable rgb image Press 'i' to enable/disable IR image UP and DOWN to tilt camera Framerate: " + frameRate,10,515);
}
void keyPressed() {
if (key == 'd') {
depth = !depth;
kinect.enableDepth(depth);
}
else if (key == 'r') {
rgb = !rgb;
if (rgb) ir = false;
kinect.enableRGB(rgb);
}
else if (key == 'i') {
ir = !ir;
if (ir) rgb = false;
kinect.enableIR(ir);
}
else if (key == CODED) {
if (keyCode == UP) {
deg++;
}
else if (keyCode == DOWN) {
deg--;
}
deg = constrain(deg,0,30);
kinect.tilt(deg);
}
}
void stop() {
kinect.quit();
super.stop();
}
avec le message d'erreur:
NullPointerExeption
No Kinect devices found.
Exception in thread "Animation Thread" java.lang.NullPointerException
at org.openkinect.processing.Kinect.enableDepth(Kinect.java:82)
at RGBDepthTest.setup(RGBDepthTest.java:43)
at processing.core.PApplet.handleDraw(PApplet.java:2103)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:190)
at processing.core.PApplet.run(PApplet.java:2006)
at java.lang.Thread.run(Thread.java:680)
que dois-je faire?
D'autant que je souhaiterais travailler ensuite avec openNI.......
merci de votre attention
je suis nouveau sur le forum et je suis plus que debutant sur processing et toute sorte de code informatique, mais en tant que plasticien et videaste je souhaite monter un projet sur kinect....
j'ai commencé par prendre la librairie de shiffman et rien ne marche
// Daniel Shiffman
// Basic Library functionality example
// http://www.shiffman.net
// https://github.com/shiffman/libfreenect/tree/master/wrappers/java/processing
import org.openkinect.*;
import org.openkinect.processing.*;
Kinect kinect;
boolean depth = true;
boolean rgb = false;
boolean ir = false;
float deg = 15; // Start at 15 degrees
void setup() {
size(1280,520);
kinect = new Kinect(this);
kinect.start();
kinect.enableDepth(depth);
kinect.enableRGB(rgb);
kinect.enableIR(ir);
kinect.tilt(deg);
}
void draw() {
background(0);
image(kinect.getVideoImage(),0,0);
image(kinect.getDepthImage(),640,0);
fill(255);
text("RGB/IR FPS: " + (int) kinect.getVideoFPS() + " Camera tilt: " + (int)deg + " degrees",10,495);
text("DEPTH FPS: " + (int) kinect.getDepthFPS(),640,495);
text("Press 'd' to enable/disable depth Press 'r' to enable/disable rgb image Press 'i' to enable/disable IR image UP and DOWN to tilt camera Framerate: " + frameRate,10,515);
}
void keyPressed() {
if (key == 'd') {
depth = !depth;
kinect.enableDepth(depth);
}
else if (key == 'r') {
rgb = !rgb;
if (rgb) ir = false;
kinect.enableRGB(rgb);
}
else if (key == 'i') {
ir = !ir;
if (ir) rgb = false;
kinect.enableIR(ir);
}
else if (key == CODED) {
if (keyCode == UP) {
deg++;
}
else if (keyCode == DOWN) {
deg--;
}
deg = constrain(deg,0,30);
kinect.tilt(deg);
}
}
void stop() {
kinect.quit();
super.stop();
}
avec le message d'erreur:
NullPointerExeption
No Kinect devices found.
Exception in thread "Animation Thread" java.lang.NullPointerException
at org.openkinect.processing.Kinect.enableDepth(Kinect.java:82)
at RGBDepthTest.setup(RGBDepthTest.java:43)
at processing.core.PApplet.handleDraw(PApplet.java:2103)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:190)
at processing.core.PApplet.run(PApplet.java:2006)
at java.lang.Thread.run(Thread.java:680)
que dois-je faire?
D'autant que je souhaiterais travailler ensuite avec openNI.......
merci de votre attention
1