I am creating an application using the SDK in which I have to have only one user, and block it so that if someone else appears, even if this person is closer to Kinect, the application tracks the first skeleton that it tracks.
From the msdn library I found, I could use the Stream Skeletom class:
Property: AppChoosesSkeletons = Gets or sets a Boolean value that determines whether the application selects which skeletons to track.
Method: SkeletonStream.ChooseSkeletons (Int32) = Select one skeleton to track. Syntax: public void ChooseSkeletons (int trackingId1)
I am not very good at programming, and I use C #, I thought to write something like code down, but it says that I use Invalid Expression.
SkeletonFrame SFrame = e.OpenSkeletonFrame();
if (SFrame == null) return;
Skeleton[] Skeletons = new Skeleton[SFrame.SkeletonArrayLength];
SFrame.CopySkeletonDataTo(Skeletons);
int firstSkeleton = Skeletons[0].TrackingId;
sensor.SkeletonStream.ChooseSkeletons(int firstSkeleton);
if (firstSkeleton == null)
return;
if (SkeletonTrackingState.Tracked == firstSkeleton.TrackingState)
{
sensor.SkeletonStream.ChooseSkeletons(int firstSkeleton, int firstSkeleton cannot be used.
- ? !