none
GetDepthCameraIntrinsics() sometimes not populating structure RRS feed

  • Question

  • Occasionally, when I call pCoordMapper->GetDepthCameraIntrinsics(), the API is not populating the intrinsics structure.

    Retail Kinect 2.0
    SDK 2.0

    The sequence is roughly:

    1. sensor->open()
    2. wait 1.5s due to get_IsAvailable() being unreliable at startup
    3. OpenMultiSourceFrameReader()
    4. get_CoordinateMapper()
    5. GetDepthCameraIntrinsics()

    Result:

    DepthCameraIntrinsics.FocalLengthX == 0

    Expected:

    DepthCameraIntrinsics.FocalLengthX > 0

    This does not happen every time. I am not able to get a 100% repro. I suspect it is timing related.


    --Dale

    Wednesday, December 17, 2014 1:34 AM

All replies

  • Further confirmation there is an issue with pCoordMap->GetDepthCameraIntrinsics() in SDK 2.0.

    Updated repro:

    1. sensor->open()
    2. wait 1.5 second
    3. call get_IsAvailable() and only continue if true
    4. get_CoordinateMapper()
    5. GetDepthCameraIntrinsics()

    Step 5 API call doesn't populate the intrinsics structure.

    If I wait another 1 second and call the API again, it will again return S_OK yet this time correctly populate the CameraIntrinsics structure. For example:

    6. if (Intrinsics.FocalLengthX == 0) then continue repro steps to retry
    7. wait 1 second
    8. GetDepthCameraIntrinsics()

    Now on my laptop, I have at least a 2.5 second wait on startup due to both APIs not returning reliable results.


    --Dale

    Wednesday, December 17, 2014 12:12 PM
  • There is additional state management errant behavior in GetDepthCameraIntrinsics(). For example:

    • If no Kinect is physically plugged in or Studio clip is playing then the intrinsics structure will not be populated. This is expected.
    • Plug in a Kinect, get default sensor, open it, get coordmapper, get intrinsics. Eventually, after a delay and retries, the intrinsics structure will be populated.
    • Unplug the Kinect, release coordmapper, Close IKinectSensor, release IKinectSensor
    • Leave the Kinect unplugged. Do not have Kinect Studio connected or a clip playing.
    • GetDefaultSensor, Open it, get coordmapper, get intrinsics. It will successfully populate intrinsics structure. This is undesired

    That last step is unexpected. There is no Kinect or Studio clip playing. Therefore, the API should not know what intrinsics exist. I believe the API should return a failure or not populate the structure.


    --Dale

    Wednesday, December 17, 2014 2:25 PM
  • What is the state of IsAvailable on the sensor in the last report?

    Carmine Sirignano - MSFT

    Wednesday, December 17, 2014 7:09 PM
  • Calling hr = get_IsAvailable(&bIsAvail) immediately after verifying the structure was successfully populated yields

    hr==S_OK
    bIsAvail==0

    Related to this (found during testing) is that the Runtime and Kinect Studio together do not fully simulate a real Kinect. In particular get_IsAvailable() does not indicate TRUE when a Studio Clip is played or started while no Kinect is physically attached. This is undesired if you want Studio to be able to fully simulate an end-2-end Kinect session.


    --Dale


    Wednesday, December 17, 2014 10:05 PM