LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinect Skeleton Engine

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,

KyleP
Applications Engineer
National Instruments
0 Kudos
Message 11 of 19
(1,351 Views)

When I try to add the Z variable to the cluster, this is what happens.

Screenshot.png

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?

0 Kudos
Message 12 of 19
(1,350 Views)

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.

0 Kudos
Message 13 of 19
(1,344 Views)

Would there be any way for the event handler to return more than one joint position?

0 Kudos
Message 14 of 19
(1,329 Views)

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.

 1

 

2

0 Kudos
Message 15 of 19
(1,321 Views)

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.

0 Kudos
Message 16 of 19
(1,319 Views)

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.

Message 17 of 19
(1,302 Views)

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?

0 Kudos
Message 18 of 19
(1,293 Views)

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!

0 Kudos
Message 19 of 19
(1,284 Views)