Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kinect2 #4

Open
WaltzBinaire opened this issue May 8, 2015 · 3 comments
Open

Kinect2 #4

WaltzBinaire opened this issue May 8, 2015 · 3 comments

Comments

@WaltzBinaire
Copy link

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

@genekogan
Copy link
Owner

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.

@WaltzBinaire
Copy link
Author

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

@mariuszkreft
Copy link

Hey princemio,

did you get it running?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants