04-04-2012 05:40 PM
trojanbrandon,
Here is a Community Example which covers depth with the Xbox Kinect. You can take a look at what they're doing in this code and see how it applies to what you're working with.
Cheers,
04-04-2012 06:13 PM
When I try to add the Z variable to the cluster, this is what happens.
I get an error that says: You have connected two clusters with different contents. Cluster, a cluster of 3 elements conflicts with cluster Value, a cluster of 2 elements. Now I know that the "Rt Hand Position" refnum is strict, so how would I allow the program to pass a cluster of more than 2 elements from the event handler to the main program?
04-04-2012 08:49 PM
I modified the code so that the Cluster you were mentioning contains Z as well. I have not tested this but hopefully it gets you going in the right direction.
04-07-2012 10:35 PM
Would there be any way for the event handler to return more than one joint position?
04-09-2012 12:02 AM
You can do like this, add one more SkelFrmRdy_EvntHdlr.In this picture,I got the left hand and right hand joint.And open the SkelFrmRdy,you should modify the value in picture 2(HandRight), Then you can get the righthand joint.
04-09-2012 12:26 AM
I have tried that, but when I increase the number of joints, the performance decreases significantly, and the data points update very slowly. I am on a fairly fast system as well.
04-10-2012 01:41 PM
Try this. This code generates a 2D array of clusters (X,Y,Z). Each row is for a different skeleton. Each column is for a different joing within that skeleton.
The "Joints of Interest" array constant in the Event Handler can be expanded to acquire the different joints you might be interested in.
Again, I have not tested this. I don't know if it will work or (if it does work) if it will perform well. But hopefully it gets you moving in the right direction.
I don't think the Windows SDK was Microsoft's biggest priority with the Kinect, so it might be less than optimized. You can try and configure Iteration Parallelism on some of the FOR loops and you might be able to get better performance.
04-10-2012 06:33 PM
Thanks! This helped so much.
Just another question though. If I only wanted to track the first skeleton in the frame, how would i make it so the array only contains that particular skeleton?
04-11-2012 09:05 AM
This might help. I've made 2 changes to the Event Handler (SkelFrmRdy_EvntHdlr.vi) and I've marked them with red boxes. The main change is to have a constant (#Skeletons) tied to "N" on the FOR loop that indexes through the Skeleton references. You'll notice that I've set that to index UP TO 10 skeletons right now. If there are less skeletons (i.e. less than 10 elements on the Skeleton reference array coming in) then only that many will be indexed. But not more than 10. Change that constant to 1 and only the first Skeleton reference will be indexed.
I also removed the Shift register for the error cluster wire on that FOR loop. The reason for this is so that you can maybe try to parallelize the FOR loop. It may not be possible still, but it definitely would not have been possible with the shift register on the error wire.
Hope that helps!