diwi / dlibs Goto Github PK
View Code? Open in Web Editor NEWprocessing/java - kinect library
Home Page: http://thomasdiewald.com/blog/?p=109
processing/java - kinect library
Home Page: http://thomasdiewald.com/blog/?p=109
Hello,
I have just downloaded and tested the library. Currently I'm interested in using 3 or 4 devices, but ran into problems if I use more than 2. I've used a slightly modified version of the kinect_basic_multipleDevices example, but here's the output I've got with 3 devices:
=========================================================
library: dLibs.freenect.*
version: 02.25
author : (c) thomas diewald
openkinect-version(freenect.dll): "OpenKinect-libfreenect-v0.1.1-0-gdbfd4ce"
tested on winXP-x86/x64, win7-x86/x64
=========================================================
#_KINECT_INFO____#
message: os.name = Windows 7
message: sun.arch.data.model = 32 bit
message: java.runtime.version = 1.6.0_24-b07
message: java.home = C:\Users\T-bird\Desktop\AAC\processing\java
#_KINECT_INFO____#
message: LIBRARY LOADED
message: path = "C:\Users\T-bird\Documents\Processing\libraries\dLibs_freenect\library/windows32/freenect.dll"
#_KINECT_INFO____#
message: available devices: 3
#_KINECT_INFO____#
on device: 0
message: created new device!
#_KINECT_INFO____#
on device: 0
message: STARTED Thread: processeEvents(...)
#_KINECT_INFO____#
on device: 1
message: created new device!
#_KINECT_INFO____#
on device: 1
message: STARTED Thread: processeEvents(...)
#_KINECT_ERROR___#
location: dLibs.freenect.KinectCore.openDevice(Unknown Source)
on device: 2
message: FAILED: open new device
message: native call returned: -1
#_KINECT_INFO____#
on device: 2
message: STARTED Thread: processeEvents(...)
#_KINECT_WARNING_#
location: dLibs.freenect.KinectCore.setDepthFormat(Unknown Source)
on device: 2
message: FAILED: set depth format
message: no device opened
#_KINECT_WARNING_#
location: dLibs.freenect.KinectCore.setDepthBuffer(Unknown Source)
on device: 2
message: FAILED: set depth buffer
message: no device opened
#_KINECT_WARNING_#
location: dLibs.freenect.KinectCore.startDepth(Unknown Source)
on device: 2
message: FAILED: start depth
message: no device opened
#_KINECT_WARNING_#
location: dLibs.freenect.KinectCore.stopDepth(Unknown Source)
on device: 2
message: FAILED: stop depth
message: no device opened
#_KINECT_WARNING_#
location: dLibs.freenect.KinectCore.closeDevice(Unknown Source)
on device: 2
message: FAILED: close device
message: device already closed
#_KINECT_INFO____#
on device: 1
message: closed device!
#_KINECT_INFO____#
on device: 0
message: closed device!
#_KINECT_DEBUG___#
location: dLibs.freenect.Kinect.shutDown(Unknown Source)
message: KINECT SHUTDOWN
ERROR in libusbemu -- source file 'libusbemu.cpp' at line 257 -- libusb0-dll:err [set_configuration] could not set config 1: win error: A device attached to the system is not functioning.
Could not claim interface on camera: -99
and for reference here's the sketch code:
//---------------------------------------------
//
// author: thomas diewald
// date: 29.07.2011
//
//---------------------------------------------
// note: sometimes, the kinects depth/video wont start at the very first run,
// in this case, just re-start the sketch!
import dLibs.freenect.toolbox.*;
import dLibs.freenect.constants.*;
import dLibs.freenect.interfaces.*;
import dLibs.freenect.*;
//-------------------------------------------------------------------
int device_count = 0;
int kinectFrame_size_x = VIDEO_FORMAT._RGB_.getWidth(); // width of kinect frame
int kinectFrame_size_y = VIDEO_FORMAT._RGB_.getHeight(); // height of kinect frame
Kinect kinect_[]; // main kinect-object
KinectFrameDepth kinect_depth_[]; // depth frame
//-------------------------------------------------------------------
PImage depth_frame_[]; // images
void setup(){
device_count = Kinect.count();
KinectLogger.log(KinectLogger.TYPE.INFO, null, "available devices: "+device_count );
size(kinectFrame_size_x*device_count, kinectFrame_size_y);
kinect_ = new Kinect[device_count];
kinect_depth_ = new KinectFrameDepth[device_count];
depth_frame_ = new PImage[3];
for(int i = 0; i < device_count; i++){
kinect_[i] = new Kinect(i); // create the main device-instance
kinect_depth_[i] = new KinectFrameDepth(DEPTH_FORMAT._11BIT_); // create a depth instance
kinect_depth_[i].connect(kinect_[i]); //connect the created depth instance to the main kinect
kinect_depth_[i].setFrameRate(30); // default is set to 60, which will be changed in the next update
depth_frame_[i] = createImage(DEPTH_FORMAT._11BIT_.getWidth(), DEPTH_FORMAT._11BIT_ .getHeight(), RGB);
}
}
//-------------------------------------------------------------------
void draw(){
for(int i = 0; i < device_count; i++){
assignPixels( depth_frame_[i], kinect_depth_[i]);
image(depth_frame_[i], kinectFrame_size_x*i, 0);
}
//println(frameRate);
}
//-------------------------------------------------------------------
void assignPixels(PImage img, Pixelable kinect_dev){
img.loadPixels();
img.pixels = kinect_dev.getPixels(); // assign pixels of the kinect device to the image
img.updatePixels();
}
//-------------------------------------------------------------------
// this is maybe not necessary, but is the proper way to close everything
void dispose(){
Kinect.shutDown();
super.dispose();
}
Any tips/hints on how I could get past this issue ?
Also, a bit off topic - does this library expose accelerometer values ?
hi there dear Mr. Diewald,
i found your library very interesting and useful, but just didn't found any update for a long time. is it possible to update this to use it with processing 3?
thanks in advance....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.