Error using processing with kinect

116 views
Skip to first unread message

Danilo Capistrano

unread,
Jan 23, 2013, 1:24:38 PM1/23/13
to openk...@googlegroups.com
Hello Guys!
I'm new in processing. I would like to work with kinect and arduino. I'm reading this book (Kinect and Arduino projetcts). I tried to use this code:

import SimpleOpenNI.*;
SimpleOpenNI kinect;

void setup() {
kinect = new SimpleOpenNI(this);
// enable depthMap and RGB image
kinect.enableDepth();
kinect.enableRGB();
// enable mirror
kinect.setMirror(true);
size(kinect.depthWidth()+kinect.rgbWidth(), kinect.depthHeight());
}

void draw() {
kinect.update();
// draw depthImageMap and RGB images
image(kinect.depthImage(), 0, 0);
image(kinect.rgbImage(),kinect.depthWidth(),0);
}

but show this error-->  Illegalargumentexception: witdth(0) and height(0) cannot be<=0

SimpleOpenNI Version 0.27
Exception in thread "Animation Thread" java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:312)
at processing.core.PGraphicsJava2D.allocate(PGraphicsJava2D.java:154)
at processing.core.PGraphicsJava2D.setSize(PGraphicsJava2D.java:126)
at processing.core.PApplet.resizeRenderer(PApplet.java:1481)
at processing.core.PApplet.size(PApplet.java:1590)
at processing.core.PApplet.size(PApplet.java:1560)
at sketch_130123a.setup(sketch_130123a.java:28)
at processing.core.PApplet.handleDraw(PApplet.java:2117)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:193)
at processing.core.PApplet.run(PApplet.java:2020)
at java.lang.Thread.run(Thread.java:662)

I'm using ubuntu 12.10 and Processing 2.0b7



thaks for all
Reply all
Reply to author
Forward
0 new messages