KinectProjectorToolkit icon indicating copy to clipboard operation
KinectProjectorToolkit copied to clipboard

Kinect2

Open WaltzBinaire opened this issue 9 years ago • 3 comments

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

WaltzBinaire avatar May 08 '15 12:05 WaltzBinaire

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.

genekogan avatar May 08 '15 14:05 genekogan

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

WaltzBinaire avatar May 08 '15 16:05 WaltzBinaire

Hey princemio,

did you get it running?

mariuszkreft avatar May 24 '15 17:05 mariuszkreft