none
Failed to Initialize Face Tracker RRS feed

  • Question

  • Hi all, 

    I am trying to work with the new Kinect 1.5 SDK with the FaceTracker tool (in C#) and I am having trouble initializing the FaceTracker object:

    faceTracker = new FaceTracker(sensor);

    Following the debugger, it hits an exception during the error checking in the FaceTracker.cs class in the initialize method of FaceTracker.cs:

    private void Initialize(
                CameraConfig newColorCameraConfig, 
                CameraConfig newDepthCameraConfig, 
                IntPtr colorImagePtr, 
                IntPtr depthImagePtr, 
                FaceTrackingRegisterDepthToColor newRegisterDepthToColorDelegate)
            {

    ...

    int hr = this.faceTrackerInteropPtr.Initialize(this.videoCameraConfig, this.depthCameraConfig, funcPtr, null);

                if (hr != 0)
                {
                    throw new InvalidOperationException(
                        string.Format(CultureInfo.CurrentCulture, "Failed to initialize face tracker - Error code from native=0x{0:X}", hr));
                }

    It terminates with 'Failed to initialize face tracker - Error code from native=0x8FAC000E'

    The exact value at this point (where it checks if hr!= 0) is hr = -1884553202.

    The biggest problem is that I cannot look at how 

    this.faceTrackerInteropPtr.Initialize(this.videoCameraConfig, this.depthCameraConfig, funcPtr, null) works or what it returns since that particular Initialize method is protected, so I am not sure what else to do.

    Thanks for any help!

    Thursday, May 31, 2012 12:25 AM

Answers

  • Nevermind, it seems that my attempt to Initialize the FaceTracker within the constructor of the kinect camera object in my particular project throws the exception, and thus I simply catch it and try to repeatedly initialize the FaceTracker again at the moment that I want to track a frame.
    • Marked as answer by Ohtrahddis Thursday, May 31, 2012 8:21 PM
    Thursday, May 31, 2012 8:21 PM

All replies

  • Just to be clear, which face tracking sample are you using Face Tracking Basics-WPF or Trace Tracking 3D-WPF? Can you put a breakpoint on the method call and provide the properties of the variables being passed? Does this happen all the time, or during at random times?

    Thursday, May 31, 2012 12:45 AM
  • I am using Face Tracking Basics-WPF as a sample to set my own Project to have Face Tracking.

    I tried to follow the instructions to include facetracking into a C# project from http://msdn.microsoft.com/en-us/library/jj131022.aspx

    as well as looking at the Face Tracking Basics-WPF sample code. 

    This happens all the time, I have not been able to Initialize the FaceTracker object (in this project that is, the sample code works fine on its own).

    Here are the properties of the variables so far.

    Before the call of-

    int hr = this.faceTrackerInteropPtr.Initialize(this.videoCameraConfig, this.depthCameraConfig, funcPtr, null);

    Name Value Type

    this: {Microsoft.Kinect.Toolkit.FaceTracking.FaceTracker} Microsoft.Kinect.Toolkit.FaceTracking.FaceTracker
    newColorCameraConfig: {Microsoft.Kinect.Toolkit.FaceTracking.CameraConfig} Microsoft.Kinect.Toolkit.FaceTracking.CameraConfig
    newDepthCameraConfig: {Microsoft.Kinect.Toolkit.FaceTracking.CameraConfig} Microsoft.Kinect.Toolkit.FaceTracking.CameraConfig
    colorImagePtr: 0 System.IntPtr
    depthImagePtr: 0 System.IntPtr
    newRegisterDepthToColorDelegate: {Method = {Int32 DepthToColorCallback(UInt32, UInt32, UInt32, UInt32, Single, Microsoft.Kinect.Toolkit.FaceTracking.Point, Int32, Int32, UInt16, Int32 ByRef, Int32 ByRef)}}  Microsoft.Kinect.Toolkit.FaceTracking.FaceTrackingRegisterDepthToColor
    funcPtr: 4394954 System.IntPtr
    hr: 0 int

    Right after the call of-

    int hr = this.faceTrackerInteropPtr.Initialize(this.videoCameraConfig, this.depthCameraConfig, funcPtr, null);

    Name Value Type

    this: {Microsoft.Kinect.Toolkit.FaceTracking.FaceTracker} Microsoft.Kinect.Toolkit.FaceTracking.FaceTracker
    newColorCameraConfig: {Microsoft.Kinect.Toolkit.FaceTracking.CameraConfig} Microsoft.Kinect.Toolkit.FaceTracking.CameraConfig
    newDepthCameraConfig: {Microsoft.Kinect.Toolkit.FaceTracking.CameraConfig} Microsoft.Kinect.Toolkit.FaceTracking.CameraConfig
    colorImagePtr: 0 System.IntPtr
    depthImagePtr: 0 System.IntPtr
    newRegisterDepthToColorDelegate: {Method = {Int32 DepthToColorCallback(UInt32, UInt32, UInt32, UInt32, Single, Microsoft.Kinect.Toolkit.FaceTracking.Point, Int32, Int32, UInt16, Int32 ByRef, Int32 ByRef)}}  Microsoft.Kinect.Toolkit.FaceTracking.FaceTrackingRegisterDepthToColor
    funcPtr: 4394954 System.IntPtr
    hr: -1884553202 int

    The value of hr is consistently the one shown above. The funcPtr's may vary on different instances of debugging, but are equal both before and after the code.






    • Edited by Ohtrahddis Thursday, May 31, 2012 1:32 AM
    Thursday, May 31, 2012 1:19 AM
  • Nevermind, it seems that my attempt to Initialize the FaceTracker within the constructor of the kinect camera object in my particular project throws the exception, and thus I simply catch it and try to repeatedly initialize the FaceTracker again at the moment that I want to track a frame.
    • Marked as answer by Ohtrahddis Thursday, May 31, 2012 8:21 PM
    Thursday, May 31, 2012 8:21 PM
  • Hello I have the same issue with the following returned code:

    Failed to initialize face tracker - Error code from native=0x80070002

    The source error is this line:

    int

    hr = this.faceTrackerInteropPtr.Initialize(this.videoCameraConfig, this.depthCameraConfig, funcPtr, null);Inside the FaceTracker.Initialize() method.

    Thanks for your help
    Tuesday, July 31, 2012 9:35 AM
  • I had this issue too. Please see thread http://social.msdn.microsoft.com/Forums/en-US/kinectsdkfacetracking/thread/a69ca439-ac6f-4c4c-9c2b-4209c1d9f23b

    One needs to include both FaceTrackLib.dll AND FaceTrackData.dll 

    not including FaceTrackLib.dll will crash but not including FaceTrackData.dll does not.

    Wednesday, August 29, 2012 10:34 PM