Respondida Kinect, skeletons index?

  • Tuesday, March 20, 2012 7:48 PM
     
     

    The actif SkeletonData in VPL does noet always have the index 0.

    RawFrames.RawSkeletonFrameData.SkeletonData[1].Joints[JointType.Head].Position

    How can I find out which SkeletonData is related with the first skeleton (body)?


    cvl-ft

All Replies

  • Thursday, March 22, 2012 12:45 AM
    Owner
     
     Answered

    This is discussed in the documentation for the Kinect for Windows SDK.
    You need to use the TrackingId...  "RawFrames.RawSkeletonFrameData.SkeletonData[0].TrackingId" which will not change even as the index does.

    • Proposed As Answer by Gershon ParentOwner Thursday, March 22, 2012 12:45 AM
    • Marked As Answer by cvl-ft Thursday, March 22, 2012 1:26 PM
    •  
  • Thursday, March 22, 2012 1:26 PM
     
     Answered

    Thanks for the hint.

    It is more complex.

    For the moment there are 6 SkeletonData available:  RawFrames.RawSkeletonFrameData. SkeletonData.Length=>6

    When I left and return several times the detection array of the Kinect I see that

    -) the TrackingId is unique for a session inside the detection array.

    -) a new session can have a different index.

    The first player is not always located with index=0.
    I did not saw a change of index with a unchanged  TrackingId.

    RawFrames.RawSkeletonFrameData.SkeletonData[0].TrackingId

    RawFrames.RawSkeletonFrameData.SkeletonData[index].TrackingId with 0 <=index<=5

    The image shows a part of a VPL program that show information of the active skeleton.


    cvl-ft

    • Marked As Answer by cvl-ft Thursday, March 22, 2012 1:26 PM
    •  
  • Saturday, March 24, 2012 8:28 PM
     
     
    Please cvl-ft is it possible to show me the full (clear) VPL program? I'm trying to solve a similar problem. Please. 
  • Saturday, March 24, 2012 10:23 PM
     
     

    In the ownload you will find 3 example VPL files which are been used during my experiments.

    download

    The download address will be valid until 1ste of april 2012

     

    cvl-ft


  • Sunday, March 25, 2012 11:37 PM
     
     
    You're awesome!!!! Thanks a bunch. 
  • Monday, March 26, 2012 10:47 AM
     
     
  • Monday, March 26, 2012 4:14 PM
     
     

    Actually, I have a few.

    1. When you join your messages     from--[JointType.ShoulderCenter] ---to--- [SHpos]
                                                             from--[JointType.Head                ] ---to--- [HDpos]
       What should I use if I want to go from--[JointType.HandLeft          ] ---to--- [??pos]      
       Likewise                                        from--[JointType.HandRight        ] ---to--- [??pos]                          

       I am interested in tracking the coordinate position of both hands (right and left). I tried RHpos and LHpos; also HRpos and HLpos but no result.

    2. Also in the [join] service, I recognise Tid, ts, index, SHpos,HDpos; however, I do not recognize [ZE]. what does [ZE] represent? and why did you set the TrackingId to zero [value==0] before passing it into [ZE]? I have a clue, but I don't want to be wrong. I though means Zero.

    3. You commented "actualeton data's". Then you go form [RawFrames.......SkeletonData[0]] to [RawFrames.....SkeletonData[5]]. That just indicates an iterative process right? So you are taking skeletal data 6 times over and combined them?

                        

    4. Lastly, is the [Log] service the best way to display these coordinates? or are there other options. I know the [Dialog] service will not work. I want to be able to take these coordinates and use them. For example, if my right hand moves rapidly upward along the Y-axis, recognize that and [update tilt position of the kinect by a certain amount.]  I want to be able to do something based on the cordinate information.

  • Monday, March 26, 2012 10:35 PM
     
     Answered

    Hi

    I think that you are making a big error in reasoning. VPL is message flow oriented.
    This differed a lot from
    iterative or objects oriented programming.
    That is also a nice reason why message flow oriented
    design and programming is very suitable in educational settings.

    =================================================

    The examples are showing experimental vpl programs which are giving an expression of how it could work. They are not end user applications.
    It suppost that you have already develop your VPL skills well. 

    Example 01 is the simplest one.

    (I notice that the original file did not contain all the 6 skeletons. I updated this)
    It shows the skeleton info in a log when the x,y,z or not 0.
    The RawFrames message is send to a calculation activities and processed.
    I selected the  JointType.ShoulderCenter
    and the JointType.Head but this is arbitrary.

    You may replace them with JointType.HandLeft and JointType.HandRight
    RawFrames.RawSkeletonFrameData.SkeletonData[x].Joints[JointType.ShoulderCenter].Position
    RawFrames.RawSkeletonFrameData.SkeletonData[x].Joints[JointType.Head].Position
    SHpos and HDpos are placeholders for two positions in the join activity. They
    are used in the log string.
    TId is a placeholder for the tracking ID and ZE is a placeholder for a Boolean.

    Ze is used for the decision of publish the information or not.

    VPL is message flow based!!

    In Example 02I made use of the fact that the Tracking ID is not 0 when there is a skeleton detected.
    I split up the calculations.

    Example 3 is more experimental.

    All 3 examples will work for ShoulderCenter & Head or one of the other indexes.

    About your questions
    1)

    Change only the indexes for the positions don’t change the placeholder in the
    join. RawFrames.RawSkeletonFrameData.SkeletonData[x].Joints[JointType.HandLeft].Position

    RawFrames.RawSkeletonFrameData.SkeletonData[x].Joints[JointType.HandRight].Position

    2)

    I don’t set
    the TrackingId to zero but I create with the calculate activity a
    new Boolean message with as content true or false.

    [value==0] is a Boolean expression, value is the content of the incoming
    message.

    Ze is a placeholder for a Boolean in this join, This Boolean has
    been used later to make the decision to log or not.  

    3)
    No, y
    ou must learn to think in messages and not in iterative processes .
    In example 2 the messages from the 6 join’s are merged. This means that if one
    or more join’s produce a message, all these message are forwarded (flow) to the
    same log activity.
    See the description of a merge in the help.

    There is no iterative process, forget this concept. You must try to think in pure message flow.

    4)

    The log activity is only an example, you can replace it with other activities.

    Advisable in this case is to created a service in C# that has the Kinect service as parent and which implements your scenario.


    cvl-ft


  • Wednesday, March 28, 2012 1:37 AM
     
     
    Wow, thanks for the insight...You've she light on a lot. This is actually my first time developing in vpl and I am having fun. Thank for your help so far.
  • Wednesday, March 28, 2012 10:11 AM
     
     

    Thanks, the didatical part of the MS-VPL documentation is a little bit weak.


    cvl-ft


    • Edited by cvl-ft Wednesday, March 28, 2012 10:11 AM
    •  
  • Monday, April 02, 2012 2:36 PM
    Moderator
     
     
    I appreciate the understatement.
  • Monday, April 02, 2012 4:41 PM
    Moderator
     
     

    Hi CVL-FT

    I downloaded your files but the VPL files had a size of 1K and when opened, were a blank screen.  I was mainly curios because I was trying to get this exact information from the Beta version and was told that I had to write a service to retrieve it.  I did that, and actually it was a better solution, but I spent untold hours trying to make the provided service work.  

    I discovered the Skeleton index problem by creating a WPF program for the Kinect and noticed that if I moved out of the field of view for more than 5 seconds or so the index changed.  This explained why, using the VPL Kinect Service it would track me then, depending on how long I was out of the field of view.  More than about 5 seconds and I received a new index, but not necessarily in order.  For my project I just had to scan until I found a tracked skeleton and I was good.  But that was all in C# and eventually in the service I wrote, not the supplied Kinect VPL service.  

    I think your documentation is a definite contribution to the cause.  

    tlc

  • Monday, April 02, 2012 7:31 PM
     
     

    Hi tlc,

    I check the download. It is still available.

    The fischertechnik.zip has a size of 33.5kb.

    Try to download it again or contact me directly.

    ft.info@inter.nl.net

    See also a different track in this forum:

    http://social.msdn.microsoft.com/Forums/en-US/kinectsdk/thread/bae1d7be-3898-41af-95b6-3b3e0c89f732


    cvl-ft


    • Edited by cvl-ft Monday, April 02, 2012 7:35 PM
    •  
  • Monday, April 02, 2012 8:01 PM
    Moderator
     
     

    cvl-ft,

    Well I downloaded it again to the machine that I was trying to view the files from my flash drive on and they opened without a problem.  Not sure what's up with that.  

    I started trying to do this with VPL the beta version of the SDK.  After much frustration it was suggested that I should write a DSS service for VPL.  In the beginning all I wanted to do was track a single skeleton in the field of view.  If it went away I wanted to note that and wait for another tracking lock.  My VPL program would track, but if I moved in and out of the field of view it would sometimes appear to "track" me and other times not.  I decided to just write a WPF application so that I could more easily monitor what was going on.  There I discovered that if I left the field of view for more than about 5 seconds it would assign a new tracking ID to me and not necessarily in numerical order.  My VPL app was only looking for skeleton[0] which was causing the problem.  I was curious how you solved the problem in VPL.     

    In conclusion, I ended up writing a C# service that "finds" a currently tracked skeleton and updates the state with the required information.  I can then do a Get in VPL and retrieve the info.  Now I'm working on identifying poses in the same service.  

    #3 looks very interesting and I'm going to try it out when I get home to my Kinect.  Thanks for your reply and sharing your information.  

    tlc

  • Monday, April 09, 2012 12:17 PM
     
     

    My idea is that I need to think in skeleton sessions.

    1)

    Session start up:

    Check if the skeleton represent the right user.

    For example: the skeleton produce a special startup situation.

    Activate the model that must be run under control of this user.

    2)

    During the session:

    Control the model.

    Check if the user is still active

    3)

    Session ends:

    The user lost control.

    Put the model in a save position and make it ready for the next session.


    cvl-ft

  • Friday, May 04, 2012 9:20 PM
     
     

    Hereby a repost of some of my tests.

    In the download you will find 3 example VPL files which are been used during my

    experiments.

    download

    The download address will be valid until 1ste of July 2012


    cvl-ft

  • Friday, May 04, 2012 10:02 PM
    Moderator
     
     

    Hi cvl-ft,

    I have been distracted by my Eddie project but now that it is submitted I'm going to spend a little more time with your files.  Thanks for setting up the download again.  

    I'll let you know.  

    Todd

  • Monday, May 07, 2012 9:57 PM
    Moderator
     
     
    Hi cvl-ft,

    I was playing with your programs last night and got varying results.  Sometimes it appeared to track, but the position information was 0,0,0.  Since you are creating message flows from all 6 possible skeleton indexes and merging them can the results be a blending of the one tracked, and five other not tracked?  

    I was trying to create a loop, incrementing the state of a var and using that to index the skeleton array.  If I output to a series of simple dialog boxes I get 5 "Not Tracked" and one "Tracked", but for some weird reason I couldn't match on Tracked in my if statement.  It has to be something stupid that I'm doing, but about that time I had to go to bed so I need to figure it out this evening. 

    Todd 
  • Wednesday, May 09, 2012 8:50 AM
     
     Answered

    Hi Todd,

    Can you e-mail me directly?ft.info@inter.nl.net

    This makes the exchange of ideas and examples easier.


    cvl-ft

    • Marked As Answer by cvl-ft Friday, May 11, 2012 8:09 AM
    •