Can Face & HDFace used at same time? RRS feed

  • Question

  • i.e. 

    FaceFrameFeatures in HDFace.

    I'm getting the next error.

    (failed to load NuIdatabase)

    This does not happen when I only use HDFace or only Face

    Thanks mates!

    • Edited by SirManu Saturday, October 18, 2014 7:43 PM
    Saturday, October 18, 2014 7:25 PM

All replies

  • NuiDatabase is folder that is located at $(KINECTSDK20_DIR)\bin\, and face tracking sdk needs it to do its work.

    Monday, October 20, 2014 6:29 AM
  • Hi friend.

    As you can read in my previous post, that's not the problem, because FaceTracking works perfectly when FaceFrameSource is not initialized (see the attached image)

    In my solution I already have this line, as the example provided in the SDK:

    xcopy "$(KINECTSDK20_DIR)Redist\Face\$(Platform)\NuiDatabase" "$(TargetDir)\NuiDatabase" /S /R /Y /I


    Monday, October 20, 2014 8:56 AM
  • I can have Face and HD Face both work on my computer.

    and as the error description says that it can't load NuiDatabase, i think you should double check it.

    • Edited by Clones1201 Monday, October 20, 2014 10:27 AM
    Monday, October 20, 2014 10:26 AM
  • When you say "both", you mean simultaneously in same app?
    What I think is that Face makes the resource busy so HD can't access and viceversa

    Let see if @carmine can shed light on this topic

    • Edited by SirManu Monday, October 20, 2014 11:31 AM
    Monday, October 20, 2014 11:30 AM
  • Yes, Face and HD Face work simultaneously. Keep in mind this is going to require a better machine than minimal requirements. The face API's are CPU bound operations and if they are lagging behind will lose data/drop frames to try to keep up.

    Carmine Sirignano - MSFT

    Tuesday, October 21, 2014 5:36 PM
  • Ok, so it must be my code.

    Thanks for the note.

    Another questions, in HDFace, FaceAlignment

    Why I can't get FaceBoundingBox?

    See image:

    (I have last SDK)
    • Edited by SirManu Tuesday, October 21, 2014 6:13 PM
    Tuesday, October 21, 2014 6:12 PM
  • FaceAlignment will give you Animation Units, rotation, skin color, hair color and scale.

    Face Bounding box is in IFaceResult

    Face provides IFaceResult

    HD Face provides IFaceAlignment

    Wednesday, October 22, 2014 1:48 AM
  • ¿?

    First of all, thanks for your reply, but, have you opened the link that I wrote?

    I think you are mixing concepts.

    EDIT: I mean, I know what you are saying, but my question is, that in HDFace class FaceAlignment

    There is a property call FaceBoundingBox

    which it seems is not implemented yet , but it appears in documentation

    • Edited by SirManu Wednesday, October 22, 2014 8:30 AM
    Wednesday, October 22, 2014 8:27 AM
  • Bounding box is a feature of the Face API's not HD Face. Its namespace is Microsoft.Kinect.Face as demonstrated in the FaceBasics samples.

    Face api's are the 2D representation of face data where HD face is 3D. A bounding box only makes sense in a 2D space.


    Carmine Sirignano - MSFT

    Wednesday, October 22, 2014 2:11 PM
  • I know that, Carmine.

    But if you read carefully, that is not what I asked.

    FaceAlignment have a property call FaceBoundingBox .

    I think is a bug in the documentation


    Wednesday, October 22, 2014 3:55 PM
  • By the way, I already solved my problem...

    FaceFrameSource must be initialized before HighDefinitionFaceFrameSource

    • Edited by SirManu Wednesday, October 22, 2014 5:13 PM
    Wednesday, October 22, 2014 5:13 PM
  • I thought that I already fixed the problem but I am still having some errors which keep off having HdFace and Face at same time. I am really going crazy.

    Please, see my code below:

    InitializeComponent(); kinect =KinectSensor.GetDefault(); if (kinect ==nullreturn; kinect.Open(); bodyFrameReader = kinect.BodyFrameSource.OpenReader();

    if (bodyFrameReader != null)
        bodyFrameReader.FrameArrived += bodyFrameReader_FrameArrived;

    // Create new sources with body TrackingId faceFrameSources =newFaceFrameSource(kinect, 0, faceFrameFeatures); if (faceFrameReaders !=null) {     faceFrameReaders.FrameArrived += faceFrameReaders_FrameArrived;     faceFrameSources.TrackingIdLost += faceFrameSources_TrackingIdLost; } //currentFaceModel = new FaceModel();//currentFaceAlignment = new FaceAlignment(); highDefinitionFaceFrameSource =newHighDefinitionFaceFrameSource(kinect); if (highDefinitionFaceFrameReader !=null) {     highDefinitionFaceFrameReader.FrameArrived += highDefinitionFaceFrameReader_FrameArrived;     highDefinitionFaceFrameSource.TrackingIdLost += highDefinitionFaceFrameSource_TrackingIdLost; } highDefinitionFaceFrameReader = highDefinitionFaceFrameSource.OpenReader(); faceFrameReaders = faceFrameSources.OpenReader();


    An this is error that I get:

    And if I put HD before Face I get:

    highDefinitionFaceFrameSource =newHighDefinitionFaceFrameSource(kinect); // Create new sources with body TrackingId faceFrameSources =newFaceFrameSource(kinect, 0, faceFrameFeatures);

    This error: (failed to load Nui Database) (as I said in OP, im copying that database)

    So please, what am I doing wrong?

    • Edited by SirManu Tuesday, December 9, 2014 4:27 PM
    Tuesday, December 9, 2014 4:22 PM
  • Regardless of order, creating the objects for face or HD Face depend on the same binary's(.dll and database files). Have you ensured that you have copied these correctly to your output directory. Additionally, are you specifically targeting x86 vs x64 or using Any CPU. "Any CPU" is not a valid target since there are separate binaries for each environment.

    // minimal code to initialize face/hd face:
        this.sensor = KinectSensor.GetDefault();
        this.highDefinitionFaceFrameSource = new HighDefinitionFaceFrameSource(this.sensor);
        this.highDefinitionFaceFrameSource.TrackingIdLost += this.HdFaceSource_TrackingIdLost;
        this.highDefinitionFaceFrameReader = this.highDefinitionFaceFrameSource.OpenReader();
        this.highDefinitionFaceFrameReader.FrameArrived += this.HdFaceReader_FrameArrived;
        FaceFrameFeatures features = FaceFrameFeatures.BoundingBoxInInfraredSpace | FaceFrameFeatures.RotationOrientation;
        this.faceFrameSource = new FaceFrameSource(this.sensor, 0, features); // only one person tracked
        this.faceFrameReader = this.faceFrameSource.OpenReader();

    be sure to use the following script to the Build Events Post-build command line entry:

    xcopy "$(KINECTSDK20_DIR)Redist\Face\$(Platform)\NuiDatabase" "$(TargetDir)\NuiDatabase" /S /R /Y /I

    Carmine Sirignano - MSFT

    Tuesday, December 9, 2014 7:53 PM
  • As usual, first of all, thanks for your help to the Kinect community. Good job!

    I think the problem is because I am using Debug instead of Release. Does it make any sense? I must check it.
    Tuesday, December 9, 2014 11:44 PM
  • HI.

    I think I have already spotted the problem.

    I am targeting x86 as you can see (because I am using some libraries , this one:A Simple C# Wrapper for the AviFile Library)

    But what I see here:

    The Kinect for Windows SDK 2.0 includes the following:
    • Drivers for using Kinect v2 sensors on a computer running Windows 8 (x64), Windows 8.1 (x64), and Windows Embedded Standard 8 (x64)
    • Application programming interfaces (APIs) and device interfaces
    • Code samples

    It is not mention to x86.

    In SDK 1.0: , there were 2 files to download.

    So,  what's the problem?

    thank you mate

    • Edited by SirManu Wednesday, December 10, 2014 5:45 PM
    Wednesday, December 10, 2014 5:41 PM
  • The operating system is required to be x64, but we provide both x86 and x64 binaries for both types of binary formats. Using the xcopy command I provided, will copy the correct binaries you will need in your output directory for x86.

    Carmine Sirignano - MSFT

    Wednesday, December 10, 2014 8:01 PM
  • Selecting x86 I get the above errors...

    I am already using that sentence (xcopy)

    • Edited by SirManu Wednesday, December 10, 2014 8:06 PM
    Wednesday, December 10, 2014 8:06 PM
  • does you output directory have both the all the required face .dll and database files? where did you put the xcopy command in your project settings, does it match the HDFaceBasics-WPF sample?

    Carmine Sirignano - MSFT

    Thursday, December 11, 2014 7:59 PM
  • YEs Carmine.

    All is placed as you said.

    Please, you may look this images.

    As you can see, when selecting x86, the error appears.

    This doesn't not happen with x64, but with x64, I can't use AviFIle because:

    "Excepción no controlada del tipo 'System.AccessViolationException' en AviFile.dll"

    I think that it's because this wrapper for video files it is programmed for x32

    Thank you for your time

    • Edited by SirManu Monday, December 15, 2014 12:14 PM
    Monday, December 15, 2014 12:11 PM