KinectProjectorToolkit
KinectProjectorToolkit copied to clipboard
Kinect2
Hey genekogan,
first of all thank you for this library! its really good for learning purposes and nicely written.
im trying to use your library to calibrate kinectv2...somehow it doesnt work. Do you know a way?
im using https://github.com/ThomasLengeling/KinectPV2/tree/master/KinectPV2/examples/MapDepthToColor
and i think it should work somehow...however the results dont make sense...Please - if you have any idea to make this work - let me know.
thank you
yes, it won't work because my library is based on SimpleOpenNI which is only for the Kinect V1. For V2, the library needs to be rewritten from scratch. i'm not familiar with the repo in the link, but if you can get the world coordinates for Kinect V2, we'd be able to make it work by reimplementing the rest, which could be pretty useful.
hey thx for answering.
so for getting worldcoordinates you need to do the following:
import:
import java.nio.FloatBuffer;
in setup:
kinect.enablePointCloud(true);
the function to return xyz Positions of a certain pixel in the depth image:
PVector getXYZPos(FloatBuffer in, int x, int y) { PVector result = new PVector(0, 0); if (x>=0 && y < KinectPV2.WIDTHDepth && y>=0 && y< KinectPV2.HEIGHTDepth) { int count= (x + y * KinectPV2.WIDTHDepth)*3; float valX = in.get(count); float valY = in.get(count+1); float valZ =in.get(count+2); result = new PVector(valX, valY, valZ); } return result; }
and the call of the function dFloat = kinect.getPointCloudDepthPos(); pos = getXYZPos(dFloat,mouseX,mouseY);
so i already did this - but i dont know what i did wrong...the results make no sense to me
Hey princemio,
did you get it running?