none
Initializing multiple kinects with runtime options RRS feed

  • Question

  • Hi,

    I'm trying to initialize multiple Kinects with different run time options. I learnt that only Kinect Sensor can be initialized for skeleton tracking or depth and player index. How can I specify which Kinect gets initialized with skeleton tracking? I tried using the uniqueDeviceName property of the Runtime.nuiCamera object, but it only returns a value after the runtime objects for each of the sensors have been initialized. I want to have access to the device names (or some way of identifying a specific Kinect) so that I can initialize it with skeletal tracking. Also, can the initialize options be changed once the initialization has already been done?

    Regards,

    Anurag. 

     

    Wednesday, July 6, 2011 7:22 PM

Answers

  • You create a runtime for each sensor. When you do that you can specify an optional index, 0..n-1 where n is the number of devices. Skeleton tracking only runs on 0, the default if you don't specify an index creating the runtime. You have no control over which is 0, 1, 2, ect. On a single controller I could control it by the order they were plugged in, but the second one wouldn't work. With differant controllers it seems to be one is always first, the other always second.

    Thursday, July 7, 2011 3:48 AM
  • About whether the initialize options can be changed once initialization has already been done, the answer is: yes, you can uninitialize and then re-initialize same kinect sensor, but you can't just change initialization flags without a full re-initialization. This should work fine for you because initialization/uninitialization have low overhead.

    - In C++ you can call NuiShutdown and then NuiInitialize again with new flags.
    - In C# you can call Runtime.Uninitialize(), then create a new Runtime instance for same Kinect index and then call Initialize again with new flags.

    Also, as LilBudyWizer said, you can't choose which device is used for skeletal tracking, since only device at index zero supports skeletal tracking.

    Eddy


    I'm here to help
    Thursday, July 7, 2011 7:15 PM

All replies

  • You create a runtime for each sensor. When you do that you can specify an optional index, 0..n-1 where n is the number of devices. Skeleton tracking only runs on 0, the default if you don't specify an index creating the runtime. You have no control over which is 0, 1, 2, ect. On a single controller I could control it by the order they were plugged in, but the second one wouldn't work. With differant controllers it seems to be one is always first, the other always second.

    Thursday, July 7, 2011 3:48 AM
  • About whether the initialize options can be changed once initialization has already been done, the answer is: yes, you can uninitialize and then re-initialize same kinect sensor, but you can't just change initialization flags without a full re-initialization. This should work fine for you because initialization/uninitialization have low overhead.

    - In C++ you can call NuiShutdown and then NuiInitialize again with new flags.
    - In C# you can call Runtime.Uninitialize(), then create a new Runtime instance for same Kinect index and then call Initialize again with new flags.

    Also, as LilBudyWizer said, you can't choose which device is used for skeletal tracking, since only device at index zero supports skeletal tracking.

    Eddy


    I'm here to help
    Thursday, July 7, 2011 7:15 PM
  • Thank you for your reply. I'd really appreciate it if selecting a specific Kinect for skeletal tracking is made possible in future SDK releases, or better still, if all the Kinects could be initialized with skeletal tracking, it would be wonderful!

    Anurag.


    Anurag.
    Monday, July 11, 2011 10:23 PM
  • hi,

    for two kinects, i add usb host controller and i used sdk 1.7 microsoft, c++

    for initilizating kinects, just initilize kinects and rest of code runs ok

    or

    what exactlly should i change indisde code c++

    thanks in advance

    saleh

    Friday, July 5, 2013 10:22 AM
  • - In C++ you can call NuiShutdown and then NuiInitialize again with new flags

    Eddy, my experiments show that kinect can be re-initialized without calling NuiShutdown, just NuiInitialize with different flags is sufficient. Is it an expected behavior, or some undocumented coincidence, which may disappear in future?


    Monday, September 2, 2013 1:04 PM